diff --git a/core/composer.lock b/core/composer.lock index 5f0d4ef127..147bcc2c37 100644 --- a/core/composer.lock +++ b/core/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": "7b0b296f666f1d7b6fe9e5e5fcd3d078", + "content-hash": "1fc42c68fd021a9ff5a12b5061f5185e", "packages": [ { "name": "composer/ca-bundle", @@ -84,21 +84,22 @@ }, { "name": "composer/composer", - "version": "2.1.12", + "version": "2.2.6", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0" + "reference": "ce785a18c0fb472421e52d958bab339247cb0e82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0", - "reference": "6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0", + "url": "https://api.github.com/repos/composer/composer/zipball/ce785a18c0fb472421e52d958bab339247cb0e82", + "reference": "ce785a18c0fb472421e52d958bab339247cb0e82", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", "composer/metadata-minifier": "^1.0", + "composer/pcre": "^1.0", "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^2.0", @@ -108,7 +109,7 @@ "react/promise": "^1.2 || ^2.7", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" @@ -128,7 +129,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.1-dev" + "dev-main": "2.2-dev" } }, "autoload": { @@ -162,7 +163,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.1.12" + "source": "https://github.com/composer/composer/tree/2.2.6" }, "funding": [ { @@ -178,7 +179,7 @@ "type": "tidelift" } ], - "time": "2021-11-09T15:02:04+00:00" + "time": "2022-02-04T16:00:38+00:00" }, { "name": "composer/metadata-minifier", @@ -1097,27 +1098,27 @@ }, { "name": "egulias/email-validator", - "version": "3.1.2", + "version": "2.1.25", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "ee0db30118f661fb166bcffbf5d82032df484697" + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ee0db30118f661fb166bcffbf5d82032df484697", - "reference": "ee0db30118f661fb166bcffbf5d82032df484697", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4", + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4", "shasum": "" }, "require": { - "doctrine/lexer": "^1.2", - "php": ">=7.2", - "symfony/polyfill-intl-idn": "^1.15" + "doctrine/lexer": "^1.0.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.10" }, "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^8.5.8|^9.3.3", - "vimeo/psalm": "^4" + "dominicsayers/isemail": "^3.0.7", + "phpunit/phpunit": "^4.8.36|^7.5.15", + "satooshi/php-coveralls": "^1.0.1" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" @@ -1125,7 +1126,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -1153,7 +1154,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/3.1.2" + "source": "https://github.com/egulias/EmailValidator/tree/2.1.25" }, "funding": [ { @@ -1161,7 +1162,7 @@ "type": "github" } ], - "time": "2021-10-11T09:18:27+00:00" + "time": "2020-12-29T14:50:06+00:00" }, { "name": "evolution-cms/salo", @@ -1676,24 +1677,24 @@ }, { "name": "illuminate/bus", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "b8eeab8d43bc4085e882bfc8583cab6ced4c29e8" + "reference": "917798f4a21c5eed1f83f9b434ce94f9c4fa8432" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/b8eeab8d43bc4085e882bfc8583cab6ced4c29e8", - "reference": "b8eeab8d43bc4085e882bfc8583cab6ced4c29e8", + "url": "https://api.github.com/repos/illuminate/bus/zipball/917798f4a21c5eed1f83f9b434ce94f9c4fa8432", + "reference": "917798f4a21c5eed1f83f9b434ce94f9c4fa8432", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/pipeline": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/pipeline": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "suggest": { "illuminate/queue": "Required to use closures when chaining jobs (^7.0)." @@ -1701,7 +1702,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -1725,43 +1726,43 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-12T17:47:05+00:00" + "time": "2022-01-10T22:25:47+00:00" }, { "name": "illuminate/cache", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", - "reference": "52ead4fcaf61d900a17990b06af5656755ca30e2" + "reference": "341b4f98a0de928d5af990f4e75acb5b34948569" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/cache/zipball/52ead4fcaf61d900a17990b06af5656755ca30e2", - "reference": "52ead4fcaf61d900a17990b06af5656755ca30e2", + "url": "https://api.github.com/repos/illuminate/cache/zipball/341b4f98a0de928d5af990f4e75acb5b34948569", + "reference": "341b4f98a0de928d5af990f4e75acb5b34948569", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "provide": { - "psr/simple-cache-implementation": "1.0|2.0|3.0" + "psr/simple-cache-implementation": "1.0" }, "suggest": { "ext-memcached": "Required to use the memcache cache driver.", - "illuminate/database": "Required to use the database cache driver (^9.0).", - "illuminate/filesystem": "Required to use the file cache driver (^9.0).", - "illuminate/redis": "Required to use the redis cache driver (^9.0).", - "symfony/cache": "Required to use PSR-6 cache bridge (^6.0)." + "illuminate/database": "Required to use the database cache driver (^8.0).", + "illuminate/filesystem": "Required to use the file cache driver (^8.0).", + "illuminate/redis": "Required to use the redis cache driver (^8.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.4)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -1785,35 +1786,34 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-14T17:27:32+00:00" + "time": "2022-01-27T17:47:01+00:00" }, { "name": "illuminate/collections", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "707ab36191228b1a4cf322985796ff7aab5578c1" + "reference": "5cf7ed1c0a1b8049576b29f5cab5c822149aaa91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/707ab36191228b1a4cf322985796ff7aab5578c1", - "reference": "707ab36191228b1a4cf322985796ff7aab5578c1", + "url": "https://api.github.com/repos/illuminate/collections/zipball/5cf7ed1c0a1b8049576b29f5cab5c822149aaa91", + "reference": "5cf7ed1c0a1b8049576b29f5cab5c822149aaa91", "shasum": "" }, "require": { - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "php": "^8.0.2" + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "php": "^7.3|^8.0" }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^6.0)." + "symfony/var-dumper": "Required to use the dump method (^5.4)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -1840,77 +1840,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-09T21:49:11+00:00" - }, - { - "name": "illuminate/conditionable", - "version": "v9.1.0", - "source": { - "type": "git", - "url": "https://github.com/illuminate/conditionable.git", - "reference": "4f7e3d67ceda9a6188757501748982ea9ed5f69a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/conditionable/zipball/4f7e3d67ceda9a6188757501748982ea9ed5f69a", - "reference": "4f7e3d67ceda9a6188757501748982ea9ed5f69a", - "shasum": "" - }, - "require": { - "php": "^8.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Conditionable package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2022-02-09T14:26:32+00:00" + "time": "2022-02-15T14:40:58+00:00" }, { "name": "illuminate/config", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", - "reference": "d2dc74fdcc89239e1910a8d08b2b2e5ad26a043c" + "reference": "feac56ab7a5c70cf2dc60dffe4323eb9851f51a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/config/zipball/d2dc74fdcc89239e1910a8d08b2b2e5ad26a043c", - "reference": "d2dc74fdcc89239e1910a8d08b2b2e5ad26a043c", + "url": "https://api.github.com/repos/illuminate/config/zipball/feac56ab7a5c70cf2dc60dffe4323eb9851f51a8", + "reference": "feac56ab7a5c70cf2dc60dffe4323eb9851f51a8", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "php": "^7.3|^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -1934,43 +1888,43 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-01T16:16:50+00:00" + "time": "2022-01-31T15:57:46+00:00" }, { "name": "illuminate/console", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", - "reference": "cb3486758b07ae824bc763592d414973a17658b7" + "reference": "d93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/console/zipball/cb3486758b07ae824bc763592d414973a17658b7", - "reference": "cb3486758b07ae824bc763592d414973a17658b7", + "url": "https://api.github.com/repos/illuminate/console/zipball/d93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf", + "reference": "d93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/console": "^6.0", - "symfony/process": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/console": "^5.4", + "symfony/process": "^5.4" }, "suggest": { - "dragonmantank/cron-expression": "Required to use scheduler (^3.1).", - "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^7.2).", - "illuminate/bus": "Required to use the scheduled job dispatcher (^9.0).", - "illuminate/container": "Required to use the scheduler (^9.0).", - "illuminate/filesystem": "Required to use the generator command (^9.0).", - "illuminate/queue": "Required to use closures for scheduled jobs (^9.0)." + "dragonmantank/cron-expression": "Required to use scheduler (^3.0.2).", + "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^6.5.5|^7.0.1).", + "illuminate/bus": "Required to use the scheduled job dispatcher (^8.0).", + "illuminate/container": "Required to use the scheduler (^8.0).", + "illuminate/filesystem": "Required to use the generator command (^8.0).", + "illuminate/queue": "Required to use closures for scheduled jobs (^8.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -1994,34 +1948,34 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-01T14:44:21+00:00" + "time": "2022-01-07T19:50:44+00:00" }, { "name": "illuminate/container", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "b249d566e8f93b9255d84f4c06a8cc7db24c900c" + "reference": "14062628d05f75047c5a1360b9350028427d568e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/b249d566e8f93b9255d84f4c06a8cc7db24c900c", - "reference": "b249d566e8f93b9255d84f4c06a8cc7db24c900c", + "url": "https://api.github.com/repos/illuminate/container/zipball/14062628d05f75047c5a1360b9350028427d568e", + "reference": "14062628d05f75047c5a1360b9350028427d568e", "shasum": "" }, "require": { - "illuminate/contracts": "^9.0", - "php": "^8.0.2", - "psr/container": "^1.1.1|^2.0.1" + "illuminate/contracts": "^8.0", + "php": "^7.3|^8.0", + "psr/container": "^1.0" }, "provide": { - "psr/container-implementation": "1.1|2.0" + "psr/container-implementation": "1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2045,31 +1999,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-05T18:02:43+00:00" + "time": "2022-02-02T21:03:35+00:00" }, { "name": "illuminate/contracts", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "c2e3cf2eda10fd3332af0b4a43481cc0af98c437" + "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/c2e3cf2eda10fd3332af0b4a43481cc0af98c437", - "reference": "c2e3cf2eda10fd3332af0b4a43481cc0af98c437", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", + "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", "shasum": "" }, "require": { - "php": "^8.0.2", - "psr/container": "^1.1.1|^2.0.1", - "psr/simple-cache": "^1.0|^2.0|^3.0" + "php": "^7.3|^8.0", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2093,45 +2047,45 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-11T14:24:50+00:00" + "time": "2022-01-13T14:47:47+00:00" }, { "name": "illuminate/database", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "9a65ca2100cada21ab2e65032821e5d3264da008" + "reference": "463de5a2028138d7f4749f072bb809288d8bd2fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/9a65ca2100cada21ab2e65032821e5d3264da008", - "reference": "9a65ca2100cada21ab2e65032821e5d3264da008", + "url": "https://api.github.com/repos/illuminate/database/zipball/463de5a2028138d7f4749f072bb809288d8bd2fe", + "reference": "463de5a2028138d7f4749f072bb809288d8bd2fe", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/console": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/console": "^5.4" }, "suggest": { "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", - "illuminate/console": "Required to use the database commands (^9.0).", - "illuminate/events": "Required to use the observers with Eloquent (^9.0).", - "illuminate/filesystem": "Required to use the migrations (^9.0).", - "illuminate/pagination": "Required to paginate the result set (^9.0).", - "symfony/finder": "Required to use Eloquent model factories (^6.0)." + "illuminate/console": "Required to use the database commands (^8.0).", + "illuminate/events": "Required to use the observers with Eloquent (^8.0).", + "illuminate/filesystem": "Required to use the migrations (^8.0).", + "illuminate/pagination": "Required to paginate the result set (^8.0).", + "symfony/finder": "Required to use Eloquent model factories (^5.4)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2161,35 +2115,35 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-12T23:43:59+00:00" + "time": "2022-02-14T17:09:29+00:00" }, { "name": "illuminate/events", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", - "reference": "b58e0e9b5afc3770505a2694c50afb23d973a75e" + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/events/zipball/b58e0e9b5afc3770505a2694c50afb23d973a75e", - "reference": "b58e0e9b5afc3770505a2694c50afb23d973a75e", + "url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d", + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d", "shasum": "" }, "require": { - "illuminate/bus": "^9.0", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/bus": "^8.0", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2216,45 +2170,45 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-01T14:44:21+00:00" + "time": "2021-09-15T14:32:50+00:00" }, { "name": "illuminate/filesystem", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "8fbb541a9d45ca5dcd459bde9fb23082371f48a9" + "reference": "73db3e9a233ed587ba54f52ab8580f3c7bc872b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/8fbb541a9d45ca5dcd459bde9fb23082371f48a9", - "reference": "8fbb541a9d45ca5dcd459bde9fb23082371f48a9", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/73db3e9a233ed587ba54f52ab8580f3c7bc872b2", + "reference": "73db3e9a233ed587ba54f52ab8580f3c7bc872b2", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/finder": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/finder": "^5.4" }, "suggest": { "ext-ftp": "Required to use the Flysystem FTP driver.", "illuminate/http": "Required for handling uploaded files (^7.0).", - "league/flysystem": "Required to use the Flysystem local driver (^3.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", - "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", - "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", + "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", + "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", + "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", - "symfony/mime": "Required to enable support for guessing extensions (^6.0)." + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", + "symfony/mime": "Required to enable support for guessing extensions (^5.4)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2278,41 +2232,41 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-10T16:13:07+00:00" + "time": "2022-01-15T15:00:40+00:00" }, { "name": "illuminate/http", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", - "reference": "e0248518e2292eb46a4f019396569f760a07ab5e" + "reference": "3966c05c38096e15cb86e44201fc5f5731d1f3ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/http/zipball/e0248518e2292eb46a4f019396569f760a07ab5e", - "reference": "e0248518e2292eb46a4f019396569f760a07ab5e", + "url": "https://api.github.com/repos/illuminate/http/zipball/3966c05c38096e15cb86e44201fc5f5731d1f3ad", + "reference": "3966c05c38096e15cb86e44201fc5f5731d1f3ad", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/session": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/mime": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/session": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/mime": "^5.4" }, "suggest": { "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", - "guzzlehttp/guzzle": "Required to use the HTTP Client (^7.2)." + "guzzlehttp/guzzle": "Required to use the HTTP Client (^6.5.5|^7.0.1)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2336,32 +2290,32 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-12T23:43:59+00:00" + "time": "2022-02-12T19:11:00+00:00" }, { "name": "illuminate/log", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/log.git", - "reference": "fd12e6928cfdf5303124cbe167a8ce16308502cb" + "reference": "1dbdc6aca24d1d2b5903f865bb206039d4b800b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/log/zipball/fd12e6928cfdf5303124cbe167a8ce16308502cb", - "reference": "fd12e6928cfdf5303124cbe167a8ce16308502cb", + "url": "https://api.github.com/repos/illuminate/log/zipball/1dbdc6aca24d1d2b5903f865bb206039d4b800b2", + "reference": "1dbdc6aca24d1d2b5903f865bb206039d4b800b2", "shasum": "" }, "require": { - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", "monolog/monolog": "^2.0", - "php": "^8.0.2" + "php": "^7.3|^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2385,29 +2339,29 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-03T09:06:04+00:00" + "time": "2022-01-10T15:22:22+00:00" }, { "name": "illuminate/macroable", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", - "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354" + "reference": "aed81891a6e046fdee72edd497f822190f61c162" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/25a2c6dac2b7541ecbadef952702e84ae15f5354", - "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", + "reference": "aed81891a6e046fdee72edd497f822190f61c162", "shasum": "" }, "require": { - "php": "^8.0.2" + "php": "^7.3|^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2431,33 +2385,33 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-01T14:44:21+00:00" + "time": "2021-11-16T13:57:03+00:00" }, { "name": "illuminate/pagination", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", - "reference": "c4b992cebde5d0cb5091613f2df7ecf850d96dec" + "reference": "a0a5784a052663fb044baed95f56801b57c2d002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/pagination/zipball/c4b992cebde5d0cb5091613f2df7ecf850d96dec", - "reference": "c4b992cebde5d0cb5091613f2df7ecf850d96dec", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/a0a5784a052663fb044baed95f56801b57c2d002", + "reference": "a0a5784a052663fb044baed95f56801b57c2d002", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2481,31 +2435,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-15T14:56:31+00:00" + "time": "2022-01-05T15:05:14+00:00" }, { "name": "illuminate/pipeline", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", - "reference": "723820323d87a2c22f017ce7ea124d08e4b65f29" + "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/pipeline/zipball/723820323d87a2c22f017ce7ea124d08e4b65f29", - "reference": "723820323d87a2c22f017ce7ea124d08e4b65f29", + "url": "https://api.github.com/repos/illuminate/pipeline/zipball/23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", + "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", "shasum": "" }, "require": { - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2529,28 +2483,28 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-01T14:44:21+00:00" + "time": "2021-03-26T18:39:16+00:00" }, { "name": "illuminate/redis", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/redis.git", - "reference": "54371f29284d4035fb837b56360f5e9c6c8e520f" + "reference": "0fee121324054226823a59623fab3d98ad88fbd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/redis/zipball/54371f29284d4035fb837b56360f5e9c6c8e520f", - "reference": "54371f29284d4035fb837b56360f5e9c6c8e520f", + "url": "https://api.github.com/repos/illuminate/redis/zipball/0fee121324054226823a59623fab3d98ad88fbd5", + "reference": "0fee121324054226823a59623fab3d98ad88fbd5", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "suggest": { "ext-redis": "Required to use the phpredis connector (^4.0|^5.0).", @@ -2559,7 +2513,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2583,46 +2537,46 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-09T14:35:47+00:00" + "time": "2022-01-24T02:32:30+00:00" }, { "name": "illuminate/routing", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/routing.git", - "reference": "66cf35da072e1bb528ef34434a5e968e29e34f58" + "reference": "791f1a5a626f421b101b64551cf2bc422e541049" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/routing/zipball/66cf35da072e1bb528ef34434a5e968e29e34f58", - "reference": "66cf35da072e1bb528ef34434a5e968e29e34f58", + "url": "https://api.github.com/repos/illuminate/routing/zipball/791f1a5a626f421b101b64551cf2bc422e541049", + "reference": "791f1a5a626f421b101b64551cf2bc422e541049", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/http": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/pipeline": "^9.0", - "illuminate/session": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/routing": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/http": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/pipeline": "^8.0", + "illuminate/session": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/routing": "^5.4" }, "suggest": { - "illuminate/console": "Required to use the make commands (^9.0).", + "illuminate/console": "Required to use the make commands (^8.0).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2646,39 +2600,39 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-15T14:35:32+00:00" + "time": "2022-01-13T18:41:16+00:00" }, { "name": "illuminate/session", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", - "reference": "bbda6e9c6fbb61c522fcd5e0a196735b0c628ae5" + "reference": "9c9988d7229d888c098eebbbb9fcb8c68580411c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/session/zipball/bbda6e9c6fbb61c522fcd5e0a196735b0c628ae5", - "reference": "bbda6e9c6fbb61c522fcd5e0a196735b0c628ae5", + "url": "https://api.github.com/repos/illuminate/session/zipball/9c9988d7229d888c098eebbbb9fcb8c68580411c", + "reference": "9c9988d7229d888c098eebbbb9fcb8c68580411c", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/finder": "^6.0", - "symfony/http-foundation": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/finder": "^5.4", + "symfony/http-foundation": "^5.4" }, "suggest": { - "illuminate/console": "Required to use the session:table command (^9.0)." + "illuminate/console": "Required to use the session:table command (^8.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2702,49 +2656,48 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-01T14:44:21+00:00" + "time": "2022-01-13T18:28:06+00:00" }, { "name": "illuminate/support", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "cb117bc9a3358d60ade85e5a13d6b82f40ee6049" + "reference": "fe5469faa982e2dd8c2f5978b23cf881e3715d1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/cb117bc9a3358d60ade85e5a13d6b82f40ee6049", - "reference": "cb117bc9a3358d60ade85e5a13d6b82f40ee6049", + "url": "https://api.github.com/repos/illuminate/support/zipball/fe5469faa982e2dd8c2f5978b23cf881e3715d1b", + "reference": "fe5469faa982e2dd8c2f5978b23cf881e3715d1b", "shasum": "" }, "require": { - "doctrine/inflector": "^2.0", + "doctrine/inflector": "^1.4|^2.0", "ext-json": "*", "ext-mbstring": "*", - "illuminate/collections": "^9.0", - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", "nesbot/carbon": "^2.53.1", - "php": "^8.0.2", - "voku/portable-ascii": "^2.0" + "php": "^7.3|^8.0", + "voku/portable-ascii": "^1.6.1" }, "conflict": { "tightenco/collect": "<5.5.33" }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^9.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", + "illuminate/filesystem": "Required to use the composer class (^8.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", - "symfony/process": "Required to use the composer class (^6.0).", - "symfony/var-dumper": "Required to use the dd function (^6.0).", + "symfony/process": "Required to use the composer class (^5.4).", + "symfony/var-dumper": "Required to use the dd function (^5.4).", "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2771,35 +2724,35 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-14T17:31:22+00:00" + "time": "2022-02-07T21:23:13+00:00" }, { "name": "illuminate/translation", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/translation.git", - "reference": "8bdac1ceea6be67e8f1c93ad68ac4abe1f91df3f" + "reference": "c10a68f37f590dc8c1c1fe5b6ad3f09381282137" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/translation/zipball/8bdac1ceea6be67e8f1c93ad68ac4abe1f91df3f", - "reference": "8bdac1ceea6be67e8f1c93ad68ac4abe1f91df3f", + "url": "https://api.github.com/repos/illuminate/translation/zipball/c10a68f37f590dc8c1c1fe5b6ad3f09381282137", + "reference": "c10a68f37f590dc8c1c1fe5b6ad3f09381282137", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2823,43 +2776,43 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-01T14:44:21+00:00" + "time": "2021-10-30T16:01:33+00:00" }, { "name": "illuminate/validation", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/validation.git", - "reference": "805f5fd17a75ce24d7e39a833000ea698d55a695" + "reference": "49b1cfd3a32f04255eed68fc1c304659de50e374" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/validation/zipball/805f5fd17a75ce24d7e39a833000ea698d55a695", - "reference": "805f5fd17a75ce24d7e39a833000ea698d55a695", + "url": "https://api.github.com/repos/illuminate/validation/zipball/49b1cfd3a32f04255eed68fc1c304659de50e374", + "reference": "49b1cfd3a32f04255eed68fc1c304659de50e374", "shasum": "" }, "require": { - "egulias/email-validator": "^3.1", + "egulias/email-validator": "^2.1.10", "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "illuminate/translation": "^9.0", - "php": "^8.0.2", - "symfony/http-foundation": "^6.0", - "symfony/mime": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "illuminate/translation": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.4", + "symfony/mime": "^5.4" }, "suggest": { "ext-bcmath": "Required to use the multiple_of validation rule.", - "illuminate/database": "Required to use the database presence verifier (^9.0)." + "illuminate/database": "Required to use the database presence verifier (^8.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2883,37 +2836,37 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-11T14:35:03+00:00" + "time": "2022-02-01T16:13:18+00:00" }, { "name": "illuminate/view", - "version": "v9.1.0", + "version": "v8.83.1", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", - "reference": "b580a1bcfa76900a59108f86e5cd3ac6c9a3d722" + "reference": "f9f3ab882025d61d72a6383679fcadd08e79fbcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/view/zipball/b580a1bcfa76900a59108f86e5cd3ac6c9a3d722", - "reference": "b580a1bcfa76900a59108f86e5cd3ac6c9a3d722", + "url": "https://api.github.com/repos/illuminate/view/zipball/f9f3ab882025d61d72a6383679fcadd08e79fbcf", + "reference": "f9f3ab882025d61d72a6383679fcadd08e79fbcf", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/events": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/events": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { @@ -2937,7 +2890,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-10T15:02:11+00:00" + "time": "2022-02-02T21:02:36+00:00" }, { "name": "james-heinrich/phpthumb", @@ -3628,27 +3581,22 @@ }, { "name": "psr/container", - "version": "2.0.2", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { "php": ">=7.4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -3675,9 +3623,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-11-05T16:47:00+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "psr/event-dispatcher", @@ -3941,25 +3889,25 @@ }, { "name": "psr/simple-cache", - "version": "3.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -3974,7 +3922,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -3986,9 +3934,9 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + "source": "https://github.com/php-fig/simple-cache/tree/master" }, - "time": "2021-10-29T13:26:27+00:00" + "time": "2017-10-23T01:57:42+00:00" }, { "name": "ralouphie/getallheaders", @@ -4460,42 +4408,46 @@ }, { "name": "symfony/console", - "version": "v6.0.3", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "22e8efd019c3270c4f79376234a3f8752cd25490" + "reference": "a2a86ec353d825c75856c6fd14fac416a7bdb6b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/22e8efd019c3270c4f79376234a3f8752cd25490", - "reference": "22e8efd019c3270c4f79376234a3f8752cd25490", + "url": "https://api.github.com/repos/symfony/console/zipball/a2a86ec353d825c75856c6fd14fac416a7bdb6b8", + "reference": "a2a86ec353d825c75856c6fd14fac416a7bdb6b8", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/string": "^5.1|^6.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -4535,7 +4487,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.3" + "source": "https://github.com/symfony/console/tree/v5.4.3" }, "funding": [ { @@ -4551,7 +4503,7 @@ "type": "tidelift" } ], - "time": "2022-01-26T17:23:29+00:00" + "time": "2022-01-26T16:28:35+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4918,20 +4870,22 @@ }, { "name": "symfony/finder", - "version": "v6.0.3", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8661b74dbabc23223f38c9b99d3f8ade71170430" + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8661b74dbabc23223f38c9b99d3f8ade71170430", - "reference": "8661b74dbabc23223f38c9b99d3f8ade71170430", + "url": "https://api.github.com/repos/symfony/finder/zipball/231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -4959,7 +4913,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.0.3" + "source": "https://github.com/symfony/finder/tree/v5.4.3" }, "funding": [ { @@ -4975,32 +4929,33 @@ "type": "tidelift" } ], - "time": "2022-01-26T17:23:29+00:00" + "time": "2022-01-26T16:34:36+00:00" }, { "name": "symfony/http-foundation", - "version": "v6.0.3", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "ad157299ced81a637fade1efcadd688d6deba5c1" + "reference": "ef409ff341a565a3663157d4324536746d49a0c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ad157299ced81a637fade1efcadd688d6deba5c1", - "reference": "ad157299ced81a637fade1efcadd688d6deba5c1", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ef409ff341a565a3663157d4324536746d49a0c7", + "reference": "ef409ff341a565a3663157d4324536746d49a0c7", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.1" + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "predis/predis": "~1.0", - "symfony/cache": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/mime": "^5.4|^6.0" + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0" }, "suggest": { "symfony/mime": "To use the file extension guesser" @@ -5031,7 +4986,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.0.3" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.3" }, "funding": [ { @@ -5047,64 +5002,67 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.0.4", + "version": "v5.4.4", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "9dce179ce52b0f4f669c07fd5e465e5d809a5d3b" + "reference": "49f40347228c773688a0488feea0175aa7f4d268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9dce179ce52b0f4f669c07fd5e465e5d809a5d3b", - "reference": "9dce179ce52b0f4f669c07fd5e465e5d809a5d3b", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/49f40347228c773688a0488feea0175aa7f4d268", + "reference": "49f40347228c773688a0488feea0175aa7f4d268", "shasum": "" }, "require": { - "php": ">=8.0.2", - "psr/log": "^1|^2|^3", - "symfony/error-handler": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/polyfill-ctype": "^1.8" + "php": ">=7.2.5", + "psr/log": "^1|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^5.0|^6.0", + "symfony/http-foundation": "^5.3.7|^6.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16" }, "conflict": { "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.4", - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/doctrine-bridge": "<5.4", - "symfony/form": "<5.4", - "symfony/http-client": "<5.4", - "symfony/mailer": "<5.4", - "symfony/messenger": "<5.4", - "symfony/translation": "<5.4", - "symfony/twig-bridge": "<5.4", - "symfony/validator": "<5.4", + "symfony/cache": "<5.0", + "symfony/config": "<5.0", + "symfony/console": "<4.4", + "symfony/dependency-injection": "<5.3", + "symfony/doctrine-bridge": "<5.0", + "symfony/form": "<5.0", + "symfony/http-client": "<5.0", + "symfony/mailer": "<5.0", + "symfony/messenger": "<5.0", + "symfony/translation": "<5.0", + "symfony/twig-bridge": "<5.0", + "symfony/validator": "<5.0", "twig/twig": "<2.13" }, "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/dom-crawler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", + "symfony/config": "^5.0|^6.0", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/css-selector": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.3|^6.0", + "symfony/dom-crawler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^5.4|^6.0", - "symfony/routing": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/routing": "^4.4|^5.0|^6.0", + "symfony/stopwatch": "^4.4|^5.0|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", "symfony/translation-contracts": "^1.1|^2|^3", "twig/twig": "^2.13|^3.0.4" }, @@ -5140,7 +5098,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.0.4" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.4" }, "funding": [ { @@ -5156,40 +5114,42 @@ "type": "tidelift" } ], - "time": "2022-01-29T18:12:46+00:00" + "time": "2022-01-29T18:08:07+00:00" }, { "name": "symfony/mime", - "version": "v6.0.3", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "2cd9601efd040e56f43360daa68f3c6b0534923a" + "reference": "e1503cfb5c9a225350f549d3bb99296f4abfb80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/2cd9601efd040e56f43360daa68f3c6b0534923a", - "reference": "2cd9601efd040e56f43360daa68f3c6b0534923a", + "url": "https://api.github.com/repos/symfony/mime/zipball/e1503cfb5c9a225350f549d3bb99296f4abfb80f", + "reference": "e1503cfb5c9a225350f549d3bb99296f4abfb80f", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16" }, "conflict": { "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<5.4" + "symfony/mailer": "<4.4" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0" + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/property-access": "^4.4|^5.1|^6.0", + "symfony/property-info": "^4.4|^5.1|^6.0", + "symfony/serializer": "^5.2|^6.0" }, "type": "library", "autoload": { @@ -5221,7 +5181,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.0.3" + "source": "https://github.com/symfony/mime/tree/v5.4.3" }, "funding": [ { @@ -5237,7 +5197,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/polyfill-ctype", @@ -5732,6 +5692,85 @@ ], "time": "2021-05-27T09:17:38+00:00" }, + { + "name": "symfony/polyfill-php73", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-05T21:20:04+00:00" + }, { "name": "symfony/polyfill-php80", "version": "v1.24.0", @@ -5817,20 +5856,21 @@ }, { "name": "symfony/process", - "version": "v6.0.3", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "298ed357274c1868c20a0061df256a1250a6c4af" + "reference": "553f50487389a977eb31cf6b37faae56da00f753" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/298ed357274c1868c20a0061df256a1250a6c4af", - "reference": "298ed357274c1868c20a0061df256a1250a6c4af", + "url": "https://api.github.com/repos/symfony/process/zipball/553f50487389a977eb31cf6b37faae56da00f753", + "reference": "553f50487389a977eb31cf6b37faae56da00f753", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -5858,7 +5898,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.0.3" + "source": "https://github.com/symfony/process/tree/v5.4.3" }, "funding": [ { @@ -5874,39 +5914,41 @@ "type": "tidelift" } ], - "time": "2022-01-26T17:23:29+00:00" + "time": "2022-01-26T16:28:35+00:00" }, { "name": "symfony/routing", - "version": "v6.0.3", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "b1debdf7a40e6bc7eee0f363ab9dd667fe04f099" + "reference": "44b29c7a94e867ccde1da604792f11a469958981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/b1debdf7a40e6bc7eee0f363ab9dd667fe04f099", - "reference": "b1debdf7a40e6bc7eee0f363ab9dd667fe04f099", + "url": "https://api.github.com/repos/symfony/routing/zipball/44b29c7a94e867ccde1da604792f11a469958981", + "reference": "44b29c7a94e867ccde1da604792f11a469958981", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "conflict": { "doctrine/annotations": "<1.12", - "symfony/config": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/yaml": "<5.4" + "symfony/config": "<5.3", + "symfony/dependency-injection": "<4.4", + "symfony/yaml": "<4.4" }, "require-dev": { "doctrine/annotations": "^1.12", "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "symfony/config": "^5.3|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0" }, "suggest": { "symfony/config": "For using the all-in-one router or any loader", @@ -5946,7 +5988,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.0.3" + "source": "https://github.com/symfony/routing/tree/v5.4.3" }, "funding": [ { @@ -5962,25 +6004,25 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.0.0", + "version": "v2.4.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603" + "reference": "d664541b99d6fb0247ec5ff32e87238582236204" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603", - "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d664541b99d6fb0247ec5ff32e87238582236204", + "reference": "d664541b99d6fb0247ec5ff32e87238582236204", "shasum": "" }, "require": { - "php": ">=8.0.2", - "psr/container": "^2.0" + "php": ">=7.2.5", + "psr/container": "^1.1" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -5991,7 +6033,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -6028,7 +6070,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.0.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.4.1" }, "funding": [ { @@ -6044,7 +6086,7 @@ "type": "tidelift" } ], - "time": "2021-11-04T17:53:12+00:00" + "time": "2021-11-04T16:37:19+00:00" }, { "name": "symfony/string", @@ -6548,16 +6590,16 @@ }, { "name": "voku/portable-ascii", - "version": "2.0.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "9bd89e83cecdf8c37b64909454249eaed98b2c89" + "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/9bd89e83cecdf8c37b64909454249eaed98b2c89", - "reference": "9bd89e83cecdf8c37b64909454249eaed98b2c89", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a", + "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a", "shasum": "" }, "require": { @@ -6594,7 +6636,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/2.0.0" + "source": "https://github.com/voku/portable-ascii/tree/1.6.1" }, "funding": [ { @@ -6618,7 +6660,7 @@ "type": "tidelift" } ], - "time": "2022-01-24T18:59:03+00:00" + "time": "2022-01-24T18:55:24+00:00" }, { "name": "wikimedia/composer-merge-plugin", diff --git a/core/vendor/autoload.php b/core/vendor/autoload.php index c3422a46a0..4d2f2d672d 100644 --- a/core/vendor/autoload.php +++ b/core/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit669025e4166b3b9854be5a09c174a331::getLoader(); +return ComposerAutoloaderInite94ab7aab7928ca33af80901518072d1::getLoader(); diff --git a/core/vendor/composer/autoload_classmap.php b/core/vendor/composer/autoload_classmap.php index 38a97929f2..c1154bdecd 100644 --- a/core/vendor/composer/autoload_classmap.php +++ b/core/vendor/composer/autoload_classmap.php @@ -146,6 +146,7 @@ 'Composer\\DependencyResolver\\PolicyInterface' => $vendorDir . '/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php', 'Composer\\DependencyResolver\\Pool' => $vendorDir . '/composer/composer/src/Composer/DependencyResolver/Pool.php', 'Composer\\DependencyResolver\\PoolBuilder' => $vendorDir . '/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php', + 'Composer\\DependencyResolver\\PoolOptimizer' => $vendorDir . '/composer/composer/src/Composer/DependencyResolver/PoolOptimizer.php', 'Composer\\DependencyResolver\\Problem' => $vendorDir . '/composer/composer/src/Composer/DependencyResolver/Problem.php', 'Composer\\DependencyResolver\\Request' => $vendorDir . '/composer/composer/src/Composer/DependencyResolver/Request.php', 'Composer\\DependencyResolver\\Rule' => $vendorDir . '/composer/composer/src/Composer/DependencyResolver/Rule.php', @@ -190,6 +191,11 @@ 'Composer\\Exception\\IrrecoverableDownloadException' => $vendorDir . '/composer/composer/src/Composer/Exception/IrrecoverableDownloadException.php', 'Composer\\Exception\\NoSslException' => $vendorDir . '/composer/composer/src/Composer/Exception/NoSslException.php', 'Composer\\Factory' => $vendorDir . '/composer/composer/src/Composer/Factory.php', + 'Composer\\Filter\\PlatformRequirementFilter\\IgnoreAllPlatformRequirementFilter' => $vendorDir . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreAllPlatformRequirementFilter.php', + 'Composer\\Filter\\PlatformRequirementFilter\\IgnoreListPlatformRequirementFilter' => $vendorDir . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php', + 'Composer\\Filter\\PlatformRequirementFilter\\IgnoreNothingPlatformRequirementFilter' => $vendorDir . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreNothingPlatformRequirementFilter.php', + 'Composer\\Filter\\PlatformRequirementFilter\\PlatformRequirementFilterFactory' => $vendorDir . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterFactory.php', + 'Composer\\Filter\\PlatformRequirementFilter\\PlatformRequirementFilterInterface' => $vendorDir . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterInterface.php', 'Composer\\IO\\BaseIO' => $vendorDir . '/composer/composer/src/Composer/IO/BaseIO.php', 'Composer\\IO\\BufferIO' => $vendorDir . '/composer/composer/src/Composer/IO/BufferIO.php', 'Composer\\IO\\ConsoleIO' => $vendorDir . '/composer/composer/src/Composer/IO/ConsoleIO.php', @@ -224,7 +230,6 @@ 'Composer\\Package\\Archiver\\BaseExcludeFilter' => $vendorDir . '/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php', 'Composer\\Package\\Archiver\\ComposerExcludeFilter' => $vendorDir . '/composer/composer/src/Composer/Package/Archiver/ComposerExcludeFilter.php', 'Composer\\Package\\Archiver\\GitExcludeFilter' => $vendorDir . '/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php', - 'Composer\\Package\\Archiver\\HgExcludeFilter' => $vendorDir . '/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php', 'Composer\\Package\\Archiver\\PharArchiver' => $vendorDir . '/composer/composer/src/Composer/Package/Archiver/PharArchiver.php', 'Composer\\Package\\Archiver\\ZipArchiver' => $vendorDir . '/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php', 'Composer\\Package\\BasePackage' => $vendorDir . '/composer/composer/src/Composer/Package/BasePackage.php', @@ -297,13 +302,11 @@ 'Composer\\Repository\\RepositorySet' => $vendorDir . '/composer/composer/src/Composer/Repository/RepositorySet.php', 'Composer\\Repository\\RootPackageRepository' => $vendorDir . '/composer/composer/src/Composer/Repository/RootPackageRepository.php', 'Composer\\Repository\\VcsRepository' => $vendorDir . '/composer/composer/src/Composer/Repository/VcsRepository.php', - 'Composer\\Repository\\Vcs\\BitbucketDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php', 'Composer\\Repository\\Vcs\\FossilDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php', 'Composer\\Repository\\Vcs\\GitBitbucketDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php', 'Composer\\Repository\\Vcs\\GitDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/GitDriver.php', 'Composer\\Repository\\Vcs\\GitHubDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php', 'Composer\\Repository\\Vcs\\GitLabDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php', - 'Composer\\Repository\\Vcs\\HgBitbucketDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php', 'Composer\\Repository\\Vcs\\HgDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/HgDriver.php', 'Composer\\Repository\\Vcs\\PerforceDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php', 'Composer\\Repository\\Vcs\\SvnDriver' => $vendorDir . '/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php', @@ -781,73 +784,52 @@ 'Egulias\\EmailValidator\\EmailLexer' => $vendorDir . '/egulias/email-validator/src/EmailLexer.php', 'Egulias\\EmailValidator\\EmailParser' => $vendorDir . '/egulias/email-validator/src/EmailParser.php', 'Egulias\\EmailValidator\\EmailValidator' => $vendorDir . '/egulias/email-validator/src/EmailValidator.php', - 'Egulias\\EmailValidator\\MessageIDParser' => $vendorDir . '/egulias/email-validator/src/MessageIDParser.php', - 'Egulias\\EmailValidator\\Parser' => $vendorDir . '/egulias/email-validator/src/Parser.php', - 'Egulias\\EmailValidator\\Parser\\Comment' => $vendorDir . '/egulias/email-validator/src/Parser/Comment.php', - 'Egulias\\EmailValidator\\Parser\\CommentStrategy\\CommentStrategy' => $vendorDir . '/egulias/email-validator/src/Parser/CommentStrategy/CommentStrategy.php', - 'Egulias\\EmailValidator\\Parser\\CommentStrategy\\DomainComment' => $vendorDir . '/egulias/email-validator/src/Parser/CommentStrategy/DomainComment.php', - 'Egulias\\EmailValidator\\Parser\\CommentStrategy\\LocalComment' => $vendorDir . '/egulias/email-validator/src/Parser/CommentStrategy/LocalComment.php', - 'Egulias\\EmailValidator\\Parser\\DomainLiteral' => $vendorDir . '/egulias/email-validator/src/Parser/DomainLiteral.php', + 'Egulias\\EmailValidator\\Exception\\AtextAfterCFWS' => $vendorDir . '/egulias/email-validator/src/Exception/AtextAfterCFWS.php', + 'Egulias\\EmailValidator\\Exception\\CRLFAtTheEnd' => $vendorDir . '/egulias/email-validator/src/Exception/CRLFAtTheEnd.php', + 'Egulias\\EmailValidator\\Exception\\CRLFX2' => $vendorDir . '/egulias/email-validator/src/Exception/CRLFX2.php', + 'Egulias\\EmailValidator\\Exception\\CRNoLF' => $vendorDir . '/egulias/email-validator/src/Exception/CRNoLF.php', + 'Egulias\\EmailValidator\\Exception\\CharNotAllowed' => $vendorDir . '/egulias/email-validator/src/Exception/CharNotAllowed.php', + 'Egulias\\EmailValidator\\Exception\\CommaInDomain' => $vendorDir . '/egulias/email-validator/src/Exception/CommaInDomain.php', + 'Egulias\\EmailValidator\\Exception\\ConsecutiveAt' => $vendorDir . '/egulias/email-validator/src/Exception/ConsecutiveAt.php', + 'Egulias\\EmailValidator\\Exception\\ConsecutiveDot' => $vendorDir . '/egulias/email-validator/src/Exception/ConsecutiveDot.php', + 'Egulias\\EmailValidator\\Exception\\DomainAcceptsNoMail' => $vendorDir . '/egulias/email-validator/src/Exception/DomainAcceptsNoMail.php', + 'Egulias\\EmailValidator\\Exception\\DomainHyphened' => $vendorDir . '/egulias/email-validator/src/Exception/DomainHyphened.php', + 'Egulias\\EmailValidator\\Exception\\DotAtEnd' => $vendorDir . '/egulias/email-validator/src/Exception/DotAtEnd.php', + 'Egulias\\EmailValidator\\Exception\\DotAtStart' => $vendorDir . '/egulias/email-validator/src/Exception/DotAtStart.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingAT' => $vendorDir . '/egulias/email-validator/src/Exception/ExpectingAT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingATEXT' => $vendorDir . '/egulias/email-validator/src/Exception/ExpectingATEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingCTEXT' => $vendorDir . '/egulias/email-validator/src/Exception/ExpectingCTEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingDTEXT' => $vendorDir . '/egulias/email-validator/src/Exception/ExpectingDTEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingDomainLiteralClose' => $vendorDir . '/egulias/email-validator/src/Exception/ExpectingDomainLiteralClose.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingQPair' => $vendorDir . '/egulias/email-validator/src/Exception/ExpectingQPair.php', + 'Egulias\\EmailValidator\\Exception\\InvalidEmail' => $vendorDir . '/egulias/email-validator/src/Exception/InvalidEmail.php', + 'Egulias\\EmailValidator\\Exception\\LocalOrReservedDomain' => $vendorDir . '/egulias/email-validator/src/Exception/LocalOrReservedDomain.php', + 'Egulias\\EmailValidator\\Exception\\NoDNSRecord' => $vendorDir . '/egulias/email-validator/src/Exception/NoDNSRecord.php', + 'Egulias\\EmailValidator\\Exception\\NoDomainPart' => $vendorDir . '/egulias/email-validator/src/Exception/NoDomainPart.php', + 'Egulias\\EmailValidator\\Exception\\NoLocalPart' => $vendorDir . '/egulias/email-validator/src/Exception/NoLocalPart.php', + 'Egulias\\EmailValidator\\Exception\\UnclosedComment' => $vendorDir . '/egulias/email-validator/src/Exception/UnclosedComment.php', + 'Egulias\\EmailValidator\\Exception\\UnclosedQuotedString' => $vendorDir . '/egulias/email-validator/src/Exception/UnclosedQuotedString.php', + 'Egulias\\EmailValidator\\Exception\\UnopenedComment' => $vendorDir . '/egulias/email-validator/src/Exception/UnopenedComment.php', 'Egulias\\EmailValidator\\Parser\\DomainPart' => $vendorDir . '/egulias/email-validator/src/Parser/DomainPart.php', - 'Egulias\\EmailValidator\\Parser\\DoubleQuote' => $vendorDir . '/egulias/email-validator/src/Parser/DoubleQuote.php', - 'Egulias\\EmailValidator\\Parser\\FoldingWhiteSpace' => $vendorDir . '/egulias/email-validator/src/Parser/FoldingWhiteSpace.php', - 'Egulias\\EmailValidator\\Parser\\IDLeftPart' => $vendorDir . '/egulias/email-validator/src/Parser/IDLeftPart.php', - 'Egulias\\EmailValidator\\Parser\\IDRightPart' => $vendorDir . '/egulias/email-validator/src/Parser/IDRightPart.php', 'Egulias\\EmailValidator\\Parser\\LocalPart' => $vendorDir . '/egulias/email-validator/src/Parser/LocalPart.php', - 'Egulias\\EmailValidator\\Parser\\PartParser' => $vendorDir . '/egulias/email-validator/src/Parser/PartParser.php', - 'Egulias\\EmailValidator\\Result\\InvalidEmail' => $vendorDir . '/egulias/email-validator/src/Result/InvalidEmail.php', - 'Egulias\\EmailValidator\\Result\\MultipleErrors' => $vendorDir . '/egulias/email-validator/src/Result/MultipleErrors.php', - 'Egulias\\EmailValidator\\Result\\Reason\\AtextAfterCFWS' => $vendorDir . '/egulias/email-validator/src/Result/Reason/AtextAfterCFWS.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CRLFAtTheEnd' => $vendorDir . '/egulias/email-validator/src/Result/Reason/CRLFAtTheEnd.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CRLFX2' => $vendorDir . '/egulias/email-validator/src/Result/Reason/CRLFX2.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CRNoLF' => $vendorDir . '/egulias/email-validator/src/Result/Reason/CRNoLF.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CharNotAllowed' => $vendorDir . '/egulias/email-validator/src/Result/Reason/CharNotAllowed.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CommaInDomain' => $vendorDir . '/egulias/email-validator/src/Result/Reason/CommaInDomain.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CommentsInIDRight' => $vendorDir . '/egulias/email-validator/src/Result/Reason/CommentsInIDRight.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ConsecutiveAt' => $vendorDir . '/egulias/email-validator/src/Result/Reason/ConsecutiveAt.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ConsecutiveDot' => $vendorDir . '/egulias/email-validator/src/Result/Reason/ConsecutiveDot.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DetailedReason' => $vendorDir . '/egulias/email-validator/src/Result/Reason/DetailedReason.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DomainAcceptsNoMail' => $vendorDir . '/egulias/email-validator/src/Result/Reason/DomainAcceptsNoMail.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DomainHyphened' => $vendorDir . '/egulias/email-validator/src/Result/Reason/DomainHyphened.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DomainTooLong' => $vendorDir . '/egulias/email-validator/src/Result/Reason/DomainTooLong.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DotAtEnd' => $vendorDir . '/egulias/email-validator/src/Result/Reason/DotAtEnd.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DotAtStart' => $vendorDir . '/egulias/email-validator/src/Result/Reason/DotAtStart.php', - 'Egulias\\EmailValidator\\Result\\Reason\\EmptyReason' => $vendorDir . '/egulias/email-validator/src/Result/Reason/EmptyReason.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExceptionFound' => $vendorDir . '/egulias/email-validator/src/Result/Reason/ExceptionFound.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExpectingATEXT' => $vendorDir . '/egulias/email-validator/src/Result/Reason/ExpectingATEXT.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExpectingCTEXT' => $vendorDir . '/egulias/email-validator/src/Result/Reason/ExpectingCTEXT.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExpectingDTEXT' => $vendorDir . '/egulias/email-validator/src/Result/Reason/ExpectingDTEXT.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExpectingDomainLiteralClose' => $vendorDir . '/egulias/email-validator/src/Result/Reason/ExpectingDomainLiteralClose.php', - 'Egulias\\EmailValidator\\Result\\Reason\\LabelTooLong' => $vendorDir . '/egulias/email-validator/src/Result/Reason/LabelTooLong.php', - 'Egulias\\EmailValidator\\Result\\Reason\\LocalOrReservedDomain' => $vendorDir . '/egulias/email-validator/src/Result/Reason/LocalOrReservedDomain.php', - 'Egulias\\EmailValidator\\Result\\Reason\\NoDNSRecord' => $vendorDir . '/egulias/email-validator/src/Result/Reason/NoDNSRecord.php', - 'Egulias\\EmailValidator\\Result\\Reason\\NoDomainPart' => $vendorDir . '/egulias/email-validator/src/Result/Reason/NoDomainPart.php', - 'Egulias\\EmailValidator\\Result\\Reason\\NoLocalPart' => $vendorDir . '/egulias/email-validator/src/Result/Reason/NoLocalPart.php', - 'Egulias\\EmailValidator\\Result\\Reason\\RFCWarnings' => $vendorDir . '/egulias/email-validator/src/Result/Reason/RFCWarnings.php', - 'Egulias\\EmailValidator\\Result\\Reason\\Reason' => $vendorDir . '/egulias/email-validator/src/Result/Reason/Reason.php', - 'Egulias\\EmailValidator\\Result\\Reason\\SpoofEmail' => $vendorDir . '/egulias/email-validator/src/Result/Reason/SpoofEmail.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnOpenedComment' => $vendorDir . '/egulias/email-validator/src/Result/Reason/UnOpenedComment.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnableToGetDNSRecord' => $vendorDir . '/egulias/email-validator/src/Result/Reason/UnableToGetDNSRecord.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnclosedComment' => $vendorDir . '/egulias/email-validator/src/Result/Reason/UnclosedComment.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnclosedQuotedString' => $vendorDir . '/egulias/email-validator/src/Result/Reason/UnclosedQuotedString.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnusualElements' => $vendorDir . '/egulias/email-validator/src/Result/Reason/UnusualElements.php', - 'Egulias\\EmailValidator\\Result\\Result' => $vendorDir . '/egulias/email-validator/src/Result/Result.php', - 'Egulias\\EmailValidator\\Result\\SpoofEmail' => $vendorDir . '/egulias/email-validator/src/Result/SpoofEmail.php', - 'Egulias\\EmailValidator\\Result\\ValidEmail' => $vendorDir . '/egulias/email-validator/src/Result/ValidEmail.php', + 'Egulias\\EmailValidator\\Parser\\Parser' => $vendorDir . '/egulias/email-validator/src/Parser/Parser.php', 'Egulias\\EmailValidator\\Validation\\DNSCheckValidation' => $vendorDir . '/egulias/email-validator/src/Validation/DNSCheckValidation.php', 'Egulias\\EmailValidator\\Validation\\EmailValidation' => $vendorDir . '/egulias/email-validator/src/Validation/EmailValidation.php', + 'Egulias\\EmailValidator\\Validation\\Error\\RFCWarnings' => $vendorDir . '/egulias/email-validator/src/Validation/Error/RFCWarnings.php', + 'Egulias\\EmailValidator\\Validation\\Error\\SpoofEmail' => $vendorDir . '/egulias/email-validator/src/Validation/Error/SpoofEmail.php', 'Egulias\\EmailValidator\\Validation\\Exception\\EmptyValidationList' => $vendorDir . '/egulias/email-validator/src/Validation/Exception/EmptyValidationList.php', - 'Egulias\\EmailValidator\\Validation\\Extra\\SpoofCheckValidation' => $vendorDir . '/egulias/email-validator/src/Validation/Extra/SpoofCheckValidation.php', - 'Egulias\\EmailValidator\\Validation\\MessageIDValidation' => $vendorDir . '/egulias/email-validator/src/Validation/MessageIDValidation.php', + 'Egulias\\EmailValidator\\Validation\\MultipleErrors' => $vendorDir . '/egulias/email-validator/src/Validation/MultipleErrors.php', 'Egulias\\EmailValidator\\Validation\\MultipleValidationWithAnd' => $vendorDir . '/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php', 'Egulias\\EmailValidator\\Validation\\NoRFCWarningsValidation' => $vendorDir . '/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php', 'Egulias\\EmailValidator\\Validation\\RFCValidation' => $vendorDir . '/egulias/email-validator/src/Validation/RFCValidation.php', + 'Egulias\\EmailValidator\\Validation\\SpoofCheckValidation' => $vendorDir . '/egulias/email-validator/src/Validation/SpoofCheckValidation.php', 'Egulias\\EmailValidator\\Warning\\AddressLiteral' => $vendorDir . '/egulias/email-validator/src/Warning/AddressLiteral.php', 'Egulias\\EmailValidator\\Warning\\CFWSNearAt' => $vendorDir . '/egulias/email-validator/src/Warning/CFWSNearAt.php', 'Egulias\\EmailValidator\\Warning\\CFWSWithFWS' => $vendorDir . '/egulias/email-validator/src/Warning/CFWSWithFWS.php', 'Egulias\\EmailValidator\\Warning\\Comment' => $vendorDir . '/egulias/email-validator/src/Warning/Comment.php', 'Egulias\\EmailValidator\\Warning\\DeprecatedComment' => $vendorDir . '/egulias/email-validator/src/Warning/DeprecatedComment.php', 'Egulias\\EmailValidator\\Warning\\DomainLiteral' => $vendorDir . '/egulias/email-validator/src/Warning/DomainLiteral.php', + 'Egulias\\EmailValidator\\Warning\\DomainTooLong' => $vendorDir . '/egulias/email-validator/src/Warning/DomainTooLong.php', 'Egulias\\EmailValidator\\Warning\\EmailTooLong' => $vendorDir . '/egulias/email-validator/src/Warning/EmailTooLong.php', 'Egulias\\EmailValidator\\Warning\\IPV6BadChar' => $vendorDir . '/egulias/email-validator/src/Warning/IPV6BadChar.php', 'Egulias\\EmailValidator\\Warning\\IPV6ColonEnd' => $vendorDir . '/egulias/email-validator/src/Warning/IPV6ColonEnd.php', @@ -856,6 +838,7 @@ 'Egulias\\EmailValidator\\Warning\\IPV6DoubleColon' => $vendorDir . '/egulias/email-validator/src/Warning/IPV6DoubleColon.php', 'Egulias\\EmailValidator\\Warning\\IPV6GroupCount' => $vendorDir . '/egulias/email-validator/src/Warning/IPV6GroupCount.php', 'Egulias\\EmailValidator\\Warning\\IPV6MaxGroups' => $vendorDir . '/egulias/email-validator/src/Warning/IPV6MaxGroups.php', + 'Egulias\\EmailValidator\\Warning\\LabelTooLong' => $vendorDir . '/egulias/email-validator/src/Warning/LabelTooLong.php', 'Egulias\\EmailValidator\\Warning\\LocalTooLong' => $vendorDir . '/egulias/email-validator/src/Warning/LocalTooLong.php', 'Egulias\\EmailValidator\\Warning\\NoDNSMXRecord' => $vendorDir . '/egulias/email-validator/src/Warning/NoDNSMXRecord.php', 'Egulias\\EmailValidator\\Warning\\ObsoleteDTEXT' => $vendorDir . '/egulias/email-validator/src/Warning/ObsoleteDTEXT.php', @@ -1292,7 +1275,6 @@ 'Illuminate\\Console\\Concerns\\HasParameters' => $vendorDir . '/illuminate/console/Concerns/HasParameters.php', 'Illuminate\\Console\\Concerns\\InteractsWithIO' => $vendorDir . '/illuminate/console/Concerns/InteractsWithIO.php', 'Illuminate\\Console\\ConfirmableTrait' => $vendorDir . '/illuminate/console/ConfirmableTrait.php', - 'Illuminate\\Console\\ContainerCommandLoader' => $vendorDir . '/illuminate/console/ContainerCommandLoader.php', 'Illuminate\\Console\\Events\\ArtisanStarting' => $vendorDir . '/illuminate/console/Events/ArtisanStarting.php', 'Illuminate\\Console\\Events\\CommandFinished' => $vendorDir . '/illuminate/console/Events/CommandFinished.php', 'Illuminate\\Console\\Events\\CommandStarting' => $vendorDir . '/illuminate/console/Events/CommandStarting.php', @@ -1361,7 +1343,6 @@ 'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => $vendorDir . '/illuminate/contracts/Container/ContextualBindingBuilder.php', 'Illuminate\\Contracts\\Cookie\\Factory' => $vendorDir . '/illuminate/contracts/Cookie/Factory.php', 'Illuminate\\Contracts\\Cookie\\QueueingFactory' => $vendorDir . '/illuminate/contracts/Cookie/QueueingFactory.php', - 'Illuminate\\Contracts\\Database\\Eloquent\\Builder' => $vendorDir . '/illuminate/contracts/Database/Eloquent/Builder.php', 'Illuminate\\Contracts\\Database\\Eloquent\\Castable' => $vendorDir . '/illuminate/contracts/Database/Eloquent/Castable.php', 'Illuminate\\Contracts\\Database\\Eloquent\\CastsAttributes' => $vendorDir . '/illuminate/contracts/Database/Eloquent/CastsAttributes.php', 'Illuminate\\Contracts\\Database\\Eloquent\\CastsInboundAttributes' => $vendorDir . '/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php', @@ -1370,7 +1351,6 @@ 'Illuminate\\Contracts\\Database\\Eloquent\\SupportsPartialRelations' => $vendorDir . '/illuminate/contracts/Database/Eloquent/SupportsPartialRelations.php', 'Illuminate\\Contracts\\Database\\Events\\MigrationEvent' => $vendorDir . '/illuminate/contracts/Database/Events/MigrationEvent.php', 'Illuminate\\Contracts\\Database\\ModelIdentifier' => $vendorDir . '/illuminate/contracts/Database/ModelIdentifier.php', - 'Illuminate\\Contracts\\Database\\Query\\Builder' => $vendorDir . '/illuminate/contracts/Database/Query/Builder.php', 'Illuminate\\Contracts\\Debug\\ExceptionHandler' => $vendorDir . '/illuminate/contracts/Debug/ExceptionHandler.php', 'Illuminate\\Contracts\\Encryption\\DecryptException' => $vendorDir . '/illuminate/contracts/Encryption/DecryptException.php', 'Illuminate\\Contracts\\Encryption\\EncryptException' => $vendorDir . '/illuminate/contracts/Encryption/EncryptException.php', @@ -1379,14 +1359,13 @@ 'Illuminate\\Contracts\\Events\\Dispatcher' => $vendorDir . '/illuminate/contracts/Events/Dispatcher.php', 'Illuminate\\Contracts\\Filesystem\\Cloud' => $vendorDir . '/illuminate/contracts/Filesystem/Cloud.php', 'Illuminate\\Contracts\\Filesystem\\Factory' => $vendorDir . '/illuminate/contracts/Filesystem/Factory.php', + 'Illuminate\\Contracts\\Filesystem\\FileExistsException' => $vendorDir . '/illuminate/contracts/Filesystem/FileExistsException.php', 'Illuminate\\Contracts\\Filesystem\\FileNotFoundException' => $vendorDir . '/illuminate/contracts/Filesystem/FileNotFoundException.php', 'Illuminate\\Contracts\\Filesystem\\Filesystem' => $vendorDir . '/illuminate/contracts/Filesystem/Filesystem.php', 'Illuminate\\Contracts\\Filesystem\\LockTimeoutException' => $vendorDir . '/illuminate/contracts/Filesystem/LockTimeoutException.php', 'Illuminate\\Contracts\\Foundation\\Application' => $vendorDir . '/illuminate/contracts/Foundation/Application.php', 'Illuminate\\Contracts\\Foundation\\CachesConfiguration' => $vendorDir . '/illuminate/contracts/Foundation/CachesConfiguration.php', 'Illuminate\\Contracts\\Foundation\\CachesRoutes' => $vendorDir . '/illuminate/contracts/Foundation/CachesRoutes.php', - 'Illuminate\\Contracts\\Foundation\\ExceptionRenderer' => $vendorDir . '/illuminate/contracts/Foundation/ExceptionRenderer.php', - 'Illuminate\\Contracts\\Foundation\\MaintenanceMode' => $vendorDir . '/illuminate/contracts/Foundation/MaintenanceMode.php', 'Illuminate\\Contracts\\Hashing\\Hasher' => $vendorDir . '/illuminate/contracts/Hashing/Hasher.php', 'Illuminate\\Contracts\\Http\\Kernel' => $vendorDir . '/illuminate/contracts/Http/Kernel.php', 'Illuminate\\Contracts\\Mail\\Factory' => $vendorDir . '/illuminate/contracts/Mail/Factory.php', @@ -1481,7 +1460,6 @@ 'Illuminate\\Database\\Console\\PruneCommand' => $vendorDir . '/illuminate/database/Console/PruneCommand.php', 'Illuminate\\Database\\Console\\Seeds\\SeedCommand' => $vendorDir . '/illuminate/database/Console/Seeds/SeedCommand.php', 'Illuminate\\Database\\Console\\Seeds\\SeederMakeCommand' => $vendorDir . '/illuminate/database/Console/Seeds/SeederMakeCommand.php', - 'Illuminate\\Database\\Console\\Seeds\\WithoutModelEvents' => $vendorDir . '/illuminate/database/Console/Seeds/WithoutModelEvents.php', 'Illuminate\\Database\\Console\\WipeCommand' => $vendorDir . '/illuminate/database/Console/WipeCommand.php', 'Illuminate\\Database\\DBAL\\TimestampType' => $vendorDir . '/illuminate/database/DBAL/TimestampType.php', 'Illuminate\\Database\\DatabaseManager' => $vendorDir . '/illuminate/database/DatabaseManager.php', @@ -1629,7 +1607,7 @@ 'Illuminate\\Events\\InvokeQueuedClosure' => $vendorDir . '/illuminate/events/InvokeQueuedClosure.php', 'Illuminate\\Events\\NullDispatcher' => $vendorDir . '/illuminate/events/NullDispatcher.php', 'Illuminate\\Events\\QueuedClosure' => $vendorDir . '/illuminate/events/QueuedClosure.php', - 'Illuminate\\Filesystem\\AwsS3V3Adapter' => $vendorDir . '/illuminate/filesystem/AwsS3V3Adapter.php', + 'Illuminate\\Filesystem\\Cache' => $vendorDir . '/illuminate/filesystem/Cache.php', 'Illuminate\\Filesystem\\Filesystem' => $vendorDir . '/illuminate/filesystem/Filesystem.php', 'Illuminate\\Filesystem\\FilesystemAdapter' => $vendorDir . '/illuminate/filesystem/FilesystemAdapter.php', 'Illuminate\\Filesystem\\FilesystemManager' => $vendorDir . '/illuminate/filesystem/FilesystemManager.php', @@ -1688,6 +1666,7 @@ 'Illuminate\\Pagination\\AbstractCursorPaginator' => $vendorDir . '/illuminate/pagination/AbstractCursorPaginator.php', 'Illuminate\\Pagination\\AbstractPaginator' => $vendorDir . '/illuminate/pagination/AbstractPaginator.php', 'Illuminate\\Pagination\\Cursor' => $vendorDir . '/illuminate/pagination/Cursor.php', + 'Illuminate\\Pagination\\CursorPaginationException' => $vendorDir . '/illuminate/pagination/CursorPaginationException.php', 'Illuminate\\Pagination\\CursorPaginator' => $vendorDir . '/illuminate/pagination/CursorPaginator.php', 'Illuminate\\Pagination\\LengthAwarePaginator' => $vendorDir . '/illuminate/pagination/LengthAwarePaginator.php', 'Illuminate\\Pagination\\PaginationServiceProvider' => $vendorDir . '/illuminate/pagination/PaginationServiceProvider.php', @@ -1722,9 +1701,7 @@ 'Illuminate\\Routing\\ControllerMiddlewareOptions' => $vendorDir . '/illuminate/routing/ControllerMiddlewareOptions.php', 'Illuminate\\Routing\\CreatesRegularExpressionRouteConstraints' => $vendorDir . '/illuminate/routing/CreatesRegularExpressionRouteConstraints.php', 'Illuminate\\Routing\\Events\\RouteMatched' => $vendorDir . '/illuminate/routing/Events/RouteMatched.php', - 'Illuminate\\Routing\\Exceptions\\BackedEnumCaseNotFoundException' => $vendorDir . '/illuminate/routing/Exceptions/BackedEnumCaseNotFoundException.php', 'Illuminate\\Routing\\Exceptions\\InvalidSignatureException' => $vendorDir . '/illuminate/routing/Exceptions/InvalidSignatureException.php', - 'Illuminate\\Routing\\Exceptions\\StreamedResponseException' => $vendorDir . '/illuminate/routing/Exceptions/StreamedResponseException.php', 'Illuminate\\Routing\\Exceptions\\UrlGenerationException' => $vendorDir . '/illuminate/routing/Exceptions/UrlGenerationException.php', 'Illuminate\\Routing\\ImplicitRouteBinding' => $vendorDir . '/illuminate/routing/ImplicitRouteBinding.php', 'Illuminate\\Routing\\Matching\\HostValidator' => $vendorDir . '/illuminate/routing/Matching/HostValidator.php', @@ -1775,7 +1752,6 @@ 'Illuminate\\Session\\SessionManager' => $vendorDir . '/illuminate/session/SessionManager.php', 'Illuminate\\Session\\SessionServiceProvider' => $vendorDir . '/illuminate/session/SessionServiceProvider.php', 'Illuminate\\Session\\Store' => $vendorDir . '/illuminate/session/Store.php', - 'Illuminate\\Session\\SymfonySessionDecorator' => $vendorDir . '/illuminate/session/SymfonySessionDecorator.php', 'Illuminate\\Session\\TokenMismatchException' => $vendorDir . '/illuminate/session/TokenMismatchException.php', 'Illuminate\\Support\\AggregateServiceProvider' => $vendorDir . '/illuminate/support/AggregateServiceProvider.php', 'Illuminate\\Support\\Arr' => $vendorDir . '/illuminate/collections/Arr.php', @@ -1826,7 +1802,7 @@ 'Illuminate\\Support\\Fluent' => $vendorDir . '/illuminate/support/Fluent.php', 'Illuminate\\Support\\HigherOrderCollectionProxy' => $vendorDir . '/illuminate/collections/HigherOrderCollectionProxy.php', 'Illuminate\\Support\\HigherOrderTapProxy' => $vendorDir . '/illuminate/support/HigherOrderTapProxy.php', - 'Illuminate\\Support\\HigherOrderWhenProxy' => $vendorDir . '/illuminate/conditionable/HigherOrderWhenProxy.php', + 'Illuminate\\Support\\HigherOrderWhenProxy' => $vendorDir . '/illuminate/collections/HigherOrderWhenProxy.php', 'Illuminate\\Support\\HtmlString' => $vendorDir . '/illuminate/support/HtmlString.php', 'Illuminate\\Support\\InteractsWithTime' => $vendorDir . '/illuminate/support/InteractsWithTime.php', 'Illuminate\\Support\\ItemNotFoundException' => $vendorDir . '/illuminate/collections/ItemNotFoundException.php', @@ -1854,7 +1830,7 @@ 'Illuminate\\Support\\Testing\\Fakes\\PendingMailFake' => $vendorDir . '/illuminate/support/Testing/Fakes/PendingMailFake.php', 'Illuminate\\Support\\Testing\\Fakes\\QueueFake' => $vendorDir . '/illuminate/support/Testing/Fakes/QueueFake.php', 'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => $vendorDir . '/illuminate/support/Traits/CapsuleManagerTrait.php', - 'Illuminate\\Support\\Traits\\Conditionable' => $vendorDir . '/illuminate/conditionable/Traits/Conditionable.php', + 'Illuminate\\Support\\Traits\\Conditionable' => $vendorDir . '/illuminate/support/Traits/Conditionable.php', 'Illuminate\\Support\\Traits\\EnumeratesValues' => $vendorDir . '/illuminate/collections/Traits/EnumeratesValues.php', 'Illuminate\\Support\\Traits\\ForwardsCalls' => $vendorDir . '/illuminate/support/Traits/ForwardsCalls.php', 'Illuminate\\Support\\Traits\\Localizable' => $vendorDir . '/illuminate/support/Traits/Localizable.php', @@ -1877,7 +1853,6 @@ 'Illuminate\\Validation\\DatabasePresenceVerifier' => $vendorDir . '/illuminate/validation/DatabasePresenceVerifier.php', 'Illuminate\\Validation\\DatabasePresenceVerifierInterface' => $vendorDir . '/illuminate/validation/DatabasePresenceVerifierInterface.php', 'Illuminate\\Validation\\Factory' => $vendorDir . '/illuminate/validation/Factory.php', - 'Illuminate\\Validation\\NestedRules' => $vendorDir . '/illuminate/validation/NestedRules.php', 'Illuminate\\Validation\\NotPwnedVerifier' => $vendorDir . '/illuminate/validation/NotPwnedVerifier.php', 'Illuminate\\Validation\\PresenceVerifierInterface' => $vendorDir . '/illuminate/validation/PresenceVerifierInterface.php', 'Illuminate\\Validation\\Rule' => $vendorDir . '/illuminate/validation/Rule.php', @@ -1953,6 +1928,7 @@ 'ImageMimeTypeGuesser\\Detectors\\Stack' => $vendorDir . '/rosell-dk/image-mime-type-guesser/src/Detectors/Stack.php', 'ImageMimeTypeGuesser\\GuessFromExtension' => $vendorDir . '/rosell-dk/image-mime-type-guesser/src/GuessFromExtension.php', 'ImageMimeTypeGuesser\\ImageMimeTypeGuesser' => $vendorDir . '/rosell-dk/image-mime-type-guesser/src/ImageMimeTypeGuesser.php', + 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'JsonSchema\\Constraints\\BaseConstraint' => $vendorDir . '/justinrainbow/json-schema/src/JsonSchema/Constraints/BaseConstraint.php', 'JsonSchema\\Constraints\\CollectionConstraint' => $vendorDir . '/justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.php', 'JsonSchema\\Constraints\\Constraint' => $vendorDir . '/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php', @@ -2712,6 +2688,7 @@ 'Symfony\\Component\\HttpFoundation\\ServerBag' => $vendorDir . '/symfony/http-foundation/ServerBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag' => $vendorDir . '/symfony/http-foundation/Session/Attribute/AttributeBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface' => $vendorDir . '/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag' => $vendorDir . '/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag' => $vendorDir . '/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag' => $vendorDir . '/symfony/http-foundation/Session/Flash/FlashBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface' => $vendorDir . '/symfony/http-foundation/Session/Flash/FlashBagInterface.php', @@ -2744,6 +2721,7 @@ 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorageFactory' => $vendorDir . '/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy' => $vendorDir . '/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy' => $vendorDir . '/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\ServiceSessionFactory' => $vendorDir . '/symfony/http-foundation/Session/Storage/ServiceSessionFactory.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageFactoryInterface' => $vendorDir . '/symfony/http-foundation/Session/Storage/SessionStorageFactoryInterface.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageInterface' => $vendorDir . '/symfony/http-foundation/Session/Storage/SessionStorageInterface.php', 'Symfony\\Component\\HttpFoundation\\StreamedResponse' => $vendorDir . '/symfony/http-foundation/StreamedResponse.php', @@ -2758,6 +2736,7 @@ 'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseIsUnprocessable' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php', 'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseStatusCodeSame' => $vendorDir . '/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php', 'Symfony\\Component\\HttpFoundation\\UrlHelper' => $vendorDir . '/symfony/http-foundation/UrlHelper.php', + 'Symfony\\Component\\HttpKernel\\Attribute\\ArgumentInterface' => $vendorDir . '/symfony/http-kernel/Attribute/ArgumentInterface.php', 'Symfony\\Component\\HttpKernel\\Attribute\\AsController' => $vendorDir . '/symfony/http-kernel/Attribute/AsController.php', 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle' => $vendorDir . '/symfony/http-kernel/Bundle/Bundle.php', 'Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface' => $vendorDir . '/symfony/http-kernel/Bundle/BundleInterface.php', @@ -2819,6 +2798,7 @@ 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ResettableServicePass' => $vendorDir . '/symfony/http-kernel/DependencyInjection/ResettableServicePass.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ServicesResetter' => $vendorDir . '/symfony/http-kernel/DependencyInjection/ServicesResetter.php', 'Symfony\\Component\\HttpKernel\\EventListener\\AbstractSessionListener' => $vendorDir . '/symfony/http-kernel/EventListener/AbstractSessionListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\AbstractTestSessionListener' => $vendorDir . '/symfony/http-kernel/EventListener/AbstractTestSessionListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\AddRequestFormatsListener' => $vendorDir . '/symfony/http-kernel/EventListener/AddRequestFormatsListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener' => $vendorDir . '/symfony/http-kernel/EventListener/DebugHandlersListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\DisallowRobotsIndexingListener' => $vendorDir . '/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php', @@ -2833,6 +2813,7 @@ 'Symfony\\Component\\HttpKernel\\EventListener\\SessionListener' => $vendorDir . '/symfony/http-kernel/EventListener/SessionListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\StreamedResponseListener' => $vendorDir . '/symfony/http-kernel/EventListener/StreamedResponseListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\SurrogateListener' => $vendorDir . '/symfony/http-kernel/EventListener/SurrogateListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\TestSessionListener' => $vendorDir . '/symfony/http-kernel/EventListener/TestSessionListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener' => $vendorDir . '/symfony/http-kernel/EventListener/ValidateRequestListener.php', 'Symfony\\Component\\HttpKernel\\Event\\ControllerArgumentsEvent' => $vendorDir . '/symfony/http-kernel/Event/ControllerArgumentsEvent.php', 'Symfony\\Component\\HttpKernel\\Event\\ControllerEvent' => $vendorDir . '/symfony/http-kernel/Event/ControllerEvent.php', @@ -3039,6 +3020,7 @@ 'Symfony\\Component\\Routing\\RequestContextAwareInterface' => $vendorDir . '/symfony/routing/RequestContextAwareInterface.php', 'Symfony\\Component\\Routing\\Route' => $vendorDir . '/symfony/routing/Route.php', 'Symfony\\Component\\Routing\\RouteCollection' => $vendorDir . '/symfony/routing/RouteCollection.php', + 'Symfony\\Component\\Routing\\RouteCollectionBuilder' => $vendorDir . '/symfony/routing/RouteCollectionBuilder.php', 'Symfony\\Component\\Routing\\RouteCompiler' => $vendorDir . '/symfony/routing/RouteCompiler.php', 'Symfony\\Component\\Routing\\RouteCompilerInterface' => $vendorDir . '/symfony/routing/RouteCompilerInterface.php', 'Symfony\\Component\\Routing\\Router' => $vendorDir . '/symfony/routing/Router.php', @@ -3209,7 +3191,6 @@ 'Symfony\\Contracts\\EventDispatcher\\Event' => $vendorDir . '/symfony/event-dispatcher-contracts/Event.php', 'Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface' => $vendorDir . '/symfony/event-dispatcher-contracts/EventDispatcherInterface.php', 'Symfony\\Contracts\\Service\\Attribute\\Required' => $vendorDir . '/symfony/service-contracts/Attribute/Required.php', - 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => $vendorDir . '/symfony/service-contracts/Attribute/SubscribedService.php', 'Symfony\\Contracts\\Service\\ResetInterface' => $vendorDir . '/symfony/service-contracts/ResetInterface.php', 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => $vendorDir . '/symfony/service-contracts/ServiceLocatorTrait.php', 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => $vendorDir . '/symfony/service-contracts/ServiceProviderInterface.php', @@ -3230,6 +3211,7 @@ 'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Normalizer.php', 'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php', 'Symfony\\Polyfill\\Php72\\Php72' => $vendorDir . '/symfony/polyfill-php72/Php72.php', + 'Symfony\\Polyfill\\Php73\\Php73' => $vendorDir . '/symfony/polyfill-php73/Php73.php', 'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php', 'Tracy\\Bar' => $vendorDir . '/tracy/tracy/src/Tracy/Bar/Bar.php', 'Tracy\\BlueScreen' => $vendorDir . '/tracy/tracy/src/Tracy/BlueScreen/BlueScreen.php', diff --git a/core/vendor/composer/autoload_files.php b/core/vendor/composer/autoload_files.php index 23a806f9fd..70e4cc33e9 100644 --- a/core/vendor/composer/autoload_files.php +++ b/core/vendor/composer/autoload_files.php @@ -6,23 +6,24 @@ $baseDir = dirname($vendorDir); return array( + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '60799491728b879e74601d83e38b2cad' => $vendorDir . '/illuminate/collections/helpers.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', '72579e7bd17821bb1321b87411366eae' => $vendorDir . '/illuminate/support/helpers.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'ef65a1626449d89d0811cf9befce46f0' => $vendorDir . '/illuminate/events/functions.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '532945a4b12d830ff3e086cc36a64375' => $vendorDir . '/james-heinrich/phpthumb/phpthumb.class.php', 'd507e002f7fce7f0c6dbf1f22edcb902' => $vendorDir . '/tracy/tracy/src/Tracy/functions.php', diff --git a/core/vendor/composer/autoload_psr4.php b/core/vendor/composer/autoload_psr4.php index 76d6e55cd8..b26f707ef5 100644 --- a/core/vendor/composer/autoload_psr4.php +++ b/core/vendor/composer/autoload_psr4.php @@ -11,6 +11,7 @@ 'Wikimedia\\Composer\\Merge\\V2\\' => array($vendorDir . '/wikimedia/composer-merge-plugin/src'), 'WebPConvert\\' => array($vendorDir . '/rosell-dk/webp-convert/src'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), + 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), @@ -38,7 +39,7 @@ 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), @@ -53,7 +54,7 @@ 'Illuminate\\View\\' => array($vendorDir . '/illuminate/view'), 'Illuminate\\Validation\\' => array($vendorDir . '/illuminate/validation'), 'Illuminate\\Translation\\' => array($vendorDir . '/illuminate/translation'), - 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/conditionable', $vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/support'), + 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/support'), 'Illuminate\\Session\\' => array($vendorDir . '/illuminate/session'), 'Illuminate\\Routing\\' => array($vendorDir . '/illuminate/routing'), 'Illuminate\\Redis\\' => array($vendorDir . '/illuminate/redis'), diff --git a/core/vendor/composer/autoload_real.php b/core/vendor/composer/autoload_real.php index bfc031e81a..67e83b4915 100644 --- a/core/vendor/composer/autoload_real.php +++ b/core/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit669025e4166b3b9854be5a09c174a331 +class ComposerAutoloaderInite94ab7aab7928ca33af80901518072d1 { private static $loader; @@ -22,15 +22,15 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit669025e4166b3b9854be5a09c174a331', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInite94ab7aab7928ca33af80901518072d1', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInit669025e4166b3b9854be5a09c174a331', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInite94ab7aab7928ca33af80901518072d1', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit669025e4166b3b9854be5a09c174a331::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInite94ab7aab7928ca33af80901518072d1::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -51,19 +51,19 @@ public static function getLoader() $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit669025e4166b3b9854be5a09c174a331::$files; + $includeFiles = Composer\Autoload\ComposerStaticInite94ab7aab7928ca33af80901518072d1::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire669025e4166b3b9854be5a09c174a331($fileIdentifier, $file); + composerRequiree94ab7aab7928ca33af80901518072d1($fileIdentifier, $file); } return $loader; } } -function composerRequire669025e4166b3b9854be5a09c174a331($fileIdentifier, $file) +function composerRequiree94ab7aab7928ca33af80901518072d1($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/core/vendor/composer/autoload_static.php b/core/vendor/composer/autoload_static.php index ea1e35b89b..1150406e6a 100644 --- a/core/vendor/composer/autoload_static.php +++ b/core/vendor/composer/autoload_static.php @@ -4,26 +4,27 @@ namespace Composer\Autoload; -class ComposerStaticInit669025e4166b3b9854be5a09c174a331 +class ComposerStaticInite94ab7aab7928ca33af80901518072d1 { public static $files = array ( + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 'ef65a1626449d89d0811cf9befce46f0' => __DIR__ . '/..' . '/illuminate/events/functions.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', '532945a4b12d830ff3e086cc36a64375' => __DIR__ . '/..' . '/james-heinrich/phpthumb/phpthumb.class.php', 'd507e002f7fce7f0c6dbf1f22edcb902' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/functions.php', @@ -61,6 +62,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'S' => array ( 'Symfony\\Polyfill\\Php80\\' => 23, + 'Symfony\\Polyfill\\Php73\\' => 23, 'Symfony\\Polyfill\\Php72\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, @@ -200,6 +202,10 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', ), + 'Symfony\\Polyfill\\Php73\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', + ), 'Symfony\\Polyfill\\Php72\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', @@ -310,8 +316,8 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 ), 'Psr\\Http\\Message\\' => array ( - 0 => __DIR__ . '/..' . '/psr/http-factory/src', - 1 => __DIR__ . '/..' . '/psr/http-message/src', + 0 => __DIR__ . '/..' . '/psr/http-message/src', + 1 => __DIR__ . '/..' . '/psr/http-factory/src', ), 'Psr\\Http\\Client\\' => array ( @@ -371,10 +377,9 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 ), 'Illuminate\\Support\\' => array ( - 0 => __DIR__ . '/..' . '/illuminate/collections', - 1 => __DIR__ . '/..' . '/illuminate/conditionable', - 2 => __DIR__ . '/..' . '/illuminate/macroable', - 3 => __DIR__ . '/..' . '/illuminate/support', + 0 => __DIR__ . '/..' . '/illuminate/macroable', + 1 => __DIR__ . '/..' . '/illuminate/collections', + 2 => __DIR__ . '/..' . '/illuminate/support', ), 'Illuminate\\Session\\' => array ( @@ -687,6 +692,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Composer\\DependencyResolver\\PolicyInterface' => __DIR__ . '/..' . '/composer/composer/src/Composer/DependencyResolver/PolicyInterface.php', 'Composer\\DependencyResolver\\Pool' => __DIR__ . '/..' . '/composer/composer/src/Composer/DependencyResolver/Pool.php', 'Composer\\DependencyResolver\\PoolBuilder' => __DIR__ . '/..' . '/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php', + 'Composer\\DependencyResolver\\PoolOptimizer' => __DIR__ . '/..' . '/composer/composer/src/Composer/DependencyResolver/PoolOptimizer.php', 'Composer\\DependencyResolver\\Problem' => __DIR__ . '/..' . '/composer/composer/src/Composer/DependencyResolver/Problem.php', 'Composer\\DependencyResolver\\Request' => __DIR__ . '/..' . '/composer/composer/src/Composer/DependencyResolver/Request.php', 'Composer\\DependencyResolver\\Rule' => __DIR__ . '/..' . '/composer/composer/src/Composer/DependencyResolver/Rule.php', @@ -731,6 +737,11 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Composer\\Exception\\IrrecoverableDownloadException' => __DIR__ . '/..' . '/composer/composer/src/Composer/Exception/IrrecoverableDownloadException.php', 'Composer\\Exception\\NoSslException' => __DIR__ . '/..' . '/composer/composer/src/Composer/Exception/NoSslException.php', 'Composer\\Factory' => __DIR__ . '/..' . '/composer/composer/src/Composer/Factory.php', + 'Composer\\Filter\\PlatformRequirementFilter\\IgnoreAllPlatformRequirementFilter' => __DIR__ . '/..' . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreAllPlatformRequirementFilter.php', + 'Composer\\Filter\\PlatformRequirementFilter\\IgnoreListPlatformRequirementFilter' => __DIR__ . '/..' . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php', + 'Composer\\Filter\\PlatformRequirementFilter\\IgnoreNothingPlatformRequirementFilter' => __DIR__ . '/..' . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreNothingPlatformRequirementFilter.php', + 'Composer\\Filter\\PlatformRequirementFilter\\PlatformRequirementFilterFactory' => __DIR__ . '/..' . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterFactory.php', + 'Composer\\Filter\\PlatformRequirementFilter\\PlatformRequirementFilterInterface' => __DIR__ . '/..' . '/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterInterface.php', 'Composer\\IO\\BaseIO' => __DIR__ . '/..' . '/composer/composer/src/Composer/IO/BaseIO.php', 'Composer\\IO\\BufferIO' => __DIR__ . '/..' . '/composer/composer/src/Composer/IO/BufferIO.php', 'Composer\\IO\\ConsoleIO' => __DIR__ . '/..' . '/composer/composer/src/Composer/IO/ConsoleIO.php', @@ -765,7 +776,6 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Composer\\Package\\Archiver\\BaseExcludeFilter' => __DIR__ . '/..' . '/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php', 'Composer\\Package\\Archiver\\ComposerExcludeFilter' => __DIR__ . '/..' . '/composer/composer/src/Composer/Package/Archiver/ComposerExcludeFilter.php', 'Composer\\Package\\Archiver\\GitExcludeFilter' => __DIR__ . '/..' . '/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php', - 'Composer\\Package\\Archiver\\HgExcludeFilter' => __DIR__ . '/..' . '/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php', 'Composer\\Package\\Archiver\\PharArchiver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Package/Archiver/PharArchiver.php', 'Composer\\Package\\Archiver\\ZipArchiver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php', 'Composer\\Package\\BasePackage' => __DIR__ . '/..' . '/composer/composer/src/Composer/Package/BasePackage.php', @@ -838,13 +848,11 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Composer\\Repository\\RepositorySet' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/RepositorySet.php', 'Composer\\Repository\\RootPackageRepository' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/RootPackageRepository.php', 'Composer\\Repository\\VcsRepository' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/VcsRepository.php', - 'Composer\\Repository\\Vcs\\BitbucketDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php', 'Composer\\Repository\\Vcs\\FossilDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php', 'Composer\\Repository\\Vcs\\GitBitbucketDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php', 'Composer\\Repository\\Vcs\\GitDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/GitDriver.php', 'Composer\\Repository\\Vcs\\GitHubDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php', 'Composer\\Repository\\Vcs\\GitLabDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php', - 'Composer\\Repository\\Vcs\\HgBitbucketDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php', 'Composer\\Repository\\Vcs\\HgDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/HgDriver.php', 'Composer\\Repository\\Vcs\\PerforceDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php', 'Composer\\Repository\\Vcs\\SvnDriver' => __DIR__ . '/..' . '/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php', @@ -1322,73 +1330,52 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Egulias\\EmailValidator\\EmailLexer' => __DIR__ . '/..' . '/egulias/email-validator/src/EmailLexer.php', 'Egulias\\EmailValidator\\EmailParser' => __DIR__ . '/..' . '/egulias/email-validator/src/EmailParser.php', 'Egulias\\EmailValidator\\EmailValidator' => __DIR__ . '/..' . '/egulias/email-validator/src/EmailValidator.php', - 'Egulias\\EmailValidator\\MessageIDParser' => __DIR__ . '/..' . '/egulias/email-validator/src/MessageIDParser.php', - 'Egulias\\EmailValidator\\Parser' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser.php', - 'Egulias\\EmailValidator\\Parser\\Comment' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/Comment.php', - 'Egulias\\EmailValidator\\Parser\\CommentStrategy\\CommentStrategy' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/CommentStrategy/CommentStrategy.php', - 'Egulias\\EmailValidator\\Parser\\CommentStrategy\\DomainComment' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/CommentStrategy/DomainComment.php', - 'Egulias\\EmailValidator\\Parser\\CommentStrategy\\LocalComment' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/CommentStrategy/LocalComment.php', - 'Egulias\\EmailValidator\\Parser\\DomainLiteral' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/DomainLiteral.php', + 'Egulias\\EmailValidator\\Exception\\AtextAfterCFWS' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/AtextAfterCFWS.php', + 'Egulias\\EmailValidator\\Exception\\CRLFAtTheEnd' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/CRLFAtTheEnd.php', + 'Egulias\\EmailValidator\\Exception\\CRLFX2' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/CRLFX2.php', + 'Egulias\\EmailValidator\\Exception\\CRNoLF' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/CRNoLF.php', + 'Egulias\\EmailValidator\\Exception\\CharNotAllowed' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/CharNotAllowed.php', + 'Egulias\\EmailValidator\\Exception\\CommaInDomain' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/CommaInDomain.php', + 'Egulias\\EmailValidator\\Exception\\ConsecutiveAt' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/ConsecutiveAt.php', + 'Egulias\\EmailValidator\\Exception\\ConsecutiveDot' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/ConsecutiveDot.php', + 'Egulias\\EmailValidator\\Exception\\DomainAcceptsNoMail' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/DomainAcceptsNoMail.php', + 'Egulias\\EmailValidator\\Exception\\DomainHyphened' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/DomainHyphened.php', + 'Egulias\\EmailValidator\\Exception\\DotAtEnd' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/DotAtEnd.php', + 'Egulias\\EmailValidator\\Exception\\DotAtStart' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/DotAtStart.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingAT' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/ExpectingAT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingATEXT' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/ExpectingATEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingCTEXT' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/ExpectingCTEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingDTEXT' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/ExpectingDTEXT.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingDomainLiteralClose' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/ExpectingDomainLiteralClose.php', + 'Egulias\\EmailValidator\\Exception\\ExpectingQPair' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/ExpectingQPair.php', + 'Egulias\\EmailValidator\\Exception\\InvalidEmail' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/InvalidEmail.php', + 'Egulias\\EmailValidator\\Exception\\LocalOrReservedDomain' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/LocalOrReservedDomain.php', + 'Egulias\\EmailValidator\\Exception\\NoDNSRecord' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/NoDNSRecord.php', + 'Egulias\\EmailValidator\\Exception\\NoDomainPart' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/NoDomainPart.php', + 'Egulias\\EmailValidator\\Exception\\NoLocalPart' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/NoLocalPart.php', + 'Egulias\\EmailValidator\\Exception\\UnclosedComment' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/UnclosedComment.php', + 'Egulias\\EmailValidator\\Exception\\UnclosedQuotedString' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/UnclosedQuotedString.php', + 'Egulias\\EmailValidator\\Exception\\UnopenedComment' => __DIR__ . '/..' . '/egulias/email-validator/src/Exception/UnopenedComment.php', 'Egulias\\EmailValidator\\Parser\\DomainPart' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/DomainPart.php', - 'Egulias\\EmailValidator\\Parser\\DoubleQuote' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/DoubleQuote.php', - 'Egulias\\EmailValidator\\Parser\\FoldingWhiteSpace' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/FoldingWhiteSpace.php', - 'Egulias\\EmailValidator\\Parser\\IDLeftPart' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/IDLeftPart.php', - 'Egulias\\EmailValidator\\Parser\\IDRightPart' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/IDRightPart.php', 'Egulias\\EmailValidator\\Parser\\LocalPart' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/LocalPart.php', - 'Egulias\\EmailValidator\\Parser\\PartParser' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/PartParser.php', - 'Egulias\\EmailValidator\\Result\\InvalidEmail' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/InvalidEmail.php', - 'Egulias\\EmailValidator\\Result\\MultipleErrors' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/MultipleErrors.php', - 'Egulias\\EmailValidator\\Result\\Reason\\AtextAfterCFWS' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/AtextAfterCFWS.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CRLFAtTheEnd' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/CRLFAtTheEnd.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CRLFX2' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/CRLFX2.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CRNoLF' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/CRNoLF.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CharNotAllowed' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/CharNotAllowed.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CommaInDomain' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/CommaInDomain.php', - 'Egulias\\EmailValidator\\Result\\Reason\\CommentsInIDRight' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/CommentsInIDRight.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ConsecutiveAt' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/ConsecutiveAt.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ConsecutiveDot' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/ConsecutiveDot.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DetailedReason' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/DetailedReason.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DomainAcceptsNoMail' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/DomainAcceptsNoMail.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DomainHyphened' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/DomainHyphened.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DomainTooLong' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/DomainTooLong.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DotAtEnd' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/DotAtEnd.php', - 'Egulias\\EmailValidator\\Result\\Reason\\DotAtStart' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/DotAtStart.php', - 'Egulias\\EmailValidator\\Result\\Reason\\EmptyReason' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/EmptyReason.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExceptionFound' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/ExceptionFound.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExpectingATEXT' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/ExpectingATEXT.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExpectingCTEXT' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/ExpectingCTEXT.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExpectingDTEXT' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/ExpectingDTEXT.php', - 'Egulias\\EmailValidator\\Result\\Reason\\ExpectingDomainLiteralClose' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/ExpectingDomainLiteralClose.php', - 'Egulias\\EmailValidator\\Result\\Reason\\LabelTooLong' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/LabelTooLong.php', - 'Egulias\\EmailValidator\\Result\\Reason\\LocalOrReservedDomain' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/LocalOrReservedDomain.php', - 'Egulias\\EmailValidator\\Result\\Reason\\NoDNSRecord' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/NoDNSRecord.php', - 'Egulias\\EmailValidator\\Result\\Reason\\NoDomainPart' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/NoDomainPart.php', - 'Egulias\\EmailValidator\\Result\\Reason\\NoLocalPart' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/NoLocalPart.php', - 'Egulias\\EmailValidator\\Result\\Reason\\RFCWarnings' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/RFCWarnings.php', - 'Egulias\\EmailValidator\\Result\\Reason\\Reason' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/Reason.php', - 'Egulias\\EmailValidator\\Result\\Reason\\SpoofEmail' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/SpoofEmail.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnOpenedComment' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/UnOpenedComment.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnableToGetDNSRecord' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/UnableToGetDNSRecord.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnclosedComment' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/UnclosedComment.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnclosedQuotedString' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/UnclosedQuotedString.php', - 'Egulias\\EmailValidator\\Result\\Reason\\UnusualElements' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Reason/UnusualElements.php', - 'Egulias\\EmailValidator\\Result\\Result' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/Result.php', - 'Egulias\\EmailValidator\\Result\\SpoofEmail' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/SpoofEmail.php', - 'Egulias\\EmailValidator\\Result\\ValidEmail' => __DIR__ . '/..' . '/egulias/email-validator/src/Result/ValidEmail.php', + 'Egulias\\EmailValidator\\Parser\\Parser' => __DIR__ . '/..' . '/egulias/email-validator/src/Parser/Parser.php', 'Egulias\\EmailValidator\\Validation\\DNSCheckValidation' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/DNSCheckValidation.php', 'Egulias\\EmailValidator\\Validation\\EmailValidation' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/EmailValidation.php', + 'Egulias\\EmailValidator\\Validation\\Error\\RFCWarnings' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/Error/RFCWarnings.php', + 'Egulias\\EmailValidator\\Validation\\Error\\SpoofEmail' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/Error/SpoofEmail.php', 'Egulias\\EmailValidator\\Validation\\Exception\\EmptyValidationList' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/Exception/EmptyValidationList.php', - 'Egulias\\EmailValidator\\Validation\\Extra\\SpoofCheckValidation' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/Extra/SpoofCheckValidation.php', - 'Egulias\\EmailValidator\\Validation\\MessageIDValidation' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/MessageIDValidation.php', + 'Egulias\\EmailValidator\\Validation\\MultipleErrors' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/MultipleErrors.php', 'Egulias\\EmailValidator\\Validation\\MultipleValidationWithAnd' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php', 'Egulias\\EmailValidator\\Validation\\NoRFCWarningsValidation' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php', 'Egulias\\EmailValidator\\Validation\\RFCValidation' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/RFCValidation.php', + 'Egulias\\EmailValidator\\Validation\\SpoofCheckValidation' => __DIR__ . '/..' . '/egulias/email-validator/src/Validation/SpoofCheckValidation.php', 'Egulias\\EmailValidator\\Warning\\AddressLiteral' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/AddressLiteral.php', 'Egulias\\EmailValidator\\Warning\\CFWSNearAt' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/CFWSNearAt.php', 'Egulias\\EmailValidator\\Warning\\CFWSWithFWS' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/CFWSWithFWS.php', 'Egulias\\EmailValidator\\Warning\\Comment' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/Comment.php', 'Egulias\\EmailValidator\\Warning\\DeprecatedComment' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/DeprecatedComment.php', 'Egulias\\EmailValidator\\Warning\\DomainLiteral' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/DomainLiteral.php', + 'Egulias\\EmailValidator\\Warning\\DomainTooLong' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/DomainTooLong.php', 'Egulias\\EmailValidator\\Warning\\EmailTooLong' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/EmailTooLong.php', 'Egulias\\EmailValidator\\Warning\\IPV6BadChar' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/IPV6BadChar.php', 'Egulias\\EmailValidator\\Warning\\IPV6ColonEnd' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/IPV6ColonEnd.php', @@ -1397,6 +1384,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Egulias\\EmailValidator\\Warning\\IPV6DoubleColon' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/IPV6DoubleColon.php', 'Egulias\\EmailValidator\\Warning\\IPV6GroupCount' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/IPV6GroupCount.php', 'Egulias\\EmailValidator\\Warning\\IPV6MaxGroups' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/IPV6MaxGroups.php', + 'Egulias\\EmailValidator\\Warning\\LabelTooLong' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/LabelTooLong.php', 'Egulias\\EmailValidator\\Warning\\LocalTooLong' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/LocalTooLong.php', 'Egulias\\EmailValidator\\Warning\\NoDNSMXRecord' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/NoDNSMXRecord.php', 'Egulias\\EmailValidator\\Warning\\ObsoleteDTEXT' => __DIR__ . '/..' . '/egulias/email-validator/src/Warning/ObsoleteDTEXT.php', @@ -1833,7 +1821,6 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Console\\Concerns\\HasParameters' => __DIR__ . '/..' . '/illuminate/console/Concerns/HasParameters.php', 'Illuminate\\Console\\Concerns\\InteractsWithIO' => __DIR__ . '/..' . '/illuminate/console/Concerns/InteractsWithIO.php', 'Illuminate\\Console\\ConfirmableTrait' => __DIR__ . '/..' . '/illuminate/console/ConfirmableTrait.php', - 'Illuminate\\Console\\ContainerCommandLoader' => __DIR__ . '/..' . '/illuminate/console/ContainerCommandLoader.php', 'Illuminate\\Console\\Events\\ArtisanStarting' => __DIR__ . '/..' . '/illuminate/console/Events/ArtisanStarting.php', 'Illuminate\\Console\\Events\\CommandFinished' => __DIR__ . '/..' . '/illuminate/console/Events/CommandFinished.php', 'Illuminate\\Console\\Events\\CommandStarting' => __DIR__ . '/..' . '/illuminate/console/Events/CommandStarting.php', @@ -1902,7 +1889,6 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => __DIR__ . '/..' . '/illuminate/contracts/Container/ContextualBindingBuilder.php', 'Illuminate\\Contracts\\Cookie\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Cookie/Factory.php', 'Illuminate\\Contracts\\Cookie\\QueueingFactory' => __DIR__ . '/..' . '/illuminate/contracts/Cookie/QueueingFactory.php', - 'Illuminate\\Contracts\\Database\\Eloquent\\Builder' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/Builder.php', 'Illuminate\\Contracts\\Database\\Eloquent\\Castable' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/Castable.php', 'Illuminate\\Contracts\\Database\\Eloquent\\CastsAttributes' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/CastsAttributes.php', 'Illuminate\\Contracts\\Database\\Eloquent\\CastsInboundAttributes' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php', @@ -1911,7 +1897,6 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Contracts\\Database\\Eloquent\\SupportsPartialRelations' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/SupportsPartialRelations.php', 'Illuminate\\Contracts\\Database\\Events\\MigrationEvent' => __DIR__ . '/..' . '/illuminate/contracts/Database/Events/MigrationEvent.php', 'Illuminate\\Contracts\\Database\\ModelIdentifier' => __DIR__ . '/..' . '/illuminate/contracts/Database/ModelIdentifier.php', - 'Illuminate\\Contracts\\Database\\Query\\Builder' => __DIR__ . '/..' . '/illuminate/contracts/Database/Query/Builder.php', 'Illuminate\\Contracts\\Debug\\ExceptionHandler' => __DIR__ . '/..' . '/illuminate/contracts/Debug/ExceptionHandler.php', 'Illuminate\\Contracts\\Encryption\\DecryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/DecryptException.php', 'Illuminate\\Contracts\\Encryption\\EncryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/EncryptException.php', @@ -1920,14 +1905,13 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Contracts\\Events\\Dispatcher' => __DIR__ . '/..' . '/illuminate/contracts/Events/Dispatcher.php', 'Illuminate\\Contracts\\Filesystem\\Cloud' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Cloud.php', 'Illuminate\\Contracts\\Filesystem\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Factory.php', + 'Illuminate\\Contracts\\Filesystem\\FileExistsException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/FileExistsException.php', 'Illuminate\\Contracts\\Filesystem\\FileNotFoundException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/FileNotFoundException.php', 'Illuminate\\Contracts\\Filesystem\\Filesystem' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Filesystem.php', 'Illuminate\\Contracts\\Filesystem\\LockTimeoutException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/LockTimeoutException.php', 'Illuminate\\Contracts\\Foundation\\Application' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/Application.php', 'Illuminate\\Contracts\\Foundation\\CachesConfiguration' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/CachesConfiguration.php', 'Illuminate\\Contracts\\Foundation\\CachesRoutes' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/CachesRoutes.php', - 'Illuminate\\Contracts\\Foundation\\ExceptionRenderer' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/ExceptionRenderer.php', - 'Illuminate\\Contracts\\Foundation\\MaintenanceMode' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/MaintenanceMode.php', 'Illuminate\\Contracts\\Hashing\\Hasher' => __DIR__ . '/..' . '/illuminate/contracts/Hashing/Hasher.php', 'Illuminate\\Contracts\\Http\\Kernel' => __DIR__ . '/..' . '/illuminate/contracts/Http/Kernel.php', 'Illuminate\\Contracts\\Mail\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Mail/Factory.php', @@ -2022,7 +2006,6 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Database\\Console\\PruneCommand' => __DIR__ . '/..' . '/illuminate/database/Console/PruneCommand.php', 'Illuminate\\Database\\Console\\Seeds\\SeedCommand' => __DIR__ . '/..' . '/illuminate/database/Console/Seeds/SeedCommand.php', 'Illuminate\\Database\\Console\\Seeds\\SeederMakeCommand' => __DIR__ . '/..' . '/illuminate/database/Console/Seeds/SeederMakeCommand.php', - 'Illuminate\\Database\\Console\\Seeds\\WithoutModelEvents' => __DIR__ . '/..' . '/illuminate/database/Console/Seeds/WithoutModelEvents.php', 'Illuminate\\Database\\Console\\WipeCommand' => __DIR__ . '/..' . '/illuminate/database/Console/WipeCommand.php', 'Illuminate\\Database\\DBAL\\TimestampType' => __DIR__ . '/..' . '/illuminate/database/DBAL/TimestampType.php', 'Illuminate\\Database\\DatabaseManager' => __DIR__ . '/..' . '/illuminate/database/DatabaseManager.php', @@ -2170,7 +2153,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Events\\InvokeQueuedClosure' => __DIR__ . '/..' . '/illuminate/events/InvokeQueuedClosure.php', 'Illuminate\\Events\\NullDispatcher' => __DIR__ . '/..' . '/illuminate/events/NullDispatcher.php', 'Illuminate\\Events\\QueuedClosure' => __DIR__ . '/..' . '/illuminate/events/QueuedClosure.php', - 'Illuminate\\Filesystem\\AwsS3V3Adapter' => __DIR__ . '/..' . '/illuminate/filesystem/AwsS3V3Adapter.php', + 'Illuminate\\Filesystem\\Cache' => __DIR__ . '/..' . '/illuminate/filesystem/Cache.php', 'Illuminate\\Filesystem\\Filesystem' => __DIR__ . '/..' . '/illuminate/filesystem/Filesystem.php', 'Illuminate\\Filesystem\\FilesystemAdapter' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemAdapter.php', 'Illuminate\\Filesystem\\FilesystemManager' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemManager.php', @@ -2229,6 +2212,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Pagination\\AbstractCursorPaginator' => __DIR__ . '/..' . '/illuminate/pagination/AbstractCursorPaginator.php', 'Illuminate\\Pagination\\AbstractPaginator' => __DIR__ . '/..' . '/illuminate/pagination/AbstractPaginator.php', 'Illuminate\\Pagination\\Cursor' => __DIR__ . '/..' . '/illuminate/pagination/Cursor.php', + 'Illuminate\\Pagination\\CursorPaginationException' => __DIR__ . '/..' . '/illuminate/pagination/CursorPaginationException.php', 'Illuminate\\Pagination\\CursorPaginator' => __DIR__ . '/..' . '/illuminate/pagination/CursorPaginator.php', 'Illuminate\\Pagination\\LengthAwarePaginator' => __DIR__ . '/..' . '/illuminate/pagination/LengthAwarePaginator.php', 'Illuminate\\Pagination\\PaginationServiceProvider' => __DIR__ . '/..' . '/illuminate/pagination/PaginationServiceProvider.php', @@ -2263,9 +2247,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Routing\\ControllerMiddlewareOptions' => __DIR__ . '/..' . '/illuminate/routing/ControllerMiddlewareOptions.php', 'Illuminate\\Routing\\CreatesRegularExpressionRouteConstraints' => __DIR__ . '/..' . '/illuminate/routing/CreatesRegularExpressionRouteConstraints.php', 'Illuminate\\Routing\\Events\\RouteMatched' => __DIR__ . '/..' . '/illuminate/routing/Events/RouteMatched.php', - 'Illuminate\\Routing\\Exceptions\\BackedEnumCaseNotFoundException' => __DIR__ . '/..' . '/illuminate/routing/Exceptions/BackedEnumCaseNotFoundException.php', 'Illuminate\\Routing\\Exceptions\\InvalidSignatureException' => __DIR__ . '/..' . '/illuminate/routing/Exceptions/InvalidSignatureException.php', - 'Illuminate\\Routing\\Exceptions\\StreamedResponseException' => __DIR__ . '/..' . '/illuminate/routing/Exceptions/StreamedResponseException.php', 'Illuminate\\Routing\\Exceptions\\UrlGenerationException' => __DIR__ . '/..' . '/illuminate/routing/Exceptions/UrlGenerationException.php', 'Illuminate\\Routing\\ImplicitRouteBinding' => __DIR__ . '/..' . '/illuminate/routing/ImplicitRouteBinding.php', 'Illuminate\\Routing\\Matching\\HostValidator' => __DIR__ . '/..' . '/illuminate/routing/Matching/HostValidator.php', @@ -2316,7 +2298,6 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Session\\SessionManager' => __DIR__ . '/..' . '/illuminate/session/SessionManager.php', 'Illuminate\\Session\\SessionServiceProvider' => __DIR__ . '/..' . '/illuminate/session/SessionServiceProvider.php', 'Illuminate\\Session\\Store' => __DIR__ . '/..' . '/illuminate/session/Store.php', - 'Illuminate\\Session\\SymfonySessionDecorator' => __DIR__ . '/..' . '/illuminate/session/SymfonySessionDecorator.php', 'Illuminate\\Session\\TokenMismatchException' => __DIR__ . '/..' . '/illuminate/session/TokenMismatchException.php', 'Illuminate\\Support\\AggregateServiceProvider' => __DIR__ . '/..' . '/illuminate/support/AggregateServiceProvider.php', 'Illuminate\\Support\\Arr' => __DIR__ . '/..' . '/illuminate/collections/Arr.php', @@ -2367,7 +2348,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Support\\Fluent' => __DIR__ . '/..' . '/illuminate/support/Fluent.php', 'Illuminate\\Support\\HigherOrderCollectionProxy' => __DIR__ . '/..' . '/illuminate/collections/HigherOrderCollectionProxy.php', 'Illuminate\\Support\\HigherOrderTapProxy' => __DIR__ . '/..' . '/illuminate/support/HigherOrderTapProxy.php', - 'Illuminate\\Support\\HigherOrderWhenProxy' => __DIR__ . '/..' . '/illuminate/conditionable/HigherOrderWhenProxy.php', + 'Illuminate\\Support\\HigherOrderWhenProxy' => __DIR__ . '/..' . '/illuminate/collections/HigherOrderWhenProxy.php', 'Illuminate\\Support\\HtmlString' => __DIR__ . '/..' . '/illuminate/support/HtmlString.php', 'Illuminate\\Support\\InteractsWithTime' => __DIR__ . '/..' . '/illuminate/support/InteractsWithTime.php', 'Illuminate\\Support\\ItemNotFoundException' => __DIR__ . '/..' . '/illuminate/collections/ItemNotFoundException.php', @@ -2395,7 +2376,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Support\\Testing\\Fakes\\PendingMailFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/PendingMailFake.php', 'Illuminate\\Support\\Testing\\Fakes\\QueueFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/QueueFake.php', 'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => __DIR__ . '/..' . '/illuminate/support/Traits/CapsuleManagerTrait.php', - 'Illuminate\\Support\\Traits\\Conditionable' => __DIR__ . '/..' . '/illuminate/conditionable/Traits/Conditionable.php', + 'Illuminate\\Support\\Traits\\Conditionable' => __DIR__ . '/..' . '/illuminate/support/Traits/Conditionable.php', 'Illuminate\\Support\\Traits\\EnumeratesValues' => __DIR__ . '/..' . '/illuminate/collections/Traits/EnumeratesValues.php', 'Illuminate\\Support\\Traits\\ForwardsCalls' => __DIR__ . '/..' . '/illuminate/support/Traits/ForwardsCalls.php', 'Illuminate\\Support\\Traits\\Localizable' => __DIR__ . '/..' . '/illuminate/support/Traits/Localizable.php', @@ -2418,7 +2399,6 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Illuminate\\Validation\\DatabasePresenceVerifier' => __DIR__ . '/..' . '/illuminate/validation/DatabasePresenceVerifier.php', 'Illuminate\\Validation\\DatabasePresenceVerifierInterface' => __DIR__ . '/..' . '/illuminate/validation/DatabasePresenceVerifierInterface.php', 'Illuminate\\Validation\\Factory' => __DIR__ . '/..' . '/illuminate/validation/Factory.php', - 'Illuminate\\Validation\\NestedRules' => __DIR__ . '/..' . '/illuminate/validation/NestedRules.php', 'Illuminate\\Validation\\NotPwnedVerifier' => __DIR__ . '/..' . '/illuminate/validation/NotPwnedVerifier.php', 'Illuminate\\Validation\\PresenceVerifierInterface' => __DIR__ . '/..' . '/illuminate/validation/PresenceVerifierInterface.php', 'Illuminate\\Validation\\Rule' => __DIR__ . '/..' . '/illuminate/validation/Rule.php', @@ -2494,6 +2474,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'ImageMimeTypeGuesser\\Detectors\\Stack' => __DIR__ . '/..' . '/rosell-dk/image-mime-type-guesser/src/Detectors/Stack.php', 'ImageMimeTypeGuesser\\GuessFromExtension' => __DIR__ . '/..' . '/rosell-dk/image-mime-type-guesser/src/GuessFromExtension.php', 'ImageMimeTypeGuesser\\ImageMimeTypeGuesser' => __DIR__ . '/..' . '/rosell-dk/image-mime-type-guesser/src/ImageMimeTypeGuesser.php', + 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'JsonSchema\\Constraints\\BaseConstraint' => __DIR__ . '/..' . '/justinrainbow/json-schema/src/JsonSchema/Constraints/BaseConstraint.php', 'JsonSchema\\Constraints\\CollectionConstraint' => __DIR__ . '/..' . '/justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.php', 'JsonSchema\\Constraints\\Constraint' => __DIR__ . '/..' . '/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php', @@ -3253,6 +3234,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Symfony\\Component\\HttpFoundation\\ServerBag' => __DIR__ . '/..' . '/symfony/http-foundation/ServerBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Attribute/AttributeBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Flash/FlashBag.php', 'Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Flash/FlashBagInterface.php', @@ -3285,6 +3267,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorageFactory' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\ServiceSessionFactory' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/ServiceSessionFactory.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageFactoryInterface' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/SessionStorageFactoryInterface.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageInterface' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/SessionStorageInterface.php', 'Symfony\\Component\\HttpFoundation\\StreamedResponse' => __DIR__ . '/..' . '/symfony/http-foundation/StreamedResponse.php', @@ -3299,6 +3282,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseIsUnprocessable' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php', 'Symfony\\Component\\HttpFoundation\\Test\\Constraint\\ResponseStatusCodeSame' => __DIR__ . '/..' . '/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php', 'Symfony\\Component\\HttpFoundation\\UrlHelper' => __DIR__ . '/..' . '/symfony/http-foundation/UrlHelper.php', + 'Symfony\\Component\\HttpKernel\\Attribute\\ArgumentInterface' => __DIR__ . '/..' . '/symfony/http-kernel/Attribute/ArgumentInterface.php', 'Symfony\\Component\\HttpKernel\\Attribute\\AsController' => __DIR__ . '/..' . '/symfony/http-kernel/Attribute/AsController.php', 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle' => __DIR__ . '/..' . '/symfony/http-kernel/Bundle/Bundle.php', 'Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface' => __DIR__ . '/..' . '/symfony/http-kernel/Bundle/BundleInterface.php', @@ -3360,6 +3344,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ResettableServicePass' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/ResettableServicePass.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ServicesResetter' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/ServicesResetter.php', 'Symfony\\Component\\HttpKernel\\EventListener\\AbstractSessionListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/AbstractSessionListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\AbstractTestSessionListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/AbstractTestSessionListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\AddRequestFormatsListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/AddRequestFormatsListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/DebugHandlersListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\DisallowRobotsIndexingListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php', @@ -3374,6 +3359,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Symfony\\Component\\HttpKernel\\EventListener\\SessionListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/SessionListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\StreamedResponseListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/StreamedResponseListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\SurrogateListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/SurrogateListener.php', + 'Symfony\\Component\\HttpKernel\\EventListener\\TestSessionListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/TestSessionListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/ValidateRequestListener.php', 'Symfony\\Component\\HttpKernel\\Event\\ControllerArgumentsEvent' => __DIR__ . '/..' . '/symfony/http-kernel/Event/ControllerArgumentsEvent.php', 'Symfony\\Component\\HttpKernel\\Event\\ControllerEvent' => __DIR__ . '/..' . '/symfony/http-kernel/Event/ControllerEvent.php', @@ -3580,6 +3566,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Symfony\\Component\\Routing\\RequestContextAwareInterface' => __DIR__ . '/..' . '/symfony/routing/RequestContextAwareInterface.php', 'Symfony\\Component\\Routing\\Route' => __DIR__ . '/..' . '/symfony/routing/Route.php', 'Symfony\\Component\\Routing\\RouteCollection' => __DIR__ . '/..' . '/symfony/routing/RouteCollection.php', + 'Symfony\\Component\\Routing\\RouteCollectionBuilder' => __DIR__ . '/..' . '/symfony/routing/RouteCollectionBuilder.php', 'Symfony\\Component\\Routing\\RouteCompiler' => __DIR__ . '/..' . '/symfony/routing/RouteCompiler.php', 'Symfony\\Component\\Routing\\RouteCompilerInterface' => __DIR__ . '/..' . '/symfony/routing/RouteCompilerInterface.php', 'Symfony\\Component\\Routing\\Router' => __DIR__ . '/..' . '/symfony/routing/Router.php', @@ -3750,7 +3737,6 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Symfony\\Contracts\\EventDispatcher\\Event' => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts/Event.php', 'Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface' => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts/EventDispatcherInterface.php', 'Symfony\\Contracts\\Service\\Attribute\\Required' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/Required.php', - 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/SubscribedService.php', 'Symfony\\Contracts\\Service\\ResetInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ResetInterface.php', 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceLocatorTrait.php', 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceProviderInterface.php', @@ -3771,6 +3757,7 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Normalizer.php', 'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php', 'Symfony\\Polyfill\\Php72\\Php72' => __DIR__ . '/..' . '/symfony/polyfill-php72/Php72.php', + 'Symfony\\Polyfill\\Php73\\Php73' => __DIR__ . '/..' . '/symfony/polyfill-php73/Php73.php', 'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php', 'Tracy\\Bar' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/Bar/Bar.php', 'Tracy\\BlueScreen' => __DIR__ . '/..' . '/tracy/tracy/src/Tracy/BlueScreen/BlueScreen.php', @@ -3889,9 +3876,9 @@ class ComposerStaticInit669025e4166b3b9854be5a09c174a331 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit669025e4166b3b9854be5a09c174a331::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit669025e4166b3b9854be5a09c174a331::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit669025e4166b3b9854be5a09c174a331::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInite94ab7aab7928ca33af80901518072d1::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInite94ab7aab7928ca33af80901518072d1::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInite94ab7aab7928ca33af80901518072d1::$classMap; }, null, ClassLoader::class); } diff --git a/core/vendor/composer/composer/CHANGELOG.md b/core/vendor/composer/composer/CHANGELOG.md index ae55a59677..ff1ac0e34f 100644 --- a/core/vendor/composer/composer/CHANGELOG.md +++ b/core/vendor/composer/composer/CHANGELOG.md @@ -1,3 +1,90 @@ +### [2.2.6] 2022-02-04 + + * BC Break: due to an oversight, the `COMPOSER_BIN_DIR` env var for binaries added in Composer 2.2.2 had to be renamed to `COMPOSER_RUNTIME_BIN_DIR` (#10512) + * Fixed enum parsing in classmap generation with syntax like `enum foo:string` without space after `:` (#10498) + * Fixed package search not urlencoding the input (#10500) + * Fixed `reinstall` command not firing `pre-install-cmd`/`post-install-cmd` events (#10514) + * Fixed edge case in path repositories where a symlink: true option would be ignored on old Windows and old PHP combos (#10482) + * Fixed test suite compatibility with latest symfony/console releases (#10499) + * Fixed some error reporting edge cases (#10484, #10451, #10493) + +### [2.2.5] 2022-01-21 + + * Disabled `composer/package-versions-deprecated` by default as it can function using `Composer\InstalledVersions` at runtime (#10458) + * Fixed artifact repositories crashing if a phar file was present in the directory (#10406) + * Fixed binary proxy issue on PHP <8 when fseek is used on the proxied binary path (#10468) + * Fixed handling of non-string versions in package repositories metadata (#10470) + +### [2.2.4] 2022-01-08 + + * Fixed handling of process timeout when running async processes during installation + * Fixed GitLab API handling when projects have a repository disabled (#10440) + * Fixed reading of environment variables (e.g. APPDATA) containing unicode characters to workaround a PHP bug on Windows (#10434) + * Fixed partial update issues with path repos missing if a path repo is required by a path repo (#10431) + * Fixed support for sourcing binaries via the new bin proxies ([#10389](https://github.com/composer/composer/issues/10389#issuecomment-1007372740)) + * Fixed messaging when GitHub tokens need SSO authorization (#10432) + +### [2.2.3] 2021-12-31 + + * Fixed issue with PHPUnit and process isolation now including PHPUnit <6.5 (#10387) + * Fixed interoperability issue with laminas/laminas-zendframework-bridge and Composer 2.2 (#10401) + * Fixed binary proxies for shell scripts to work correctly when they are symlinked (jakzal/phpqa#336) + * Fixed overly greedy pool optimization in cases where a locked package is not required by anything anymore in a partial update (#10405) + +### [2.2.2] 2021-12-29 + + * Added [`COMPOSER_BIN_DIR` env var and `_composer_bin_dir` global](https://getcomposer.org/doc/articles/vendor-binaries.md#finding-the-composer-bin-dir-from-a-binary) containing the path to the bin-dir for binaries. Packages relying on finding the bin dir with `$BASH_SOURCES[0]` will need to update their binaries (#10402) + * Fixed issue when new binary proxies are combined with PHPUnit and process isolation (#10387) + * Fixed deprecation warnings when using Symfony 5.4+ and requiring composer/composer itself (#10404) + * Fixed UX of plugin warnings (#10381) + +### [2.2.1] 2021-12-22 + + * Fixed plugin autoloading including files autoload rules from the root package (#10382) + * Fixed issue parsing php files with unterminated comments found inside backticks (#10385) + +### [2.2.0] 2021-12-22 + + * Added support for using `dev-main` as the default path repo package version if no VCS info is available (#10372) + * Added --no-scripts as a globally supported flag to all Composer commands to disable scripts execution (#10371) + * Fixed self-update failing in some edge cases due to loading plugins (#10371) + * Fixed display of conflicts showing the wrong package name in some conditions (#10355) + +### [2.2.0-RC1] 2021-12-08 + + * Bumped `composer-runtime-api` and `composer-plugin-api` to `2.2.0` + * UX Change: Added [`allow-plugins`](https://getcomposer.org/doc/06-config.md#allow-plugins) config value to enhance security against runtime execution, this will prompt you the first time you use a plugin and may hang pipelines if they aren't using --no-interaction (-n) as they should (#10314) + * Added an optimization pass to reduce the amount of redundant inspected during resolution, drastically improving memory and CPU usage (#9261, #9620) + * Added a [global $_composer_autoload_path variable](https://getcomposer.org/doc/articles/vendor-binaries.md#finding-the-composer-autoloader-from-a-binary) containing the path to autoload.php for binaries (#10137) + * Added wildcard support to --ignore-platform-req (e.g. `ext-*`) (#10083) + * Added support for ignoring the upper bound of platform requirements using "name+" notation e.g. using `--ignore-platform-req=php+` would allow installing a package requiring `php: 8.0.*` on PHP 8.1, but not on PHP 7.4. Useful for CI builds of upcoming PHP versions (#10318) + * Added support for setting platform packages to false in config.platform to disable/hide them (#10308) + * Added [`use-parent-dir`](https://getcomposer.org/doc/06-config.md#use-parent-dir) option to configure the prompt for using composer.json in upper directory when none is present in current dir (#10307) + * Added [`composer` platform package](https://getcomposer.org/doc/articles/composer-platform-dependencies.md) which is always the exact version of Composer running unlike `composer-*-api` packages (#10313) + * Added a --source flag to `config` command to show where config values are loaded from (#10129) + * Added support for `files` autoloaders in the runtime scripts/plugins contexts (#10065) + * Added retry behavior on certain http status and curl error codes (#10162) + * Added abandoned flag display in search command output + * Added support for --ignore-platform-reqs in `outdated` command (#10293) + * Added --only-vendor (-O) flag to `search` command to search (and return) vendor names (#10336) + * Added COMPOSER_NO_DEV environment variable to set the --no-dev flag (#10262) + * Fixed `archive` command to behave more like git archive, gitignore/hgignore are not taken into account anymore, and gitattributes support was improved (#10309) + * Fixed unlocking of replacers when a replaced package is unlocked (#10280) + * Fixed auto-unlocked path repo packages also unlocking their transitive deps when -w/-W is used (#10157) + * Fixed handling of recursive package links (e.g. requiring or replacing oneself) + * Fixed env var reads to check $_SERVER and $_ENV before getenv for broader ecosystem compatibility (#10218) + * Fixed `archive` command to produce archives with files sorted by name (#10274) + * Fixed VcsRepository issues where server failure could cause missing tags/branches (#10319) + * Fixed some error reporting issues (#10283, #10339) + +### [2.1.14] 2021-11-30 + + * Fixed invalid release build + +### [2.1.13] 2021-11-30 + + * Removed `symfony/console ^6` support as we cannot be compatible until Composer 2.3.0 is released. If you have issues with Composer required as a dependency + Symfony make sure you stay on Symfony 5.4 for now. (#10321) + ### [2.1.12] 2021-11-09 * Fixed issues in proxied binary files relying on __FILE__ / __DIR__ on php <8 (#10261) @@ -258,7 +345,7 @@ ### [2.0.1] 2020-10-24 - * Fixed crash on PHP8 + * Fixed crash on PHP 8 ### [2.0.0] 2020-10-24 @@ -1297,6 +1384,16 @@ * Initial release +[2.2.6]: https://github.com/composer/composer/compare/2.2.5...2.2.6 +[2.2.5]: https://github.com/composer/composer/compare/2.2.4...2.2.5 +[2.2.4]: https://github.com/composer/composer/compare/2.2.3...2.2.4 +[2.2.3]: https://github.com/composer/composer/compare/2.2.2...2.2.3 +[2.2.2]: https://github.com/composer/composer/compare/2.2.1...2.2.2 +[2.2.1]: https://github.com/composer/composer/compare/2.2.0...2.2.1 +[2.2.0]: https://github.com/composer/composer/compare/2.2.0-RC1...2.2.0 +[2.2.0-RC1]: https://github.com/composer/composer/compare/2.1.14...2.2.0-RC1 +[2.1.14]: https://github.com/composer/composer/compare/2.1.13...2.1.14 +[2.1.13]: https://github.com/composer/composer/compare/2.1.12...2.1.13 [2.1.12]: https://github.com/composer/composer/compare/2.1.11...2.1.12 [2.1.11]: https://github.com/composer/composer/compare/2.1.10...2.1.11 [2.1.10]: https://github.com/composer/composer/compare/2.1.9...2.1.10 diff --git a/core/vendor/composer/composer/bin/composer b/core/vendor/composer/composer/bin/composer index cee476b6d7..55391b9b62 100755 --- a/core/vendor/composer/composer/bin/composer +++ b/core/vendor/composer/composer/bin/composer @@ -65,6 +65,16 @@ if (function_exists('ini_set')) { unset($memoryLimit); } +// Workaround PHP bug on Windows where env vars containing Unicode chars are mangled in $_SERVER +// see https://github.com/php/php-src/issues/7896 +if (PHP_VERSION_ID >= 70113 && (PHP_VERSION_ID < 80016 || (PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80103)) && Platform::isWindows()) { + foreach ($_SERVER as $serverVar => $serverVal) { + if (($serverVal = getenv($serverVar)) !== false) { + $_SERVER[$serverVar] = $serverVal; + } + } +} + Platform::putEnv('COMPOSER_BINARY', realpath($_SERVER['argv'][0])); ErrorHandler::register(); diff --git a/core/vendor/composer/composer/composer.json b/core/vendor/composer/composer/composer.json index a13c6b5d4f..308b011009 100644 --- a/core/vendor/composer/composer/composer.json +++ b/core/vendor/composer/composer/composer.json @@ -32,11 +32,12 @@ "psr/log": "^1.0 || ^2.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "react/promise": "^1.2 || ^2.7" + "react/promise": "^1.2 || ^2.7", + "composer/pcre": "^1.0" }, "require-dev": { "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0", @@ -55,7 +56,7 @@ }, "extra": { "branch-alias": { - "dev-main": "2.1-dev" + "dev-main": "2.2-dev" } }, "autoload": { @@ -78,11 +79,11 @@ ], "scripts": { "compile": "@php -dphar.readonly=0 bin/compile", - "test": "simple-phpunit", + "test": "@php simple-phpunit", "phpstan-setup": [ "@composer config platform --unset", - "@php composer.phar update", - "@composer require --dev phpstan/phpstan:^0.12.93 phpstan/phpstan-phpunit:^0.12.17 phpunit/phpunit:^7.5.20 --with-all-dependencies", + "@composer update", + "@composer require --dev phpstan/phpstan:1.4.* phpstan/phpstan-phpunit:1.0.* phpstan/phpstan-deprecation-rules:1.0.* phpstan/phpstan-strict-rules:1.1.* phpunit/phpunit:^7.5.20 --with-all-dependencies", "git checkout composer.json composer.lock" ], "phpstan": "@php vendor/bin/phpstan analyse --configuration=phpstan/config.neon" diff --git a/core/vendor/composer/composer/composer.lock b/core/vendor/composer/composer/composer.lock index e628c1a231..6b44b0234a 100644 --- a/core/vendor/composer/composer/composer.lock +++ b/core/vendor/composer/composer/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": "d3dfd8964a34240eba83383a25e2f1fb", + "content-hash": "659a81a68363780c2e9fb35a1116808c", "packages": [ { "name": "composer/ca-bundle", @@ -151,25 +151,96 @@ ], "time": "2021-04-07T13:37:33+00:00" }, + { + "name": "composer/pcre", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.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/1.0.1" + }, + "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-01-21T20:24:37+00:00" + }, { "name": "composer/semver", - "version": "3.2.6", + "version": "3.2.9", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "83e511e247de329283478496f7a1e114c9517506" + "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", - "reference": "83e511e247de329283478496f7a1e114c9517506", + "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", @@ -214,7 +285,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.6" + "source": "https://github.com/composer/semver/tree/3.2.9" }, "funding": [ { @@ -230,27 +301,28 @@ "type": "tidelift" } ], - "time": "2021-10-25T11:34:17+00:00" + "time": "2022-02-04T13:58:43+00:00" }, { "name": "composer/spdx-licenses", - "version": "1.5.5", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "de30328a7af8680efdc03e396aad24befd513200" + "reference": "a30d487169d799745ca7280bc90fdfa693536901" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", - "reference": "de30328a7af8680efdc03e396aad24befd513200", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/a30d487169d799745ca7280bc90fdfa693536901", + "reference": "a30d487169d799745ca7280bc90fdfa693536901", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { @@ -293,7 +365,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.5" + "source": "https://github.com/composer/spdx-licenses/tree/1.5.6" }, "funding": [ { @@ -309,29 +381,31 @@ "type": "tidelift" } ], - "time": "2020-12-03T16:04:16+00:00" + "time": "2021-11-18T10:14:14+00:00" }, { "name": "composer/xdebug-handler", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", "shasum": "" }, "require": { + "composer/pcre": "^1", "php": "^5.3.2 || ^7.0 || ^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": "^4.2 || ^5.0 || ^6.0" }, "type": "library", "autoload": { @@ -357,7 +431,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.4" }, "funding": [ { @@ -373,7 +447,7 @@ "type": "tidelift" } ], - "time": "2021-07-31T17:03:58+00:00" + "time": "2022-01-04T17:06:45+00:00" }, { "name": "justinrainbow/json-schema", @@ -519,12 +593,12 @@ } }, "autoload": { - "psr-0": { - "React\\Promise": "src/" - }, "files": [ "src/React/Promise/functions_include.php" - ] + ], + "psr-0": { + "React\\Promise": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -608,16 +682,16 @@ }, { "name": "seld/phar-utils", - "version": "1.1.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0" + "reference": "9f3452c93ff423469c0d56450431562ca423dcee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/749042a2315705d2dfbbc59234dd9ceb22bf3ff0", - "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/9f3452c93ff423469c0d56450431562ca423dcee", + "reference": "9f3452c93ff423469c0d56450431562ca423dcee", "shasum": "" }, "require": { @@ -650,9 +724,9 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.1.2" + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.0" }, - "time": "2021-08-19T21:01:38+00:00" + "time": "2021-12-10T11:20:11+00:00" }, { "name": "symfony/console", @@ -1607,5 +1681,5 @@ "platform-overrides": { "php": "5.3.9" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/core/vendor/composer/composer/doc/00-intro.md b/core/vendor/composer/composer/doc/00-intro.md index acd5ee3e60..ec088011f2 100644 --- a/core/vendor/composer/composer/doc/00-intro.md +++ b/core/vendor/composer/composer/doc/00-intro.md @@ -53,7 +53,7 @@ or review it on [GitHub](https://github.com/composer/getcomposer.org/blob/main/w if you wish to know more about the inner workings of the installer. The source is plain PHP. -There are in short, two ways to install Composer. Locally as part of your +There are, in short, two ways to install Composer. Locally as part of your project, or globally as a system wide executable. #### Locally @@ -99,7 +99,7 @@ you can use `~/.local/bin` instead which is available by default on some Linux distributions. > **Note:** If the above fails due to permissions, you may need to run it again -> with sudo. +> with `sudo`. > **Note:** On some versions of macOS the `/usr` directory does not exist by > default. If you receive the error "/usr/local/bin/composer: No such file or diff --git a/core/vendor/composer/composer/doc/01-basic-usage.md b/core/vendor/composer/composer/doc/01-basic-usage.md index 4ccc509654..671e46dd66 100644 --- a/core/vendor/composer/composer/doc/01-basic-usage.md +++ b/core/vendor/composer/composer/doc/01-basic-usage.md @@ -41,8 +41,8 @@ Composer uses this information to search for the right set of files in package key, or in [Packagist.org](https://packagist.org), the default package repository. In the above example, since no other repository has been registered in the `composer.json` file, it is assumed that the `monolog/monolog` package is registered -on Packagist.org. (See more about Packagist [below](#packagist), or read more -about repositories [here](05-repositories.md)). +on Packagist.org. (Read more [about Packagist](#packagist), and +[about repositories](05-repositories.md)). ### Package names @@ -51,7 +51,7 @@ will be identical - the vendor name only exists to prevent naming clashes. For example, it would allow two different people to create a library named `json`. One might be named `igorw/json` while the other might be `seldaek/json`. -Read more about publishing packages and package naming [here](02-libraries.md). +Read more about [publishing packages and package naming](02-libraries.md). (Note that you can also specify "platform packages" as dependencies, allowing you to require certain versions of server software. See [platform packages](#platform-packages) below.) @@ -243,7 +243,7 @@ Composer will register a [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloader for the `Acme` namespace. You define a mapping from namespaces to directories. The `src` directory would -be in your project root, on the same level as `vendor` directory is. An example +be in your project root, on the same level as the `vendor` directory. An example filename would be `src/Foo.php` containing an `Acme\Foo` class. After adding the [`autoload`](04-schema.md#autoload) field, you have to re-run diff --git a/core/vendor/composer/composer/doc/03-cli.md b/core/vendor/composer/composer/doc/03-cli.md index 6722fa8b32..1d262dfd77 100644 --- a/core/vendor/composer/composer/doc/03-cli.md +++ b/core/vendor/composer/composer/doc/03-cli.md @@ -22,6 +22,7 @@ The following options are available with every command: * **--quiet (-q):** Do not output any message. * **--no-interaction (-n):** Do not ask any interactive question. * **--no-plugins:** Disables plugins. +* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-cache:** Disables the use of the cache directory. Same as setting the COMPOSER_CACHE_DIR env var to /dev/null (or NUL on Windows). * **--working-dir (-d):** If specified, use the given directory as working directory. @@ -100,7 +101,6 @@ resolution. * **--no-dev:** Skip installing packages listed in `require-dev`. The autoloader generation skips the `autoload-dev` rules. * **--no-autoloader:** Skips autoloader generation. -* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-progress:** Removes the progress display that can mess with some terminals or scripts which don't handle backspace characters. * **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to get a faster @@ -117,7 +117,10 @@ resolution. See also the [`platform`](06-config.md#platform) config option. * **--ignore-platform-req:** ignore a specific platform requirement(`php`, `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine - does not fulfill it. + does not fulfill it. Multiple requirements can be ignored via wildcard. Appending + a `+` makes it only ignore the upper-bound of the requirements. For example, if a package + requires `php: ^7`, then the option `--ignore-platform-req=php+` would allow installing on PHP 8, + but installation on PHP 5.6 would still fail. ## update / u @@ -183,7 +186,6 @@ php composer.phar update vendor/package:2.0.1 vendor/package2:3.0.* lock file being out of date. * **--with:** Temporary version constraint to add, e.g. foo/bar:1.0.0 or foo/bar=1.0.0 * **--no-autoloader:** Skips autoloader generation. -* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-progress:** Removes the progress display that can mess with some terminals or scripts which don't handle backspace characters. * **--with-dependencies (-w):** Update also dependencies of packages in the argument list, except those which are root requirements. @@ -202,7 +204,10 @@ php composer.phar update vendor/package:2.0.1 vendor/package2:3.0.* See also the [`platform`](06-config.md#platform) config option. * **--ignore-platform-req:** ignore a specific platform requirement(`php`, `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine - does not fulfill it. + does not fulfill it. Multiple requirements can be ignored via wildcard. Appending + a `+` makes it only ignore the upper-bound of the requirements. For example, if a package + requires `php: ^7`, then the option `--ignore-platform-req=php+` would allow installing on PHP 8, + but installation on PHP 5.6 would still fail. * **--prefer-stable:** Prefer stable versions of dependencies. * **--prefer-lowest:** Prefer lowest versions of dependencies. Useful for testing minimal versions of requirements, generally used with `--prefer-stable`. @@ -248,7 +253,6 @@ If you do not specify a package, Composer will prompt you to search for a packag terminals or scripts which don't handle backspace characters. * **--no-update:** Disables the automatic update of the dependencies (implies --no-install). * **--no-install:** Does not run the install step after updating the composer.lock file. -* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--update-no-dev:** Run the dependency update with the `--no-dev` option. * **--update-with-dependencies (-w):** Also update dependencies of the newly required packages, except those that are root requirements. * **--update-with-all-dependencies (-W):** Also update dependencies of the newly required packages, including those that are root requirements. @@ -258,7 +262,7 @@ If you do not specify a package, Composer will prompt you to search for a packag See also the [`platform`](06-config.md#platform) config option. * **--ignore-platform-req:** ignore a specific platform requirement(`php`, `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine - does not fulfill it. + does not fulfill it. Multiple requirements can be ignored via wildcard. * **--prefer-stable:** Prefer stable versions of dependencies. * **--prefer-lowest:** Prefer lowest versions of dependencies. Useful for testing minimal versions of requirements, generally used with `--prefer-stable`. @@ -291,7 +295,6 @@ uninstalled. terminals or scripts which don't handle backspace characters. * **--no-update:** Disables the automatic update of the dependencies (implies --no-install). * **--no-install:** Does not run the install step after updating the composer.lock file. -* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--update-no-dev:** Run the dependency update with the --no-dev option. * **--update-with-dependencies (-w):** Also update dependencies of the removed packages. (Deprecated, is now default behavior) @@ -303,7 +306,7 @@ uninstalled. See also the [`platform`](06-config.md#platform) config option. * **--ignore-platform-req:** ignore a specific platform requirement(`php`, `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine - does not fulfill it. + does not fulfill it. Multiple requirements can be ignored via wildcard. * **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to get a faster autoloader. This is recommended especially for production, but can take a bit of time to run so it is currently not done by default. @@ -342,7 +345,6 @@ php composer.phar reinstall "acme/*" versions of packages, use `--prefer-install=auto`. See also [config.preferred-install](06-config.md#preferred-install). Passing this flag will override the config value. * **--no-autoloader:** Skips autoloader generation. -* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-progress:** Removes the progress display that can mess with some terminals or scripts which don't handle backspace characters. * **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to get a faster @@ -358,7 +360,7 @@ php composer.phar reinstall "acme/*" reinstall command. * **--ignore-platform-req:** ignore a specific platform requirement. This only has an effect in the context of the autoloader generation for the - reinstall command. + reinstall command. Multiple requirements can be ignored via wildcard. ## check-platform-reqs @@ -414,7 +416,9 @@ You can also search for more than one term by passing multiple arguments. ### Options -* **--only-name (-N):** Search only in name. +* **--only-name (-N):** Search only in package names. +* **--only-vendor (-O):** Search only for vendor / organization names, returns only "vendor" + as a result. * **--type (-t):** Search for a specific package type. * **--format (-f):** Lets you pick between text (default) or json output format. Note that in the json, only the name and description keys are guaranteed to be @@ -485,6 +489,13 @@ php composer.phar show monolog/monolog 1.0.2 * **--direct (-D):** Restricts the list of packages to your direct dependencies. * **--strict:** Return a non-zero exit code when there are outdated packages. * **--format (-f):** Lets you pick between text (default) or json output format. +* **--ignore-platform-reqs:** ignore all platform requirements (`php`, `hhvm`, + `lib-*` and `ext-*`) and force the installation even if the local machine does + not fulfill these. Use with the --outdated option. +* **--ignore-platform-req:** ignore a specific platform requirement(`php`, + `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine + does not fulfill it. Multiple requirements can be ignored via wildcard. Use with + the --outdated option. ## outdated @@ -508,6 +519,12 @@ The color coding is as such: * **--format (-f):** Lets you pick between text (default) or json output format. * **--no-dev:** Do not show outdated dev dependencies. * **--locked:** Shows updates for packages from the lock file, regardless of what is currently in vendor dir. +* **--ignore-platform-reqs:** ignore all platform requirements (`php`, `hhvm`, + `lib-*` and `ext-*`) and force the installation even if the local machine does + not fulfill these. +* **--ignore-platform-req:** ignore a specific platform requirement(`php`, + `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine + does not fulfill it. Multiple requirements can be ignored via wildcard. ## browse / home @@ -521,7 +538,7 @@ in your browser. ## suggests -Lists all packages suggested by currently installed set of packages. You can +Lists all packages suggested by the currently installed set of packages. You can optionally pass one or multiple package names in the format of `vendor/package` to limit output to suggestions made by those packages only. @@ -709,7 +726,7 @@ php composer.phar config --list `setting-key` is a configuration option name and `setting-value1` is a configuration value. For settings that can take an array of values (like -`github-protocols`), more than one setting-value arguments are allowed. +`github-protocols`), multiple setting-value arguments are allowed. You can also edit the values of the following properties: @@ -736,6 +753,8 @@ See the [Config](06-config.md) chapter for valid configuration options. instead of relative. * **--json:** JSON decode the setting value, to be used with `extra.*` keys. * **--merge:** Merge the setting value with the current value, to be used with `extra.*` keys in combination with `--json`. +* **--append:** When adding a repository, append it (lowest priority) to the existing ones instead of prepending it (highest priority). +* **--source:** Display where the config value is loaded from. ### Modifying Repositories @@ -786,7 +805,7 @@ There are several applications for this: To create a new project using Composer you can use the `create-project` command. Pass it a package name, and the directory to create the project in. You can also -provide a version as third argument, otherwise the latest version is used. +provide a version as a third argument, otherwise the latest version is used. If the directory does not currently exist, it will be created during installation. @@ -816,7 +835,7 @@ By default the command checks for the packages on packagist.org. JSON string which similar to what the [repositories](04-schema.md#repositories) key accepts. You can use this multiple times to configure multiple repositories. * **--add-repository:** Add the custom repository in the composer.json. If a lock - file is present it will be deleted and an update will be run instead of install. + file is present, it will be deleted and an update will be run instead of an install. * **--dev:** Install packages listed in `require-dev`. * **--no-dev:** Disables installation of require-dev packages. * **--no-scripts:** Disables the execution of the scripts defined in the root @@ -837,8 +856,8 @@ By default the command checks for the packages on packagist.org. See also the [`platform`](06-config.md#platform) config option. * **--ignore-platform-req:** ignore a specific platform requirement(`php`, `hhvm`, `lib-*` and `ext-*`) and force the installation even if the local machine - does not fulfill it. -* **--ask:** Ask user to provide target directory for new project. + does not fulfill it. Multiple requirements can be ignored via wildcard. +* **--ask:** Ask the user to provide a target directory for the new project. ## dump-autoload (dumpautoload) @@ -854,7 +873,6 @@ using this option you can still use PSR-0/4 for convenience and classmaps for performance. ### Options -* **--no-scripts:** Skips the execution of all scripts defined in `composer.json` file. * **--optimize (-o):** Convert PSR-0/4 autoloading to classmap to get a faster autoloader. This is recommended especially for production, but can take a bit of time to run, so it is currently not done by default. @@ -872,6 +890,7 @@ performance. See also the [`platform`](06-config.md#platform) config option. * **--ignore-platform-req:** ignore a specific platform requirement (`php`, `hhvm`, `lib-*` and `ext-*`) and skip the [platform check](07-runtime.md#platform-check) for it. + Multiple requirements can be ignored via wildcard. ## clear-cache / clearcache / cc @@ -931,8 +950,8 @@ php composer.phar archive vendor/package 2.0.21 --format=zip ### Options -* **--format (-f):** Format of the resulting archive: tar or zip (default: - "tar") +* **--format (-f):** Format of the resulting archive: tar, tar.gz, tar.bz2 + or zip (default: "tar"). * **--dir:** Write the archive to this directory (default: ".") * **--file:** Write the archive with the given file name. @@ -973,7 +992,7 @@ The generated lock file will use the same name: `composer-other.lock` in this ex If set to 1, this env disables the warning about running commands as root/super user. It also disables automatic clearing of sudo sessions, so you should really only set this -if you use Composer as super user at all times like in docker containers. +if you use Composer as a super user at all times like in docker containers. ### COMPOSER_ALLOW_XDEBUG @@ -997,8 +1016,11 @@ directory to something other than `vendor/bin`. The `COMPOSER_CACHE_DIR` var allows you to change the Composer cache directory, which is also configurable via the [`cache-dir`](06-config.md#cache-dir) option. -By default, it points to `$COMPOSER_HOME/cache` on \*nix and macOS, and -`C:\Users\<user>\AppData\Local\Composer` (or `%LOCALAPPDATA%/Composer`) on Windows. +By default, it points to `C:\Users\<user>\AppData\Local\Composer` (or `%LOCALAPPDATA%/Composer`) on Windows. +On \*nix systems that follow the [XDG Base +Directory Specifications](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), +it points to `$XDG_CACHE_HOME/composer`. On other \*nix systems and on macOS, it points to +`$COMPOSER_HOME/cache`. ### COMPOSER_CAFILE @@ -1121,7 +1143,7 @@ from setting the request_fulluri option. ### COMPOSER_SELF_UPDATE_TARGET -If set, makes the self-update command write the new Composer phar file into that path instead of overwriting itself. Useful for updating Composer on read-only filesystem. +If set, makes the self-update command write the new Composer phar file into that path instead of overwriting itself. Useful for updating Composer on a read-only filesystem. ### no_proxy or NO_PROXY @@ -1147,3 +1169,8 @@ If set to `1`, outputs information about events being dispatched, which can be useful for plugin authors to identify what is firing when exactly. ← [Libraries](02-libraries.md) | [Schema](04-schema.md) → + +### COMPOSER_NO_DEV + +If set to `1`, it is the equivalent of passing the `--no-dev` argument to `install` or +`update`. You can override this for a single command by setting `COMPOSER_NO_DEV=0`. diff --git a/core/vendor/composer/composer/doc/04-schema.md b/core/vendor/composer/composer/doc/04-schema.md index dbc02ff249..78a1627f45 100644 --- a/core/vendor/composer/composer/doc/04-schema.md +++ b/core/vendor/composer/composer/doc/04-schema.md @@ -34,7 +34,7 @@ separated by `/`. Examples: * monolog/monolog * igorw/event-source -The name must be lowercased and consist of words separated by `-`, `.` or `_`. +The name must be lowercase and consist of words separated by `-`, `.` or `_`. The complete name should match `^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$`. The `name` property is required for published packages (libraries). @@ -171,7 +171,7 @@ An Example: ``` For a package, when there is a choice between licenses ("disjunctive license"), -multiple can be specified as array. +multiple can be specified as an array. An Example for disjunctive licenses: @@ -675,7 +675,7 @@ for more details on how to reduce this impact. ### autoload-dev <span>([root-only](04-schema.md#root-package))</span> -This section allows to define autoload rules for development purposes. +This section allows defining autoload rules for development purposes. Classes needed to run the test suite should not be included in the main autoload rules to avoid polluting the autoloader in production and when other people use @@ -884,8 +884,8 @@ Optional. ### bin -A set of files that should be treated as binaries and symlinked into the `bin-dir` -(from config). +A set of files that should be treated as binaries and made available +into the `bin-dir` (from config). See [Vendor Binaries](articles/vendor-binaries.md) for more details. @@ -941,7 +941,7 @@ It can be boolean or a package name/URL pointing to a recommended alternative. Examples: -Use `"abandoned": true` to indicates this package is abandoned. +Use `"abandoned": true` to indicate this package is abandoned. Use `"abandoned": "monolog/monolog"` to indicates this package is abandoned, and the recommended alternative is `monolog/monolog`. @@ -962,7 +962,7 @@ version of the parent branch or at least master or something. To handle non-numeric named branches as versions instead of searching for a parent branch with a valid version or special branch name like master, you can set patterns for branch -names, that should be handled as dev version branches. +names that should be handled as dev version branches. This is really helpful when you have dependencies using "self.version", so that not dev-master, but the same branch is installed (in the example: latest-testing). diff --git a/core/vendor/composer/composer/doc/05-repositories.md b/core/vendor/composer/composer/doc/05-repositories.md index 2379165bbc..7ab8b9da76 100644 --- a/core/vendor/composer/composer/doc/05-repositories.md +++ b/core/vendor/composer/composer/doc/05-repositories.md @@ -197,7 +197,7 @@ Avoid redirects to alternative 404 pages. If your repository only has a small number of packages, and you want to avoid the 404-requests, you can also specify an `"available-packages"` key in `packages.json` which should be an array with all the package names that your -repository contain. Alternatively you can specify an +repository contains. Alternatively you can specify an `"available-package-patterns"` key which is an array of package name patterns (with `*` matching any string, e.g. `vendor/*` would make Composer look up every matching package name in this repository). @@ -299,12 +299,33 @@ described [above](#packages). These fields are optional. You probably don't need them for your own custom repository. -#### stream options +#### cURL or stream options -The `packages.json` file is loaded using a PHP stream. You can set extra -options on that stream using the `options` parameter. You can set any valid -PHP stream context option. See [Context options and -parameters](https://php.net/manual/en/context.php) for more information. +The repository is accessed either using cURL (Composer 2 with ext-curl enabled) +or PHP streams. You can set extra options using the `options` parameter. For +PHP streams, you can set any valid PHP stream context option. See [Context +options and parameters](https://php.net/manual/en/context.php) for more +information. When cURL is used, only a limited set of `http` and `ssl` options +can be configured. + +```json +{ + "repositories": [ + { + "type": "composer", + "url": "https://example.org", + "options": { + "http": { + "timeout": 60 + } + } + } + ], + "require": { + "acme/package": "^1.0" + } +} +``` ### VCS @@ -321,8 +342,9 @@ project to use the patched version. If the library is on GitHub (this is the case most of the time), you can fork it there and push your changes to your fork. After that you update the project's `composer.json`. All you have to do is add your fork as a repository and update the version constraint to -point to your custom branch. In `composer.json`, you should prefix your custom -branch name with `"dev-"`. For version constraint naming conventions see +point to your custom branch. In `composer.json` only, you should prefix your +custom branch name with `"dev-"` (without making it part of the actual branch +name). For version constraint naming conventions see [Libraries](02-libraries.md) for more information. Example assuming you patched monolog to fix a bug in the `bugfix` branch: @@ -362,7 +384,7 @@ For more information [see the aliases article](articles/aliases.md). #### Using private repositories Exactly the same solution allows you to work with your private repositories at -GitHub and BitBucket: +GitHub and Bitbucket: ```json { @@ -392,16 +414,16 @@ The following are supported: To get packages from these systems you need to have their respective clients installed. That can be inconvenient. And for this reason there is special -support for GitHub and BitBucket that use the APIs provided by these sites, to +support for GitHub and Bitbucket that use the APIs provided by these sites, to fetch the packages without having to install the version control system. The VCS repository provides `dist`s for them that fetch the packages as zips. * **GitHub:** [github.com](https://github.com) (Git) -* **BitBucket:** [bitbucket.org](https://bitbucket.org) (Git and Mercurial) +* **Bitbucket:** [bitbucket.org](https://bitbucket.org) (Git) The VCS driver to be used is detected automatically based on the URL. However, -should you need to specify one for whatever reason, you can use `git-bitbucket`, -`hg-bitbucket`, `github`, `gitlab`, `perforce`, `fossil`, `git`, `svn` or `hg` +should you need to specify one for whatever reason, you can use `bitbucket`, +`github`, `gitlab`, `perforce`, `fossil`, `git`, `svn` or `hg` as the repository type instead of `vcs`. If you set the `no-api` key to `true` on a github repository it will clone the @@ -412,10 +434,11 @@ attempt to use github's zip files. Please note: * **To let Composer choose which driver to use** the repository type needs to be defined as "vcs" * **If you already used a private repository**, this means Composer should have cloned it in cache. If you want to install the same package with drivers, remember to launch the command `composer clearcache` followed by the command `composer update` to update Composer cache and install the package from dist. +* VCS driver `git-bitbucket` is deprecated in favor of `bitbucket` -#### BitBucket Driver Configuration +#### Bitbucket Driver Configuration -> **Note that the repository endpoint for BitBucket needs to be https rather than git.** +> **Note that the repository endpoint for Bitbucket needs to be https rather than git.** After setting up your bitbucket repository, you will also need to [set up authentication](articles/authentication-for-private-packages.md#bitbucket-oauth). @@ -445,7 +468,7 @@ repository like this: If you have no branches or tags directory you can disable them entirely by setting the `branches-path` or `tags-path` to `false`. -If the package is in a sub-directory, e.g. `/trunk/foo/bar/composer.json` and +If the package is in a subdirectory, e.g. `/trunk/foo/bar/composer.json` and `/tags/1.0/foo/bar/composer.json`, then you can make Composer access it by setting the `"package-path"` option to the sub-directory, in this example it would be `"package-path": "foo/bar/"`. diff --git a/core/vendor/composer/composer/doc/06-config.md b/core/vendor/composer/composer/doc/06-config.md index 96bd1840e7..636cf95550 100644 --- a/core/vendor/composer/composer/doc/06-config.md +++ b/core/vendor/composer/composer/doc/06-config.md @@ -24,6 +24,37 @@ helper is available: } ``` +## allow-plugins + +Defaults to `null` (allow all plugins implicitly) for backwards compatibility until July 2022. +At that point the default will become `{}` and plugins will not load anymore unless allowed. + +As of Composer 2.2.0, the `allow-plugins` option adds a layer of security +allowing you to restrict which Composer plugins are able to execute code during +a Composer run. + +When a new plugin is first activated, which is not yet listed in the config option, +Composer will print a warning. If you run Composer interactively it will +prompt you to decide if you want to execute the plugin or not. + +Use this setting to allow only packages you trust to execute code. Set it to +an object with package name patterns as keys. The values are **true** to allow +and **false** to disallow while suppressing further warnings and prompts. + +```json +{ + "config": { + "allow-plugins": { + "third-party/required-plugin": true, + "my-organization/*": true, + "unnecessary/plugin": false + } + } +} +``` + +You can also set the config option itself to `false` to disallow all plugins, or `true` to allow all plugins to run (NOT recommended). + ## use-include-path Defaults to `false`. If `true`, the Composer autoloader will also look for classes @@ -33,7 +64,7 @@ in the PHP include path. Defaults to `dist` and can be any of `source`, `dist` or `auto`. This option allows you to set the install method Composer will prefer to use. Can -optionally be a hash of patterns for more granular install preferences. +optionally be an object with package name patterns for keys for more granular install preferences. ```json { @@ -63,6 +94,19 @@ optionally be a hash of patterns for more granular install preferences. > configuration in global and package configurations the string notation > is translated to a `*` package pattern. +## use-parent-dir + +When running Composer in a directory where there is no composer.json, if there +is one present in a directory above Composer will by default ask you whether +you want to use that directory's composer.json instead. + +If you always want to answer yes to this prompt, you can set this config value +to `true`. To never be prompted, set it to `false`. The default is `"prompt"`. + +> **Note:** This config must be set in your global user-wide config for it +> to work. Use for example `php composer.phar config --global use-parent-dir true` +> to set it. + ## store-auths What to do after prompting for authentication, one of: `true` (always store), @@ -191,6 +235,9 @@ you may ignore it instead by passing `--ignore-platform-req=ext-foo` to `update` extensions as if you ignore one now and a new package you add a month later also requires it, you may introduce issues in production unknowingly. +If you have an extension installed locally but *not* on production, you may want +to artificially hide it from Composer using `{"ext-foo": false}`. + ## vendor-dir Defaults to `vendor`. You can install dependencies into a different directory if @@ -206,8 +253,8 @@ into this directory. Defaults to `C:\Users\<user>\AppData\Roaming\Composer` on Windows, `$XDG_DATA_HOME/composer` on unix systems that follow the XDG Base Directory -Specifications, and `$home` on other unix systems. Right now it is only -used for storing past composer.phar files to be able to rollback to older +Specifications, and `$COMPOSER_HOME` on other unix systems. Right now it is only +used for storing past composer.phar files to be able to roll back to older versions. See also [COMPOSER_HOME](03-cli.md#composer-home). ## cache-dir @@ -215,8 +262,8 @@ versions. See also [COMPOSER_HOME](03-cli.md#composer-home). Defaults to `C:\Users\<user>\AppData\Local\Composer` on Windows, `/Users/<user>/Library/Caches/composer` on macOS, `$XDG_CACHE_HOME/composer` on unix systems that follow the XDG Base Directory Specifications, and -`$home/cache` on other unix systems. Stores all the caches used by Composer. -See also [COMPOSER_HOME](03-cli.md#composer-home). +`$COMPOSER_HOME/cache` on other unix systems. Stores all the caches used by +Composer. See also [COMPOSER_HOME](03-cli.md#composer-home). ## cache-files-dir @@ -257,8 +304,8 @@ If it is `auto` then Composer only installs .bat proxy files when on Windows or set to `full` then both .bat files for Windows and scripts for Unix-based operating systems will be installed for each binary. This is mainly useful if you run Composer inside a linux VM but still want the `.bat` proxies available for use -in the Windows host OS. If set to `symlink` Composer will always symlink even on -Windows/WSL. +in the Windows host OS. If set to `proxy` Composer will only create bash/Unix-style +proxy files and no .bat files even on Windows/WSL. ## prepend-autoloader diff --git a/core/vendor/composer/composer/doc/07-runtime.md b/core/vendor/composer/composer/doc/07-runtime.md index 79f0022fd6..fef0b3923e 100644 --- a/core/vendor/composer/composer/doc/07-runtime.md +++ b/core/vendor/composer/composer/doc/07-runtime.md @@ -152,4 +152,23 @@ not its exact version. `lib-*` requirements are never supported/checked by the platform check feature. +## Autoloader path in binaries + +composer-runtime-api 2.2 introduced a new `$_composer_autoload_path` global +variable set when running binaries installed with Composer. Read more +about this [on the vendor binaries docs](articles/vendor-binaries.md#finding-the-composer-autoloader-from-a-binary). + +This is set by the binary proxy and as such is not made available to projects +by Composer's `vendor/autoload.php`, which would be useless as it would point back +to itself. + +## Binary (bin-dir) path in binaries + +composer-runtime-api 2.2.2 introduced a new `$_composer_bin_dir` global +variable set when running binaries installed with Composer. Read more +about this [on the vendor binaries docs](articles/vendor-binaries.md#finding-the-composer-bin-dir-from-a-binary). + +This is set by the binary proxy and as such is not made available to projects +by Composer's `vendor/autoload.php`. + ← [Config](06-config.md) | [Community](08-community.md) → diff --git a/core/vendor/composer/composer/doc/articles/authentication-for-private-packages.md b/core/vendor/composer/composer/doc/articles/authentication-for-private-packages.md index 4dda9a9b85..1c6081afdc 100644 --- a/core/vendor/composer/composer/doc/articles/authentication-for-private-packages.md +++ b/core/vendor/composer/composer/doc/articles/authentication-for-private-packages.md @@ -224,7 +224,7 @@ php composer.phar config [--global] --editor --auth > [`gitlab-domains`](../06-config.md#gitlab-domains) section should also contain the url. To create a new access token, go to your [access tokens section on GitLab](https://gitlab.com/-/profile/personal_access_tokens) -(or the equivalent URL on your private instance) and create a new token. See also [the GitLab access token documentation](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token) for more informations. +(or the equivalent URL on your private instance) and create a new token. See also [the GitLab access token documentation](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token) for more information. When creating a gitlab token manually, make sure it has either the `read_api` or `api` scope. diff --git a/core/vendor/composer/composer/doc/articles/composer-platform-dependencies.md b/core/vendor/composer/composer/doc/articles/composer-platform-dependencies.md new file mode 100644 index 0000000000..a3f2cadb2b --- /dev/null +++ b/core/vendor/composer/composer/doc/articles/composer-platform-dependencies.md @@ -0,0 +1,77 @@ +<!-- + tagline: Making your package depend on specific Composer versions +--> + +# Composer platform dependencies + +## What are platform dependencies + +Composer makes information about the environment Composer runs in available as virtual packages. This allows other +packages to define dependencies ([require](../04-schema.md#require), [conflict](../04-schema.md#conflict), +[provide](../04-schema.md#provide), [replace](../04-schema.md#replace)) on different aspects of the platform, like PHP, +extensions or system libraries, including version constraints. + +When you require one of the platform packages no code is installed. The version numbers of platform packages are +derived from the environment Composer is executed in and they cannot be updated or removed. They can however be +overwritten for the purposes of dependency resolution with a [platform configuration](../06-config.md#platform). + +**For example:** If you are executing `composer update` with a PHP interpreter in version +`7.4.42`, then Composer automatically adds a package to the pool of available packages +called `php` and assigns version `7.4.42` to it. + +That's how packages can add a dependency on the used PHP version: + +```json +{ + "require" : { + "php" : ">=7.4" + } +} +``` + +Composer will check this requirement against the currently used PHP version when running the composer command. + +### Different types of platform packages + +The following types of platform packages exist and can be depended on: + +1. PHP (`php` and the subtypes: `php-64bit`, `php-ipv6`, `php-zts` `php-debug`) +2. PHP Extensions (`ext-*`, e.g. `ext-mbstring`) +3. PHP Libraries (`lib-*`, e.g. `lib-curl`) +4. Composer (`composer`, `composer-plugin-api`, `composer-runtime-api`) + +To see the complete list of platform packages available in your environment +you can run `php composer.phar show --platform` (or `show -p` for short). + +The differences between the various Composer platform packages are explained further in this document. + +## Plugin package `composer-plugin-api` + +You can modify Composer's behavior with [plugin](plugins.md) packages. Composer provides a set of versioned APIs for +plugins. Because internal Composer changes may **not** change the plugin APIs, the API version may not increase every +time the Composer version increases. E.g. In Composer version `2.3.12`, the `composer-plugin-api` version could still +be `2.2.0`. + +## Runtime package `composer-runtime-api` + +When applications which were installed with Composer are run (either on CLI or through a web request), they require the +`vendor/autoload.php` file, typically as one of the first lines of executed code. Invocations of the Composer +autoloader are considered the application "runtime". + +Starting with version 2.0, Composer makes [additional features](../07-runtime.md) (besides registering the class autoloader) available to the application runtime environment. + +Similar to `composer-plugin-api`, not every Composer release adds new runtime features, +thus the version of `composer-runtimeapi` is also increased independently from Composer's version. + +## Composer package `composer` + +Starting with Composer 2.2.0, a new platform package called `composer` is available, which represents the exact +Composer version that is executed. Packages depending on this platform package can therefore depend on (or conflict +with) individual Composer versions to cover edge cases where neither the `composer-runtime-api` version nor the +`composer-plugin-api` was changed. + +Because this option was introduced with Composer 2.2.0, it is recommended to add a `composer-plugin-api` dependency on +at least `>=2.2.0` to provide a more meaningful error message for users running older Composer versions. + +In general, depending on `composer-plugin-api` or `composer-runtime-api` is always recommended +over depending on concrete Composer versions with the `composer` platform package. diff --git a/core/vendor/composer/composer/doc/articles/custom-installers.md b/core/vendor/composer/composer/doc/articles/custom-installers.md index 02d62b836f..6e2ad86703 100644 --- a/core/vendor/composer/composer/doc/articles/custom-installers.md +++ b/core/vendor/composer/composer/doc/articles/custom-installers.md @@ -78,7 +78,7 @@ requirements: 1. the [type][1] attribute must be `composer-plugin`. 2. the [extra][2] attribute must contain an element `class` defining the class name of the plugin (including namespace). If a package contains - multiple plugins this can be array of class names. + multiple plugins, this can be an array of class names. Example: diff --git a/core/vendor/composer/composer/doc/articles/plugins.md b/core/vendor/composer/composer/doc/articles/plugins.md index e19e325627..e3df2cf951 100644 --- a/core/vendor/composer/composer/doc/articles/plugins.md +++ b/core/vendor/composer/composer/doc/articles/plugins.md @@ -27,19 +27,19 @@ requirements: 1. The [type][1] attribute must be `composer-plugin`. 2. The [extra][2] attribute must contain an element `class` defining the class name of the plugin (including namespace). If a package contains - multiple plugins, this can be array of class names. + multiple plugins, this can be an array of class names. 3. You must require the special package called `composer-plugin-api` to define which Plugin API versions your plugin is compatible with. Requiring this package doesn't actually include any extra dependencies, it only specifies which version of the plugin API to use. > **Note:** When developing a plugin, although not required, it's useful to add -> a require-dev dependency on `composer/composer` to have IDE auto completion on Composer classes. +> a require-dev dependency on `composer/composer` to have IDE autocompletion on Composer classes. The required version of the `composer-plugin-api` follows the same [rules][7] -as a normal package's. +as a normal package's rules. -The current Composer plugin API version is `2.1.0`. +The current Composer plugin API version is `2.2.0`. An example of a valid plugin `composer.json` file (with the autoloading part omitted and an optional require-dev dependency on `composer/composer` for IDE auto completion): diff --git a/core/vendor/composer/composer/doc/articles/repository-priorities.md b/core/vendor/composer/composer/doc/articles/repository-priorities.md index d87eed6ddf..baaefb3140 100644 --- a/core/vendor/composer/composer/doc/articles/repository-priorities.md +++ b/core/vendor/composer/composer/doc/articles/repository-priorities.md @@ -13,17 +13,17 @@ goes on to the next one, until one repository contains it and the process ends. Canonical repositories are better for a few reasons: - Performance wise, it is more efficient to stop looking for a package once it -has been found somewhere. It also avoids loading duplicate packages in case -the same package is present in several of your repositories. + has been found somewhere. It also avoids loading duplicate packages in case + the same package is present in several of your repositories. - Security wise, it is safer to treat them canonically as it means that packages you -expect to come from your most important repositories will never be loaded from -another repository instead. Let's -say you have a private repository which is not canonical, and you require your -private package `foo/bar ^2.0` for example. Now if someone publishes -`foo/bar 2.999` to packagist.org, suddenly Composer will pick that package as it -has a higher version than your latest release (say 2.4.3), and you end up installing -something you may not have meant to. If the private repository is canonical -however, that 2.999 version from packagist.org will not be considered at all. + expect to come from your most important repositories will never be loaded from + another repository instead. Let's + say you have a private repository which is not canonical, and you require your + private package `foo/bar ^2.0` for example. Now if someone publishes + `foo/bar 2.999` to packagist.org, suddenly Composer will pick that package as it + has a higher version than your latest release (say 2.4.3), and you end up installing + something you may not have meant to. However, if the private repository is canonical, + that 2.999 version from packagist.org will not be considered at all. There are however a few cases where you may want to specifically load some packages from a given repository, but not all. Or you may want a given repository to not be @@ -92,4 +92,4 @@ we may not want to load in this project. ``` Both `only` and `exclude` should be arrays of package names, which can also -contain wildcards (`*`) which will match any characters. +contain wildcards (`*`), which will match any character. diff --git a/core/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md b/core/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md index fe6d1a1106..2733a186ae 100644 --- a/core/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md +++ b/core/vendor/composer/composer/doc/articles/resolving-merge-conflicts.md @@ -49,8 +49,8 @@ php composer.phar install [--dry-run] ## Important considerations -Keep in mind that whenever merge conflicts occur on the lock file, the information about the exact version -new packages were locked on for one of the branches gets lost. When package A in branch 1 is constrained +Keep in mind that whenever merge conflicts occur on the lock file, the information, about the exact version +new packages were locked on for one of the branches, is lost. When package A in branch 1 is constrained as `^1.2.0` and locked as `1.2.0`, it might get updated when branch 2 is used as baseline and a new `composer require package/A:^1.2.0` is executed, as that will use the most recent version that the constraint allows when possible. There might be a version 1.3.0 for that package available by now, which diff --git a/core/vendor/composer/composer/doc/articles/scripts.md b/core/vendor/composer/composer/doc/articles/scripts.md index 30fa038512..5d2a377bb1 100644 --- a/core/vendor/composer/composer/doc/articles/scripts.md +++ b/core/vendor/composer/composer/doc/articles/scripts.md @@ -71,7 +71,7 @@ Composer fires the following named events during its execution process: manipulate the `InputInterface` object's options and arguments to tweak a command's behavior. - **pre-pool-create**: occurs before the Pool of packages is created, and lets - you filter the list of packages which is going to enter the Solver. + you filter the list of packages that is going to enter the Solver. > **Note:** Composer makes no assumptions about the state of your dependencies > prior to `install` or `update`. Therefore, you should not specify scripts @@ -166,7 +166,7 @@ class MyClass `COMPOSER_DEV_MODE` will be added to the environment. If the command was run with the `--no-dev` flag, this variable will be set to 0, otherwise it will be set to 1. The variable is also available while `dump-autoload` runs, and it -will be set to same as the last `install` or `update` was run in. +will be set to the same as the last `install` or `update` was run in. ## Event classes diff --git a/core/vendor/composer/composer/doc/articles/troubleshooting.md b/core/vendor/composer/composer/doc/articles/troubleshooting.md index 0182f92317..3ccd03536c 100644 --- a/core/vendor/composer/composer/doc/articles/troubleshooting.md +++ b/core/vendor/composer/composer/doc/articles/troubleshooting.md @@ -5,6 +5,7 @@ This is a list of common pitfalls on using Composer, and how to avoid them. + ## General 1. When facing any kind of problems using Composer, be sure to **work with the @@ -23,6 +24,7 @@ This is a list of common pitfalls on using Composer, and how to avoid them. possible interferences with existing vendor installations or `composer.lock` entries. + ## Package not found 1. Double-check you **don't have typos** in your `composer.json` or repository @@ -47,6 +49,12 @@ This is a list of common pitfalls on using Composer, and how to avoid them. In this case add the `--with-dependencies` argument **or** add all dependencies which need an update to the command. + +## Package is not updating to the expected version + +Try running `php composer.phar why-not [package-name] [expected-version]`. + + ## Dependencies on the root package When your root package depends on a package which ends up depending (directly or @@ -69,6 +77,7 @@ indirectly) back on the root package itself, issues can occur in two cases: the variable only for the call to composer, or you can define it globally in the CI env vars. + ## Package not found in a Jenkins-build 1. Check the ["Package not found"](#package-not-found) item above. @@ -81,6 +90,7 @@ indirectly) back on the root package itself, issues can occur in two cases: branch as you are checking out. Using this, the checkout will not be in detached state any more and the dependency on the root package should become satisfied. + ## I have a dependency which contains a "repositories" definition in its composer.json, but it seems to be ignored. The [`repositories`](../04-schema.md#repositories) configuration property is defined as [root-only](../04-schema.md#root-package). It is not inherited. You can read more about the reasons behind this in the "[why can't @@ -88,6 +98,7 @@ Composer load repositories recursively?](../faqs/why-can't-composer-load-reposit The simplest work-around to this limitation, is moving or duplicating the `repositories` definition into your root composer.json. + ## I have locked a dependency to a specific commit but get unexpected results. While Composer supports locking dependencies to a specific commit using the `#commit-ref` syntax, there are certain @@ -103,6 +114,7 @@ frequently overlooked: There is no simple work-around to this limitation. It is therefore strongly recommended that you do not use it. + ## Need to override a package version Let's say your project depends on package A, which in turn depends on a specific @@ -123,8 +135,18 @@ composer.json: See [aliases](aliases.md) for more information. + +## Figuring out where a config value came from + +Use `php composer.phar config --list --source` to see where each config value originated from. + + ## Memory limit errors +The first thing to do is to make sure you are running Composer 2, and if possible 2.2.0 or above. + +Composer 1 used much more memory and upgrading to the latest version will give you much better and faster results. + Composer may sometimes fail on some commands with this message: `PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>` @@ -161,6 +183,7 @@ php -d memory_limit=-1 composer.phar <...> This issue can also happen on cPanel instances, when the shell fork bomb protection is activated. For more information, see the [documentation](https://documentation.cpanel.net/display/68Docs/Shell+Fork+Bomb+Protection) of the fork bomb feature on the cPanel site. + ## Xdebug impact on Composer To improve performance when the Xdebug extension is enabled, Composer automatically restarts PHP without it. @@ -170,13 +193,15 @@ Composer will always show a warning if Xdebug is being used, but you can overrid `COMPOSER_DISABLE_XDEBUG_WARN=1`. If you see this warning unexpectedly, then the restart process has failed: please report this [issue](https://github.com/composer/composer/issues). + ## "The system cannot find the path specified" (Windows) 1. Open regedit. 2. Search for an `AutoRun` key inside `HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor`, `HKEY_CURRENT_USER\Software\Microsoft\Command Processor` or `HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Command Processor`. -3. Check if it contains any path to non-existent file, if it's the case, remove them. +3. Check if it contains any path to a non-existent file, if it's the case, remove them. + ## API rate limit and OAuth tokens @@ -188,7 +213,9 @@ manually create a token using the [procedure documented here](authentication-for Now Composer should install/update without asking for authentication. + ## proc_open(): fork failed errors + If Composer shows proc_open() fork failed on some commands: `PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar` @@ -214,6 +241,7 @@ To enable the swap you can use for example: ``` You can make a permanent swap file following this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04). + ## proc_open(): failed to open stream errors (Windows) If Composer shows proc_open(NUL) errors on Windows: @@ -227,6 +255,7 @@ service. The issue was fixed in PHP 7.2.23 and 7.3.10. Alternatively it could be because the Windows Null Service is not enabled. For more information, see this [issue](https://github.com/composer/composer/issues/7186#issuecomment-373134916). + ## Degraded Mode Due to some intermittent issues on Travis and other systems, we introduced a @@ -244,11 +273,11 @@ If you have been pointed to this page, you want to check a few things: - If you are using IPv6, try disabling it. If that solves your issues, get in touch with your ISP or server host, the problem is not at the Packagist level but in the routing rules between you and Packagist (i.e. the internet at large). The best way to get - these fixed is raise awareness to the network engineers that have the power to fix it. + these fixed is to raise awareness to the network engineers that have the power to fix it. Take a look at the next section for IPv6 workarounds. - - If none of the above helped, please report the error. + ## Operation timed out (IPv6 issues) You may run into errors if IPv6 is not configured correctly. A common error is: @@ -264,7 +293,7 @@ following workarounds: **Workaround Linux:** On linux, it seems that running this command helps to make ipv4 traffic have a -higher prio than ipv6, which is a better alternative than disabling ipv6 entirely: +higher priority than ipv6, which is a better alternative than disabling ipv6 entirely: ```bash sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf" @@ -297,9 +326,10 @@ networksetup -setv6automatic Wi-Fi ``` That said, if this fixes your problem, please talk to your ISP about it to -try and resolve the routing errors. That's the best way to get things resolved +try to resolve the routing errors. That's the best way to get things resolved for everyone. + ## Composer hangs with SSH ControlMaster When you try to install packages from a Git repository and you use the `ControlMaster` @@ -317,9 +347,33 @@ php composer.phar update See also https://github.com/composer/composer/issues/4180 for more information. + ## Zip archives are not unpacked correctly. -Composer can unpack zipballs using either a system-provided `unzip` utility or PHP's -native `ZipArchive` class. The `ZipArchive` class is preferred on Windows. On other -OSes where ZIP files can contain permissions and symlinks, the `unzip` utility is -preferred. You're advised to install it if you need these features. +Composer can unpack zipballs using either a system-provided `unzip` or `7z` (7-Zip) utility, or PHP's +native `ZipArchive` class. On OSes where ZIP files can contain permissions and symlinks, we recommend +installing `unzip` or `7z` as these features are not supported by `ZipArchive`. + + +## Disabling the pool optimizer + +In Composer, the `Pool` class contains all the packages that are relevant for the dependency +resolving process. That is what is used to generate all the rules which are then +passed on to the dependency solver. +In order to improve performance, Composer tries to optimize this `Pool` by removing useless +package information early on. + +If all goes well, you should never notice any issues with it but in case you run into +an unexpected result such as an unresolvable set of dependencies or conflicts where you +think Composer is wrong, you might want to disable the optimizer by using the environment +variable `COMPOSER_POOL_OPTIMIZER` and run the update again like so: + +```bash +COMPOSER_POOL_OPTIMIZER=0 php composer.phar update +``` + +Now double check if the result is still the same. It will take significantly longer and use +a lot more memory to run the dependency resolving process. + +If the result is different, you likely hit a problem in the pool optimizer. +Please [report this issue](https://github.com/composer/composer/issues) so it can be fixed. diff --git a/core/vendor/composer/composer/doc/articles/vendor-binaries.md b/core/vendor/composer/composer/doc/articles/vendor-binaries.md index 0022b90b9c..6ce952a4ea 100644 --- a/core/vendor/composer/composer/doc/articles/vendor-binaries.md +++ b/core/vendor/composer/composer/doc/articles/vendor-binaries.md @@ -40,7 +40,8 @@ For the binaries that a package defines directly, nothing happens. ## What happens when Composer is run on a composer.json that has dependencies with vendor binaries listed? Composer looks for the binaries defined in all of the dependencies. A -symlink is created from each dependency's binaries to `vendor/bin`. +proxy file (or two on Windows/WSL) is created from each dependency's +binaries to `vendor/bin`. Say package `my-vendor/project-a` has binaries setup like this: @@ -69,8 +70,62 @@ Running `composer install` for this `composer.json` will look at all of project-a's binaries and install them to `vendor/bin`. In this case, Composer will make `vendor/my-vendor/project-a/bin/project-a-bin` -available as `vendor/bin/project-a-bin`. On a Unix-like platform -this is accomplished by creating a symlink. +available as `vendor/bin/project-a-bin`. + +## Finding the Composer autoloader from a binary + +As of Composer 2.2, a new `$_composer_autoload_path` global variable +is defined by the bin proxy file, so that when your binary gets executed +it can use it to easily locate the project's autoloader. + +This global will not be available however when running binaries defined +by the root package itself, so you need to have a fallback in place. + +This can look like this for example: + +```php +<?php + +include $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php'; +``` + +If you want to rely on this in your package you should however make sure to +also require `"composer-runtime-api": "^2.2"` to ensure that the package +gets installed with a Composer version supporting the feature. + +## Finding the Composer bin-dir from a binary + +As of Composer 2.2.2, a new `$_composer_bin_dir` global variable +is defined by the bin proxy file, so that when your binary gets executed +it can use it to easily locate the project's autoloader. + +For non-PHP binaries, as of Composer 2.2.6, the bin proxy sets a +`COMPOSER_RUNTIME_BIN_DIR` environment variable. + +This global variable will not be available however when running binaries defined +by the root package itself, so you need to have a fallback in place. + +This can look like this for example: + +```php +<?php + +$binDir = $_composer_bin_dir ?? __DIR__ . '/../vendor/bin'; +``` + +```php +#!/bin/bash + +if [[ -z "$COMPOSER_RUNTIME_BIN_DIR" ]]; then + BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +else + BIN_DIR="$COMPOSER_RUNTIME_BIN_DIR" +fi +``` + +If you want to rely on this in your package you should however make sure to +also require `"composer-runtime-api": "^2.2.2"` to ensure that the package +gets installed with a Composer version supporting the feature. ## What about Windows and .bat files? @@ -79,8 +134,8 @@ Packages managed entirely by Composer do not *need* to contain any of binaries in a special way when run in a Windows environment: * A `.bat` file is generated automatically to reference the binary - * A Unix-style proxy file with the same name as the binary is generated - automatically (useful for Cygwin or Git Bash) + * A Unix-style proxy file with the same name as the binary is also + generated, which is useful for WSL, Linux VMs, etc. Packages that need to support workflows that may not include Composer are welcome to maintain custom `.bat` files. In this case, the package diff --git a/core/vendor/composer/composer/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md b/core/vendor/composer/composer/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md index 986fd5ec84..8452048735 100644 --- a/core/vendor/composer/composer/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md +++ b/core/vendor/composer/composer/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md @@ -30,7 +30,7 @@ for your package. As a **package consumer** you can set or override the install path for a package that requires composer/installers by configuring the `installer-paths` extra. A useful example would be for a Drupal multisite setup where the package should be -installed into your sites subdirectory. Here we are overriding the install path +installed into your site's subdirectory. Here we are overriding the install path for a module that uses composer/installers, as well as putting all packages of type `drupal-theme` into a themes folder: diff --git a/core/vendor/composer/composer/res/composer-schema.json b/core/vendor/composer/composer/res/composer-schema.json index bb86996e7b..f636fc9f5a 100644 --- a/core/vendor/composer/composer/res/composer-schema.json +++ b/core/vendor/composer/composer/res/composer-schema.json @@ -8,18 +8,38 @@ "description": "Package name, including 'vendor-name/' prefix.", "pattern": "^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$" }, + "description": { + "type": "string", + "description": "Short package description." + }, + "license": { + "type": ["string", "array"], + "description": "License name. Or an array of license names." + }, "type": { "description": "Package type, either 'library' for common packages, 'composer-plugin' for plugins, 'metapackage' for empty packages, or a custom type ([a-z0-9-]+) defined by whatever project this package applies to.", "type": "string", "pattern": "^[a-z0-9-]+$" }, - "target-dir": { - "description": "DEPRECATED: Forces the package to be installed into the given subdirectory path. This is used for autoloading PSR-0 packages that do not contain their full path. Use forward slashes for cross-platform compatibility.", - "type": "string" + "abandoned": { + "type": ["boolean", "string"], + "description": "Indicates whether this package has been abandoned, it can be boolean or a package name/URL pointing to a recommended alternative. Defaults to false." }, - "description": { + "version": { "type": "string", - "description": "Short package description." + "description": "Package version, see https://getcomposer.org/doc/04-schema.md#version for more info on valid schemes.", + "pattern": "^v?\\d+(\\.\\d+){0,3}|^dev-" + }, + "default-branch": { + "type": ["boolean"], + "description": "Internal use only, do not specify this in composer.json. Indicates whether this version is the default branch of the linked VCS repository. Defaults to false." + }, + "non-feature-branches": { + "type": ["array"], + "description": "A set of string or regex patterns for non-numeric branch names that will not be handled as feature branches.", + "items": { + "type": "string" + } }, "keywords": { "type": "array", @@ -28,77 +48,253 @@ "description": "A tag/keyword that this package relates to." } }, - "homepage": { - "type": "string", - "description": "Homepage URL for the project.", - "format": "uri" - }, "readme": { "type": "string", "description": "Relative path to the readme document." }, - "version": { - "type": "string", - "description": "Package version, see https://getcomposer.org/doc/04-schema.md#version for more info on valid schemes.", - "pattern": "^v?\\d+(\\.\\d+){0,3}|^dev-" - }, "time": { "type": "string", "description": "Package release date, in 'YYYY-MM-DD', 'YYYY-MM-DD HH:MM:SS' or 'YYYY-MM-DDTHH:MM:SSZ' format." }, - "license": { - "type": ["string", "array"], - "description": "License name. Or an array of license names." - }, "authors": { "$ref": "#/definitions/authors" }, + "homepage": { + "type": "string", + "description": "Homepage URL for the project.", + "format": "uri" + }, + "support": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email address for support.", + "format": "email" + }, + "issues": { + "type": "string", + "description": "URL to the issue tracker.", + "format": "uri" + }, + "forum": { + "type": "string", + "description": "URL to the forum.", + "format": "uri" + }, + "wiki": { + "type": "string", + "description": "URL to the wiki.", + "format": "uri" + }, + "irc": { + "type": "string", + "description": "IRC channel for support, as irc://server/channel.", + "format": "uri" + }, + "chat": { + "type": "string", + "description": "URL to the support chat.", + "format": "uri" + }, + "source": { + "type": "string", + "description": "URL to browse or download the sources.", + "format": "uri" + }, + "docs": { + "type": "string", + "description": "URL to the documentation.", + "format": "uri" + }, + "rss": { + "type": "string", + "description": "URL to the RSS feed.", + "format": "uri" + } + } + }, + "funding": { + "type": "array", + "description": "A list of options to fund the development and maintenance of the package.", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of funding or platform through which funding is possible." + }, + "url": { + "type": "string", + "description": "URL to a website with details on funding and a way to fund the package.", + "format": "uri" + } + } + } + }, + "_comment": { + "type": ["array", "string"], + "description": "A key to store comments in" + }, "require": { "type": "object", - "description": "This is a hash of package name (keys) and version constraints (values) that are required to run this package.", + "description": "This is an object of package name (keys) and version constraints (values) that are required to run this package.", + "additionalProperties": { + "type": "string" + } + }, + "require-dev": { + "type": "object", + "description": "This is an object of package name (keys) and version constraints (values) that this package requires for developing it (testing tools and such).", "additionalProperties": { "type": "string" } }, "replace": { "type": "object", - "description": "This is a hash of package name (keys) and version constraints (values) that can be replaced by this package.", + "description": "This is an object of package name (keys) and version constraints (values) that can be replaced by this package.", "additionalProperties": { "type": "string" } }, "conflict": { "type": "object", - "description": "This is a hash of package name (keys) and version constraints (values) that conflict with this package.", + "description": "This is an object of package name (keys) and version constraints (values) that conflict with this package.", "additionalProperties": { "type": "string" } }, "provide": { "type": "object", - "description": "This is a hash of package name (keys) and version constraints (values) that this package provides in addition to this package's name.", + "description": "This is an object of package name (keys) and version constraints (values) that this package provides in addition to this package's name.", "additionalProperties": { "type": "string" } }, - "require-dev": { + "suggest": { "type": "object", - "description": "This is a hash of package name (keys) and version constraints (values) that this package requires for developing it (testing tools and such).", + "description": "This is an object of package name (keys) and descriptions (values) that this package suggests work well with it (this will be suggested to the user during installation).", "additionalProperties": { "type": "string" } }, - "suggest": { - "type": "object", - "description": "This is a hash of package name (keys) and descriptions (values) that this package suggests work well with it (this will be suggested to the user during installation).", + "repositories": { + "type": ["object", "array"], + "description": "A set of additional repositories where packages can be found.", "additionalProperties": { + "anyOf": [ + { "$ref": "#/definitions/repository" }, + { "type": "boolean", "enum": [false] } + ] + }, + "items": { + "anyOf": [ + { "$ref": "#/definitions/repository" }, + { + "type": "object", + "additionalProperties": { "type": "boolean", "enum": [false] }, + "minProperties": 1, + "maxProperties": 1 + } + ] + } + }, + "minimum-stability": { + "type": ["string"], + "description": "The minimum stability the packages must have to be install-able. Possible values are: dev, alpha, beta, RC, stable.", + "enum": ["dev", "alpha", "beta", "rc", "RC", "stable"] + }, + "prefer-stable": { + "type": ["boolean"], + "description": "If set to true, stable packages will be preferred to dev packages when possible, even if the minimum-stability allows unstable packages." + }, + "autoload": { + "$ref": "#/definitions/autoload" + }, + "autoload-dev": { + "type": "object", + "description": "Description of additional autoload rules for development purpose (eg. a test suite).", + "properties": { + "psr-0": { + "type": "object", + "description": "This is an object of namespaces (keys) and the directories they can be found into (values, can be arrays of paths) by the autoloader.", + "additionalProperties": { + "type": ["string", "array"], + "items": { + "type": "string" + } + } + }, + "psr-4": { + "type": "object", + "description": "This is an object of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.", + "additionalProperties": { + "type": ["string", "array"], + "items": { + "type": "string" + } + } + }, + "classmap": { + "type": "array", + "description": "This is an array of paths that contain classes to be included in the class-map generation process." + }, + "files": { + "type": "array", + "description": "This is an array of files that are always required on every request." + } + } + }, + "target-dir": { + "description": "DEPRECATED: Forces the package to be installed into the given subdirectory path. This is used for autoloading PSR-0 packages that do not contain their full path. Use forward slashes for cross-platform compatibility.", + "type": "string" + }, + "include-path": { + "type": ["array"], + "description": "DEPRECATED: A list of directories which should get added to PHP's include path. This is only present to support legacy projects, and all new code should preferably use autoloading.", + "items": { "type": "string" } }, + "bin": { + "type": ["string", "array"], + "description": "A set of files, or a single file, that should be treated as binaries and symlinked into bin-dir (from config).", + "items": { + "type": "string" + } + }, + "archive": { + "type": ["object"], + "description": "Options for creating package archives for distribution.", + "properties": { + "name": { + "type": "string", + "description": "A base name for archive." + }, + "exclude": { + "type": "array", + "description": "A list of patterns for paths to exclude or include if prefixed with an exclamation mark." + } + } + }, "config": { "type": "object", "description": "Composer options.", "properties": { + "platform": { + "type": "object", + "description": "This is an object of package name (keys) and version (values) that will be used to mock the platform packages on this machine.", + "additionalProperties": { + "type": ["string", "boolean"] + } + }, + "allow-plugins": { + "type": ["object", "boolean"], + "description": "This is an object of {\"pattern\": true|false} with packages which are allowed to be loaded as plugins, or true to allow all, false to allow none. Defaults to {} which prompts when an unknown plugin is added.", + "additionalProperties": { + "type": ["boolean"] + } + }, "process-timeout": { "type": "integer", "description": "The timeout in seconds for process executions, defaults to 300 (5mins)." @@ -107,9 +303,16 @@ "type": "boolean", "description": "If true, the Composer autoloader will also look for classes in the PHP include path." }, + "use-parent-dir": { + "type": ["string", "boolean"], + "description": "When running Composer in a directory where there is no composer.json, if there is one present in a directory above Composer will by default ask you whether you want to use that directory's composer.json instead. One of: true (always use parent if needed), false (never ask or use it) or \"prompt\" (ask every time), defaults to prompt." + }, "preferred-install": { "type": ["string", "object"], - "description": "The install method Composer will prefer to use, defaults to auto and can be any of source, dist, auto, or a hash of {\"pattern\": \"preference\"}." + "description": "The install method Composer will prefer to use, defaults to auto and can be any of source, dist, auto, or an object of {\"pattern\": \"preference\"}.", + "additionalProperties": { + "type": ["string"] + } }, "notify-on-install": { "type": "boolean", @@ -124,21 +327,21 @@ }, "github-oauth": { "type": "object", - "description": "A hash of domain name => github API oauth tokens, typically {\"github.com\":\"<token>\"}.", + "description": "An object of domain name => github API oauth tokens, typically {\"github.com\":\"<token>\"}.", "additionalProperties": { "type": "string" } }, "gitlab-oauth": { "type": "object", - "description": "A hash of domain name => gitlab API oauth tokens, typically {\"gitlab.com\":\"<token>\"}.", + "description": "An object of domain name => gitlab API oauth tokens, typically {\"gitlab.com\":\"<token>\"}.", "additionalProperties": { "type": "string" } }, "gitlab-token": { "type": "object", - "description": "A hash of domain name => gitlab private tokens, typically {\"gitlab.com\":\"<token>\"}.", + "description": "An object of domain name => gitlab private tokens, typically {\"gitlab.com\":\"<token>\"}.", "additionalProperties": { "type": "string" } @@ -149,7 +352,7 @@ }, "bearer": { "type": "object", - "description": "A hash of domain name => bearer authentication token, for example {\"example.com\":\"<token>\"}.", + "description": "An object of domain name => bearer authentication token, for example {\"example.com\":\"<token>\"}.", "additionalProperties": { "type": "string" } @@ -179,7 +382,7 @@ }, "http-basic": { "type": "object", - "description": "A hash of domain name => {\"username\": \"...\", \"password\": \"...\"}.", + "description": "An object of domain name => {\"username\": \"...\", \"password\": \"...\"}.", "additionalProperties": { "type": "object", "required": ["username", "password"], @@ -199,13 +402,6 @@ "type": ["string", "boolean"], "description": "What to do after prompting for authentication, one of: true (store), false (do not store) or \"prompt\" (ask every time), defaults to prompt." }, - "platform": { - "type": "object", - "description": "This is a hash of package name (keys) and version (values) that will be used to mock the platform packages on this machine.", - "additionalProperties": { - "type": "string" - } - }, "vendor-dir": { "type": "string", "description": "The location where all packages are installed, defaults to \"vendor\"." @@ -251,8 +447,8 @@ "description": "Whether to use the Composer cache in read-only mode." }, "bin-compat": { - "enum": ["auto", "full", "symlink"], - "description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed), can be \"full\" (compatible with both Windows and Unix-based systems) and \"symlink\" (symlink also for WSL)." + "enum": ["auto", "full", "proxy", "symlink"], + "description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed), can be \"full\" (compatible with both Windows and Unix-based systems) and \"proxy\" (only bash-style proxy)." }, "discard-changes": { "type": ["string", "boolean"], @@ -331,101 +527,6 @@ "description": "Arbitrary extra data that can be used by plugins, for example, package of type composer-plugin may have a 'class' key defining an installer class name.", "additionalProperties": true }, - "autoload": { - "$ref": "#/definitions/autoload" - }, - "autoload-dev": { - "type": "object", - "description": "Description of additional autoload rules for development purpose (eg. a test suite).", - "properties": { - "psr-0": { - "type": "object", - "description": "This is a hash of namespaces (keys) and the directories they can be found into (values, can be arrays of paths) by the autoloader.", - "additionalProperties": { - "type": ["string", "array"], - "items": { - "type": "string" - } - } - }, - "psr-4": { - "type": "object", - "description": "This is a hash of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.", - "additionalProperties": { - "type": ["string", "array"], - "items": { - "type": "string" - } - } - }, - "classmap": { - "type": "array", - "description": "This is an array of paths that contain classes to be included in the class-map generation process." - }, - "files": { - "type": "array", - "description": "This is an array of files that are always required on every request." - } - } - }, - "archive": { - "type": ["object"], - "description": "Options for creating package archives for distribution.", - "properties": { - "name": { - "type": "string", - "description": "A base name for archive." - }, - "exclude": { - "type": "array", - "description": "A list of patterns for paths to exclude or include if prefixed with an exclamation mark." - } - } - }, - "repositories": { - "type": ["object", "array"], - "description": "A set of additional repositories where packages can be found.", - "additionalProperties": { - "anyOf": [ - { "$ref": "#/definitions/repository" }, - { "type": "boolean", "enum": [false] } - ] - }, - "items": { - "anyOf": [ - { "$ref": "#/definitions/repository" }, - { - "type": "object", - "additionalProperties": { "type": "boolean", "enum": [false] }, - "minProperties": 1, - "maxProperties": 1 - } - ] - } - }, - "minimum-stability": { - "type": ["string"], - "description": "The minimum stability the packages must have to be install-able. Possible values are: dev, alpha, beta, RC, stable.", - "enum": ["dev", "alpha", "beta", "rc", "RC", "stable"] - }, - "prefer-stable": { - "type": ["boolean"], - "description": "If set to true, stable packages will be preferred to dev packages when possible, even if the minimum-stability allows unstable packages." - }, - "bin": { - "type": ["string", "array"], - "description": "A set of files, or a single file, that should be treated as binaries and symlinked into bin-dir (from config).", - "items": { - "type": "string" - } - }, - "include-path": { - "type": ["array"], - "description": "DEPRECATED: A list of directories which should get added to PHP's include path. This is only present to support legacy projects, and all new code should preferably use autoloading.", - "items": { - "type": "string" - } - }, "scripts": { "type": ["object"], "description": "Script listeners that will be executed before/after some events.", @@ -502,93 +603,6 @@ "additionalProperties": { "type": "string" } - }, - "support": { - "type": "object", - "properties": { - "email": { - "type": "string", - "description": "Email address for support.", - "format": "email" - }, - "issues": { - "type": "string", - "description": "URL to the issue tracker.", - "format": "uri" - }, - "forum": { - "type": "string", - "description": "URL to the forum.", - "format": "uri" - }, - "wiki": { - "type": "string", - "description": "URL to the wiki.", - "format": "uri" - }, - "irc": { - "type": "string", - "description": "IRC channel for support, as irc://server/channel.", - "format": "uri" - }, - "chat": { - "type": "string", - "description": "URL to the support chat.", - "format": "uri" - }, - "source": { - "type": "string", - "description": "URL to browse or download the sources.", - "format": "uri" - }, - "docs": { - "type": "string", - "description": "URL to the documentation.", - "format": "uri" - }, - "rss": { - "type": "string", - "description": "URL to the RSS feed.", - "format": "uri" - } - } - }, - "funding": { - "type": "array", - "description": "A list of options to fund the development and maintenance of the package.", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "Type of funding or platform through which funding is possible." - }, - "url": { - "type": "string", - "description": "URL to a website with details on funding and a way to fund the package.", - "format": "uri" - } - } - } - }, - "non-feature-branches": { - "type": ["array"], - "description": "A set of string or regex patterns for non-numeric branch names that will not be handled as feature branches.", - "items": { - "type": "string" - } - }, - "default-branch": { - "type": ["boolean"], - "description": "Internal use only, do not specify this in composer.json. Indicates whether this version is the default branch of the linked VCS repository. Defaults to false." - }, - "abandoned": { - "type": ["boolean", "string"], - "description": "Indicates whether this package has been abandoned, it can be boolean or a package name/URL pointing to a recommended alternative. Defaults to false." - }, - "_comment": { - "type": ["array", "string"], - "description": "A key to store comments in" } }, "definitions": { @@ -627,7 +641,7 @@ "properties": { "psr-0": { "type": "object", - "description": "This is a hash of namespaces (keys) and the directories they can be found in (values, can be arrays of paths) by the autoloader.", + "description": "This is an object of namespaces (keys) and the directories they can be found in (values, can be arrays of paths) by the autoloader.", "additionalProperties": { "type": ["string", "array"], "items": { @@ -637,7 +651,7 @@ }, "psr-4": { "type": "object", - "description": "This is a hash of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.", + "description": "This is an object of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.", "additionalProperties": { "type": ["string", "array"], "items": { @@ -701,7 +715,7 @@ "type": "object", "required": ["type", "url"], "properties": { - "type": { "type": "string", "enum": ["vcs", "github", "git", "gitlab", "git-bitbucket", "hg", "hg-bitbucket", "fossil", "perforce", "svn"] }, + "type": { "type": "string", "enum": ["vcs", "github", "git", "gitlab", "bitbucket", "git-bitbucket", "hg", "fossil", "perforce", "svn"] }, "url": { "type": "string" }, "canonical": { "type": "boolean" }, "only": { diff --git a/core/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php b/core/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php index 482dc0c21b..efb8c7cefa 100644 --- a/core/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php +++ b/core/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php @@ -14,13 +14,16 @@ use Composer\Config; use Composer\EventDispatcher\EventDispatcher; +use Composer\Filter\PlatformRequirementFilter\IgnoreAllPlatformRequirementFilter; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; use Composer\Installer\InstallationManager; use Composer\IO\IOInterface; use Composer\Package\AliasPackage; use Composer\Package\PackageInterface; use Composer\Package\RootPackageInterface; +use Composer\Pcre\Preg; use Composer\Repository\InstalledRepositoryInterface; -use Composer\Repository\PlatformRepository; use Composer\Semver\Constraint\Bound; use Composer\Util\Filesystem; use Composer\Util\Platform; @@ -70,14 +73,16 @@ class AutoloadGenerator private $runScripts = false; /** - * @var bool|string[] + * @var PlatformRequirementFilterInterface */ - private $ignorePlatformReqs = false; + private $platformRequirementFilter; public function __construct(EventDispatcher $eventDispatcher, IOInterface $io = null) { $this->eventDispatcher = $eventDispatcher; $this->io = $io; + + $this->platformRequirementFilter = PlatformRequirementFilterFactory::ignoreNothing(); } /** @@ -133,16 +138,22 @@ public function setRunScripts($runScripts = true) * * @param bool|string[] $ignorePlatformReqs * @return void + * + * @deprecated use setPlatformRequirementFilter instead */ public function setIgnorePlatformRequirements($ignorePlatformReqs) { - if (is_array($ignorePlatformReqs)) { - $this->ignorePlatformReqs = array_filter($ignorePlatformReqs, function ($req) { - return PlatformRepository::isPlatformPackage($req); - }); - } else { - $this->ignorePlatformReqs = (bool) $ignorePlatformReqs; - } + trigger_error('AutoloadGenerator::setIgnorePlatformRequirements is deprecated since Composer 2.2, use setPlatformRequirementFilter instead.', E_USER_DEPRECATED); + + $this->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs)); + } + + /** + * @return void + */ + public function setPlatformRequirementFilter(PlatformRequirementFilterInterface $platformRequirementFilter) + { + $this->platformRequirementFilter = $platformRequirementFilter; } /** @@ -346,12 +357,12 @@ public static function autoload(\$class) } } - foreach ($ambiguousClasses as $className => $ambigiousPaths) { + foreach ($ambiguousClasses as $className => $ambiguousPaths) { $cleanPath = str_replace(array('$vendorDir . \'', '$baseDir . \'', "',\n"), array($vendorPath, $basePath, ''), $classMap[$className]); $this->io->writeError( '<warning>Warning: Ambiguous class resolution, "'.$className.'"'. - ' was found '. (count($ambigiousPaths) + 1) .'x: in "'.$cleanPath.'" and "'. implode('", "', $ambigiousPaths) .'", the first will be used.</warning>' + ' was found '. (count($ambiguousPaths) + 1) .'x: in "'.$cleanPath.'" and "'. implode('", "', $ambiguousPaths) .'", the first will be used.</warning>' ); } @@ -365,7 +376,7 @@ public static function autoload(\$class) if (!$suffix) { if (!$config->get('autoloader-suffix') && Filesystem::isReadable($vendorPath.'/autoload.php')) { $content = file_get_contents($vendorPath.'/autoload.php'); - if (preg_match('{ComposerAutoloaderInit([^:\s]+)::}', $content, $match)) { + if (Preg::isMatch('{ComposerAutoloaderInit([^:\s]+)::}', $content, $match)) { $suffix = $match[1]; } } @@ -391,10 +402,10 @@ public static function autoload(\$class) unlink($includeFilesFilePath); } $filesystem->filePutContentsIfModified($targetDir.'/autoload_static.php', $this->getStaticFile($suffix, $targetDir, $vendorPath, $basePath, $staticPhpVersion)); - $checkPlatform = $config->get('platform-check') && $this->ignorePlatformReqs !== true; + $checkPlatform = $config->get('platform-check') && !($this->platformRequirementFilter instanceof IgnoreAllPlatformRequirementFilter); $platformCheckContent = null; if ($checkPlatform) { - $platformCheckContent = $this->getPlatformCheck($packageMap, $this->ignorePlatformReqs ?: array(), $config->get('platform-check'), $devPackageNames); + $platformCheckContent = $this->getPlatformCheck($packageMap, $config->get('platform-check'), $devPackageNames); if (null === $platformCheckContent) { $checkPlatform = false; } @@ -437,7 +448,7 @@ private function addClassMapCode(Filesystem $filesystem, $basePath, $vendorPath, $pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n"; if (!isset($classMap[$class])) { $classMap[$class] = $pathCode; - } elseif ($this->io && $classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class].' '.$path, '\\', '/'))) { + } elseif ($this->io && $classMap[$class] !== $pathCode && !Preg::isMatch('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class].' '.$path, '\\', '/'))) { $ambiguousClasses[$class][] = $path; } } @@ -465,7 +476,7 @@ private function generateClassMap($dir, $excluded, $namespaceFilter, $autoloadTy $dirMatch = preg_quote(strtr(realpath($dir), '\\', '/')); foreach ($excluded as $index => $pattern) { // extract the constant string prefix of the pattern here, until we reach a non-escaped regex special character - $pattern = preg_replace('{^(([^.+*?\[^\]$(){}=!<>|:\\\\#-]+|\\\\[.+*?\[^\]$(){}=!<>|:#-])*).*}', '$1', $pattern); + $pattern = Preg::replace('{^(([^.+*?\[^\]$(){}=!<>|:\\\\#-]+|\\\\[.+*?\[^\]$(){}=!<>|:#-])*).*}', '$1', $pattern); // if the pattern is not a subset or superset of $dir, it is unrelated and we skip it if (0 !== strpos($pattern, $dirMatch) && 0 !== strpos($dirMatch, $pattern)) { unset($excluded[$index]); @@ -575,7 +586,7 @@ public function parseAutoloads(array $packageMap, PackageInterface $rootPackage, /** * Registers an autoloader based on an autoload-map returned by parseAutoloads * - * @param array<string, array> $autoloads see parseAutoloads return value + * @param array<string, mixed[]> $autoloads see parseAutoloads return value * @param ?string $vendorDir * @return ClassLoader */ @@ -734,12 +745,11 @@ protected function getPathCode(Filesystem $filesystem, $basePath, $vendorPath, $ /** * @param array<int, array{0: PackageInterface, 1: string}> $packageMap - * @param string[] $ignorePlatformReqs * @param bool $checkPlatform * @param string[] $devPackageNames * @return ?string */ - protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs, $checkPlatform, array $devPackageNames) + protected function getPlatformCheck(array $packageMap, $checkPlatform, array $devPackageNames) { $lowestPhpVersion = Bound::zero(); $requiredExtensions = array(); @@ -748,7 +758,7 @@ protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs foreach ($packageMap as $item) { $package = $item[0]; foreach (array_merge($package->getReplaces(), $package->getProvides()) as $link) { - if (preg_match('{^ext-(.+)$}iD', $link->getTarget(), $match)) { + if (Preg::isMatch('{^ext-(.+)$}iD', $link->getTarget(), $match)) { $extensionProviders[$match[1]][] = $link->getConstraint(); } } @@ -762,7 +772,7 @@ protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs } foreach ($package->getRequires() as $link) { - if (in_array($link->getTarget(), $ignorePlatformReqs, true)) { + if ($this->platformRequirementFilter->isIgnored($link->getTarget())) { continue; } @@ -773,7 +783,7 @@ protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs } } - if ($checkPlatform === true && preg_match('{^ext-(.+)$}iD', $link->getTarget(), $match)) { + if ($checkPlatform === true && Preg::isMatch('{^ext-(.+)$}iD', $link->getTarget(), $match)) { // skip extension checks if they have a valid provider/replacer if (isset($extensionProviders[$match[1]])) { foreach ($extensionProviders[$match[1]] as $provided) { @@ -1089,12 +1099,17 @@ public static function getLoader() return $file . <<<FOOTER } +/** + * @param string \$fileIdentifier + * @param string \$file + * @return void + */ function composerRequire$suffix(\$fileIdentifier, \$file) { if (empty(\$GLOBALS['__composer_autoload_files'][\$fileIdentifier])) { - require \$file; - \$GLOBALS['__composer_autoload_files'][\$fileIdentifier] = true; + + require \$file; } } @@ -1190,7 +1205,7 @@ class ComposerStaticInit$suffix $absoluteAppBaseDirPharCode => $appBaseDirPharCode, ) ); - $value = ltrim(preg_replace('/^ */m', ' $0$0', $value)); + $value = ltrim(Preg::replace('/^ */m', ' $0$0', $value)); $file .= sprintf(" public static $%s = %s;\n\n", $prop, $value); if ('files' !== $prop) { @@ -1241,7 +1256,7 @@ protected function parseAutoloadsType(array $packageMap, $type, RootPackageInter // remove target-dir from file paths of the root package if ($package === $rootPackage) { $targetDir = str_replace('\\<dirsep\\>', '[\\\\/]', preg_quote(str_replace(array('/', '\\'), '<dirsep>', $package->getTargetDir()))); - $path = ltrim(preg_replace('{^'.$targetDir.'}', '', ltrim($path, '\\/')), '\\/'); + $path = ltrim(Preg::replace('{^'.$targetDir.'}', '', ltrim($path, '\\/')), '\\/'); } else { // add target-dir from file paths that don't have it $path = $package->getTargetDir() . '/' . $path; @@ -1250,14 +1265,14 @@ protected function parseAutoloadsType(array $packageMap, $type, RootPackageInter if ($type === 'exclude-from-classmap') { // first escape user input - $path = preg_replace('{/+}', '/', preg_quote(trim(strtr($path, '\\', '/'), '/'))); + $path = Preg::replace('{/+}', '/', preg_quote(trim(strtr($path, '\\', '/'), '/'))); // add support for wildcards * and ** $path = strtr($path, array('\\*\\*' => '.+?', '\\*' => '[^/]+?')); // add support for up-level relative paths $updir = null; - $path = preg_replace_callback( + $path = Preg::replaceCallback( '{^((?:(?:\\\\\\.){1,2}+/)+)}', function ($matches) use (&$updir) { if (isset($matches[1])) { @@ -1393,3 +1408,17 @@ protected function sortPackageMap(array $packageMap) return $sortedPackageMap; } } + +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ +function composerRequire($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } +} diff --git a/core/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php b/core/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php index 0cd6055d1b..afef3fa2ad 100644 --- a/core/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php +++ b/core/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php @@ -149,7 +149,7 @@ public function getFallbackDirsPsr4() /** * @return string[] Array of classname => path - * @psalm-var array<string, string> + * @psalm-return array<string, string> */ public function getClassMap() { diff --git a/core/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php b/core/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php index 6910fcb6fc..cc25985960 100644 --- a/core/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php +++ b/core/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php @@ -18,6 +18,7 @@ namespace Composer\Autoload; +use Composer\Pcre\Preg; use Symfony\Component\Finder\Finder; use Composer\IO\IOInterface; use Composer\Util\Filesystem; @@ -92,7 +93,7 @@ public static function createMap($path, $excluded = null, IOInterface $io = null $filePath = $cwd . '/' . $filePath; $filePath = $filesystem->normalizePath($filePath); } else { - $filePath = preg_replace('{[\\\\/]{2,}}', '/', $filePath); + $filePath = Preg::replace('{[\\\\/]{2,}}', '/', $filePath); } $realPath = realpath($filePath); @@ -104,11 +105,11 @@ public static function createMap($path, $excluded = null, IOInterface $io = null } // check the realpath of the file against the excluded paths as the path might be a symlink and the excluded path is realpath'd so symlink are resolved - if ($excluded && preg_match($excluded, strtr($realPath, '\\', '/'))) { + if ($excluded && Preg::isMatch($excluded, strtr($realPath, '\\', '/'))) { continue; } // check non-realpath of file for directories symlink in project dir - if ($excluded && preg_match($excluded, strtr($filePath, '\\', '/'))) { + if ($excluded && Preg::isMatch($excluded, strtr($filePath, '\\', '/'))) { continue; } @@ -133,7 +134,7 @@ public static function createMap($path, $excluded = null, IOInterface $io = null if (!isset($map[$class])) { $map[$class] = $filePath; - } elseif ($io && $map[$class] !== $filePath && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($map[$class].' '.$filePath, '\\', '/'))) { + } elseif ($io && $map[$class] !== $filePath && !Preg::isMatch('{/(test|fixture|example|stub)s?/}i', strtr($map[$class].' '.$filePath, '\\', '/'))) { $io->writeError( '<warning>Warning: Ambiguous class resolution, "'.$class.'"'. ' was found in both "'.$map[$class].'" and "'.$filePath.'", the first will be used.</warning>' @@ -196,7 +197,7 @@ private static function filterByNamespace($classes, $filePath, $baseNamespace, $ if (empty($validClasses)) { foreach ($rejectedClasses as $class) { if ($io) { - $io->writeError("<warning>Class $class located in ".preg_replace('{^'.preg_quote(getcwd()).'}', '.', $filePath, 1)." does not comply with $namespaceType autoloading standard. Skipping.</warning>"); + $io->writeError("<warning>Class $class located in ".Preg::replace('{^'.preg_quote(getcwd()).'}', '.', $filePath, 1)." does not comply with $namespaceType autoloading standard. Skipping.</warning>"); } } @@ -239,7 +240,7 @@ private static function findClasses($path) } // return early if there is no chance of matching anything in this file - preg_match_all('{\b(?:class|interface'.$extraTypes.')\s}i', $contents, $matches); + Preg::matchAll('{\b(?:class|interface'.$extraTypes.')\s}i', $contents, $matches); if (!$matches) { return array(); } @@ -248,7 +249,7 @@ private static function findClasses($path) $contents = $p->clean(); unset($p); - preg_match_all('{ + Preg::matchAll('{ (?: \b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+) | \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+)? \s*+ [\{;] @@ -271,11 +272,18 @@ private static function findClasses($path) // This is an XHP class, https://github.com/facebook/xhp $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1); } elseif ($matches['type'][$i] === 'enum') { - // In Hack, something like: + // something like: // enum Foo: int { HERP = '123'; } // The regex above captures the colon, which isn't part of // the class name. - $name = rtrim($name, ':'); + // or: + // enum Foo:int { HERP = '123'; } + // The regex above captures the colon and type, which isn't part of + // the class name. + $colonPos = strrpos($name, ':'); + if (false !== $colonPos) { + $name = substr($name, 0, $colonPos); + } } $classes[] = ltrim($namespace . $name, '\\'); } diff --git a/core/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php b/core/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php index 677f7e978e..7941f463c2 100644 --- a/core/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php +++ b/core/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php @@ -12,16 +12,18 @@ namespace Composer\Autoload; +use Composer\Pcre\Preg; + /** * @author Jordi Boggiano <j.boggiano@seld.be> * @internal */ class PhpFileCleaner { - /** @var array<array{name: string, length: int, pattern: string}> */ + /** @var array<array{name: string, length: int, pattern: non-empty-string}> */ private static $typeConfig; - /** @var string */ + /** @var non-empty-string */ private static $restPattern; /** @@ -118,6 +120,7 @@ public function clean() } if ($this->peek('*')) { $this->skipComment(); + continue; } } @@ -125,7 +128,7 @@ public function clean() $type = self::$typeConfig[$char]; if ( \substr($this->contents, $this->index, $type['length']) === $type['name'] - && \preg_match($type['pattern'], $this->contents, $match, 0, $this->index - 1) + && Preg::isMatch($type['pattern'], $this->contents, $match, 0, $this->index - 1) ) { $clean .= $match[0]; @@ -263,16 +266,12 @@ private function peek($char) } /** - * @param string $regex + * @param non-empty-string $regex * @param ?array<int, string> $match * @return bool */ private function match($regex, array &$match = null) { - if (\preg_match($regex, $this->contents, $match, 0, $this->index)) { - return true; - } - - return false; + return Preg::isMatch($regex, $this->contents, $match, 0, $this->index); } } diff --git a/core/vendor/composer/composer/src/Composer/Cache.php b/core/vendor/composer/composer/src/Composer/Cache.php index b1baef8ead..c7da5c6127 100644 --- a/core/vendor/composer/composer/src/Composer/Cache.php +++ b/core/vendor/composer/composer/src/Composer/Cache.php @@ -13,7 +13,9 @@ namespace Composer; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; +use Composer\Util\Platform; use Composer\Util\Silencer; use Symfony\Component\Finder\Finder; @@ -84,7 +86,7 @@ public function isReadOnly() */ public static function isUsable($path) { - return !preg_match('{(^|[\\\\/])(\$null|nul|NUL|/dev/null)([\\\\/]|$)}', $path); + return !Preg::isMatch('{(^|[\\\\/])(\$null|nul|NUL|/dev/null)([\\\\/]|$)}', $path); } /** @@ -123,7 +125,7 @@ public function getRoot() public function read($file) { if ($this->isEnabled()) { - $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); + $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { $this->io->writeError('Reading '.$this->root . $file.' from cache', true, IOInterface::DEBUG); @@ -143,7 +145,7 @@ public function read($file) public function write($file, $contents) { if ($this->isEnabled() && !$this->readOnly) { - $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); + $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file); $this->io->writeError('Writing '.$this->root . $file.' into cache', true, IOInterface::DEBUG); @@ -152,7 +154,7 @@ public function write($file, $contents) return file_put_contents($tempFileName, $contents) !== false && rename($tempFileName, $this->root . $file); } catch (\ErrorException $e) { $this->io->writeError('<warning>Failed to write into cache: '.$e->getMessage().'</warning>', true, IOInterface::DEBUG); - if (preg_match('{^file_put_contents\(\): Only ([0-9]+) of ([0-9]+) bytes written}', $e->getMessage(), $m)) { + if (Preg::isMatch('{^file_put_contents\(\): Only ([0-9]+) of ([0-9]+) bytes written}', $e->getMessage(), $m)) { // Remove partial file. unlink($tempFileName); @@ -187,7 +189,7 @@ public function write($file, $contents) public function copyFrom($file, $source) { if ($this->isEnabled() && !$this->readOnly) { - $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); + $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file); $this->filesystem->ensureDirectoryExists(dirname($this->root . $file)); if (!file_exists($source)) { @@ -213,7 +215,7 @@ public function copyFrom($file, $source) public function copyTo($file, $target) { if ($this->isEnabled()) { - $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); + $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { try { touch($this->root . $file, filemtime($this->root . $file), time()); @@ -242,7 +244,7 @@ public function gcIsNecessary() } self::$cacheCollected = true; - if (getenv('COMPOSER_TEST_SUITE')) { + if (Platform::getEnv('COMPOSER_TEST_SUITE')) { return false; } @@ -261,7 +263,7 @@ public function gcIsNecessary() public function remove($file) { if ($this->isEnabled()) { - $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); + $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { return $this->filesystem->unlink($this->root . $file); } @@ -284,6 +286,23 @@ public function clear() return false; } + /** + * @param string $file + * @return int|false + * @phpstan-return int<0, max>|false + */ + public function getAge($file) + { + if ($this->isEnabled()) { + $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file); + if (file_exists($this->root . $file) && ($mtime = filemtime($this->root . $file)) !== false) { + return abs(time() - $mtime); + } + } + + return false; + } + /** * @param int $ttl * @param int $maxSize @@ -328,7 +347,7 @@ public function gc($ttl, $maxSize) public function sha1($file) { if ($this->isEnabled()) { - $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); + $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { return sha1_file($this->root . $file); } @@ -345,7 +364,7 @@ public function sha1($file) public function sha256($file) { if ($this->isEnabled()) { - $file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file); + $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { return hash_file('sha256', $this->root . $file); } diff --git a/core/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php b/core/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php index c30c2364df..acf72c5489 100644 --- a/core/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php @@ -49,7 +49,7 @@ protected function configure() ->setDefinition(array( new InputArgument('package', InputArgument::OPTIONAL, 'The package to archive instead of the current project'), new InputArgument('version', InputArgument::OPTIONAL, 'A version constraint to find the package to archive'), - new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the resulting archive: tar or zip'), + new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the resulting archive: tar, tar.gz, tar.bz2 or zip (default tar)'), new InputOption('dir', null, InputOption::VALUE_REQUIRED, 'Write the archive to this directory'), new InputOption('file', null, InputOption::VALUE_REQUIRED, 'Write the archive with the given file name.' .' Note that the format will be appended.'), diff --git a/core/vendor/composer/composer/src/Composer/Command/BaseCommand.php b/core/vendor/composer/composer/src/Composer/Command/BaseCommand.php index 5e98226f43..59cbbe9abf 100644 --- a/core/vendor/composer/composer/src/Composer/Command/BaseCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/BaseCommand.php @@ -52,16 +52,17 @@ abstract class BaseCommand extends Command /** * @param bool $required * @param bool|null $disablePlugins + * @param bool|null $disableScripts * @throws \RuntimeException * @return Composer|null */ - public function getComposer($required = true, $disablePlugins = null) + public function getComposer($required = true, $disablePlugins = null, $disableScripts = null) { if (null === $this->composer) { $application = $this->getApplication(); if ($application instanceof Application) { /* @var $application Application */ - $this->composer = $application->getComposer($required, $disablePlugins); + $this->composer = $application->getComposer($required, $disablePlugins, $disableScripts); /** @phpstan-ignore-next-line */ } elseif ($required) { throw new \RuntimeException( @@ -140,9 +141,15 @@ protected function initialize(InputInterface $input, OutputInterface $output) { // initialize a plugin-enabled Composer instance, either local or global $disablePlugins = $input->hasParameterOption('--no-plugins'); - $composer = $this->getComposer(false, $disablePlugins); + $disableScripts = $input->hasParameterOption('--no-scripts'); + if ($this instanceof SelfUpdateCommand) { + $disablePlugins = true; + $disableScripts = true; + } + + $composer = $this->getComposer(false, $disablePlugins, $disableScripts); if (null === $composer) { - $composer = Factory::createGlobal($this->getIO(), $disablePlugins); + $composer = Factory::createGlobal($this->getIO(), $disablePlugins, $disableScripts); } if ($composer) { $preCommandRunEvent = new PreCommandRunEvent(PluginEvents::PRE_COMMAND_RUN, $input, $this->getName()); @@ -153,6 +160,12 @@ protected function initialize(InputInterface $input, OutputInterface $output) $input->setOption('no-progress', true); } + if (true == $input->hasOption('no-dev')) { + if (!$input->getOption('no-dev') && true == Platform::getEnv('COMPOSER_NO_DEV')) { + $input->setOption('no-dev', true); + } + } + parent::initialize($input, $output); } @@ -244,7 +257,7 @@ protected function normalizeRequirements(array $requirements) } /** - * @param array<TableSeparator|array> $table + * @param array<TableSeparator|mixed[]> $table * * @return void */ diff --git a/core/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php b/core/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php index ae91abae63..ba48173da3 100644 --- a/core/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php @@ -132,7 +132,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output, $in /** * Assembles and prints a bottom-up table of the dependencies. * - * @param array[] $results + * @param array{PackageInterface, Link, mixed}[] $results * * @return void */ @@ -191,7 +191,7 @@ protected function initStyles(OutputInterface $output) /** * Recursively prints a tree of the selected results. * - * @param array[] $results Results to be printed at this level. + * @param array{PackageInterface, Link, mixed[]|bool}[] $results Results to be printed at this level. * @param string $prefix Prefix of the current tree level. * @param int $level Current level of recursion. * @@ -202,11 +202,6 @@ protected function printTree($results, $prefix = '', $level = 1) $count = count($results); $idx = 0; foreach ($results as $result) { - /** - * @var PackageInterface $package - * @var Link $link - * @var mixed[]|bool $children - */ list($package, $link, $children) = $result; $color = $this->colors[$level % count($this->colors)]; diff --git a/core/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php b/core/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php index 170e25f298..73aee95513 100644 --- a/core/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/CheckPlatformReqsCommand.php @@ -173,7 +173,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } /** - * @param array[] $results + * @param mixed[] $results * * @return void */ diff --git a/core/vendor/composer/composer/src/Composer/Command/ConfigCommand.php b/core/vendor/composer/composer/src/Composer/Command/ConfigCommand.php index 4f486cc83c..e51ba1a7ca 100644 --- a/core/vendor/composer/composer/src/Composer/Command/ConfigCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/ConfigCommand.php @@ -12,6 +12,7 @@ namespace Composer\Command; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; use Composer\Util\Platform; use Composer\Util\Silencer; @@ -77,6 +78,7 @@ protected function configure() new InputOption('json', 'j', InputOption::VALUE_NONE, 'JSON decode the setting value, to be used with extra.* keys'), new InputOption('merge', 'm', InputOption::VALUE_NONE, 'Merge the setting value with the current value, to be used with extra.* keys in combination with --json'), new InputOption('append', null, InputOption::VALUE_NONE, 'When adding a repository, append it (lowest priority) to the existing ones instead of prepending it (highest priority)'), + new InputOption('source', null, InputOption::VALUE_NONE, 'Display where the config value is loaded from'), new InputArgument('setting-key', null, 'Setting key'), new InputArgument('setting-value', InputArgument::IS_ARRAY, 'Setting value'), )) @@ -212,8 +214,8 @@ protected function initialize(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output) { // Open file in editor - if ($input->getOption('editor')) { - $editor = escapeshellcmd(getenv('EDITOR')); + if (true === $input->getOption('editor')) { + $editor = escapeshellcmd(Platform::getEnv('EDITOR')); if (!$editor) { if (Platform::isWindows()) { $editor = 'notepad'; @@ -233,20 +235,20 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } - if (!$input->getOption('global')) { - $this->config->merge($this->configFile->read()); - $this->config->merge(array('config' => $this->authConfigFile->exists() ? $this->authConfigFile->read() : array())); + if (false === $input->getOption('global')) { + $this->config->merge($this->configFile->read(), $this->configFile->getPath()); + $this->config->merge(array('config' => $this->authConfigFile->exists() ? $this->authConfigFile->read() : array()), $this->authConfigFile->getPath()); } // List the configuration of the file settings - if ($input->getOption('list')) { - $this->listConfiguration($this->config->all(), $this->config->raw(), $output); + if (true === $input->getOption('list')) { + $this->listConfiguration($this->config->all(), $this->config->raw(), $output, null, (bool) $input->getOption('source')); return 0; } $settingKey = $input->getArgument('setting-key'); - if (!$settingKey || !is_string($settingKey)) { + if (!is_string($settingKey)) { return 0; } @@ -260,7 +262,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $properties = array('name', 'type', 'description', 'homepage', 'version', 'minimum-stability', 'prefer-stable', 'keywords', 'license', 'extra'); $rawData = $this->configFile->read(); $data = $this->config->all(); - if (preg_match('/^repos?(?:itories)?(?:\.(.+))?/', $settingKey, $matches)) { + if (Preg::isMatch('/^repos?(?:itories)?(?:\.(.+))?/', $settingKey, $matches)) { if (!isset($matches[1]) || $matches[1] === '') { $value = isset($data['repositories']) ? $data['repositories'] : array(); } else { @@ -305,7 +307,12 @@ protected function execute(InputInterface $input, OutputInterface $output) $value = json_encode($value); } - $this->getIO()->write($value, true, IOInterface::QUIET); + $sourceOfConfigValue = ''; + if ($input->getOption('source')) { + $sourceOfConfigValue = ' (' . $this->config->getSourceOfValue($settingKey) . ')'; + } + + $this->getIO()->write($value . $sourceOfConfigValue, true, IOInterface::QUIET); return 0; } @@ -384,7 +391,7 @@ function ($val) { 'cache-files-ttl' => array('is_numeric', 'intval'), 'cache-files-maxsize' => array( function ($val) { - return preg_match('/^\s*([0-9.]+)\s*(?:([kmg])(?:i?b)?)?\s*$/i', $val) > 0; + return Preg::isMatch('/^\s*([0-9.]+)\s*(?:([kmg])(?:i?b)?)?\s*$/i', $val); }, function ($val) { return $val; @@ -439,6 +446,7 @@ function ($val) { 'github-expose-hostname' => array($booleanValidator, $booleanNormalizer), 'htaccess-protect' => array($booleanValidator, $booleanNormalizer), 'lock' => array($booleanValidator, $booleanNormalizer), + 'allow-plugins' => array($booleanValidator, $booleanNormalizer), 'platform-check' => array( function ($val) { return in_array($val, array('php-only', 'true', 'false', '1', '0'), true); @@ -448,6 +456,18 @@ function ($val) { return 'php-only'; } + return $val !== 'false' && (bool)$val; + }, + ), + 'use-parent-dir' => array( + function ($val) { + return in_array($val, array('true', 'false', 'prompt'), true); + }, + function ($val) { + if ('prompt' === $val) { + return 'prompt'; + } + return $val !== 'false' && (bool) $val; }, ), @@ -517,7 +537,7 @@ function ($vals) { return 0; } // handle preferred-install per-package config - if (preg_match('/^preferred-install\.(.+)/', $settingKey, $matches)) { + if (Preg::isMatch('/^preferred-install\.(.+)/', $settingKey, $matches)) { if ($input->getOption('unset')) { $this->configSource->removeConfigSetting($settingKey); @@ -534,6 +554,28 @@ function ($vals) { return 0; } + // handle allow-plugins config setting elements true or false to add/remove + if (Preg::isMatch('{^allow-plugins\.([a-zA-Z0-9/*-]+)}', $settingKey, $matches)) { + if ($input->getOption('unset')) { + $this->configSource->removeConfigSetting($settingKey); + + return 0; + } + + if (true !== $booleanValidator($values[0])) { + throw new \RuntimeException(sprintf( + '"%s" is an invalid value', + $values[0] + )); + } + + $normalizedValue = $booleanNormalizer($values[0]); + + $this->configSource->addConfigSetting($settingKey, $normalizedValue); + + return 0; + } + // handle properties $uniqueProps = array( 'name' => array('is_string', function ($val) { @@ -589,7 +631,7 @@ function ($vals) { ); if ($input->getOption('global') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]) || strpos($settingKey, 'extra.') === 0)) { - throw new \InvalidArgumentException('The '.$settingKey.' property can not be set in the global config.json file. Use `composer global config` to apply changes to the global composer.json'); + throw new \InvalidArgumentException('The ' . $settingKey . ' property can not be set in the global config.json file. Use `composer global config` to apply changes to the global composer.json'); } if ($input->getOption('unset') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]))) { $this->configSource->removeProperty($settingKey); @@ -608,7 +650,7 @@ function ($vals) { } // handle repositories - if (preg_match('/^repos?(?:itories)?\.(.+)/', $settingKey, $matches)) { + if (Preg::isMatch('/^repos?(?:itories)?\.(.+)/', $settingKey, $matches)) { if ($input->getOption('unset')) { $this->configSource->removeRepository($matches[1]); @@ -644,7 +686,7 @@ function ($vals) { } // handle extra - if (preg_match('/^extra\.(.+)/', $settingKey, $matches)) { + if (Preg::isMatch('/^extra\.(.+)/', $settingKey, $matches)) { if ($input->getOption('unset')) { $this->configSource->removeProperty($settingKey); @@ -671,7 +713,7 @@ function ($vals) { } // handle suggest - if (preg_match('/^suggest\.(.+)/', $settingKey, $matches)) { + if (Preg::isMatch('/^suggest\.(.+)/', $settingKey, $matches)) { if ($input->getOption('unset')) { $this->configSource->removeProperty($settingKey); @@ -691,14 +733,14 @@ function ($vals) { } // handle platform - if (preg_match('/^platform\.(.+)/', $settingKey, $matches)) { + if (Preg::isMatch('/^platform\.(.+)/', $settingKey, $matches)) { if ($input->getOption('unset')) { $this->configSource->removeConfigSetting($settingKey); return 0; } - $this->configSource->addConfigSetting($settingKey, $values[0]); + $this->configSource->addConfigSetting($settingKey, $values[0] === 'false' ? false : $values[0]); return 0; } @@ -711,7 +753,7 @@ function ($vals) { } // handle auth - if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic|bearer)\.(.+)/', $settingKey, $matches)) { + if (Preg::isMatch('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic|bearer)\.(.+)/', $settingKey, $matches)) { if ($input->getOption('unset')) { $this->authConfigSource->removeConfigSetting($matches[1].'.'.$matches[2]); $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]); @@ -746,7 +788,7 @@ function ($vals) { } // handle script - if (preg_match('/^scripts\.(.+)/', $settingKey, $matches)) { + if (Preg::isMatch('/^scripts\.(.+)/', $settingKey, $matches)) { if ($input->getOption('unset')) { $this->configSource->removeProperty($settingKey); @@ -820,13 +862,14 @@ protected function handleMultiValue($key, array $callbacks, array $values, $meth /** * Display the contents of the file in a pretty formatted way * - * @param array<array|bool|string> $contents - * @param array<array|string> $rawContents - * @param string|null $k + * @param array<mixed[]|bool|string> $contents + * @param array<mixed[]|string> $rawContents + * @param string|null $k + * @param bool $showSource * * @return void */ - protected function listConfiguration(array $contents, array $rawContents, OutputInterface $output, $k = null) + protected function listConfiguration(array $contents, array $rawContents, OutputInterface $output, $k = null, $showSource = false) { $origK = $k; $io = $this->getIO(); @@ -838,8 +881,8 @@ protected function listConfiguration(array $contents, array $rawContents, Output $rawVal = isset($rawContents[$key]) ? $rawContents[$key] : null; if (is_array($value) && (!is_numeric(key($value)) || ($key === 'repositories' && null === $k))) { - $k .= preg_replace('{^config\.}', '', $key . '.'); - $this->listConfiguration($value, $rawVal, $output, $k); + $k .= Preg::replace('{^config\.}', '', $key . '.'); + $this->listConfiguration($value, $rawVal, $output, $k, $showSource); $k = $origK; continue; @@ -857,10 +900,14 @@ protected function listConfiguration(array $contents, array $rawContents, Output $value = var_export($value, true); } + $source = ''; + if ($showSource) { + $source = ' (' . $this->config->getSourceOfValue($k . $key) . ')'; + } if (is_string($rawVal) && $rawVal != $value) { - $io->write('[<comment>' . $k . $key . '</comment>] <info>' . $rawVal . ' (' . $value . ')</info>', true, IOInterface::QUIET); + $io->write('[<comment>' . $k . $key . '</comment>] <info>' . $rawVal . ' (' . $value . ')</info>' . $source, true, IOInterface::QUIET); } else { - $io->write('[<comment>' . $k . $key . '</comment>] <info>' . $value . '</info>', true, IOInterface::QUIET); + $io->write('[<comment>' . $k . $key . '</comment>] <info>' . $value . '</info>' . $source, true, IOInterface::QUIET); } } } diff --git a/core/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php b/core/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php index da01080f6d..a1eba060f7 100644 --- a/core/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php @@ -14,6 +14,9 @@ use Composer\Config; use Composer\Factory; +use Composer\Filter\PlatformRequirementFilter\IgnoreAllPlatformRequirementFilter; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; use Composer\Installer; use Composer\Installer\ProjectInstaller; use Composer\Installer\SuggestedPackagesReporter; @@ -22,6 +25,7 @@ use Composer\DependencyResolver\Operation\InstallOperation; use Composer\Package\Version\VersionSelector; use Composer\Package\AliasPackage; +use Composer\Pcre\Preg; use Composer\Repository\RepositoryFactory; use Composer\Repository\CompositeRepository; use Composer\Repository\PlatformRepository; @@ -159,33 +163,32 @@ protected function execute(InputInterface $input, OutputInterface $output) $input->getOption('no-scripts'), $input->getOption('no-progress'), $input->getOption('no-install'), - $ignorePlatformReqs, + PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs), !$input->getOption('no-secure-http'), $input->getOption('add-repository') ); } /** - * @param string|null $packageName - * @param string|null $directory - * @param string|null $packageVersion - * @param string $stability - * @param bool $preferSource - * @param bool $preferDist - * @param bool $installDevPackages + * @param string|null $packageName + * @param string|null $directory + * @param string|null $packageVersion + * @param string $stability + * @param bool $preferSource + * @param bool $preferDist + * @param bool $installDevPackages * @param string|array<string>|null $repositories - * @param bool $disablePlugins - * @param bool $noScripts - * @param bool $noProgress - * @param bool $noInstall - * @param bool $ignorePlatformReqs - * @param bool $secureHttp - * @param bool $addRepository + * @param bool $disablePlugins + * @param bool $disableScripts + * @param bool $noProgress + * @param bool $noInstall + * @param bool $secureHttp + * @param bool $addRepository * * @return int * @throws \Exception */ - public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName = null, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repositories = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $noInstall = false, $ignorePlatformReqs = false, $secureHttp = true, $addRepository = false) + public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName = null, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repositories = null, $disablePlugins = false, $disableScripts = false, $noProgress = false, $noInstall = false, PlatformRequirementFilterInterface $platformRequirementFilter = null, $secureHttp = true, $addRepository = false) { $oldCwd = getcwd(); @@ -193,13 +196,15 @@ public function installProject(IOInterface $io, Config $config, InputInterface $ $repositories = (array) $repositories; } + $platformRequirementFilter = $platformRequirementFilter ?: PlatformRequirementFilterFactory::ignoreNothing(); + // we need to manually load the configuration to pass the auth credentials to the io interface! $io->loadConfiguration($config); $this->suggestedPackagesReporter = new SuggestedPackagesReporter($io); if ($packageName !== null) { - $installedFromVcs = $this->installRootPackage($io, $config, $packageName, $directory, $packageVersion, $stability, $preferSource, $preferDist, $installDevPackages, $repositories, $disablePlugins, $noScripts, $noProgress, $ignorePlatformReqs, $secureHttp); + $installedFromVcs = $this->installRootPackage($io, $config, $packageName, $platformRequirementFilter, $directory, $packageVersion, $stability, $preferSource, $preferDist, $installDevPackages, $repositories, $disablePlugins, $disableScripts, $noProgress, $secureHttp); } else { $installedFromVcs = false; } @@ -208,8 +213,7 @@ public function installProject(IOInterface $io, Config $config, InputInterface $ unlink('composer.lock'); } - $composer = Factory::create($io, null, $disablePlugins); - $composer->getEventDispatcher()->setRunScripts(!$noScripts); + $composer = Factory::create($io, null, $disablePlugins, $disableScripts); // add the repository to the composer.json and use it for the install run later if ($repositories !== null && $addRepository) { @@ -250,7 +254,7 @@ public function installProject(IOInterface $io, Config $config, InputInterface $ $installer->setPreferSource($preferSource) ->setPreferDist($preferDist) ->setDevMode($installDevPackages) - ->setIgnorePlatformRequirements($ignorePlatformReqs) + ->setPlatformRequirementFilter($platformRequirementFilter) ->setSuggestedPackagesReporter($this->suggestedPackagesReporter) ->setOptimizeAutoloader($config->get('optimize-autoloader')) ->setClassMapAuthoritative($config->get('classmap-authoritative')) @@ -331,27 +335,26 @@ public function installProject(IOInterface $io, Config $config, InputInterface $ } /** - * @param string $packageName - * @param string|null $directory - * @param string|null $packageVersion - * @param string|null $stability - * @param bool $preferSource - * @param bool $preferDist - * @param bool $installDevPackages + * @param string $packageName + * @param string|null $directory + * @param string|null $packageVersion + * @param string|null $stability + * @param bool $preferSource + * @param bool $preferDist + * @param bool $installDevPackages * @param array<string>|null $repositories - * @param bool $disablePlugins - * @param bool $noScripts - * @param bool $noProgress - * @param bool $ignorePlatformReqs - * @param bool $secureHttp + * @param bool $disablePlugins + * @param bool $disableScripts + * @param bool $noProgress + * @param bool $secureHttp * * @return bool * @throws \Exception */ - protected function installRootPackage(IOInterface $io, Config $config, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, array $repositories = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $ignorePlatformReqs = false, $secureHttp = true) + protected function installRootPackage(IOInterface $io, Config $config, $packageName, PlatformRequirementFilterInterface $platformRequirementFilter, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, array $repositories = null, $disablePlugins = false, $disableScripts = false, $noProgress = false, $secureHttp = true) { if (!$secureHttp) { - $config->merge(array('config' => array('secure-http' => false))); + $config->merge(array('config' => array('secure-http' => false)), Config::SOURCE_COMMAND); } $parser = new VersionParser(); @@ -387,7 +390,7 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN if (null === $stability) { if (null === $packageVersion) { $stability = 'stable'; - } elseif (preg_match('{^[^,\s]*?@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $packageVersion, $match)) { + } elseif (Preg::isMatch('{^[^,\s]*?@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $packageVersion, $match)) { $stability = $match[1]; } else { $stability = VersionParser::parseStability($packageVersion); @@ -425,11 +428,11 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN // find the latest version if there are multiple $versionSelector = new VersionSelector($repositorySet, $platformRepo); - $package = $versionSelector->findBestCandidate($name, $packageVersion, $stability, $ignorePlatformReqs); + $package = $versionSelector->findBestCandidate($name, $packageVersion, $stability, $platformRequirementFilter); if (!$package) { $errorMessage = "Could not find package $name with " . ($packageVersion ? "version $packageVersion" : "stability $stability"); - if (true !== $ignorePlatformReqs && $versionSelector->findBestCandidate($name, $packageVersion, $stability, true)) { + if (!($platformRequirementFilter instanceof IgnoreAllPlatformRequirementFilter) && $versionSelector->findBestCandidate($name, $packageVersion, $stability, PlatformRequirementFilterFactory::ignoreAll())) { throw new \InvalidArgumentException($errorMessage .' in a version installable using your PHP version, PHP extensions and Composer version.'); } diff --git a/core/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php b/core/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php index 8e4e617cca..242c581545 100644 --- a/core/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php @@ -16,6 +16,7 @@ use Composer\Factory; use Composer\Config; use Composer\Downloader\TransportException; +use Composer\Pcre\Preg; use Composer\Repository\PlatformRepository; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; @@ -90,7 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $config = Factory::createConfig(); } - $config->merge(array('config' => array('secure-http' => false))); + $config->merge(array('config' => array('secure-http' => false)), Config::SOURCE_COMMAND); $config->prohibitUrlByConfig('http://repo.packagist.org', new NullIO); $this->httpDownloader = Factory::createHttpDownloader($io, $config); @@ -579,7 +580,7 @@ private function checkPlatform() ob_start(); phpinfo(INFO_GENERAL); $phpinfo = ob_get_clean(); - if (preg_match('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</td>|$)}m', $phpinfo, $match)) { + if (Preg::isMatch('{Configure Command(?: *</td><td class="v">| *=> *)(.*?)(?:</td>|$)}m', $phpinfo, $match)) { $configure = $match[1]; if (false !== strpos($configure, '--enable-sigchild')) { diff --git a/core/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php b/core/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php index 20da6fb151..2b105e81c7 100644 --- a/core/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php @@ -12,6 +12,7 @@ namespace Composer\Command; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; use Symfony\Component\Console\Input\InputInterface; @@ -33,7 +34,6 @@ protected function configure() ->setAliases(array('dumpautoload')) ->setDescription('Dumps the autoloader.') ->setDefinition(array( - new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('optimize', 'o', InputOption::VALUE_NONE, 'Optimizes PSR0 and PSR4 packages to be loaded with classmaps too, good for production.'), new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize`.'), new InputOption('apcu', null, InputOption::VALUE_NONE, 'Use APCu to cache found/not-found classes.'), @@ -59,7 +59,6 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { $composer = $this->getComposer(); - $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts')); $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'dump-autoload', $input, $output); $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent); @@ -97,7 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $generator->setClassMapAuthoritative($authoritative); $generator->setRunScripts(true); $generator->setApcu($apcu, $apcuPrefix); - $generator->setIgnorePlatformRequirements($ignorePlatformReqs); + $generator->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs)); $numberOfClasses = $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize); if ($authoritative) { diff --git a/core/vendor/composer/composer/src/Composer/Command/FundCommand.php b/core/vendor/composer/composer/src/Composer/Command/FundCommand.php index 00bbca4aff..96c2c25d8e 100644 --- a/core/vendor/composer/composer/src/Composer/Command/FundCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/FundCommand.php @@ -16,6 +16,7 @@ use Composer\Package\AliasPackage; use Composer\Package\BasePackage; use Composer\Package\CompletePackageInterface; +use Composer\Pcre\Preg; use Composer\Repository\CompositeRepository; use Composer\Semver\Constraint\MatchAllConstraint; use Symfony\Component\Console\Input\InputInterface; @@ -132,8 +133,8 @@ protected function execute(InputInterface $input, OutputInterface $output) } /** - * @param array[] $fundings - * @return array[] + * @param mixed[] $fundings + * @return mixed[] */ private function insertFundingData(array $fundings, CompletePackageInterface $package) { @@ -144,7 +145,7 @@ private function insertFundingData(array $fundings, CompletePackageInterface $pa continue; } $url = $fundingOption['url']; - if (!empty($fundingOption['type']) && $fundingOption['type'] === 'github' && preg_match('{^https://github.com/([^/]+)$}', $url, $match)) { + if (!empty($fundingOption['type']) && $fundingOption['type'] === 'github' && Preg::isMatch('{^https://github.com/([^/]+)$}', $url, $match)) { $url = 'https://github.com/sponsors/'.$match[1]; } $fundings[$vendor][$url][] = $packageName; diff --git a/core/vendor/composer/composer/src/Composer/Command/GlobalCommand.php b/core/vendor/composer/composer/src/Composer/Command/GlobalCommand.php index 9fd711fe58..ad629de4bb 100644 --- a/core/vendor/composer/composer/src/Composer/Command/GlobalCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/GlobalCommand.php @@ -13,6 +13,7 @@ namespace Composer\Command; use Composer\Factory; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; use Composer\Util\Platform; use Symfony\Component\Console\Input\InputInterface; @@ -71,7 +72,7 @@ public function run(InputInterface $input, OutputInterface $output) } // extract real command name - $tokens = preg_split('{\s+}', $input->__toString()); + $tokens = Preg::split('{\s+}', $input->__toString()); $args = array(); foreach ($tokens as $token) { if ($token && $token[0] !== '-') { @@ -88,7 +89,7 @@ public function run(InputInterface $input, OutputInterface $output) } // The COMPOSER env var should not apply to the global execution scope - if (getenv('COMPOSER')) { + if (Platform::getEnv('COMPOSER')) { Platform::clearEnv('COMPOSER'); } @@ -112,7 +113,7 @@ public function run(InputInterface $input, OutputInterface $output) $this->getIO()->writeError('<info>Changed current directory to '.$home.'</info>'); // create new input without "global" command prefix - $input = new StringInput(preg_replace('{\bg(?:l(?:o(?:b(?:a(?:l)?)?)?)?)?\b}', '', $input->__toString(), 1)); + $input = new StringInput(Preg::replace('{\bg(?:l(?:o(?:b(?:a(?:l)?)?)?)?)?\b}', '', $input->__toString(), 1)); $this->getApplication()->resetComposer(); return $this->getApplication()->run($input, $output); diff --git a/core/vendor/composer/composer/src/Composer/Command/InitCommand.php b/core/vendor/composer/composer/src/Composer/Command/InitCommand.php index d2e09e0f9b..a5cf0fee4a 100644 --- a/core/vendor/composer/composer/src/Composer/Command/InitCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/InitCommand.php @@ -13,6 +13,8 @@ namespace Composer\Command; use Composer\Factory; +use Composer\Filter\PlatformRequirementFilter\IgnoreAllPlatformRequirementFilter; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; use Composer\Json\JsonFile; use Composer\Json\JsonValidationException; use Composer\Package\BasePackage; @@ -21,6 +23,7 @@ use Composer\Package\PackageInterface; use Composer\Package\Version\VersionParser; use Composer\Package\Version\VersionSelector; +use Composer\Pcre\Preg; use Composer\Repository\CompositeRepository; use Composer\Repository\PlatformRepository; use Composer\Repository\RepositoryFactory; @@ -102,7 +105,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $allowlist = array('name', 'description', 'author', 'type', 'homepage', 'require', 'require-dev', 'stability', 'license', 'autoload'); $options = array_filter(array_intersect_key($input->getOptions(), array_flip($allowlist))); - if (isset($options['name']) && !preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $options['name'])) { + if (isset($options['name']) && !Preg::isMatch('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $options['name'])) { throw new \InvalidArgumentException( 'The package name '.$options['name'].' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+' ); @@ -281,7 +284,7 @@ protected function interact(InputInterface $input, OutputInterface $output) if (!$name = $input->getOption('name')) { $name = basename($cwd); - $name = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $name); + $name = Preg::replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $name); $name = strtolower($name); if (!empty($_SERVER['COMPOSER_DEFAULT_VENDOR'])) { $name = $_SERVER['COMPOSER_DEFAULT_VENDOR'] . '/' . $name; @@ -307,7 +310,7 @@ function ($value) use ($name) { return $name; } - if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $value)) { + if (!Preg::isMatch('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $value)) { throw new \InvalidArgumentException( 'The package name '.$value.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+' ); @@ -450,7 +453,7 @@ function ($value) use ($autoload) { $value = $value ?: $autoload; - if (!preg_match('{^[^/][A-Za-z0-9\-_/]+/$}', $value)) { + if (!Preg::isMatch('{^[^/][A-Za-z0-9\-_/]+/$}', $value)) { throw new \InvalidArgumentException(sprintf( 'The src folder name "%s" is invalid. Please add a relative path with tailing forward slash. [A-Za-z0-9_-/]+/', $value @@ -472,7 +475,7 @@ function ($value) use ($autoload) { */ public function parseAuthorString($author) { - if (preg_match('/^(?P<name>[- .,\p{L}\p{N}\p{Mn}\'’"()]+) <(?P<email>.+?)>$/u', $author, $match)) { + if (Preg::isMatch('/^(?P<name>[- .,\p{L}\p{N}\p{Mn}\'’"()]+) <(?P<email>.+?)>$/u', $author, $match)) { if ($this->isValidEmail($match['email'])) { return array( 'name' => trim($match['name']), @@ -487,15 +490,6 @@ public function parseAuthorString($author) ); } - /** - * @param string $name - * @return list<array{name: string, description: ?string}> - */ - protected function findPackages($name) - { - return $this->getRepos()->search($name); - } - /** * @return CompositeRepository */ @@ -571,7 +565,7 @@ final protected function determineRequirements(InputInterface $input, OutputInte $io = $this->getIO(); while (null !== $package = $io->ask('Search for a package: ')) { - $matches = $this->findPackages($package); + $matches = $this->getRepos()->search($package); if (count($matches)) { // Remove existing packages from search results. @@ -624,7 +618,7 @@ final protected function determineRequirements(InputInterface $input, OutputInte return $package['name']; } - if (preg_match('{^\s*(?P<name>[\S/]+)(?:\s+(?P<version>\S+))?\s*$}', $selection, $packageMatches)) { + if (Preg::isMatch('{^\s*(?P<name>[\S/]+)(?:\s+(?P<version>\S+))?\s*$}', $selection, $packageMatches)) { if (isset($packageMatches['version'])) { // parsing `acme/example ~2.3` @@ -714,7 +708,7 @@ public function namespaceFromPackageName($packageName) $namespace = array_map( function ($part) { - $part = preg_replace('/[^a-z0-9]/i', ' ', $part); + $part = Preg::replace('/[^a-z0-9]/i', ' ', $part); $part = ucwords($part); return str_replace(' ', '', $part); @@ -748,9 +742,9 @@ protected function getGitConfig() if ($cmd->isSuccessful()) { $this->gitConfig = array(); - preg_match_all('{^([^=]+)=(.*)$}m', $cmd->getOutput(), $matches, PREG_SET_ORDER); - foreach ($matches as $match) { - $this->gitConfig[$match[1]] = $match[2]; + Preg::matchAll('{^([^=]+)=(.*)$}m', $cmd->getOutput(), $matches); + foreach ($matches[1] as $key => $match) { + $this->gitConfig[$match] = $matches[2][$key]; } return $this->gitConfig; @@ -785,7 +779,7 @@ protected function hasVendorIgnore($ignoreFile, $vendor = 'vendor') $lines = file($ignoreFile, FILE_IGNORE_NEW_LINES); foreach ($lines as $line) { - if (preg_match($pattern, $line)) { + if (Preg::isMatch($pattern, $line)) { return true; } } @@ -890,22 +884,23 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, if ($input->hasOption('ignore-platform-reqs') && $input->hasOption('ignore-platform-req')) { $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false); } + $platformRequirementFilter = PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs); // find the latest version allowed in this repo set $versionSelector = new VersionSelector($this->getRepositorySet($input, $minimumStability), $platformRepo); $effectiveMinimumStability = $minimumStability ?: $this->getMinimumStability($input); - $package = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $ignorePlatformReqs); + $package = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $platformRequirementFilter); if (!$package) { // platform packages can not be found in the pool in versions other than the local platform's has // so if platform reqs are ignored we just take the user's word for it - if ((true === $ignorePlatformReqs || (is_array($ignorePlatformReqs) && in_array($name, $ignorePlatformReqs))) && PlatformRepository::isPlatformPackage($name)) { + if ($platformRequirementFilter->isIgnored($name)) { return array($name, $requiredVersion ?: '*'); } // Check whether the package requirements were the problem - if (true !== $ignorePlatformReqs && ($candidate = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, true))) { + if (!($platformRequirementFilter instanceof IgnoreAllPlatformRequirementFilter) && ($candidate = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, PlatformRequirementFilterFactory::ignoreAll()))) { throw new \InvalidArgumentException(sprintf( 'Package %s%s has requirements incompatible with your PHP version, PHP extensions and Composer version' . $this->getPlatformExceptionDetails($candidate, $platformRepo), $name, @@ -913,11 +908,11 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, )); } // Check whether the minimum stability was the problem but the package exists - if ($package = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $ignorePlatformReqs, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES)) { + if ($package = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $platformRequirementFilter, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES)) { // we must first verify if a valid package would be found in a lower priority repository - if ($allReposPackage = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $ignorePlatformReqs, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) { + if ($allReposPackage = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $platformRequirementFilter, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) { throw new \InvalidArgumentException( - 'Package '.$name.' exists in '.$allReposPackage->getRepository()->getRepoName().' and '.$package->getRepository()->getRepoName().' which has a higher repository priority. The packages with higher priority do not match your minimum-stability and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.' + 'Package '.$name.' exists in '.$allReposPackage->getRepository()->getRepoName().' and '.$package->getRepository()->getRepoName().' which has a higher repository priority. The packages from the higher priority repository do not match your minimum-stability and are therefore not installable. That repository is canonical so the lower priority repo\'s packages are not installable. See https://getcomposer.org/repoprio for details and assistance.' ); } @@ -928,11 +923,11 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, )); } // Check whether the required version was the problem - if ($requiredVersion && $package = $versionSelector->findBestCandidate($name, null, $preferredStability, $ignorePlatformReqs)) { + if ($requiredVersion && $package = $versionSelector->findBestCandidate($name, null, $preferredStability, $platformRequirementFilter)) { // we must first verify if a valid package would be found in a lower priority repository - if ($allReposPackage = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, false, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) { + if ($allReposPackage = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, PlatformRequirementFilterFactory::ignoreNothing(), RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) { throw new \InvalidArgumentException( - 'Package '.$name.' exists in '.$allReposPackage->getRepository()->getRepoName().' and '.$package->getRepository()->getRepoName().' which has a higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.' + 'Package '.$name.' exists in '.$allReposPackage->getRepository()->getRepoName().' and '.$package->getRepository()->getRepoName().' which has a higher repository priority. The packages from the higher priority repository do not match your constraint and are therefore not installable. That repository is canonical so the lower priority repo\'s packages are not installable. See https://getcomposer.org/repoprio for details and assistance.' ); } @@ -943,9 +938,9 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, )); } // Check whether the PHP version was the problem for all versions - if (true !== $ignorePlatformReqs && ($candidate = $versionSelector->findBestCandidate($name, null, $preferredStability, true, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES))) { + if (!($platformRequirementFilter instanceof IgnoreAllPlatformRequirementFilter) && ($candidate = $versionSelector->findBestCandidate($name, null, $preferredStability, PlatformRequirementFilterFactory::ignoreAll(), RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES))) { $additional = ''; - if (false === $versionSelector->findBestCandidate($name, null, $preferredStability, true)) { + if (false === $versionSelector->findBestCandidate($name, null, $preferredStability, PlatformRequirementFilterFactory::ignoreAll())) { $additional = PHP_EOL.PHP_EOL.'Additionally, the package was only found with a stability of "'.$candidate->getStability().'" while your minimum stability is "'.$effectiveMinimumStability.'".'; } @@ -1002,7 +997,11 @@ private function getPlatformExceptionDetails(PackageInterface $candidate, Platfo } $platformPkg = $platformRepo->findPackage($link->getTarget(), '*'); if (!$platformPkg) { - $details[] = $candidate->getPrettyName().' '.$candidate->getPrettyVersion().' requires '.$link->getTarget().' '.$link->getPrettyConstraint().' but it is not present.'; + if ($platformRepo->isPlatformPackageDisabled($link->getTarget())) { + $details[] = $candidate->getPrettyName().' '.$candidate->getPrettyVersion().' requires '.$link->getTarget().' '.$link->getPrettyConstraint().' but it is disabled by your platform config. Enable it again with "composer config platform.'.$link->getTarget().' --unset".'; + } else { + $details[] = $candidate->getPrettyName().' '.$candidate->getPrettyVersion().' requires '.$link->getTarget().' '.$link->getPrettyConstraint().' but it is not present.'; + } continue; } if (!$link->getConstraint()->matches(new Constraint('==', $platformPkg->getVersion()))) { diff --git a/core/vendor/composer/composer/src/Composer/Command/InstallCommand.php b/core/vendor/composer/composer/src/Composer/Command/InstallCommand.php index 583fc33a1d..5d1d018365 100644 --- a/core/vendor/composer/composer/src/Composer/Command/InstallCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/InstallCommand.php @@ -12,6 +12,7 @@ namespace Composer\Command; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; use Composer\Installer; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; @@ -47,7 +48,6 @@ protected function configure() new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'DEPRECATED: This flag does not exist anymore.'), new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'), new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'), - new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-install', null, InputOption::VALUE_NONE, 'Do not use, only defined here to catch misuse of the install command.'), new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'), @@ -96,8 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output) return 1; } - $composer = $this->getComposer(true, $input->getOption('no-plugins')); - $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts')); + $composer = $this->getComposer(true, $input->getOption('no-plugins'), $input->getOption('no-scripts')); if ((!$composer->getLocker() || !$composer->getLocker()->isLocked()) && !HttpDownloader::isCurlEnabled()) { $io->writeError('<warning>Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.</warning>'); @@ -130,7 +129,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ->setOptimizeAutoloader($optimize) ->setClassMapAuthoritative($authoritative) ->setApcuAutoloader($apcu, $apcuPrefix) - ->setIgnorePlatformRequirements($ignorePlatformReqs) + ->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs)) ; if ($input->getOption('no-plugins')) { diff --git a/core/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php b/core/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php index 0b38f2f0ea..503541584f 100644 --- a/core/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/OutdatedCommand.php @@ -42,6 +42,8 @@ protected function configure() new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'), new InputOption('ignore', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore specified package(s). Use it with the --outdated option if you don\'t want to be informed about new versions of some packages.'), new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables search in require-dev packages.'), + new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages). Use with the --outdated option'), + new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages). Use with the --outdated option'), )) ->setHelp( <<<EOT @@ -88,6 +90,12 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($input->getOption('no-dev')) { $args['--no-dev'] = true; } + if ($input->getOption('ignore-platform-req')) { + $args['--ignore-platform-req'] = $input->getOption('ignore-platform-req'); + } + if ($input->getOption('ignore-platform-reqs')) { + $args['--ignore-platform-reqs'] = true; + } $args['--format'] = $input->getOption('format'); $args['--ignore'] = $input->getOption('ignore'); diff --git a/core/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php b/core/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php index 94da95f1d6..7a1160743e 100644 --- a/core/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/ReinstallCommand.php @@ -15,10 +15,14 @@ use Composer\DependencyResolver\Operation\InstallOperation; use Composer\DependencyResolver\Operation\UninstallOperation; use Composer\DependencyResolver\Transaction; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; use Composer\Package\AliasPackage; use Composer\Package\BasePackage; +use Composer\Pcre\Preg; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; +use Composer\Script\ScriptEvents; +use Composer\Util\Platform; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; @@ -42,7 +46,6 @@ protected function configure() new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist (default behavior).'), new InputOption('prefer-install', null, InputOption::VALUE_REQUIRED, 'Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest).'), new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'), - new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump'), new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'), @@ -71,8 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $io = $this->getIO(); - $composer = $this->getComposer(true, $input->getOption('no-plugins')); - $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts')); + $composer = $this->getComposer(true, $input->getOption('no-plugins'), $input->getOption('no-scripts')); $localRepo = $composer->getRepositoryManager()->getLocalRepository(); $packagesToReinstall = array(); @@ -81,7 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $patternRegexp = BasePackage::packageNameToRegexp($pattern); $matched = false; foreach ($localRepo->getCanonicalPackages() as $package) { - if (preg_match($patternRegexp, $package->getName())) { + if (Preg::isMatch($patternRegexp, $package->getName())) { $matched = true; $packagesToReinstall[] = $package; $packageNamesToReinstall[] = $package->getName(); @@ -127,7 +129,8 @@ protected function execute(InputInterface $input, OutputInterface $output) }); $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'reinstall', $input, $output); - $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent); + $eventDispatcher = $composer->getEventDispatcher(); + $eventDispatcher->dispatch($commandEvent->getName(), $commandEvent); $config = $composer->getConfig(); list($preferSource, $preferDist) = $this->getPreferredInstallOptions($config, $input); @@ -146,8 +149,13 @@ protected function execute(InputInterface $input, OutputInterface $output) $downloadManager->setPreferSource($preferSource); $downloadManager->setPreferDist($preferDist); - $installationManager->execute($localRepo, $uninstallOperations, true); - $installationManager->execute($localRepo, $installOperations, true); + $devMode = $localRepo->getDevMode() !== null ? $localRepo->getDevMode() : true; + + Platform::putEnv('COMPOSER_DEV_MODE', $devMode ? '1' : '0'); + $eventDispatcher->dispatchScript(ScriptEvents::PRE_INSTALL_CMD, $devMode); + + $installationManager->execute($localRepo, $uninstallOperations, $devMode); + $installationManager->execute($localRepo, $installOperations, $devMode); if (!$input->getOption('no-autoloader')) { $optimize = $input->getOption('optimize-autoloader') || $config->get('optimize-autoloader'); @@ -158,10 +166,12 @@ protected function execute(InputInterface $input, OutputInterface $output) $generator = $composer->getAutoloadGenerator(); $generator->setClassMapAuthoritative($authoritative); $generator->setApcu($apcu, $apcuPrefix); - $generator->setIgnorePlatformRequirements($ignorePlatformReqs); + $generator->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs)); $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize); } + $eventDispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, $devMode); + return 0; } } diff --git a/core/vendor/composer/composer/src/Composer/Command/RemoveCommand.php b/core/vendor/composer/composer/src/Composer/Command/RemoveCommand.php index 926500c094..7705e3f0ad 100644 --- a/core/vendor/composer/composer/src/Composer/Command/RemoveCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/RemoveCommand.php @@ -14,7 +14,9 @@ use Composer\Config\JsonConfigSource; use Composer\DependencyResolver\Request; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; use Composer\Installer; +use Composer\Pcre\Preg; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; use Composer\Json\JsonFile; @@ -46,7 +48,6 @@ protected function configure() new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies (implies --no-install).'), new InputOption('no-install', null, InputOption::VALUE_NONE, 'Skip the install step after updating the composer.lock file.'), - new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'), new InputOption('update-with-dependencies', 'w', InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated with explicit dependencies. (Deprecrated, is now default behavior)'), new InputOption('update-with-all-dependencies', 'W', InputOption::VALUE_NONE, 'Allows all inherited dependencies to be updated, including those that are root requirements.'), @@ -177,7 +178,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } } } - } elseif (isset($composer[$type]) && $matches = preg_grep(BasePackage::packageNameToRegexp($package), array_keys($composer[$type]))) { + } elseif (isset($composer[$type]) && $matches = Preg::grep(BasePackage::packageNameToRegexp($package), array_keys($composer[$type]))) { foreach ($matches as $matchedPackage) { if ($dryRun) { $toRemove[$type][] = $matchedPackage; @@ -185,7 +186,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $json->removeLink($type, $matchedPackage); } } - } elseif (isset($composer[$altType]) && $matches = preg_grep(BasePackage::packageNameToRegexp($package), array_keys($composer[$altType]))) { + } elseif (isset($composer[$altType]) && $matches = Preg::grep(BasePackage::packageNameToRegexp($package), array_keys($composer[$altType]))) { foreach ($matches as $matchedPackage) { $io->writeError('<warning>' . $matchedPackage . ' could not be found in ' . $type . ' but it is present in ' . $altType . '</warning>'); if ($io->isInteractive()) { @@ -209,10 +210,13 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } + if ($composer = $this->getComposer(false)) { + $composer->getPluginManager()->deactivateInstalledPlugins(); + } + // Update packages $this->resetComposer(); - $composer = $this->getComposer(true, $input->getOption('no-plugins')); - $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts')); + $composer = $this->getComposer(true, $input->getOption('no-plugins'), $input->getOption('no-scripts')); if ($dryRun) { $rootPackage = $composer->getPackage(); @@ -265,7 +269,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ->setUpdate(true) ->setInstall(!$input->getOption('no-install')) ->setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies) - ->setIgnorePlatformRequirements($ignorePlatformReqs) + ->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs)) ->setDryRun($dryRun) ; diff --git a/core/vendor/composer/composer/src/Composer/Command/RequireCommand.php b/core/vendor/composer/composer/src/Composer/Command/RequireCommand.php index c629af5db8..92fc2114a0 100644 --- a/core/vendor/composer/composer/src/Composer/Command/RequireCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/RequireCommand.php @@ -13,6 +13,7 @@ namespace Composer\Command; use Composer\DependencyResolver\Request; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; use Composer\Util\Filesystem; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputArgument; @@ -76,7 +77,6 @@ protected function configure() new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies (implies --no-install).'), new InputOption('no-install', null, InputOption::VALUE_NONE, 'Skip the install step after updating the composer.lock file.'), - new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'), new InputOption('update-with-dependencies', 'w', InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated, except those that are root requirements.'), new InputOption('update-with-all-dependencies', 'W', InputOption::VALUE_NONE, 'Allows all inherited dependencies to be updated, including those that are root requirements.'), @@ -205,6 +205,8 @@ protected function execute(InputInterface $input, OutputInterface $output) ); } catch (\Exception $e) { if ($this->newlyCreated) { + $this->revertComposerFile(false); + throw new \RuntimeException('No composer.json present in the current directory ('.$this->file.'), this may be the cause of the following exception.', 0, $e); } @@ -277,6 +279,8 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } + $composer->getPluginManager()->deactivateInstalledPlugins(); + try { return $this->doUpdate($input, $output, $io, $requirements, $requireKey, $removeKey); } catch (\Exception $e) { @@ -351,8 +355,7 @@ private function doUpdate(InputInterface $input, OutputInterface $output, IOInte { // Update packages $this->resetComposer(); - $composer = $this->getComposer(true, $input->getOption('no-plugins')); - $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts')); + $composer = $this->getComposer(true, $input->getOption('no-plugins'), $input->getOption('no-scripts')); $this->dependencyResolutionCompleted = false; $composer->getEventDispatcher()->addListener(InstallerEvents::PRE_OPERATIONS_EXEC, array($this, 'markSolverComplete'), 10000); @@ -413,7 +416,7 @@ private function doUpdate(InputInterface $input, OutputInterface $output, IOInte ->setUpdate(true) ->setInstall(!$input->getOption('no-install')) ->setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies) - ->setIgnorePlatformRequirements($ignorePlatformReqs) + ->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs)) ->setPreferStable($input->getOption('prefer-stable')) ->setPreferLowest($input->getOption('prefer-lowest')) ; diff --git a/core/vendor/composer/composer/src/Composer/Command/SearchCommand.php b/core/vendor/composer/composer/src/Composer/Command/SearchCommand.php index a4e63198b7..285fd4221c 100644 --- a/core/vendor/composer/composer/src/Composer/Command/SearchCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/SearchCommand.php @@ -38,7 +38,8 @@ protected function configure() ->setName('search') ->setDescription('Searches for packages.') ->setDefinition(array( - new InputOption('only-name', 'N', InputOption::VALUE_NONE, 'Search only in name'), + new InputOption('only-name', 'N', InputOption::VALUE_NONE, 'Search only in package names'), + new InputOption('only-vendor', 'O', InputOption::VALUE_NONE, 'Search only for vendor / organization names, returns only "vendor" as result'), new InputOption('type', 't', InputOption::VALUE_REQUIRED, 'Search for a specific package type'), new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'), new InputArgument('tokens', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'tokens to search for'), @@ -77,11 +78,24 @@ protected function execute(InputInterface $input, OutputInterface $output) $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'search', $input, $output); $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent); - $onlyName = $input->getOption('only-name'); - $type = $input->getOption('type') ?: null; + $mode = RepositoryInterface::SEARCH_FULLTEXT; + if ($input->getOption('only-name') === true) { + if ($input->getOption('only-vendor') === true) { + throw new \InvalidArgumentException('--only-name and --only-vendor cannot be used together'); + } + $mode = RepositoryInterface::SEARCH_NAME; + } elseif ($input->getOption('only-vendor') === true) { + $mode = RepositoryInterface::SEARCH_VENDOR; + } + + $type = $input->getOption('type'); + + $query = implode(' ', $input->getArgument('tokens')); + if ($mode !== RepositoryInterface::SEARCH_FULLTEXT) { + $query = preg_quote($query); + } - $flags = $onlyName ? RepositoryInterface::SEARCH_NAME : RepositoryInterface::SEARCH_FULLTEXT; - $results = $repos->search(implode(' ', $input->getArgument('tokens')), $flags, $type); + $results = $repos->search($query, $mode, $type); if ($results && $format === 'text') { $width = $this->getTerminalWidth(); @@ -93,12 +107,13 @@ protected function execute(InputInterface $input, OutputInterface $output) $nameLength += 1; foreach ($results as $result) { $description = isset($result['description']) ? $result['description'] : ''; - $remaining = $width - $nameLength - 2; + $warning = !empty($result['abandoned']) ? '<warning>! Abandoned !</warning> ' : ''; + $remaining = $width - $nameLength - strlen($warning) - 2; if (strlen($description) > $remaining) { $description = substr($description, 0, $remaining - 3) . '...'; } - $io->write(str_pad($result['name'], $nameLength, ' ') . $description); + $io->write(str_pad($result['name'], $nameLength, ' ') . $warning . $description); } } elseif ($format === 'json') { $io->write(JsonFile::encode($results)); diff --git a/core/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php b/core/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php index 360442a1c1..daf1b55ff3 100644 --- a/core/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php @@ -15,6 +15,7 @@ use Composer\Composer; use Composer\Factory; use Composer\Config; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; use Composer\Util\Platform; use Composer\SelfUpdate\Keys; @@ -157,9 +158,9 @@ class_exists('Composer\Downloader\FilesystemException'); } $latestVersion = $latest['version']; $updateVersion = $input->getArgument('version') ?: $latestVersion; - $currentMajorVersion = preg_replace('{^(\d+).*}', '$1', Composer::getVersion()); - $updateMajorVersion = preg_replace('{^(\d+).*}', '$1', $updateVersion); - $previewMajorVersion = preg_replace('{^(\d+).*}', '$1', $latestPreview['version']); + $currentMajorVersion = Preg::replace('{^(\d+).*}', '$1', Composer::getVersion()); + $updateMajorVersion = Preg::replace('{^(\d+).*}', '$1', $updateVersion); + $previewMajorVersion = Preg::replace('{^(\d+).*}', '$1', $latestPreview['version']); if ($versionsUtil->getChannel() === 'stable' && !$input->getArgument('version')) { // if requesting stable channel and no specific version, avoid automatically upgrading to the next major @@ -185,7 +186,7 @@ class_exists('Composer\Downloader\FilesystemException'); $io->writeError('<warning>Warning: You forced the install of '.$latestVersion.' via --'.$requestedChannel.', but '.$latestStable['version'].' is the latest stable version. Updating to it via composer self-update --stable is recommended.</warning>'); } - if (preg_match('{^[0-9a-f]{40}$}', $updateVersion) && $updateVersion !== $latestVersion) { + if (Preg::isMatch('{^[0-9a-f]{40}$}', $updateVersion) && $updateVersion !== $latestVersion) { $io->writeError('<error>You can not update to a specific SHA-1 as those phars are not available for download</error>'); return 1; @@ -218,11 +219,11 @@ class_exists('Composer\Downloader\FilesystemException'); '%s/%s-%s%s', $rollbackDir, strtr(Composer::RELEASE_DATE, ' :', '_-'), - preg_replace('{^([0-9a-f]{7})[0-9a-f]{33}$}', '$1', Composer::VERSION), + Preg::replace('{^([0-9a-f]{7})[0-9a-f]{33}$}', '$1', Composer::VERSION), self::OLD_INSTALL_EXT ); - $updatingToTag = !preg_match('{^[0-9a-f]{40}$}', $updateVersion); + $updatingToTag = !Preg::isMatch('{^[0-9a-f]{40}$}', $updateVersion); $io->write(sprintf("Upgrading to version <info>%s</info> (%s channel).", $updateVersion, $channelString)); $remoteFilename = $baseUrl . ($updatingToTag ? "/download/{$updateVersion}/composer.phar" : '/composer.phar'); @@ -351,7 +352,7 @@ protected function fetchKeys(IOInterface $io, Config $config) $io->write('Open <info>https://composer.github.io/pubkeys.html</info> to find the latest keys'); $validator = function ($value) { - if (!preg_match('{^-----BEGIN PUBLIC KEY-----$}', trim($value))) { + if (!Preg::isMatch('{^-----BEGIN PUBLIC KEY-----$}', trim($value))) { throw new \UnexpectedValueException('Invalid input'); } @@ -359,7 +360,7 @@ protected function fetchKeys(IOInterface $io, Config $config) }; $devKey = ''; - while (!preg_match('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $devKey, $match)) { + while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $devKey, $match)) { $devKey = $io->askAndValidate('Enter Dev / Snapshot Public Key (including lines with -----): ', $validator); while ($line = $io->ask('')) { $devKey .= trim($line)."\n"; @@ -372,7 +373,7 @@ protected function fetchKeys(IOInterface $io, Config $config) $io->write('Stored key with fingerprint: ' . Keys::fingerprint($keyPath)); $tagsKey = ''; - while (!preg_match('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $tagsKey, $match)) { + while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $tagsKey, $match)) { $tagsKey = $io->askAndValidate('Enter Tags Public Key (including lines with -----): ', $validator); while ($line = $io->ask('')) { $tagsKey .= trim($line)."\n"; @@ -467,6 +468,7 @@ protected function setLocalPhar($localFilename, $newFilename, $backupTarget = nu return $this->tryAsWindowsAdmin($localFilename, $newFilename); } + @unlink($newFilename); $action = 'Composer '.($backupTarget ? 'update' : 'rollback'); throw new FilesystemException($action.' failed: "'.$localFilename.'" could not be written.'.PHP_EOL.$e->getMessage()); } @@ -619,7 +621,7 @@ protected function tryAsWindowsAdmin($localFilename, $newFilename) exec('"'.$script.'"'); @unlink($script); - // see if the file was moved and is still accessible + // see if the file was copied and is still accessible if ($result = Filesystem::isReadable($localFilename) && (hash_file('sha256', $localFilename) === $checksum)) { $io->writeError('<info>Operation succeeded.</info>'); @unlink($newFilename); diff --git a/core/vendor/composer/composer/src/Composer/Command/ShowCommand.php b/core/vendor/composer/composer/src/Composer/Command/ShowCommand.php index ea9c1dac81..6df57e08c7 100644 --- a/core/vendor/composer/composer/src/Composer/Command/ShowCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/ShowCommand.php @@ -14,14 +14,17 @@ use Composer\Composer; use Composer\DependencyResolver\DefaultPolicy; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; use Composer\Json\JsonFile; use Composer\Package\BasePackage; use Composer\Package\CompletePackageInterface; use Composer\Package\Link; use Composer\Package\AliasPackage; +use Composer\Package\Package; use Composer\Package\PackageInterface; use Composer\Package\Version\VersionParser; use Composer\Package\Version\VersionSelector; +use Composer\Pcre\Preg; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; use Composer\Repository\InstalledArrayRepository; @@ -88,6 +91,8 @@ protected function configure() new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code when there are outdated packages'), new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'), new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables search in require-dev packages.'), + new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages). Use with the --outdated option'), + new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages). Use with the --outdated option'), )) ->setHelp( <<<EOT @@ -151,6 +156,8 @@ protected function execute(InputInterface $input, OutputInterface $output) return 1; } + $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false); + // init repos $platformOverrides = array(); if ($composer) { @@ -240,16 +247,21 @@ protected function execute(InputInterface $input, OutputInterface $output) if (empty($package)) { $options = $input->getOptions(); - if (!isset($options['working-dir']) || !file_exists('composer.json')) { - if (PlatformRepository::isPlatformPackage($input->getArgument('package')) && !$input->getOption('platform')) { - throw new \InvalidArgumentException('Package ' . $packageFilter . ' not found, try using --platform (-p) to show platform packages.'); - } - throw new \InvalidArgumentException('Package ' . $packageFilter . ' not found'); + $hint = ''; + if ($input->getOption('locked')) { + $hint .= ' in lock file'; + } + if (isset($options['working-dir'])) { + $hint .= ' in ' . $options['working-dir'] . '/composer.json'; + } + if (PlatformRepository::isPlatformPackage($input->getArgument('package')) && !$input->getOption('platform')) { + $hint .= ', try using --platform (-p) to show platform packages'; + } + if (!$input->getOption('all')) { + $hint .= ', try using --all (-a) to show all available packages'; } - $io->writeError('Package ' . $packageFilter . ' not found in ' . $options['working-dir'] . '/composer.json'); - - return 1; + throw new \InvalidArgumentException('Package "' . $packageFilter . '" not found'.$hint.'.'); } } else { $versions = array($package->getPrettyVersion() => $package->getVersion()); @@ -267,7 +279,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } else { $latestPackage = null; if ($input->getOption('latest')) { - $latestPackage = $this->findLatestPackage($package, $composer, $platformRepo, $input->getOption('minor-only')); + $latestPackage = $this->findLatestPackage($package, $composer, $platformRepo, $input->getOption('minor-only'), $ignorePlatformReqs); } if ( $input->getOption('outdated') @@ -299,7 +311,9 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($input->getOption('tree')) { $rootRequires = $this->getRootRequires(); $packages = $installedRepo->getPackages(); - usort($packages, 'strcmp'); + usort($packages, function (BasePackage $a, BasePackage $b) { + return strcmp((string) $a, (string) $b); + }); $arrayTree = array(); foreach ($packages as $package) { if (in_array($package->getName(), $rootRequires, true)) { @@ -356,13 +370,18 @@ protected function execute(InputInterface $input, OutputInterface $output) while ($package instanceof AliasPackage) { $package = $package->getAliasOf(); } - if (!$packageFilterRegex || preg_match($packageFilterRegex, $package->getName())) { + if (!$packageFilterRegex || Preg::isMatch($packageFilterRegex, $package->getName())) { if (!$packageListFilter || in_array($package->getName(), $packageListFilter, true)) { $packages[$type][$package->getName()] = $package; } } } } + if ($repo === $platformRepo) { + foreach ($platformRepo->getDisabledPackages() as $name => $package) { + $packages[$type][$name] = $package; + } + } } } @@ -385,7 +404,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($showLatest && $showVersion) { foreach ($packages[$type] as $package) { if (is_object($package)) { - $latestPackage = $this->findLatestPackage($package, $composer, $platformRepo, $showMinorOnly); + $latestPackage = $this->findLatestPackage($package, $composer, $platformRepo, $showMinorOnly, $ignorePlatformReqs); if ($latestPackage === false) { continue; } @@ -704,7 +723,8 @@ protected function printMeta(CompletePackageInterface $package, array $versions, if ($package->getAutoload()) { $io->write("\n<info>autoload</info>"); - foreach ($package->getAutoload() as $type => $autoloads) { + $autoloadConfig = $package->getAutoload(); + foreach ($autoloadConfig as $type => $autoloads) { $io->write('<comment>' . $type . '</comment>'); if ($type === 'psr-0' || $type === 'psr-4') { @@ -712,7 +732,7 @@ protected function printMeta(CompletePackageInterface $package, array $versions, $io->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.'))); } } elseif ($type === 'classmap') { - $io->write(implode(', ', $autoloads)); + $io->write(implode(', ', $autoloadConfig[$type])); } } if ($package->getIncludePaths()) { @@ -1005,7 +1025,7 @@ protected function initStyles(OutputInterface $output) /** * Display the tree * - * @param array<int, array<string, string|array>> $arrayTree + * @param array<int, array<string, string|mixed[]>> $arrayTree * @return void */ protected function displayPackageTree(array $arrayTree) @@ -1051,7 +1071,7 @@ protected function displayPackageTree(array $arrayTree) /** * Generate the package tree * - * @return array<string, array<int, array<string, array|string>>|string|null> + * @return array<string, array<int, array<string, mixed[]|string>>|string|null> */ protected function generatePackageTree( PackageInterface $package, @@ -1093,8 +1113,8 @@ protected function generatePackageTree( /** * Display a package tree * - * @param array<string, array<int, array<string, array|string>>|string|null>|string $package - * @param array<int, string|array> $packagesInTree + * @param array<string, array<int, array<string, mixed[]|string>>|string|null>|string $package + * @param array<int, string|mixed[]> $packagesInTree * @param string $previousTreeBar * @param int $level * @@ -1245,10 +1265,11 @@ private function writeTreeLine($line) * Given a package, this finds the latest package matching it * * @param bool $minorOnly + * @param bool|string $ignorePlatformReqs * * @return PackageInterface|false */ - private function findLatestPackage(PackageInterface $package, Composer $composer, PlatformRepository $platformRepo, $minorOnly = false) + private function findLatestPackage(PackageInterface $package, Composer $composer, PlatformRepository $platformRepo, $minorOnly = false, $ignorePlatformReqs = false) { // find the latest version allowed in this repo set $name = $package->getName(); @@ -1273,7 +1294,7 @@ private function findLatestPackage(PackageInterface $package, Composer $composer $targetVersion = '^' . $package->getVersion(); } - $candidate = $versionSelector->findBestCandidate($name, $targetVersion, $bestStability); + $candidate = $versionSelector->findBestCandidate($name, $targetVersion, $bestStability, PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs)); while ($candidate instanceof AliasPackage) { $candidate = $candidate->getAliasOf(); } diff --git a/core/vendor/composer/composer/src/Composer/Command/UpdateCommand.php b/core/vendor/composer/composer/src/Composer/Command/UpdateCommand.php index 84c99ffd79..9b752a2188 100644 --- a/core/vendor/composer/composer/src/Composer/Command/UpdateCommand.php +++ b/core/vendor/composer/composer/src/Composer/Command/UpdateCommand.php @@ -14,9 +14,11 @@ use Composer\Composer; use Composer\DependencyResolver\Request; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; use Composer\Installer; use Composer\IO\IOInterface; use Composer\Package\Loader\RootPackageLoader; +use Composer\Pcre\Preg; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; use Composer\Package\Version\VersionParser; @@ -57,7 +59,6 @@ protected function configure() new InputOption('lock', null, InputOption::VALUE_NONE, 'Overwrites the lock file hash to suppress warning about the lock file being out of date without updating package versions. Package metadata like mirrors and URLs are updated if they changed.'), new InputOption('no-install', null, InputOption::VALUE_NONE, 'Skip the install step after updating the composer.lock file.'), new InputOption('no-autoloader', null, InputOption::VALUE_NONE, 'Skips autoloader generation'), - new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'DEPRECATED: This flag does not exist anymore.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('with-dependencies', 'w', InputOption::VALUE_NONE, 'Update also dependencies of packages in the argument list, except those which are root requirements.'), @@ -122,8 +123,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $io->writeError('<warning>You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.</warning>'); } - $composer = $this->getComposer(true, $input->getOption('no-plugins')); - $composer->getEventDispatcher()->setRunScripts(!$input->getOption('no-scripts')); + $composer = $this->getComposer(true, $input->getOption('no-plugins'), $input->getOption('no-scripts')); if (!HttpDownloader::isCurlEnabled()) { $io->writeError('<warning>Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.</warning>'); @@ -135,7 +135,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // extract --with shorthands from the allowlist if ($packages) { $allowlistPackagesWithRequirements = array_filter($packages, function ($pkg) { - return preg_match('{\S+[ =:]\S+}', $pkg) > 0; + return Preg::isMatch('{\S+[ =:]\S+}', $pkg); }); foreach ($this->formatRequirements($allowlistPackagesWithRequirements) as $package => $constraint) { $reqs[$package] = $constraint; @@ -143,7 +143,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // replace the foo/bar:req by foo/bar in the allowlist foreach ($allowlistPackagesWithRequirements as $package) { - $packageName = preg_replace('{^([^ =:]+)[ =:].*$}', '$1', $package); + $packageName = Preg::replace('{^([^ =:]+)[ =:].*$}', '$1', $package); $index = array_search($package, $packages); $packages[$index] = $packageName; } @@ -236,7 +236,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ->setUpdateMirrors($updateMirrors) ->setUpdateAllowList($packages) ->setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies) - ->setIgnorePlatformRequirements($ignorePlatformReqs) + ->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs)) ->setPreferStable($input->getOption('prefer-stable')) ->setPreferLowest($input->getOption('prefer-lowest')) ; diff --git a/core/vendor/composer/composer/src/Composer/Compiler.php b/core/vendor/composer/composer/src/Composer/Compiler.php index cd27a5f72e..622965076e 100644 --- a/core/vendor/composer/composer/src/Composer/Compiler.php +++ b/core/vendor/composer/composer/src/Composer/Compiler.php @@ -14,6 +14,7 @@ use Composer\Json\JsonFile; use Composer\CaBundle\CaBundle; +use Composer\Pcre\Preg; use Symfony\Component\Finder\Finder; use Symfony\Component\Process\Process; use Seld\PharUtils\Timestamps; @@ -161,11 +162,11 @@ public function compile($pharFile = 'composer.phar') foreach ($finder as $file) { if (in_array(realpath($file), $extraFiles, true)) { unset($extraFiles[array_search(realpath($file), $extraFiles, true)]); - } elseif (!preg_match('{([/\\\\]LICENSE|\.php)$}', $file)) { + } elseif (!Preg::isMatch('{([/\\\\]LICENSE|\.php)$}', $file)) { $unexpectedFiles[] = (string) $file; } - if (preg_match('{\.php[\d.]*$}', $file)) { + if (Preg::isMatch('{\.php[\d.]*$}', $file)) { $this->addFile($phar, $file); } else { $this->addFile($phar, $file, false); @@ -241,7 +242,7 @@ private function addFile(\Phar $phar, \SplFileInfo $file, $strip = true) '@release_date@' => $this->versionDate->format('Y-m-d H:i:s'), ) ); - $content = preg_replace('{SOURCE_VERSION = \'[^\']+\';}', 'SOURCE_VERSION = \'\';', $content); + $content = Preg::replace('{SOURCE_VERSION = \'[^\']+\';}', 'SOURCE_VERSION = \'\';', $content); } $phar->addFromString($path, $content); @@ -253,7 +254,7 @@ private function addFile(\Phar $phar, \SplFileInfo $file, $strip = true) private function addComposerBin(\Phar $phar) { $content = file_get_contents(__DIR__.'/../../bin/composer'); - $content = preg_replace('{^#!/usr/bin/env php\s*}', '', $content); + $content = Preg::replace('{^#!/usr/bin/env php\s*}', '', $content); $phar->addFromString('bin/composer', $content); } @@ -277,11 +278,11 @@ private function stripWhitespace($source) $output .= str_repeat("\n", substr_count($token[1], "\n")); } elseif (T_WHITESPACE === $token[0]) { // reduce wide spaces - $whitespace = preg_replace('{[ \t]+}', ' ', $token[1]); + $whitespace = Preg::replace('{[ \t]+}', ' ', $token[1]); // normalize newlines to \n - $whitespace = preg_replace('{(?:\r\n|\r|\n)}', "\n", $whitespace); + $whitespace = Preg::replace('{(?:\r\n|\r|\n)}', "\n", $whitespace); // trim leading spaces - $whitespace = preg_replace('{\n +}', "\n", $whitespace); + $whitespace = Preg::replace('{\n +}', "\n", $whitespace); $output .= $whitespace; } else { $output .= $token[1]; @@ -329,7 +330,7 @@ private function getStub() EOF; // add warning once the phar is older than 60 days - if (preg_match('{^[a-f0-9]+$}', $this->version)) { + if (Preg::isMatch('{^[a-f0-9]+$}', $this->version)) { $warningTime = ((int) $this->versionDate->format('U')) + 60 * 86400; $stub .= "define('COMPOSER_DEV_WARNING_TIME', $warningTime);\n"; } diff --git a/core/vendor/composer/composer/src/Composer/Composer.php b/core/vendor/composer/composer/src/Composer/Composer.php index 62bbc9b31f..8c74a689a5 100644 --- a/core/vendor/composer/composer/src/Composer/Composer.php +++ b/core/vendor/composer/composer/src/Composer/Composer.php @@ -14,6 +14,7 @@ use Composer\Package\RootPackageInterface; use Composer\Package\Locker; +use Composer\Pcre\Preg; use Composer\Util\Loop; use Composer\Repository\RepositoryManager; use Composer\Installer\InstallationManager; @@ -51,9 +52,9 @@ class Composer * const RELEASE_DATE = '@release_date@'; * const SOURCE_VERSION = '1.8-dev+source'; */ - const VERSION = '2.1.12'; + const VERSION = '2.2.6'; const BRANCH_ALIAS_VERSION = ''; - const RELEASE_DATE = '2021-11-09 16:02:04'; + const RELEASE_DATE = '2022-02-04 17:00:38'; const SOURCE_VERSION = ''; /** @@ -65,7 +66,7 @@ class Composer * * @var string */ - const RUNTIME_API_VERSION = '2.1.0'; + const RUNTIME_API_VERSION = '2.2.2'; /** * @return string @@ -78,7 +79,7 @@ public static function getVersion() } // we have a branch alias and version is a commit id, this must be a snapshot build - if (self::BRANCH_ALIAS_VERSION !== '' && preg_match('{^[a-f0-9]{40}$}', self::VERSION)) { + if (self::BRANCH_ALIAS_VERSION !== '' && Preg::isMatch('{^[a-f0-9]{40}$}', self::VERSION)) { return self::BRANCH_ALIAS_VERSION.'+'.self::VERSION; } diff --git a/core/vendor/composer/composer/src/Composer/Config.php b/core/vendor/composer/composer/src/Composer/Config.php index 5e0ab4bc0c..0d927f1903 100644 --- a/core/vendor/composer/composer/src/Composer/Config.php +++ b/core/vendor/composer/composer/src/Composer/Config.php @@ -15,6 +15,7 @@ use Composer\Config\ConfigSourceInterface; use Composer\Downloader\TransportException; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; use Composer\Util\Platform; use Composer\Util\ProcessExecutor; @@ -23,12 +24,18 @@ */ class Config { + const SOURCE_DEFAULT = 'default'; + const SOURCE_COMMAND = 'command'; + const SOURCE_UNKNOWN = 'unknown'; + const RELATIVE_PATHS = 1; /** @var array<string, mixed> */ public static $defaultConfig = array( 'process-timeout' => 300, 'use-include-path' => false, + 'allow-plugins' => null, // null for BC for now, will become array() after July 2022 + 'use-parent-dir' => 'prompt', 'preferred-install' => 'dist', 'notify-on-install' => true, 'github-protocols' => array('https', 'ssh', 'git'), @@ -100,6 +107,8 @@ class Config private $useEnvironment; /** @var array<string, true> */ private $warnedHosts = array(); + /** @var array<string, string> */ + private $sourceOfConfigValue = array(); /** * @param bool $useEnvironment Use COMPOSER_ environment variables to replace config settings @@ -109,9 +118,23 @@ public function __construct($useEnvironment = true, $baseDir = null) { // load defaults $this->config = static::$defaultConfig; + + // TODO after July 2022 remove this and update the default value above in self::$defaultConfig + remove note from 06-config.md + if (strtotime('2022-07-01') < time()) { + $this->config['allow-plugins'] = array(); + } + $this->repositories = static::$defaultRepositories; $this->useEnvironment = (bool) $useEnvironment; $this->baseDir = $baseDir; + + foreach ($this->config as $configKey => $configValue) { + $this->setSourceOfConfigValue($configValue, $configKey, self::SOURCE_DEFAULT); + } + + foreach ($this->repositories as $configKey => $configValue) { + $this->setSourceOfConfigValue($configValue, 'repositories.' . $configKey, self::SOURCE_DEFAULT); + } } /** @@ -149,19 +172,27 @@ public function getAuthConfigSource() /** * Merges new config values with the existing ones (overriding) * - * @param array<string, mixed> $config + * @param array{config?: array<string, mixed>, repositories?: array<mixed>} $config + * @param string $source * * @return void */ - public function merge($config) + public function merge($config, $source = self::SOURCE_UNKNOWN) { // override defaults with given config if (!empty($config['config']) && is_array($config['config'])) { foreach ($config['config'] as $key => $val) { - if (in_array($key, array('bitbucket-oauth', 'github-oauth', 'gitlab-oauth', 'gitlab-token', 'http-basic', 'bearer')) && isset($this->config[$key])) { + if (in_array($key, array('bitbucket-oauth', 'github-oauth', 'gitlab-oauth', 'gitlab-token', 'http-basic', 'bearer'), true) && isset($this->config[$key])) { $this->config[$key] = array_merge($this->config[$key], $val); - } elseif (in_array($key, array('gitlab-domains', 'github-domains')) && isset($this->config[$key])) { + $this->setSourceOfConfigValue($val, $key, $source); + } elseif (in_array($key, array('allow-plugins'), true) && isset($this->config[$key]) && is_array($this->config[$key])) { + // merging $val first to get the local config on top of the global one, then appending the global config, + // then merging local one again to make sure the values from local win over global ones for keys present in both + $this->config[$key] = array_merge($val, $this->config[$key], $val); + $this->setSourceOfConfigValue($val, $key, $source); + } elseif (in_array($key, array('gitlab-domains', 'github-domains'), true) && isset($this->config[$key])) { $this->config[$key] = array_unique(array_merge($this->config[$key], $val)); + $this->setSourceOfConfigValue($val, $key, $source); } elseif ('preferred-install' === $key && isset($this->config[$key])) { if (is_array($val) || is_array($this->config[$key])) { if (is_string($val)) { @@ -169,8 +200,10 @@ public function merge($config) } if (is_string($this->config[$key])) { $this->config[$key] = array('*' => $this->config[$key]); + $this->sourceOfConfigValue[$key . '*'] = $source; } $this->config[$key] = array_merge($this->config[$key], $val); + $this->setSourceOfConfigValue($val, $key, $source); // the full match pattern needs to be last if (isset($this->config[$key]['*'])) { $wildcard = $this->config[$key]['*']; @@ -179,9 +212,11 @@ public function merge($config) } } else { $this->config[$key] = $val; + $this->setSourceOfConfigValue($val, $key, $source); } } else { $this->config[$key] = $val; + $this->setSourceOfConfigValue($val, $key, $source); } } } @@ -203,18 +238,21 @@ public function merge($config) } // auto-deactivate the default packagist.org repo if it gets redefined - if (isset($repository['type'], $repository['url']) && $repository['type'] === 'composer' && preg_match('{^https?://(?:[a-z0-9-.]+\.)?packagist.org(/|$)}', $repository['url'])) { + if (isset($repository['type'], $repository['url']) && $repository['type'] === 'composer' && Preg::isMatch('{^https?://(?:[a-z0-9-.]+\.)?packagist.org(/|$)}', $repository['url'])) { $this->disableRepoByName('packagist.org'); } // store repo if (is_int($name)) { $this->repositories[] = $repository; + $this->setSourceOfConfigValue($repository, 'repositories.' . array_search($repository, $this->repositories, true), $source); } else { if ($name === 'packagist') { // BC support for default "packagist" named repo $this->repositories[$name . '.org'] = $repository; + $this->setSourceOfConfigValue($repository, 'repositories.' . $name . '.org', $source); } else { $this->repositories[$name] = $repository; + $this->setSourceOfConfigValue($repository, 'repositories.' . $name, $source); } } } @@ -257,6 +295,10 @@ public function get($key, $flags = 0) $env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_')); $val = $this->getComposerEnv($env); + if ($val !== false) { + $this->setSourceOfConfigValue($val, $key, $env); + } + $val = rtrim((string) $this->process(false !== $val ? $val : $this->config[$key], $flags), '/\\'); $val = Platform::expandPath($val); @@ -275,6 +317,8 @@ public function get($key, $flags = 0) $val = $this->getComposerEnv($env); if (false === $val) { $val = $this->config[$key]; + } else { + $this->setSourceOfConfigValue($val, $key, $env); } return $val !== 'false' && (bool) $val; @@ -297,7 +341,7 @@ public function get($key, $flags = 0) // numbers with kb/mb/gb support, without env var support case 'cache-files-maxsize': - if (!preg_match('/^\s*([0-9.]+)\s*(?:([kmg])(?:i?b)?)?\s*$/i', $this->config[$key], $matches)) { + if (!Preg::isMatch('/^\s*([0-9.]+)\s*(?:([kmg])(?:i?b)?)?\s*$/i', $this->config[$key], $matches)) { throw new \RuntimeException( "Could not parse the value of '$key': {$this->config[$key]}" ); @@ -330,19 +374,23 @@ public function get($key, $flags = 0) return (int) $this->config['cache-ttl']; case 'home': - $val = preg_replace('#^(\$HOME|~)(/|$)#', rtrim(getenv('HOME') ?: getenv('USERPROFILE'), '/\\') . '/', $this->config[$key]); + $val = Preg::replace('#^(\$HOME|~)(/|$)#', rtrim(Platform::getEnv('HOME') ?: Platform::getEnv('USERPROFILE'), '/\\') . '/', $this->config[$key]); return rtrim($this->process($val, $flags), '/\\'); case 'bin-compat': $value = $this->getComposerEnv('COMPOSER_BIN_COMPAT') ?: $this->config[$key]; - if (!in_array($value, array('auto', 'full', 'symlink'))) { + if (!in_array($value, array('auto', 'full', 'proxy', 'symlink'))) { throw new \RuntimeException( - "Invalid value for 'bin-compat': {$value}. Expected auto, full or symlink" + "Invalid value for 'bin-compat': {$value}. Expected auto, full or proxy" ); } + if ($value === 'symlink') { + trigger_error('config.bin-compat "symlink" is deprecated since Composer 2.2, use auto, full (for Windows compatibility) or proxy instead.', E_USER_DEPRECATED); + } + return $value; case 'discard-changes': @@ -405,6 +453,35 @@ public function all($flags = 0) return $all; } + /** + * @param string $key + * @return string + */ + public function getSourceOfValue($key) + { + $this->get($key); + + return isset($this->sourceOfConfigValue[$key]) ? $this->sourceOfConfigValue[$key] : self::SOURCE_UNKNOWN; + } + + /** + * @param mixed $configValue + * @param string $path + * @param string $source + * + * @return void + */ + private function setSourceOfConfigValue($configValue, $path, $source) + { + $this->sourceOfConfigValue[$path] = $source; + + if (is_array($configValue)) { + foreach ($configValue as $key => $value) { + $this->setSourceOfConfigValue($value, $path . '.' . $key, $source); + } + } + } + /** * @return array<string, mixed[]> */ @@ -443,7 +520,7 @@ private function process($value, $flags) return $value; } - return preg_replace_callback('#\{\$(.+)\}#', function ($match) use ($config, $flags) { + return Preg::replaceCallback('#\{\$(.+)\}#', function ($match) use ($config, $flags) { return $config->get($match[1], $flags); }, $value); } @@ -458,11 +535,11 @@ private function process($value, $flags) */ private function realpath($path) { - if (preg_match('{^(?:/|[a-z]:|[a-z0-9.]+://)}i', $path)) { + if (Preg::isMatch('{^(?:/|[a-z]:|[a-z0-9.]+://)}i', $path)) { return $path; } - return $this->baseDir . '/' . $path; + return $this->baseDir ? $this->baseDir . '/' . $path : $path; } /** @@ -477,7 +554,7 @@ private function realpath($path) private function getComposerEnv($var) { if ($this->useEnvironment) { - return getenv($var); + return Platform::getEnv($var); } return false; @@ -529,10 +606,12 @@ public function prohibitUrlByConfig($url, IOInterface $io = null) } if ($io) { $host = parse_url($url, PHP_URL_HOST); - if (!isset($this->warnedHosts[$host])) { - $io->writeError("<warning>Warning: Accessing $host over $scheme which is an insecure protocol.</warning>"); + if (is_string($host)) { + if (!isset($this->warnedHosts[$host])) { + $io->writeError("<warning>Warning: Accessing $host over $scheme which is an insecure protocol.</warning>"); + } + $this->warnedHosts[$host] = true; } - $this->warnedHosts[$host] = true; } } } diff --git a/core/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php b/core/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php index d9165d7190..b650309e48 100644 --- a/core/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php +++ b/core/vendor/composer/composer/src/Composer/Config/JsonConfigSource.php @@ -15,6 +15,7 @@ use Composer\Json\JsonFile; use Composer\Json\JsonManipulator; use Composer\Json\JsonValidationException; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; use Composer\Util\Silencer; @@ -102,7 +103,7 @@ public function addConfigSetting($name, $value) { $authConfig = $this->authConfig; $this->manipulateJson('addConfigSetting', $name, $value, function (&$config, $key, $val) use ($authConfig) { - if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|bearer|http-basic|platform)\.}', $key)) { + if (Preg::isMatch('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|bearer|http-basic|platform)\.}', $key)) { list($key, $host) = explode('.', $key, 2); if ($authConfig) { $config[$key][$host] = $val; @@ -122,7 +123,7 @@ public function removeConfigSetting($name) { $authConfig = $this->authConfig; $this->manipulateJson('removeConfigSetting', $name, function (&$config, $key) use ($authConfig) { - if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|bearer|http-basic|platform)\.}', $key)) { + if (Preg::isMatch('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|bearer|http-basic|platform)\.}', $key)) { list($key, $host) = explode('.', $key, 2); if ($authConfig) { unset($config[$key][$host]); @@ -286,7 +287,7 @@ protected function manipulateJson($method, $args, $fallback) } catch (JsonValidationException $e) { // restore contents to the original state file_put_contents($this->file->getPath(), $contents); - throw new \RuntimeException('Failed to update composer.json with a valid format, reverting to the original content. Please report an issue to us with details (command you run and a copy of your composer.json).', 0, $e); + throw new \RuntimeException('Failed to update composer.json with a valid format, reverting to the original content. Please report an issue to us with details (command you run and a copy of your composer.json). '.PHP_EOL.implode(PHP_EOL, $e->getErrors()), 0, $e); } if ($newFile) { diff --git a/core/vendor/composer/composer/src/Composer/Console/Application.php b/core/vendor/composer/composer/src/Composer/Console/Application.php index 7880d1471a..e7c3a32a56 100644 --- a/core/vendor/composer/composer/src/Composer/Console/Application.php +++ b/core/vendor/composer/composer/src/Composer/Console/Application.php @@ -20,6 +20,7 @@ use Symfony\Component\Console\Exception\CommandNotFoundException; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\QuestionHelper; +use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -69,6 +70,8 @@ class Application extends BaseApplication private $hasPluginCommands = false; /** @var bool */ private $disablePluginsByDefault = false; + /** @var bool */ + private $disableScriptsByDefault = false; /** * @var string Store the initial working directory at startup time @@ -117,7 +120,7 @@ public function __construct() } /** - * @inheritDoc + * @return int */ public function run(InputInterface $input = null, OutputInterface $output = null) { @@ -129,13 +132,14 @@ public function run(InputInterface $input = null, OutputInterface $output = null } /** - * @inheritDoc + * @return int */ public function doRun(InputInterface $input, OutputInterface $output) { $this->disablePluginsByDefault = $input->hasParameterOption('--no-plugins'); + $this->disableScriptsByDefault = $input->hasParameterOption('--no-scripts'); - if (getenv('COMPOSER_NO_INTERACTION') || !Platform::isTty(defined('STDIN') ? STDIN : fopen('php://stdin', 'r'))) { + if (Platform::getEnv('COMPOSER_NO_INTERACTION') || !Platform::isTty(defined('STDIN') ? STDIN : fopen('php://stdin', 'r'))) { $input->setInteractive(false); } @@ -172,14 +176,19 @@ public function doRun(InputInterface $input, OutputInterface $output) } // prompt user for dir change if no composer.json is present in current dir - if ($io->isInteractive() && !$newWorkDir && !in_array($commandName, array('', 'list', 'init', 'about', 'help', 'diagnose', 'self-update', 'global', 'create-project', 'outdated'), true) && !file_exists(Factory::getComposerFile())) { + if ($io->isInteractive() && !$newWorkDir && !in_array($commandName, array('', 'list', 'init', 'about', 'help', 'diagnose', 'self-update', 'global', 'create-project', 'outdated'), true) && !file_exists(Factory::getComposerFile()) && ($useParentDirIfNoJsonAvailable = $this->getUseParentDirConfigValue()) !== false) { $dir = dirname(getcwd()); - $home = realpath(getenv('HOME') ?: getenv('USERPROFILE') ?: '/'); + $home = realpath(Platform::getEnv('HOME') ?: Platform::getEnv('USERPROFILE') ?: '/'); // abort when we reach the home dir or top of the filesystem while (dirname($dir) !== $dir && $dir !== $home) { if (file_exists($dir.'/'.Factory::getComposerFile())) { - if ($io->askConfirmation('<info>No composer.json in current directory, do you want to use the one at '.$dir.'?</info> [<comment>Y,n</comment>]? ')) { + if ($useParentDirIfNoJsonAvailable === true || $io->askConfirmation('<info>No composer.json in current directory, do you want to use the one at '.$dir.'?</info> [<comment>Y,n</comment>]? ')) { + if ($useParentDirIfNoJsonAvailable === true) { + $io->writeError('<info>No composer.json in current directory, changing working directory to '.$dir.'</info>'); + } else { + $io->writeError('<info>Always want to use the parent dir? Use "composer config --global use-parent-dir true" to change the default.</info>'); + } $oldWorkingDir = getcwd(); chdir($dir); } @@ -253,7 +262,7 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow $io->writeError('<warning>Composer only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP '.PHP_VERSION.', upgrading is strongly recommended.</warning>'); } - if (XdebugHandler::isXdebugActive() && !getenv('COMPOSER_DISABLE_XDEBUG_WARN')) { + if (XdebugHandler::isXdebugActive() && !Platform::getEnv('COMPOSER_DISABLE_XDEBUG_WARN')) { $io->writeError('<warning>Composer is operating slower than normal because you have Xdebug enabled. See https://getcomposer.org/xdebug</warning>'); } @@ -264,7 +273,7 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow if ( !Platform::isWindows() && function_exists('exec') - && !getenv('COMPOSER_ALLOW_SUPERUSER') + && !Platform::getEnv('COMPOSER_ALLOW_SUPERUSER') && (ini_get('open_basedir') || !file_exists('/.dockerenv')) ) { if (function_exists('posix_getuid') && posix_getuid() === 0) { @@ -277,7 +286,7 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow } } } - if ($uid = (int) getenv('SUDO_UID')) { + if ($uid = (int) Platform::getEnv('SUDO_UID')) { // Silently clobber any sudo credentials on the invoking user to avoid privilege escalations later on // ref. https://github.com/composer/composer/issues/5119 Silencer::call('exec', "sudo -u \\#{$uid} sudo -K > /dev/null 2>&1"); @@ -339,7 +348,7 @@ function_exists('php_uname') ? php_uname('s') . ' / ' . php_uname('r') : 'Unknow return $result; } catch (ScriptExecutionException $e) { - return (int) $e->getCode(); + return $e->getCode(); } catch (\Exception $e) { $ghe = new GithubActionError($this->io); $ghe->emit($e->getMessage()); @@ -417,19 +426,23 @@ private function hintCommonErrors(\Exception $exception) /** * @param bool $required * @param bool|null $disablePlugins + * @param bool|null $disableScripts * @throws JsonValidationException * @throws \InvalidArgumentException * @return ?\Composer\Composer If $required is true then the return value is guaranteed */ - public function getComposer($required = true, $disablePlugins = null) + public function getComposer($required = true, $disablePlugins = null, $disableScripts = null) { if (null === $disablePlugins) { $disablePlugins = $this->disablePluginsByDefault; } + if (null === $disableScripts) { + $disableScripts = $this->disableScriptsByDefault; + } if (null === $this->composer) { try { - $this->composer = Factory::create($this->io, null, $disablePlugins); + $this->composer = Factory::create($this->io, null, $disablePlugins, $disableScripts); } catch (\InvalidArgumentException $e) { if ($required) { $this->io->writeError($e->getMessage()); @@ -480,6 +493,7 @@ public function getHelp() /** * Initializes all the composer commands. + * @return \Symfony\Component\Console\Command\Command[] */ protected function getDefaultCommands() { @@ -522,7 +536,7 @@ protected function getDefaultCommands() } /** - * @inheritDoc + * @return string */ public function getLongVersion() { @@ -540,13 +554,14 @@ public function getLongVersion() } /** - * @inheritDoc + * @return InputDefinition */ protected function getDefaultInputDefinition() { $definition = parent::getDefaultInputDefinition(); $definition->addOption(new InputOption('--profile', null, InputOption::VALUE_NONE, 'Display timing and memory usage information')); $definition->addOption(new InputOption('--no-plugins', null, InputOption::VALUE_NONE, 'Whether to disable plugins.')); + $definition->addOption(new InputOption('--no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.')); $definition->addOption(new InputOption('--working-dir', '-d', InputOption::VALUE_REQUIRED, 'If specified, use the given directory as working directory.')); $definition->addOption(new InputOption('--no-cache', null, InputOption::VALUE_NONE, 'Prevent use of the cache')); @@ -593,4 +608,14 @@ public function getInitialWorkingDirectory() { return $this->initialWorkingDirectory; } + + /** + * @return 'prompt'|bool + */ + private function getUseParentDirConfigValue() + { + $config = Factory::createConfig($this->io); + + return $config->get('use-parent-dir'); + } } diff --git a/core/vendor/composer/composer/src/Composer/Console/GithubActionError.php b/core/vendor/composer/composer/src/Composer/Console/GithubActionError.php index 49048ffcf9..9ccb8221d3 100644 --- a/core/vendor/composer/composer/src/Composer/Console/GithubActionError.php +++ b/core/vendor/composer/composer/src/Composer/Console/GithubActionError.php @@ -13,6 +13,7 @@ namespace Composer\Console; use Composer\IO\IOInterface; +use Composer\Util\Platform; final class GithubActionError { @@ -35,7 +36,7 @@ public function __construct(IOInterface $io) */ public function emit($message, $file = null, $line = null) { - if (getenv('GITHUB_ACTIONS') && !getenv('COMPOSER_TESTS_ARE_RUNNING')) { + if (Platform::getEnv('GITHUB_ACTIONS') && !Platform::getEnv('COMPOSER_TESTS_ARE_RUNNING')) { $message = $this->escapeData($message); if ($file && $line) { diff --git a/core/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php b/core/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php index f15494b58f..7fc0876ec1 100644 --- a/core/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php +++ b/core/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php @@ -12,6 +12,7 @@ namespace Composer\Console; +use Composer\Pcre\Preg; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Formatter\OutputFormatterStyle; @@ -60,7 +61,7 @@ public function __construct(array $styles = array()) } /** - * @param string $message + * @param ?string $message * * @return string */ @@ -70,6 +71,7 @@ public function format($message) $clearEscapeCodes = '(?:39|49|0|22|24|25|27|28)'; + // TODO in 2.3 replace with Closure::fromCallable and then use Preg::replaceCallback return preg_replace_callback("{\033\[([0-9;]+)m(.*?)\033\[(?:".$clearEscapeCodes.";)*?".$clearEscapeCodes."m}s", array($this, 'formatHtml'), $formatted); } @@ -82,12 +84,12 @@ private function formatHtml($matches) { $out = '<span style="'; foreach (explode(';', $matches[1]) as $code) { - if (isset(self::$availableForegroundColors[$code])) { - $out .= 'color:'.self::$availableForegroundColors[$code].';'; - } elseif (isset(self::$availableBackgroundColors[$code])) { - $out .= 'background-color:'.self::$availableBackgroundColors[$code].';'; - } elseif (isset(self::$availableOptions[$code])) { - switch (self::$availableOptions[$code]) { + if (isset(self::$availableForegroundColors[(int) $code])) { + $out .= 'color:'.self::$availableForegroundColors[(int) $code].';'; + } elseif (isset(self::$availableBackgroundColors[(int) $code])) { + $out .= 'background-color:'.self::$availableBackgroundColors[(int) $code].';'; + } elseif (isset(self::$availableOptions[(int) $code])) { + switch (self::$availableOptions[(int) $code]) { case 'bold': $out .= 'font-weight:bold;'; break; diff --git a/core/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php b/core/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php index 0ee5c7f4c3..857f62df84 100644 --- a/core/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php +++ b/core/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php @@ -36,16 +36,57 @@ class Pool implements \Countable protected $providerCache = array(); /** @var BasePackage[] */ protected $unacceptableFixedOrLockedPackages; + /** @var array<string, array<string, string>> Map of package name => normalized version => pretty version */ + protected $removedVersions = array(); + /** @var array<string, array<string, string>> Map of package object hash => removed normalized versions => removed pretty version */ + protected $removedVersionsByPackage = array(); /** * @param BasePackage[] $packages * @param BasePackage[] $unacceptableFixedOrLockedPackages + * @param array<string, array<string, string>> $removedVersions + * @param array<string, array<string, string>> $removedVersionsByPackage */ - public function __construct(array $packages = array(), array $unacceptableFixedOrLockedPackages = array()) + public function __construct(array $packages = array(), array $unacceptableFixedOrLockedPackages = array(), array $removedVersions = array(), array $removedVersionsByPackage = array()) { $this->versionParser = new VersionParser; $this->setPackages($packages); $this->unacceptableFixedOrLockedPackages = $unacceptableFixedOrLockedPackages; + $this->removedVersions = $removedVersions; + $this->removedVersionsByPackage = $removedVersionsByPackage; + } + + /** + * @param string $name + * @return array<string, string> + */ + public function getRemovedVersions($name, ConstraintInterface $constraint) + { + if (!isset($this->removedVersions[$name])) { + return array(); + } + + $result = array(); + foreach ($this->removedVersions[$name] as $version => $prettyVersion) { + if ($constraint->matches(new Constraint('==', $version))) { + $result[$version] = $prettyVersion; + } + } + + return $result; + } + + /** + * @param string $objectHash + * @return array<string, string> + */ + public function getRemovedVersionsByPackage($objectHash) + { + if (!isset($this->removedVersionsByPackage[$objectHash])) { + return array(); + } + + return $this->removedVersionsByPackage[$objectHash]; } /** @@ -221,6 +262,14 @@ public function isUnacceptableFixedOrLockedPackage(BasePackage $package) return \in_array($package, $this->unacceptableFixedOrLockedPackages, true); } + /** + * @return BasePackage[] + */ + public function getUnacceptableFixedOrLockedPackages() + { + return $this->unacceptableFixedOrLockedPackages; + } + public function __toString() { $str = "Pool:\n"; diff --git a/core/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php b/core/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php index 2705f61811..de7626fe4f 100644 --- a/core/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php +++ b/core/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php @@ -20,6 +20,7 @@ use Composer\Package\CompletePackage; use Composer\Package\PackageInterface; use Composer\Package\Version\StabilityFilter; +use Composer\Pcre\Preg; use Composer\Plugin\PluginEvents; use Composer\Plugin\PrePoolCreateEvent; use Composer\Repository\PlatformRepository; @@ -61,6 +62,10 @@ class PoolBuilder * @var ?EventDispatcher */ private $eventDispatcher; + /** + * @var PoolOptimizer|null + */ + private $poolOptimizer; /** * @var IOInterface */ @@ -95,9 +100,19 @@ class PoolBuilder private $unacceptableFixedOrLockedPackages = array(); /** @var string[] */ private $updateAllowList = array(); - /** @var array<string, string> */ + /** @var array<string, array<PackageInterface>> */ private $skippedLoad = array(); + /** + * Keeps a list of dependencies which are locked but were auto-unlocked as they are path repositories + * + * This half-unlocked state means the package itself will update but the UPDATE_LISTED_WITH_TRANSITIVE_DEPS* + * flags will not apply until the package really gets unlocked in some other way than being a path repo + * + * @var array<string, true> + */ + private $pathRepoUnlocked = array(); + /** * Keeps a list of dependencies which are root requirements, and as such * have already their maximum required range loaded and can not be @@ -128,13 +143,14 @@ class PoolBuilder * @param string[] $rootReferences an array of package name => source reference * @phpstan-param array<string, string> $rootReferences */ - public function __construct(array $acceptableStabilities, array $stabilityFlags, array $rootAliases, array $rootReferences, IOInterface $io, EventDispatcher $eventDispatcher = null) + public function __construct(array $acceptableStabilities, array $stabilityFlags, array $rootAliases, array $rootReferences, IOInterface $io, EventDispatcher $eventDispatcher = null, PoolOptimizer $poolOptimizer = null) { $this->acceptableStabilities = $acceptableStabilities; $this->stabilityFlags = $stabilityFlags; $this->rootAliases = $rootAliases; $this->rootReferences = $rootReferences; $this->eventDispatcher = $eventDispatcher; + $this->poolOptimizer = $poolOptimizer; $this->io = $io; } @@ -150,13 +166,25 @@ public function buildPool(array $repositories, Request $request) foreach ($request->getLockedRepository()->getPackages() as $lockedPackage) { if (!$this->isUpdateAllowed($lockedPackage)) { - $request->lockPackage($lockedPackage); - $lockedName = $lockedPackage->getName(); // remember which packages we skipped loading remote content for in this partial update - $this->skippedLoad[$lockedName] = $lockedName; + $this->skippedLoad[$lockedPackage->getName()][] = $lockedPackage; foreach ($lockedPackage->getReplaces() as $link) { - $this->skippedLoad[$link->getTarget()] = $lockedName; + $this->skippedLoad[$link->getTarget()][] = $lockedPackage; } + + // Path repo packages are never loaded from lock, to force them to always remain in sync + // unless symlinking is disabled in which case we probably should rather treat them like + // regular packages. We mark them specially so they can be reloaded fully including update propagation + // if they do get unlocked, but by default they are unlocked without update propagation. + if ($lockedPackage->getDistType() === 'path') { + $transportOptions = $lockedPackage->getTransportOptions(); + if (!isset($transportOptions['symlink']) || $transportOptions['symlink'] !== false) { + $this->pathRepoUnlocked[$lockedPackage->getName()] = true; + continue; + } + } + + $request->lockPackage($lockedPackage); } } } @@ -179,7 +207,7 @@ public function buildPool(array $repositories, Request $request) || $package->getRepository() instanceof PlatformRepository || StabilityFilter::isPackageAcceptable($this->acceptableStabilities, $this->stabilityFlags, $package->getNames(), $package->getStability()) ) { - $this->loadPackage($request, $package, false); + $this->loadPackage($request, $repositories, $package, false); } else { $this->unacceptableFixedOrLockedPackages[] = $package; } @@ -259,6 +287,8 @@ public function buildPool(array $repositories, Request $request) $this->skippedLoad = array(); $this->indexCounter = 0; + $pool = $this->runOptimizer($request, $pool); + Intervals::clear(); return $pool; @@ -327,7 +357,7 @@ private function markPackageNameForLoading(Request $request, $name, ConstraintIn * @param RepositoryInterface[] $repositories * @return void */ - private function loadPackagesMarkedForLoading(Request $request, $repositories) + private function loadPackagesMarkedForLoading(Request $request, array $repositories) { foreach ($this->packagesToLoad as $name => $constraint) { $this->loadedPackages[$name] = $constraint; @@ -354,16 +384,17 @@ private function loadPackagesMarkedForLoading(Request $request, $repositories) } foreach ($result['packages'] as $package) { $this->loadedPerRepo[$repoIndex][$package->getName()][$package->getVersion()] = $package; - $this->loadPackage($request, $package); + $this->loadPackage($request, $repositories, $package, !isset($this->pathRepoUnlocked[$package->getName()])); } } } /** * @param bool $propagateUpdate + * @param RepositoryInterface[] $repositories * @return void */ - private function loadPackage(Request $request, BasePackage $package, $propagateUpdate = true) + private function loadPackage(Request $request, array $repositories, BasePackage $package, $propagateUpdate) { $index = $this->indexCounter++; $this->packages[$index] = $package; @@ -384,7 +415,7 @@ private function loadPackage(Request $request, BasePackage $package, $propagateU } } - // if propogateUpdate is false we are loading a fixed or locked package, root aliases do not apply as they are + // if propagateUpdate is false we are loading a fixed or locked package, root aliases do not apply as they are // manually loaded as separate packages in this case if ($propagateUpdate && isset($this->rootAliases[$name][$package->getVersion()])) { $alias = $this->rootAliases[$name][$package->getVersion()]; @@ -415,13 +446,23 @@ private function loadPackage(Request $request, BasePackage $package, $propagateU // looking at a package which needs to be updated we need to unlock the package we now know is a // dependency of another package which we are trying to update, and then attempt to load it again if ($propagateUpdate && $request->getUpdateAllowTransitiveDependencies()) { - if ($request->getUpdateAllowTransitiveRootDependencies() || !$this->isRootRequire($request, $this->skippedLoad[$require])) { - $this->unlockPackage($request, $require); + $skippedRootRequires = $this->getSkippedRootRequires($request, $require); + + if ($request->getUpdateAllowTransitiveRootDependencies() || !$skippedRootRequires) { + $this->unlockPackage($request, $repositories, $require); $this->markPackageNameForLoading($request, $require, $linkConstraint); - } elseif (!isset($this->updateAllowWarned[$this->skippedLoad[$require]])) { - $this->updateAllowWarned[$this->skippedLoad[$require]] = true; - $this->io->writeError('<warning>Dependency "'.$this->skippedLoad[$require].'" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies (-W) to include root dependencies.</warning>'); + } else { + foreach ($skippedRootRequires as $rootRequire) { + if (!isset($this->updateAllowWarned[$rootRequire])) { + $this->updateAllowWarned[$rootRequire] = true; + $this->io->writeError('<warning>Dependency '.$rootRequire.' is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies (-W) to include root dependencies.</warning>'); + } + } } + } elseif (isset($this->pathRepoUnlocked[$require]) && !isset($this->loadedPackages[$require])) { + // if doing a partial update and a package depends on a path-repo-unlocked package which is not referenced by the root, we need to ensure it gets loaded as it was not loaded by the request's root requirements + // and would not be loaded above if update propagation is not allowed (which happens if the requirer is itself a path-repo-unlocked package) or if transitive deps are not allowed to be unlocked + $this->markPackageNameForLoading($request, $require, $linkConstraint); } } else { $this->markPackageNameForLoading($request, $require, $linkConstraint); @@ -434,12 +475,18 @@ private function loadPackage(Request $request, BasePackage $package, $propagateU foreach ($package->getReplaces() as $link) { $replace = $link->getTarget(); if (isset($this->loadedPackages[$replace], $this->skippedLoad[$replace])) { - if ($request->getUpdateAllowTransitiveRootDependencies() || !$this->isRootRequire($request, $this->skippedLoad[$replace])) { - $this->unlockPackage($request, $replace); + $skippedRootRequires = $this->getSkippedRootRequires($request, $replace); + + if ($request->getUpdateAllowTransitiveRootDependencies() || !$skippedRootRequires) { + $this->unlockPackage($request, $repositories, $replace); $this->markPackageNameForLoading($request, $replace, $link->getConstraint()); - } elseif (!$request->getUpdateAllowTransitiveRootDependencies() && $this->isRootRequire($request, $replace) && !isset($this->updateAllowWarned[$replace])) { - $this->updateAllowWarned[$replace] = true; - $this->io->writeError('<warning>Dependency "'.$replace.'" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies (-W) to include root dependencies.</warning>'); + } else { + foreach ($skippedRootRequires as $rootRequire) { + if (!isset($this->updateAllowWarned[$rootRequire])) { + $this->updateAllowWarned[$rootRequire] = true; + $this->io->writeError('<warning>Dependency '.$rootRequire.' is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies (-W) to include root dependencies.</warning>'); + } + } } } } @@ -459,6 +506,48 @@ private function isRootRequire(Request $request, $name) return isset($rootRequires[$name]); } + /** + * @param string $name + * @return string[] + */ + private function getSkippedRootRequires(Request $request, $name) + { + if (!isset($this->skippedLoad[$name])) { + return array(); + } + + $rootRequires = $request->getRequires(); + $matches = array(); + + if (isset($rootRequires[$name])) { + return array_map(function (PackageInterface $package) use ($name) { + if ($name !== $package->getName()) { + return $package->getName() .' (via replace of '.$name.')'; + } + + return $package->getName(); + }, $this->skippedLoad[$name]); + } + + foreach ($this->skippedLoad[$name] as $packageOrReplacer) { + if (isset($rootRequires[$packageOrReplacer->getName()])) { + $matches[] = $packageOrReplacer->getName(); + } + foreach ($packageOrReplacer->getReplaces() as $link) { + if (isset($rootRequires[$link->getTarget()])) { + if ($name !== $packageOrReplacer->getName()) { + $matches[] = $packageOrReplacer->getName() .' (via replace of '.$name.')'; + } else { + $matches[] = $packageOrReplacer->getName(); + } + break; + } + } + } + + return $matches; + } + /** * Checks whether the update allow list allows this package in the lock file to be updated * @@ -466,19 +555,9 @@ private function isRootRequire(Request $request, $name) */ private function isUpdateAllowed(BasePackage $package) { - // Path repo packages are never loaded from lock, to force them to always remain in sync - // unless symlinking is disabled in which case we probably should rather treat them like - // regular packages - if ($package->getDistType() === 'path') { - $transportOptions = $package->getTransportOptions(); - if (!isset($transportOptions['symlink']) || $transportOptions['symlink'] !== false) { - return true; - } - } - foreach ($this->updateAllowList as $pattern => $void) { $patternRegexp = BasePackage::packageNameToRegexp($pattern); - if (preg_match($patternRegexp, $package->getName())) { + if (Preg::isMatch($patternRegexp, $package->getName())) { return true; } } @@ -495,13 +574,13 @@ private function warnAboutNonMatchingUpdateAllowList(Request $request) $patternRegexp = BasePackage::packageNameToRegexp($pattern); // update pattern matches a locked package? => all good foreach ($request->getLockedRepository()->getPackages() as $package) { - if (preg_match($patternRegexp, $package->getName())) { + if (Preg::isMatch($patternRegexp, $package->getName())) { continue 2; } } // update pattern matches a root require? => all good, probably a new package foreach ($request->getRequires() as $packageName => $constraint) { - if (preg_match($patternRegexp, $packageName)) { + if (Preg::isMatch($patternRegexp, $packageName)) { continue 2; } } @@ -517,38 +596,63 @@ private function warnAboutNonMatchingUpdateAllowList(Request $request) * Reverts the decision to use a locked package if a partial update with transitive dependencies * found that this package actually needs to be updated * + * @param RepositoryInterface[] $repositories * @param string $name * @return void */ - private function unlockPackage(Request $request, $name) + private function unlockPackage(Request $request, array $repositories, $name) { - if ( + foreach ($this->skippedLoad[$name] as $packageOrReplacer) { // if we unfixed a replaced package name, we also need to unfix the replacer itself - $this->skippedLoad[$name] !== $name // as long as it was not unfixed yet - && isset($this->skippedLoad[$this->skippedLoad[$name]]) - ) { - $this->unlockPackage($request, $this->skippedLoad[$name]); + if ($packageOrReplacer->getName() !== $name && isset($this->skippedLoad[$packageOrReplacer->getName()])) { + $replacerName = $packageOrReplacer->getName(); + if ($request->getUpdateAllowTransitiveRootDependencies() || (!$this->isRootRequire($request, $name) && !$this->isRootRequire($request, $replacerName))) { + $this->unlockPackage($request, $repositories, $replacerName); + + if ($this->isRootRequire($request, $replacerName)) { + $this->markPackageNameForLoading($request, $replacerName, new MatchAllConstraint); + } else { + foreach ($this->packages as $loadedPackage) { + $requires = $loadedPackage->getRequires(); + if (isset($requires[$replacerName])) { + $this->markPackageNameForLoading($request, $replacerName, $requires[$replacerName]->getConstraint()); + } + } + } + } + } } - unset($this->skippedLoad[$name], $this->loadedPackages[$name], $this->maxExtendedReqs[$name]); + if (isset($this->pathRepoUnlocked[$name])) { + foreach ($this->packages as $index => $package) { + if ($package->getName() === $name) { + $this->removeLoadedPackage($request, $repositories, $package, $index); + } + } + } + + unset($this->skippedLoad[$name], $this->loadedPackages[$name], $this->maxExtendedReqs[$name], $this->pathRepoUnlocked[$name]); // remove locked package by this name which was already initialized foreach ($request->getLockedPackages() as $lockedPackage) { if (!($lockedPackage instanceof AliasPackage) && $lockedPackage->getName() === $name) { if (false !== $index = array_search($lockedPackage, $this->packages, true)) { $request->unlockPackage($lockedPackage); - $this->removeLoadedPackage($request, $lockedPackage, $index); + $this->removeLoadedPackage($request, $repositories, $lockedPackage, $index); // make sure that any requirements for this package by other locked or fixed packages are now // also loaded, as they were previously ignored because the locked (now unlocked) package already // satisfied their requirements foreach ($request->getFixedOrLockedPackages() as $fixedOrLockedPackage) { - if ($fixedOrLockedPackage !== $lockedPackage && isset($this->skippedLoad[$fixedOrLockedPackage->getName()])) { - foreach ($fixedOrLockedPackage->getRequires() as $requireLink) { - if ($requireLink->getTarget() === $lockedPackage->getName()) { - $this->markPackageNameForLoading($request, $lockedPackage->getName(), $requireLink->getConstraint()); - } + if ($fixedOrLockedPackage === $lockedPackage) { + continue; + } + + if (isset($this->skippedLoad[$fixedOrLockedPackage->getName()])) { + $requires = $fixedOrLockedPackage->getRequires(); + if (isset($requires[$lockedPackage->getName()])) { + $this->markPackageNameForLoading($request, $lockedPackage->getName(), $requires[$lockedPackage->getName()]->getConstraint()); } } } @@ -558,18 +662,51 @@ private function unlockPackage(Request $request, $name) } /** + * @param RepositoryInterface[] $repositories * @param int $index * @return void */ - private function removeLoadedPackage(Request $request, BasePackage $package, $index) + private function removeLoadedPackage(Request $request, array $repositories, BasePackage $package, $index) { + $repoIndex = array_search($package->getRepository(), $repositories, true); + + unset($this->loadedPerRepo[$repoIndex][$package->getName()][$package->getVersion()]); unset($this->packages[$index]); if (isset($this->aliasMap[spl_object_hash($package)])) { foreach ($this->aliasMap[spl_object_hash($package)] as $aliasIndex => $aliasPackage) { - $request->unlockPackage($aliasPackage); + unset($this->loadedPerRepo[$repoIndex][$aliasPackage->getName()][$aliasPackage->getVersion()]); unset($this->packages[$aliasIndex]); } unset($this->aliasMap[spl_object_hash($package)]); } } + + /** + * @return Pool + */ + private function runOptimizer(Request $request, Pool $pool) + { + if (null === $this->poolOptimizer) { + return $pool; + } + + $total = \count($pool->getPackages()); + + $pool = $this->poolOptimizer->optimize($request, $pool); + + $filtered = $total - \count($pool->getPackages()); + + if (0 === $filtered) { + return $pool; + } + + $this->io->write(sprintf( + '<info>Found %s package versions referenced in your dependency graph. %s (%d%%) were optimized away.</info>', + number_format($total), + number_format($filtered), + round(100/$total*$filtered) + ), true, IOInterface::VERY_VERBOSE); + + return $pool; + } } diff --git a/core/vendor/composer/composer/src/Composer/DependencyResolver/PoolOptimizer.php b/core/vendor/composer/composer/src/Composer/DependencyResolver/PoolOptimizer.php new file mode 100644 index 0000000000..841a2e9c63 --- /dev/null +++ b/core/vendor/composer/composer/src/Composer/DependencyResolver/PoolOptimizer.php @@ -0,0 +1,451 @@ +<?php + +/* + * This file is part of Composer. + * + * (c) Nils Adermann <naderman@naderman.de> + * Jordi Boggiano <j.boggiano@seld.be> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\DependencyResolver; + +use Composer\Package\AliasPackage; +use Composer\Package\BasePackage; +use Composer\Package\Version\VersionParser; +use Composer\Semver\CompilingMatcher; +use Composer\Semver\Constraint\ConstraintInterface; +use Composer\Semver\Constraint\Constraint; +use Composer\Semver\Constraint\MultiConstraint; +use Composer\Semver\Intervals; + +/** + * Optimizes a given pool + * + * @author Yanick Witschi <yanick.witschi@terminal42.ch> + */ +class PoolOptimizer +{ + /** + * @var PolicyInterface + */ + private $policy; + + /** + * @var array<int, true> + */ + private $irremovablePackages = array(); + + /** + * @var array<string, array<string, ConstraintInterface>> + */ + private $requireConstraintsPerPackage = array(); + + /** + * @var array<string, array<string, ConstraintInterface>> + */ + private $conflictConstraintsPerPackage = array(); + + /** + * @var array<int, true> + */ + private $packagesToRemove = array(); + + /** + * @var array<int, BasePackage[]> + */ + private $aliasesPerPackage = array(); + + /** + * @var array<string, array<string, string>> + */ + private $removedVersionsByPackage = array(); + + public function __construct(PolicyInterface $policy) + { + $this->policy = $policy; + } + + /** + * @return Pool + */ + public function optimize(Request $request, Pool $pool) + { + $this->prepare($request, $pool); + + $this->optimizeByIdenticalDependencies($request, $pool); + + $this->optimizeImpossiblePackagesAway($request, $pool); + + $optimizedPool = $this->applyRemovalsToPool($pool); + + // No need to run this recursively at the moment + // because the current optimizations cannot provide + // even more gains when ran again. Might change + // in the future with additional optimizations. + + $this->irremovablePackages = array(); + $this->requireConstraintsPerPackage = array(); + $this->conflictConstraintsPerPackage = array(); + $this->packagesToRemove = array(); + $this->aliasesPerPackage = array(); + $this->removedVersionsByPackage = array(); + + return $optimizedPool; + } + + /** + * @return void + */ + private function prepare(Request $request, Pool $pool) + { + $irremovablePackageConstraintGroups = array(); + + // Mark fixed or locked packages as irremovable + foreach ($request->getFixedOrLockedPackages() as $package) { + $irremovablePackageConstraintGroups[$package->getName()][] = new Constraint('==', $package->getVersion()); + } + + // Extract requested package requirements + foreach ($request->getRequires() as $require => $constraint) { + $constraint = Intervals::compactConstraint($constraint); + $this->requireConstraintsPerPackage[$require][(string) $constraint] = $constraint; + } + + // First pass over all packages to extract information and mark package constraints irremovable + foreach ($pool->getPackages() as $package) { + // Extract package requirements + foreach ($package->getRequires() as $link) { + $constraint = Intervals::compactConstraint($link->getConstraint()); + $this->requireConstraintsPerPackage[$link->getTarget()][(string) $constraint] = $constraint; + } + // Extract package conflicts + foreach ($package->getConflicts() as $link) { + $constraint = Intervals::compactConstraint($link->getConstraint()); + $this->conflictConstraintsPerPackage[$link->getTarget()][(string) $constraint] = $constraint; + } + + // Keep track of alias packages for every package so if either the alias or aliased is kept + // we keep the others as they are a unit of packages really + if ($package instanceof AliasPackage) { + $this->aliasesPerPackage[$package->getAliasOf()->id][] = $package; + } + } + + $irremovablePackageConstraints = array(); + foreach ($irremovablePackageConstraintGroups as $packageName => $constraints) { + $irremovablePackageConstraints[$packageName] = 1 === \count($constraints) ? $constraints[0] : new MultiConstraint($constraints, false); + } + unset($irremovablePackageConstraintGroups); + + // Mark the packages as irremovable based on the constraints + foreach ($pool->getPackages() as $package) { + if (!isset($irremovablePackageConstraints[$package->getName()])) { + continue; + } + + if (CompilingMatcher::match($irremovablePackageConstraints[$package->getName()], Constraint::OP_EQ, $package->getVersion())) { + $this->markPackageIrremovable($package); + } + } + } + + /** + * @return void + */ + private function markPackageIrremovable(BasePackage $package) + { + $this->irremovablePackages[$package->id] = true; + if ($package instanceof AliasPackage) { + // recursing here so aliasesPerPackage for the aliasOf can be checked + // and all its aliases marked as irremovable as well + $this->markPackageIrremovable($package->getAliasOf()); + } + if (isset($this->aliasesPerPackage[$package->id])) { + foreach ($this->aliasesPerPackage[$package->id] as $aliasPackage) { + $this->irremovablePackages[$aliasPackage->id] = true; + } + } + } + + /** + * @return Pool Optimized pool + */ + private function applyRemovalsToPool(Pool $pool) + { + $packages = array(); + $removedVersions = array(); + foreach ($pool->getPackages() as $package) { + if (!isset($this->packagesToRemove[$package->id])) { + $packages[] = $package; + } else { + $removedVersions[$package->getName()][$package->getVersion()] = $package->getPrettyVersion(); + } + } + + $optimizedPool = new Pool($packages, $pool->getUnacceptableFixedOrLockedPackages(), $removedVersions, $this->removedVersionsByPackage); + + return $optimizedPool; + } + + /** + * @return void + */ + private function optimizeByIdenticalDependencies(Request $request, Pool $pool) + { + $identicalDefinitionsPerPackage = array(); + $packageIdenticalDefinitionLookup = array(); + + foreach ($pool->getPackages() as $package) { + + // If that package was already marked irremovable, we can skip + // the entire process for it + if (isset($this->irremovablePackages[$package->id])) { + continue; + } + + $this->markPackageForRemoval($package->id); + + $dependencyHash = $this->calculateDependencyHash($package); + + foreach ($package->getNames(false) as $packageName) { + + if (!isset($this->requireConstraintsPerPackage[$packageName])) { + continue; + } + + foreach ($this->requireConstraintsPerPackage[$packageName] as $requireConstraint) { + $groupHashParts = array(); + + if (CompilingMatcher::match($requireConstraint, Constraint::OP_EQ, $package->getVersion())) { + $groupHashParts[] = 'require:' . (string) $requireConstraint; + } + + if ($package->getReplaces()) { + foreach ($package->getReplaces() as $link) { + if (CompilingMatcher::match($link->getConstraint(), Constraint::OP_EQ, $package->getVersion())) { + // Use the same hash part as the regular require hash because that's what the replacement does + $groupHashParts[] = 'require:' . (string) $link->getConstraint(); + } + } + } + + if (isset($this->conflictConstraintsPerPackage[$packageName])) { + foreach ($this->conflictConstraintsPerPackage[$packageName] as $conflictConstraint) { + if (CompilingMatcher::match($conflictConstraint, Constraint::OP_EQ, $package->getVersion())) { + $groupHashParts[] = 'conflict:' . (string) $conflictConstraint; + } + } + } + + if (!$groupHashParts) { + continue; + } + + $groupHash = implode('', $groupHashParts); + $identicalDefinitionsPerPackage[$packageName][$groupHash][$dependencyHash][] = $package; + $packageIdenticalDefinitionLookup[$package->id][$packageName] = array('groupHash' => $groupHash, 'dependencyHash' => $dependencyHash); + } + } + } + + foreach ($identicalDefinitionsPerPackage as $constraintGroups) { + foreach ($constraintGroups as $constraintGroup) { + foreach ($constraintGroup as $packages) { + // Only one package in this constraint group has the same requirements, we're not allowed to remove that package + if (1 === \count($packages)) { + $this->keepPackage($packages[0], $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup); + continue; + } + + // Otherwise we find out which one is the preferred package in this constraint group which is + // then not allowed to be removed either + $literals = array(); + + foreach ($packages as $package) { + $literals[] = $package->id; + } + + foreach ($this->policy->selectPreferredPackages($pool, $literals) as $preferredLiteral) { + $this->keepPackage($pool->literalToPackage($preferredLiteral), $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup); + } + } + } + } + } + + /** + * @return string + */ + private function calculateDependencyHash(BasePackage $package) + { + $hash = ''; + + $hashRelevantLinks = array( + 'requires' => $package->getRequires(), + 'conflicts' => $package->getConflicts(), + 'replaces' => $package->getReplaces(), + 'provides' => $package->getProvides() + ); + + foreach ($hashRelevantLinks as $key => $links) { + if (0 === \count($links)) { + continue; + } + + // start new hash section + $hash .= $key . ':'; + + $subhash = array(); + + foreach ($links as $link) { + // To get the best dependency hash matches we should use Intervals::compactConstraint() here. + // However, the majority of projects are going to specify their constraints already pretty + // much in the best variant possible. In other words, we'd be wasting time here and it would actually hurt + // performance more than the additional few packages that could be filtered out would benefit the process. + $subhash[$link->getTarget()] = (string) $link->getConstraint(); + } + + // Sort for best result + ksort($subhash); + + foreach ($subhash as $target => $constraint) { + $hash .= $target . '@' . $constraint; + } + } + + return $hash; + } + + /** + * @param int $id + * @return void + */ + private function markPackageForRemoval($id) + { + // We are not allowed to remove packages if they have been marked as irremovable + if (isset($this->irremovablePackages[$id])) { + throw new \LogicException('Attempted removing a package which was previously marked irremovable'); + } + + $this->packagesToRemove[$id] = true; + } + + /** + * @param array<string, array<string, array<string, list<BasePackage>>>> $identicalDefinitionsPerPackage + * @param array<int, array<string, array{groupHash: string, dependencyHash: string}>> $packageIdenticalDefinitionLookup + * @return void + */ + private function keepPackage(BasePackage $package, $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup) + { + unset($this->packagesToRemove[$package->id]); + + if ($package instanceof AliasPackage) { + // recursing here so aliasesPerPackage for the aliasOf can be checked + // and all its aliases marked to be kept as well + $this->keepPackage($package->getAliasOf(), $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup); + } + + // record all the versions of the package group so we can list them later in Problem output + foreach ($package->getNames(false) as $name) { + if (isset($packageIdenticalDefinitionLookup[$package->id][$name])) { + $packageGroupPointers = $packageIdenticalDefinitionLookup[$package->id][$name]; + $packageGroup = $identicalDefinitionsPerPackage[$name][$packageGroupPointers['groupHash']][$packageGroupPointers['dependencyHash']]; + foreach ($packageGroup as $pkg) { + if ($pkg instanceof AliasPackage && $pkg->getPrettyVersion() === VersionParser::DEFAULT_BRANCH_ALIAS) { + $pkg = $pkg->getAliasOf(); + } + $this->removedVersionsByPackage[spl_object_hash($package)][$pkg->getVersion()] = $pkg->getPrettyVersion(); + } + } + } + + if (isset($this->aliasesPerPackage[$package->id])) { + foreach ($this->aliasesPerPackage[$package->id] as $aliasPackage) { + unset($this->packagesToRemove[$aliasPackage->id]); + + // record all the versions of the package group so we can list them later in Problem output + foreach ($aliasPackage->getNames(false) as $name) { + if (isset($packageIdenticalDefinitionLookup[$aliasPackage->id][$name])) { + $packageGroupPointers = $packageIdenticalDefinitionLookup[$aliasPackage->id][$name]; + $packageGroup = $identicalDefinitionsPerPackage[$name][$packageGroupPointers['groupHash']][$packageGroupPointers['dependencyHash']]; + foreach ($packageGroup as $pkg) { + if ($pkg instanceof AliasPackage && $pkg->getPrettyVersion() === VersionParser::DEFAULT_BRANCH_ALIAS) { + $pkg = $pkg->getAliasOf(); + } + $this->removedVersionsByPackage[spl_object_hash($aliasPackage)][$pkg->getVersion()] = $pkg->getPrettyVersion(); + } + } + } + } + } + } + + /** + * Use the list of locked packages to constrain the loaded packages + * This will reduce packages with significant numbers of historical versions to a smaller number + * and reduce the resulting rule set that is generated + * + * @return void + */ + private function optimizeImpossiblePackagesAway(Request $request, Pool $pool) + { + if (count($request->getLockedPackages()) === 0) { + return; + } + + $packageIndex = array(); + + foreach ($pool->getPackages() as $package) { + $id = $package->id; + + // Do not remove irremovable packages + if (isset($this->irremovablePackages[$id])) { + continue; + } + // Do not remove a package aliased by another package, nor aliases + if (isset($this->aliasesPerPackage[$id]) || $package instanceof AliasPackage) { + continue; + } + // Do not remove locked packages + if ($request->isFixedPackage($package) || $request->isLockedPackage($package)) { + continue; + } + + $packageIndex[$package->getName()][$package->id] = $package; + } + + foreach ($request->getLockedPackages() as $package) { + // If this locked package is no longer required by root or anything in the pool, it may get uninstalled so do not apply its requirements + // In a case where a requirement WERE to appear in the pool by a package that would not be used, it would've been unlocked and so not filtered still + $isUnusedPackage = true; + foreach ($package->getNames(false) as $packageName) { + if (isset($this->requireConstraintsPerPackage[$packageName])) { + $isUnusedPackage = false; + break; + } + } + + if ($isUnusedPackage) { + continue; + } + + foreach ($package->getRequires() as $link) { + $require = $link->getTarget(); + if (!isset($packageIndex[$require])) { + continue; + } + + $linkConstraint = $link->getConstraint(); + foreach ($packageIndex[$require] as $id => $requiredPkg) { + if (false === CompilingMatcher::match($linkConstraint, Constraint::OP_EQ, $requiredPkg->getVersion())) { + $this->markPackageForRemoval($id); + unset($packageIndex[$require][$id]); + } + } + } + } + } +} diff --git a/core/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php b/core/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php index 507e45d177..124a544cbf 100644 --- a/core/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php +++ b/core/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php @@ -15,13 +15,16 @@ use Composer\Package\CompletePackageInterface; use Composer\Package\AliasPackage; use Composer\Package\BasePackage; +use Composer\Package\Link; use Composer\Package\PackageInterface; use Composer\Package\RootPackageInterface; +use Composer\Pcre\Preg; use Composer\Repository\RepositorySet; use Composer\Repository\LockArrayRepository; use Composer\Semver\Constraint\Constraint; use Composer\Semver\Constraint\ConstraintInterface; use Composer\Package\Version\VersionParser; +use Composer\Repository\PlatformRepository; /** * Represents a problem detected while solving dependencies @@ -122,10 +125,14 @@ public static function formatDeduplicatedRules($rules, $indent, RepositorySet $r $deduplicatableRuleTypes = array(Rule::RULE_PACKAGE_REQUIRES, Rule::RULE_PACKAGE_CONFLICT); foreach ($rules as $rule) { $message = $rule->getPrettyString($repositorySet, $request, $pool, $isVerbose, $installedMap, $learnedPool); - if (in_array($rule->getReason(), $deduplicatableRuleTypes, true) && preg_match('{^(?P<package>\S+) (?P<version>\S+) (?P<type>requires|conflicts)}', $message, $m)) { - $template = preg_replace('{^\S+ \S+ }', '%s%s ', $message); + if (in_array($rule->getReason(), $deduplicatableRuleTypes, true) && Preg::isMatch('{^(?P<package>\S+) (?P<version>\S+) (?P<type>requires|conflicts)}', $message, $m)) { + $template = Preg::replace('{^\S+ \S+ }', '%s%s ', $message); $messages[] = $template; $templates[$template][$m[1]][$parser->normalize($m[2])] = $m[2]; + $sourcePackage = $rule->getSourcePackage($pool); + foreach ($pool->getRemovedVersionsByPackage(spl_object_hash($sourcePackage)) as $version => $prettyVersion) { + $templates[$template][$m[1]][$version] = $prettyVersion; + } } elseif ($message !== '') { $messages[] = $message; } @@ -141,7 +148,7 @@ public static function formatDeduplicatedRules($rules, $indent, RepositorySet $r } if (count($versions) > 1) { // remove the s from requires/conflicts to correct grammar - $message = preg_replace('{^(%s%s (?:require|conflict))s}', '$1', $message); + $message = Preg::replace('{^(%s%s (?:require|conflict))s}', '$1', $message); $result[] = sprintf($message, $package, '['.implode(', ', $versions).']'); } else { $result[] = sprintf($message, $package, ' '.reset($versions)); @@ -205,46 +212,62 @@ public function nextSection() */ public static function getMissingPackageReason(RepositorySet $repositorySet, Request $request, Pool $pool, $isVerbose, $packageName, ConstraintInterface $constraint = null) { - // handle php/hhvm - if ($packageName === 'php' || $packageName === 'php-64bit' || $packageName === 'hhvm') { - $version = self::getPlatformPackageVersion($pool, $packageName, phpversion()); + if (PlatformRepository::isPlatformPackage($packageName)) { + // handle php/php-*/hhvm + if (0 === stripos($packageName, 'php') || $packageName === 'hhvm') { + $version = self::getPlatformPackageVersion($pool, $packageName, phpversion()); - $msg = "- Root composer.json requires ".$packageName.self::constraintToText($constraint).' but '; + $msg = "- Root composer.json requires ".$packageName.self::constraintToText($constraint).' but '; - if (defined('HHVM_VERSION') || ($packageName === 'hhvm' && count($pool->whatProvides($packageName)) > 0)) { - return array($msg, 'your HHVM version does not satisfy that requirement.'); - } + if (defined('HHVM_VERSION') || ($packageName === 'hhvm' && count($pool->whatProvides($packageName)) > 0)) { + return array($msg, 'your HHVM version does not satisfy that requirement.'); + } - if ($packageName === 'hhvm') { - return array($msg, 'HHVM was not detected on this machine, make sure it is in your PATH.'); - } + if ($packageName === 'hhvm') { + return array($msg, 'HHVM was not detected on this machine, make sure it is in your PATH.'); + } - return array($msg, 'your '.$packageName.' version ('. $version .') does not satisfy that requirement.'); - } + if (null === $version) { + return array($msg, 'the '.$packageName.' package is disabled by your platform config. Enable it again with "composer config platform.'.$packageName.' --unset".'); + } - // handle php extensions - if (0 === stripos($packageName, 'ext-')) { - if (false !== strpos($packageName, ' ')) { - return array('- ', "PHP extension ".$packageName.' should be required as '.str_replace(' ', '-', $packageName).'.'); + return array($msg, 'your '.$packageName.' version ('. $version .') does not satisfy that requirement.'); } - $ext = substr($packageName, 4); - $version = self::getPlatformPackageVersion($pool, $packageName, phpversion($ext) ?: '0'); + // handle php extensions + if (0 === stripos($packageName, 'ext-')) { + if (false !== strpos($packageName, ' ')) { + return array('- ', "PHP extension ".$packageName.' should be required as '.str_replace(' ', '-', $packageName).'.'); + } - $error = extension_loaded($ext) ? 'it has the wrong version ('.$version.') installed' : 'it is missing from your system'; + $ext = substr($packageName, 4); + $msg = "- Root composer.json requires PHP extension ".$packageName.self::constraintToText($constraint).' but '; - return array("- Root composer.json requires PHP extension ".$packageName.self::constraintToText($constraint).' but ', $error.'. Install or enable PHP\'s '.$ext.' extension.'); - } + $version = self::getPlatformPackageVersion($pool, $packageName, phpversion($ext) ?: '0'); + if (null === $version) { + if (extension_loaded($ext)) { + return array( + $msg, + 'the '.$packageName.' package is disabled by your platform config. Enable it again with "composer config platform.'.$packageName.' --unset".', + ); + } - // handle linked libs - if (0 === stripos($packageName, 'lib-')) { - if (strtolower($packageName) === 'lib-icu') { - $error = extension_loaded('intl') ? 'it has the wrong version installed, try upgrading the intl extension.' : 'it is missing from your system, make sure the intl extension is loaded.'; + return array($msg, 'it is missing from your system. Install or enable PHP\'s '.$ext.' extension.'); + } - return array("- Root composer.json requires linked library ".$packageName.self::constraintToText($constraint).' but ', $error); + return array($msg, 'it has the wrong version installed ('.$version.').'); } - return array("- Root composer.json requires linked library ".$packageName.self::constraintToText($constraint).' but ', 'it has the wrong version installed or is missing from your system, make sure to load the extension providing it.'); + // handle linked libs + if (0 === stripos($packageName, 'lib-')) { + if (strtolower($packageName) === 'lib-icu') { + $error = extension_loaded('intl') ? 'it has the wrong version installed, try upgrading the intl extension.' : 'it is missing from your system, make sure the intl extension is loaded.'; + + return array("- Root composer.json requires linked library ".$packageName.self::constraintToText($constraint).' but ', $error); + } + + return array("- Root composer.json requires linked library ".$packageName.self::constraintToText($constraint).' but ', 'it has the wrong version installed or is missing from your system, make sure to load the extension providing it.'); + } } $lockedPackage = null; @@ -267,7 +290,7 @@ public static function getMissingPackageReason(RepositorySet $repositorySet, Req return $rootReqs[$packageName]->matches(new Constraint('==', $p->getVersion())); }); if (0 === count($filtered)) { - return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose).' but '.(self::hasMultipleNames($packages) ? 'these conflict' : 'it conflicts').' with your root composer.json require ('.$rootReqs[$packageName]->getPrettyString().').'); + return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose, $pool, $constraint).' but '.(self::hasMultipleNames($packages) ? 'these conflict' : 'it conflicts').' with your root composer.json require ('.$rootReqs[$packageName]->getPrettyString().').'); } } @@ -277,7 +300,7 @@ public static function getMissingPackageReason(RepositorySet $repositorySet, Req return $fixedConstraint->matches(new Constraint('==', $p->getVersion())); }); if (0 === count($filtered)) { - return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose).' but the package is fixed to '.$lockedPackage->getPrettyVersion().' (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.'); + return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose, $pool, $constraint).' but the package is fixed to '.$lockedPackage->getPrettyVersion().' (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.'); } } @@ -286,27 +309,27 @@ public static function getMissingPackageReason(RepositorySet $repositorySet, Req }); if (!$nonLockedPackages) { - return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose).' in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.'); + return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose, $pool, $constraint).' in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.'); } - return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose).' but these were not loaded, likely because '.(self::hasMultipleNames($packages) ? 'they conflict' : 'it conflicts').' with another require.'); + return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose, $pool, $constraint).' but these were not loaded, likely because '.(self::hasMultipleNames($packages) ? 'they conflict' : 'it conflicts').' with another require.'); } // check if the package is found when bypassing stability checks if ($packages = $repositorySet->findPackages($packageName, $constraint, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES)) { // we must first verify if a valid package would be found in a lower priority repository if ($allReposPackages = $repositorySet->findPackages($packageName, $constraint, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) { - return self::computeCheckForLowerPrioRepo($isVerbose, $packageName, $packages, $allReposPackages, 'minimum-stability', $constraint); + return self::computeCheckForLowerPrioRepo($pool, $isVerbose, $packageName, $packages, $allReposPackages, 'minimum-stability', $constraint); } - return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose).' but '.(self::hasMultipleNames($packages) ? 'these do' : 'it does').' not match your minimum-stability.'); + return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose, $pool, $constraint).' but '.(self::hasMultipleNames($packages) ? 'these do' : 'it does').' not match your minimum-stability.'); } // check if the package is found when bypassing the constraint and stability checks if ($packages = $repositorySet->findPackages($packageName, null, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES)) { // we must first verify if a valid package would be found in a lower priority repository if ($allReposPackages = $repositorySet->findPackages($packageName, $constraint, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) { - return self::computeCheckForLowerPrioRepo($isVerbose, $packageName, $packages, $allReposPackages, 'constraint', $constraint); + return self::computeCheckForLowerPrioRepo($pool, $isVerbose, $packageName, $packages, $allReposPackages, 'constraint', $constraint); } $suffix = ''; @@ -326,11 +349,11 @@ public static function getMissingPackageReason(RepositorySet $repositorySet, Req $suffix = ' See https://getcomposer.org/dep-on-root for details and assistance.'; } - return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose).' but '.(self::hasMultipleNames($packages) ? 'these do' : 'it does').' not match the constraint.' . $suffix); + return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose, $pool, $constraint).' but '.(self::hasMultipleNames($packages) ? 'these do' : 'it does').' not match the constraint.' . $suffix); } - if (!preg_match('{^[A-Za-z0-9_./-]+$}', $packageName)) { - $illegalChars = preg_replace('{[A-Za-z0-9_./-]+}', '', $packageName); + if (!Preg::isMatch('{^[A-Za-z0-9_./-]+$}', $packageName)) { + $illegalChars = Preg::replace('{[A-Za-z0-9_./-]+}', '', $packageName); return array("- Root composer.json requires $packageName, it ", 'could not be found, it looks like its name is invalid, "'.$illegalChars.'" is not allowed in package names.'); } @@ -356,19 +379,32 @@ public static function getMissingPackageReason(RepositorySet $repositorySet, Req * @internal * @param PackageInterface[] $packages * @param bool $isVerbose + * @param bool $useRemovedVersionGroup * @return string */ - public static function getPackageList(array $packages, $isVerbose) + public static function getPackageList(array $packages, $isVerbose, Pool $pool = null, ConstraintInterface $constraint = null, $useRemovedVersionGroup = false) { $prepared = array(); $hasDefaultBranch = array(); foreach ($packages as $package) { $prepared[$package->getName()]['name'] = $package->getPrettyName(); $prepared[$package->getName()]['versions'][$package->getVersion()] = $package->getPrettyVersion().($package instanceof AliasPackage ? ' (alias of '.$package->getAliasOf()->getPrettyVersion().')' : ''); + if ($pool && $constraint) { + foreach ($pool->getRemovedVersions($package->getName(), $constraint) as $version => $prettyVersion) { + $prepared[$package->getName()]['versions'][$version] = $prettyVersion; + } + } + if ($pool && $useRemovedVersionGroup) { + foreach ($pool->getRemovedVersionsByPackage(spl_object_hash($package)) as $version => $prettyVersion) { + $prepared[$package->getName()]['versions'][$version] = $prettyVersion; + } + } if ($package->isDefaultBranch()) { $hasDefaultBranch[$package->getName()] = true; } } + + $preparedStrings = array(); foreach ($prepared as $name => $package) { // remove the implicit default branch alias to avoid cruft in the display if (isset($package['versions'][VersionParser::DEFAULT_BRANCH_ALIAS], $hasDefaultBranch[$name])) { @@ -380,28 +416,50 @@ public static function getPackageList(array $packages, $isVerbose) if (!$isVerbose) { $package['versions'] = self::condenseVersionList($package['versions'], 4); } - $prepared[$name] = $package['name'].'['.implode(', ', $package['versions']).']'; + $preparedStrings[] = $package['name'].'['.implode(', ', $package['versions']).']'; } - return implode(', ', $prepared); + return implode(', ', $preparedStrings); } /** - * @param string $version * @param string $packageName - * @return string + * @param string $version the effective runtime version of the platform package + * @return ?string a version string or null if it appears the package was artificially disabled */ private static function getPlatformPackageVersion(Pool $pool, $packageName, $version) { $available = $pool->whatProvides($packageName); if (count($available)) { - $firstAvailable = reset($available); - $version = $firstAvailable->getPrettyVersion(); - $extra = $firstAvailable->getExtra(); - if ($firstAvailable instanceof CompletePackageInterface && isset($extra['config.platform']) && $extra['config.platform'] === true) { - $version .= '; ' . str_replace('Package ', '', $firstAvailable->getDescription()); + $selected = null; + foreach ($available as $pkg) { + if ($pkg->getRepository() instanceof PlatformRepository) { + $selected = $pkg; + break; + } + } + if ($selected === null) { + $selected = reset($available); + } + + // must be a package providing/replacing and not a real platform package + if ($selected->getName() !== $packageName) { + /** @var Link $link */ + foreach (array_merge(array_values($selected->getProvides()), array_values($selected->getReplaces())) as $link) { + if ($link->getTarget() === $packageName) { + return $link->getPrettyConstraint().' '.substr($link->getDescription(), 0, -1).'d by '.$selected->getPrettyString(); + } + } + } + + $version = $selected->getPrettyVersion(); + $extra = $selected->getExtra(); + if ($selected instanceof CompletePackageInterface && isset($extra['config.platform']) && $extra['config.platform'] === true) { + $version .= '; ' . str_replace('Package ', '', $selected->getDescription()); } + } else { + return null; } return $version; @@ -425,7 +483,7 @@ private static function condenseVersionList(array $versions, $max, $maxDev = 16) if (0 === stripos($version, 'dev-')) { $byMajor['dev'][] = $pretty; } else { - $byMajor[preg_replace('{^(\d+)\..*}', '$1', $version)][] = $pretty; + $byMajor[Preg::replace('{^(\d+)\..*}', '$1', $version)][] = $pretty; } } foreach ($byMajor as $majorVersion => $versionsForMajor) { @@ -469,7 +527,7 @@ private static function hasMultipleNames(array $packages) * @param string $reason * @return array{0: string, 1: string} */ - private static function computeCheckForLowerPrioRepo($isVerbose, $packageName, array $higherRepoPackages, array $allReposPackages, $reason, ConstraintInterface $constraint = null) + private static function computeCheckForLowerPrioRepo(Pool $pool, $isVerbose, $packageName, array $higherRepoPackages, array $allReposPackages, $reason, ConstraintInterface $constraint = null) { $nextRepoPackages = array(); $nextRepo = null; @@ -488,7 +546,7 @@ private static function computeCheckForLowerPrioRepo($isVerbose, $packageName, a if ($topPackage instanceof RootPackageInterface) { return array( "- Root composer.json requires $packageName".self::constraintToText($constraint).', it is ', - 'satisfiable by '.self::getPackageList($nextRepoPackages, $isVerbose).' from '.$nextRepo->getRepoName().' but '.$topPackage->getPrettyName().' is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.', + 'satisfiable by '.self::getPackageList($nextRepoPackages, $isVerbose, $pool, $constraint).' from '.$nextRepo->getRepoName().' but '.$topPackage->getPrettyName().' is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.', ); } } @@ -496,11 +554,21 @@ private static function computeCheckForLowerPrioRepo($isVerbose, $packageName, a if ($nextRepo instanceof LockArrayRepository) { $singular = count($higherRepoPackages) === 1; - return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', it is ', - 'found '.self::getPackageList($nextRepoPackages, $isVerbose).' in the lock file and '.self::getPackageList($higherRepoPackages, $isVerbose).' from '.reset($higherRepoPackages)->getRepository()->getRepoName().' but ' . ($singular ? 'it does' : 'these do') . ' not match your '.$reason.' and ' . ($singular ? 'is' : 'are') . ' therefore not installable. Make sure you either fix the '.$reason.' or avoid updating this package to keep the one from the lock file.', ); + $suggestion = 'Make sure you either fix the '.$reason.' or avoid updating this package to keep the one present in the lock file ('.self::getPackageList($nextRepoPackages, $isVerbose, $pool, $constraint).').'; + // symlinked path repos cannot be locked so do not suggest keeping it locked + if ($nextRepoPackages[0]->getDistType() === 'path') { + $transportOptions = $nextRepoPackages[0]->getTransportOptions(); + if (!isset($transportOptions['symlink']) || $transportOptions['symlink'] !== false) { + $suggestion = 'Make sure you fix the '.$reason.' as packages installed from symlinked path repos are updated even in partial updates and the one from the lock file can thus not be used.'; + } + } + + return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', + 'found ' . self::getPackageList($higherRepoPackages, $isVerbose, $pool, $constraint).' but ' . ($singular ? 'it does' : 'these do') . ' not match your '.$reason.' and ' . ($singular ? 'is' : 'are') . ' therefore not installable. '.$suggestion, + ); } - return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', it is ', 'satisfiable by '.self::getPackageList($nextRepoPackages, $isVerbose).' from '.$nextRepo->getRepoName().' but '.self::getPackageList($higherRepoPackages, $isVerbose).' from '.reset($higherRepoPackages)->getRepository()->getRepoName().' has higher repository priority. The packages with higher priority do not match your '.$reason.' and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.'); + return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', it is ', 'satisfiable by '.self::getPackageList($nextRepoPackages, $isVerbose, $pool, $constraint).' from '.$nextRepo->getRepoName().' but '.self::getPackageList($higherRepoPackages, $isVerbose, $pool, $constraint).' from '.reset($higherRepoPackages)->getRepository()->getRepoName().' has higher repository priority. The packages from the higher priority repository do not match your '.$reason.' and are therefore not installable. That repository is canonical so the lower priority repo\'s packages are not installable. See https://getcomposer.org/repoprio for details and assistance.'); } /** diff --git a/core/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php b/core/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php index bafd579946..b5777a8e41 100644 --- a/core/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php +++ b/core/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php @@ -228,6 +228,40 @@ public function isCausedByLock(RepositorySet $repositorySet, Request $request, P return false; } + /** + * @internal + * @return BasePackage + */ + public function getSourcePackage(Pool $pool) + { + $literals = $this->getLiterals(); + + switch ($this->getReason()) { + case self::RULE_PACKAGE_CONFLICT: + $package1 = $this->deduplicateDefaultBranchAlias($pool->literalToPackage($literals[0])); + $package2 = $this->deduplicateDefaultBranchAlias($pool->literalToPackage($literals[1])); + + if ($reasonData = $this->getReasonData()) { + // swap literals if they are not in the right order with package2 being the conflicter + if ($reasonData->getSource() === $package1->getName()) { + list($package2, $package1) = array($package1, $package2); + } + } + + return $package2; + + case self::RULE_PACKAGE_REQUIRES: + $sourceLiteral = array_shift($literals); + $sourcePackage = $this->deduplicateDefaultBranchAlias($pool->literalToPackage($sourceLiteral)); + + return $sourcePackage; + + default: + throw new \LogicException('Not implemented'); + } + } + + /** * @param bool $isVerbose * @param BasePackage[] $installedMap @@ -258,7 +292,7 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, } } - return 'Root composer.json requires '.$packageName.($constraint ? ' '.$constraint->getPrettyString() : '').' -> satisfiable by '.$this->formatPackagesUnique($pool, $packages, $isVerbose).'.'; + return 'Root composer.json requires '.$packageName.($constraint ? ' '.$constraint->getPrettyString() : '').' -> satisfiable by '.$this->formatPackagesUnique($pool, $packages, $isVerbose, $constraint).'.'; case self::RULE_FIXED: $package = $this->deduplicateDefaultBranchAlias($this->reasonData['package']); @@ -275,9 +309,12 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, $conflictTarget = $package1->getPrettyString(); if ($reasonData = $this->getReasonData()) { + assert($reasonData instanceof Link); + // swap literals if they are not in the right order with package2 being the conflicter if ($reasonData->getSource() === $package1->getName()) { list($package2, $package1) = array($package1, $package2); + $conflictTarget = $package1->getPrettyName().' '.$reasonData->getPrettyConstraint(); } // if the conflict is not directly against the package but something it provides/replaces, @@ -320,7 +357,7 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, $text = $reasonData->getPrettyString($sourcePackage); if ($requires) { - $text .= ' -> satisfiable by ' . $this->formatPackagesUnique($pool, $requires, $isVerbose) . '.'; + $text .= ' -> satisfiable by ' . $this->formatPackagesUnique($pool, $requires, $isVerbose, $this->reasonData->getConstraint()) . '.'; } else { $targetName = $reasonData->getTarget(); @@ -368,13 +405,13 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, } if ($installedPackages && $removablePackages) { - return $this->formatPackagesUnique($pool, $removablePackages, $isVerbose).' cannot be installed as that would require removing '.$this->formatPackagesUnique($pool, $installedPackages, $isVerbose).'. '.$reason; + return $this->formatPackagesUnique($pool, $removablePackages, $isVerbose, null, true).' cannot be installed as that would require removing '.$this->formatPackagesUnique($pool, $installedPackages, $isVerbose, null, true).'. '.$reason; } - return 'Only one of these can be installed: '.$this->formatPackagesUnique($pool, $literals, $isVerbose).'. '.$reason; + return 'Only one of these can be installed: '.$this->formatPackagesUnique($pool, $literals, $isVerbose, null, true).'. '.$reason; } - return 'You can only install one version of a package, so only one of these can be installed: ' . $this->formatPackagesUnique($pool, $literals, $isVerbose) . '.'; + return 'You can only install one version of a package, so only one of these can be installed: ' . $this->formatPackagesUnique($pool, $literals, $isVerbose, null, true) . '.'; case self::RULE_LEARNED: /** @TODO currently still generates way too much output to be helpful, and in some cases can even lead to endless recursion */ // if (isset($learnedPool[$this->reasonData])) { @@ -445,9 +482,10 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, /** * @param array<int|BasePackage> $packages An array containing packages or literals * @param bool $isVerbose + * @param bool $useRemovedVersionGroup * @return string */ - protected function formatPackagesUnique(Pool $pool, array $packages, $isVerbose) + protected function formatPackagesUnique(Pool $pool, array $packages, $isVerbose, ConstraintInterface $constraint = null, $useRemovedVersionGroup = false) { foreach ($packages as $index => $package) { if (!\is_object($package)) { @@ -455,7 +493,7 @@ protected function formatPackagesUnique(Pool $pool, array $packages, $isVerbose) } } - return Problem::getPackageList($packages, $isVerbose); + return Problem::getPackageList($packages, $isVerbose, $pool, $constraint, $useRemovedVersionGroup); } /** diff --git a/core/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php b/core/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php index b754046a6f..0ad9280984 100644 --- a/core/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php +++ b/core/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php @@ -45,7 +45,7 @@ class RuleSet implements \IteratorAggregate, \Countable /** @var int */ protected $nextRuleId = 0; - /** @var array<string, Rule|Rule[]> */ + /** @var array<int|string, Rule|Rule[]> */ protected $rulesByHash = array(); public function __construct() diff --git a/core/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php b/core/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php index e20a6299e6..9164c333a3 100644 --- a/core/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php +++ b/core/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php @@ -12,6 +12,9 @@ namespace Composer\DependencyResolver; +use Composer\Filter\PlatformRequirementFilter\IgnoreListPlatformRequirementFilter; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; use Composer\Package\BasePackage; use Composer\Package\AliasPackage; use Composer\Repository\PlatformRepository; @@ -160,10 +163,9 @@ private function addRule($type, Rule $newRule = null) } /** - * @param bool|string[] $ignorePlatformReqs * @return void */ - protected function addRulesForPackage(BasePackage $package, $ignorePlatformReqs) + protected function addRulesForPackage(BasePackage $package, PlatformRequirementFilterInterface $platformRequirementFilter) { /** @var \SplQueue<BasePackage> */ $workQueue = new \SplQueue; @@ -196,11 +198,14 @@ protected function addRulesForPackage(BasePackage $package, $ignorePlatformReqs) } foreach ($package->getRequires() as $link) { - if ((true === $ignorePlatformReqs || (is_array($ignorePlatformReqs) && in_array($link->getTarget(), $ignorePlatformReqs, true))) && PlatformRepository::isPlatformPackage($link->getTarget())) { + $constraint = $link->getConstraint(); + if ($platformRequirementFilter->isIgnored($link->getTarget())) { continue; + } elseif ($platformRequirementFilter instanceof IgnoreListPlatformRequirementFilter) { + $constraint = $platformRequirementFilter->filterConstraint($link->getTarget(), $constraint); } - $possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint()); + $possibleRequires = $this->pool->whatProvides($link->getTarget(), $constraint); $this->addRule(RuleSet::TYPE_PACKAGE, $this->createRequireRule($package, $possibleRequires, Rule::RULE_PACKAGE_REQUIRES, $link)); @@ -212,10 +217,9 @@ protected function addRulesForPackage(BasePackage $package, $ignorePlatformReqs) } /** - * @param bool|string[] $ignorePlatformReqs * @return void */ - protected function addConflictRules($ignorePlatformReqs = false) + protected function addConflictRules(PlatformRequirementFilterInterface $platformRequirementFilter) { /** @var BasePackage $package */ foreach ($this->addedMap as $package) { @@ -225,11 +229,14 @@ protected function addConflictRules($ignorePlatformReqs = false) continue; } - if ((true === $ignorePlatformReqs || (is_array($ignorePlatformReqs) && in_array($link->getTarget(), $ignorePlatformReqs, true))) && PlatformRepository::isPlatformPackage($link->getTarget())) { + $constraint = $link->getConstraint(); + if ($platformRequirementFilter->isIgnored($link->getTarget())) { continue; + } elseif ($platformRequirementFilter instanceof IgnoreListPlatformRequirementFilter) { + $constraint = $platformRequirementFilter->filterConstraint($link->getTarget(), $constraint); } - $conflicts = $this->pool->whatProvides($link->getTarget(), $link->getConstraint()); + $conflicts = $this->pool->whatProvides($link->getTarget(), $constraint); foreach ($conflicts as $conflict) { // define the conflict rule for regular packages, for alias packages it's only needed if the name @@ -251,10 +258,9 @@ protected function addConflictRules($ignorePlatformReqs = false) } /** - * @param bool|string[] $ignorePlatformReqs * @return void */ - protected function addRulesForRequest(Request $request, $ignorePlatformReqs) + protected function addRulesForRequest(Request $request, PlatformRequirementFilterInterface $platformRequirementFilter) { foreach ($request->getFixedPackages() as $package) { if ($package->id == -1) { @@ -267,7 +273,7 @@ protected function addRulesForRequest(Request $request, $ignorePlatformReqs) throw new \LogicException("Fixed package ".$package->getPrettyString()." was not added to solver pool."); } - $this->addRulesForPackage($package, $ignorePlatformReqs); + $this->addRulesForPackage($package, $platformRequirementFilter); $rule = $this->createInstallOneOfRule(array($package), Rule::RULE_FIXED, array( 'package' => $package, @@ -276,14 +282,16 @@ protected function addRulesForRequest(Request $request, $ignorePlatformReqs) } foreach ($request->getRequires() as $packageName => $constraint) { - if ((true === $ignorePlatformReqs || (is_array($ignorePlatformReqs) && in_array($packageName, $ignorePlatformReqs, true))) && PlatformRepository::isPlatformPackage($packageName)) { + if ($platformRequirementFilter->isIgnored($packageName)) { continue; + } elseif ($platformRequirementFilter instanceof IgnoreListPlatformRequirementFilter) { + $constraint = $platformRequirementFilter->filterConstraint($packageName, $constraint); } $packages = $this->pool->whatProvides($packageName, $constraint); if ($packages) { foreach ($packages as $package) { - $this->addRulesForPackage($package, $ignorePlatformReqs); + $this->addRulesForPackage($package, $platformRequirementFilter); } $rule = $this->createInstallOneOfRule($packages, Rule::RULE_ROOT_REQUIRE, array( @@ -296,10 +304,9 @@ protected function addRulesForRequest(Request $request, $ignorePlatformReqs) } /** - * @param bool|string[] $ignorePlatformReqs * @return void */ - protected function addRulesForRootAliases($ignorePlatformReqs) + protected function addRulesForRootAliases(PlatformRequirementFilterInterface $platformRequirementFilter) { foreach ($this->pool->getPackages() as $package) { // ensure that rules for root alias packages and aliases of packages which were loaded are also loaded @@ -309,22 +316,23 @@ protected function addRulesForRootAliases($ignorePlatformReqs) $package instanceof AliasPackage && ($package->isRootPackageAlias() || isset($this->addedMap[$package->getAliasOf()->id])) ) { - $this->addRulesForPackage($package, $ignorePlatformReqs); + $this->addRulesForPackage($package, $platformRequirementFilter); } } } /** - * @param bool|string[] $ignorePlatformReqs * @return RuleSet */ - public function getRulesFor(Request $request, $ignorePlatformReqs = false) + public function getRulesFor(Request $request, PlatformRequirementFilterInterface $platformRequirementFilter = null) { - $this->addRulesForRequest($request, $ignorePlatformReqs); + $platformRequirementFilter = $platformRequirementFilter ?: PlatformRequirementFilterFactory::ignoreNothing(); - $this->addRulesForRootAliases($ignorePlatformReqs); + $this->addRulesForRequest($request, $platformRequirementFilter); - $this->addConflictRules($ignorePlatformReqs); + $this->addRulesForRootAliases($platformRequirementFilter); + + $this->addConflictRules($platformRequirementFilter); // Remove references to packages $this->addedMap = $this->addedPackagesByNames = array(); diff --git a/core/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php b/core/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php index c8979748bb..b0a3eb00fb 100644 --- a/core/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php +++ b/core/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php @@ -12,9 +12,11 @@ namespace Composer\DependencyResolver; +use Composer\Filter\PlatformRequirementFilter\IgnoreListPlatformRequirementFilter; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; use Composer\IO\IOInterface; use Composer\Package\BasePackage; -use Composer\Repository\PlatformRepository; /** * @author Nils Adermann <naderman@naderman.de> @@ -41,7 +43,7 @@ class Solver /** @var int */ protected $propagateIndex; - /** @var array[] */ + /** @var mixed[] */ protected $branches = array(); /** @var Problem[] */ protected $problems = array(); @@ -166,14 +168,15 @@ protected function setupFixedMap(Request $request) } /** - * @param bool|string[] $ignorePlatformReqs * @return void */ - protected function checkForRootRequireProblems(Request $request, $ignorePlatformReqs) + protected function checkForRootRequireProblems(Request $request, PlatformRequirementFilterInterface $platformRequirementFilter) { foreach ($request->getRequires() as $packageName => $constraint) { - if ((true === $ignorePlatformReqs || (is_array($ignorePlatformReqs) && in_array($packageName, $ignorePlatformReqs, true))) && PlatformRepository::isPlatformPackage($packageName)) { + if ($platformRequirementFilter->isIgnored($packageName)) { continue; + } elseif ($platformRequirementFilter instanceof IgnoreListPlatformRequirementFilter) { + $constraint = $platformRequirementFilter->filterConstraint($packageName, $constraint); } if (!$this->pool->whatProvides($packageName, $constraint)) { @@ -185,18 +188,19 @@ protected function checkForRootRequireProblems(Request $request, $ignorePlatform } /** - * @param bool|string[] $ignorePlatformReqs * @return LockTransaction */ - public function solve(Request $request, $ignorePlatformReqs = false) + public function solve(Request $request, PlatformRequirementFilterInterface $platformRequirementFilter = null) { + $platformRequirementFilter = $platformRequirementFilter ?: PlatformRequirementFilterFactory::ignoreNothing(); + $this->setupFixedMap($request); $this->io->writeError('Generating rules', true, IOInterface::DEBUG); $ruleSetGenerator = new RuleSetGenerator($this->policy, $this->pool); - $this->rules = $ruleSetGenerator->getRulesFor($request, $ignorePlatformReqs); + $this->rules = $ruleSetGenerator->getRulesFor($request, $platformRequirementFilter); unset($ruleSetGenerator); - $this->checkForRootRequireProblems($request, $ignorePlatformReqs); + $this->checkForRootRequireProblems($request, $platformRequirementFilter); $this->decisions = new Decisions($this->pool); $this->watchGraph = new RuleWatchGraph; @@ -320,7 +324,7 @@ private function setPropagateLearn($level, $literal, Rule $rule) if ($newLevel <= 0 || $newLevel >= $level) { throw new SolverBugException( - "Trying to revert to invalid level ".(int) $newLevel." from level ".(int) $level."." + "Trying to revert to invalid level ".$newLevel." from level ".$level."." ); } @@ -419,7 +423,7 @@ protected function analyze($level, Rule $rule) while ($l1retry) { $l1retry = false; - if (!$num && !--$l1num) { + if (0 === $num && 0 === --$l1num) { // all level 1 literals done break 2; } @@ -443,7 +447,7 @@ protected function analyze($level, Rule $rule) unset($seen[abs($literal)]); - if ($num && 0 === --$num) { + if (0 !== $num && 0 === --$num) { if ($literal < 0) { $this->testFlagLearnedPositiveLiteral = true; } diff --git a/core/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php b/core/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php index d332fee580..deaec7d24c 100644 --- a/core/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php +++ b/core/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php @@ -17,6 +17,8 @@ /** * @author Nils Adermann <naderman@naderman.de> + * + * @method self::ERROR_DEPENDENCY_RESOLUTION_FAILED getCode() */ class SolverProblemsException extends \RuntimeException { @@ -47,16 +49,14 @@ public function __construct(array $problems, array $learnedPool) public function getPrettyString(RepositorySet $repositorySet, Request $request, Pool $pool, $isVerbose, $isDevExtraction = false) { $installedMap = $request->getPresentMap(true); - $hasExtensionProblems = false; + $missingExtensions = array(); $isCausedByLock = false; $problems = array(); foreach ($this->problems as $problem) { $problems[] = $problem->getPrettyString($repositorySet, $request, $pool, $isVerbose, $installedMap, $this->learnedPool)."\n"; - if (!$hasExtensionProblems && $this->hasExtensionProblems($problem->getReasons())) { - $hasExtensionProblems = true; - } + $missingExtensions = array_merge($missingExtensions, $this->getExtensionProblems($problem->getReasons())); $isCausedByLock = $isCausedByLock || $problem->isCausedByLock($repositorySet, $request, $pool); } @@ -72,8 +72,8 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, $hints[] = "Potential causes:\n - A typo in the package name\n - The package is not available in a stable-enough version according to your minimum-stability setting\n see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.\n - It's a private package and you forgot to add a custom repository to find it\n\nRead <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems."; } - if ($hasExtensionProblems) { - $hints[] = $this->createExtensionHint(); + if (!empty($missingExtensions)) { + $hints[] = $this->createExtensionHint($missingExtensions); } if ($isCausedByLock && !$isDevExtraction && !$request->getUpdateAllowTransitiveRootDependencies()) { @@ -106,9 +106,10 @@ public function getProblems() } /** + * @param string[] $missingExtensions * @return string */ - private function createExtensionHint() + private function createExtensionHint(array $missingExtensions) { $paths = IniHelper::getAll(); @@ -116,28 +117,34 @@ private function createExtensionHint() return ''; } + $ignoreExtensionsArguments = implode(" ", array_map(function ($extension) { + return "--ignore-platform-req=$extension"; + }, $missingExtensions)); + $text = "To enable extensions, verify that they are enabled in your .ini files:\n - "; $text .= implode("\n - ", $paths); - $text .= "\nYou can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode."; + $text .= "\nYou can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode."; + $text .= "\nAlternatively, you can run Composer with `$ignoreExtensionsArguments` to temporarily ignore these required extensions."; return $text; } /** * @param Rule[][] $reasonSets - * @return bool + * @return string[] */ - private function hasExtensionProblems(array $reasonSets) + private function getExtensionProblems(array $reasonSets) { + $missingExtensions = array(); foreach ($reasonSets as $reasonSet) { foreach ($reasonSet as $rule) { $required = $rule->getRequiredPackage(); if (null !== $required && 0 === strpos($required, 'ext-')) { - return true; + $missingExtensions[$required] = 1; } } } - return false; + return array_keys($missingExtensions); } } diff --git a/core/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php b/core/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php index fe737d1b5f..8e457f117f 100644 --- a/core/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php +++ b/core/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php @@ -14,6 +14,7 @@ use Composer\Package\PackageInterface; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; use Composer\Exception\IrrecoverableDownloadException; use React\Promise\PromiseInterface; @@ -392,7 +393,7 @@ protected function resolvePackageInstallPreference(PackageInterface $package) { foreach ($this->packagePreferences as $pattern => $preference) { $pattern = '{^'.str_replace('\\*', '.*', preg_quote($pattern)).'$}i'; - if (preg_match($pattern, $package->getName())) { + if (Preg::isMatch($pattern, $package->getName())) { if ('dist' === $preference || (!$package->isDev() && 'auto' === $preference)) { return 'dist'; } diff --git a/core/vendor/composer/composer/src/Composer/Downloader/FossilDownloader.php b/core/vendor/composer/composer/src/Composer/Downloader/FossilDownloader.php index ccef029f69..f5215d9664 100644 --- a/core/vendor/composer/composer/src/Composer/Downloader/FossilDownloader.php +++ b/core/vendor/composer/composer/src/Composer/Downloader/FossilDownloader.php @@ -13,6 +13,7 @@ namespace Composer\Downloader; use Composer\Package\PackageInterface; +use Composer\Pcre\Preg; use Composer\Util\ProcessExecutor; /** @@ -108,7 +109,7 @@ protected function getCommitLogs($fromReference, $toReference, $path) $match = '/\d\d:\d\d:\d\d\s+\[' . $toReference . '\]/'; foreach ($this->process->splitLines($output) as $line) { - if (preg_match($match, $line)) { + if (Preg::isMatch($match, $line)) { break; } $log .= $line; diff --git a/core/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php b/core/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php index 3a9e944274..33ff7922a8 100644 --- a/core/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php +++ b/core/vendor/composer/composer/src/Composer/Downloader/GitDownloader.php @@ -15,6 +15,7 @@ use Composer\Config; use Composer\IO\IOInterface; use Composer\Package\PackageInterface; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; use Composer\Util\Git as GitUtil; use Composer\Util\Url; @@ -61,7 +62,7 @@ protected function doDownload(PackageInterface $package, $path, $url, PackageInt { GitUtil::cleanEnv(); - $cachePath = $this->config->get('cache-vcs-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $url).'/'; + $cachePath = $this->config->get('cache-vcs-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', $url).'/'; $gitVersion = GitUtil::getVersion($this->process); // --dissociate option is only available since git 2.3.0-rc0 @@ -86,20 +87,27 @@ protected function doInstall(PackageInterface $package, $path, $url) { GitUtil::cleanEnv(); $path = $this->normalizePath($path); - $cachePath = $this->config->get('cache-vcs-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $url).'/'; + $cachePath = $this->config->get('cache-vcs-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', $url).'/'; $ref = $package->getSourceReference(); $flag = Platform::isWindows() ? '/D ' : ''; if (!empty($this->cachedPackages[$package->getId()][$ref])) { $msg = "Cloning ".$this->getShortHash($ref).' from cache'; + + $cloneFlags = '--dissociate --reference %cachePath% '; + $transportOptions = $package->getTransportOptions(); + if (isset($transportOptions['git']['single_use_clone']) && $transportOptions['git']['single_use_clone']) { + $cloneFlags = ''; + } + $command = - 'git clone --no-checkout %cachePath% %path% --dissociate --reference %cachePath% ' + 'git clone --no-checkout %cachePath% %path% ' . $cloneFlags . '&& cd '.$flag.'%path% ' . '&& git remote set-url origin -- %sanitizedUrl% && git remote add composer -- %sanitizedUrl%'; } else { $msg = "Cloning ".$this->getShortHash($ref); $command = 'git clone --no-checkout -- %url% %path% && cd '.$flag.'%path% && git remote add composer -- %url% && git fetch composer && git remote set-url origin -- %sanitizedUrl% && git remote set-url composer -- %sanitizedUrl%'; - if (getenv('COMPOSER_DISABLE_NETWORK')) { + if (Platform::getEnv('COMPOSER_DISABLE_NETWORK')) { throw new \RuntimeException('The required git reference for '.$package->getName().' is not in cache and network is disabled, aborting'); } } @@ -113,7 +121,7 @@ protected function doInstall(PackageInterface $package, $path, $url) ProcessExecutor::escape($url), ProcessExecutor::escape($path), ProcessExecutor::escape($cachePath), - ProcessExecutor::escape(preg_replace('{://([^@]+?):(.+?)@}', '://', $url)), + ProcessExecutor::escape(Preg::replace('{://([^@]+?):(.+?)@}', '://', $url)), ), $command ); @@ -127,7 +135,7 @@ protected function doInstall(PackageInterface $package, $path, $url) $this->setPushUrl($path, $url); } - if ($newRef = $this->updateToCommit($path, $ref, $package->getPrettyVersion(), $package->getReleaseDate())) { + if ($newRef = $this->updateToCommit($package, $path, (string) $ref, $package->getPrettyVersion())) { if ($package->getDistReference() === $package->getSourceReference()) { $package->setDistReference($newRef); } @@ -148,7 +156,7 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, throw new \RuntimeException('The .git directory is missing from '.$path.', see https://getcomposer.org/commit-deps for more information'); } - $cachePath = $this->config->get('cache-vcs-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $url).'/'; + $cachePath = $this->config->get('cache-vcs-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', $url).'/'; $ref = $target->getSourceReference(); if (!empty($this->cachedPackages[$target->getId()][$ref])) { @@ -157,7 +165,7 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, } else { $msg = "Checking out ".$this->getShortHash($ref); $command = '(git remote set-url composer -- %url% && git rev-parse --quiet --verify %ref% || (git fetch composer && git fetch --tags composer)) && git remote set-url composer -- %sanitizedUrl%'; - if (getenv('COMPOSER_DISABLE_NETWORK')) { + if (Platform::getEnv('COMPOSER_DISABLE_NETWORK')) { throw new \RuntimeException('The required git reference for '.$target->getName().' is not in cache and network is disabled, aborting'); } } @@ -171,14 +179,14 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, ProcessExecutor::escape($url), ProcessExecutor::escape($ref.'^{commit}'), ProcessExecutor::escape($cachePath), - ProcessExecutor::escape(preg_replace('{://([^@]+?):(.+?)@}', '://', $url)), + ProcessExecutor::escape(Preg::replace('{://([^@]+?):(.+?)@}', '://', $url)), ), $command ); }; $this->gitUtil->runCommand($commandCallable, $url, $path); - if ($newRef = $this->updateToCommit($path, $ref, $target->getPrettyVersion(), $target->getReleaseDate())) { + if ($newRef = $this->updateToCommit($target, $path, (string) $ref, $target->getPrettyVersion())) { if ($target->getDistReference() === $target->getSourceReference()) { $target->setDistReference($newRef); } @@ -188,8 +196,8 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target, $updateOriginUrl = false; if ( 0 === $this->process->execute('git remote -v', $output, $path) - && preg_match('{^origin\s+(?P<url>\S+)}m', $output, $originMatch) - && preg_match('{^composer\s+(?P<url>\S+)}m', $output, $composerMatch) + && Preg::isMatch('{^origin\s+(?P<url>\S+)}m', $output, $originMatch) + && Preg::isMatch('{^composer\s+(?P<url>\S+)}m', $output, $composerMatch) ) { if ($originMatch['url'] === $composerMatch['url'] && $composerMatch['url'] !== $target->getSourceUrl()) { $updateOriginUrl = true; @@ -237,13 +245,13 @@ public function getUnpushedChanges(PackageInterface $package, $path) } $refs = trim($output); - if (!preg_match('{^([a-f0-9]+) HEAD$}mi', $refs, $match)) { + if (!Preg::isMatch('{^([a-f0-9]+) HEAD$}mi', $refs, $match)) { // could not match the HEAD for some reason return null; } $headRef = $match[1]; - if (!preg_match_all('{^'.$headRef.' refs/heads/(.+)$}mi', $refs, $matches)) { + if (!Preg::isMatchAll('{^'.$headRef.' refs/heads/(.+)$}mi', $refs, $matches)) { // not on a branch, we are either on a not-modified tag or some sort of detached head, so skip this return null; } @@ -260,7 +268,7 @@ public function getUnpushedChanges(PackageInterface $package, $path) // try to find matching branch names in remote repos foreach ($candidateBranches as $candidate) { - if (preg_match_all('{^[a-f0-9]+ refs/remotes/((?:[^/]+)/'.preg_quote($candidate).')$}mi', $refs, $matches)) { + if (Preg::isMatchAll('{^[a-f0-9]+ refs/remotes/((?:[^/]+)/'.preg_quote($candidate).')$}mi', $refs, $matches)) { foreach ($matches[1] as $match) { $branch = $candidate; $remoteBranches[] = $match; @@ -352,7 +360,7 @@ protected function cleanChanges(PackageInterface $package, $path, $update) $changes = array_map(function ($elem) { return ' '.$elem; - }, preg_split('{\s*\r?\n\s*}', $changes)); + }, Preg::split('{\s*\r?\n\s*}', $changes)); $this->io->writeError(' <error>'.$package->getPrettyName().' has modified files:</error>'); $this->io->writeError(array_slice($changes, 0, 10)); if (count($changes) > 10) { @@ -426,12 +434,11 @@ protected function reapplyChanges($path) * * @param string $path * @param string $reference - * @param string $branch - * @param \DateTime $date + * @param string $prettyVersion * @throws \RuntimeException * @return null|string if a string is returned, it is the commit reference that was checked out if the original could not be found */ - protected function updateToCommit($path, $reference, $branch, $date) + protected function updateToCommit(PackageInterface $package, $path, $reference, $prettyVersion) { $force = !empty($this->hasDiscardedChanges[$path]) || !empty($this->hasStashedChanges[$path]) ? '-f ' : ''; @@ -441,7 +448,7 @@ protected function updateToCommit($path, $reference, $branch, $date) // If the non-existent branch is actually the name of a file, the file // is checked out. $template = 'git checkout '.$force.'%s -- && git reset --hard %1$s --'; - $branch = preg_replace('{(?:^dev-|(?:\.x)?-dev$)}i', '', $branch); + $branch = Preg::replace('{(?:^dev-|(?:\.x)?-dev$)}i', '', $prettyVersion); $branches = null; if (0 === $this->process->execute('git branch -r', $output, $path)) { @@ -450,9 +457,9 @@ protected function updateToCommit($path, $reference, $branch, $date) // check whether non-commitish are branches or tags, and fetch branches with the remote name $gitRef = $reference; - if (!preg_match('{^[a-f0-9]{40}$}', $reference) + if (!Preg::isMatch('{^[a-f0-9]{40}$}', $reference) && $branches - && preg_match('{^\s+composer/'.preg_quote($reference).'$}m', $branches) + && Preg::isMatch('{^\s+composer/'.preg_quote($reference).'$}m', $branches) ) { $command = sprintf('git checkout '.$force.'-B %s %s -- && git reset --hard %2$s --', ProcessExecutor::escape($branch), ProcessExecutor::escape('composer/'.$reference)); if (0 === $this->process->execute($command, $output, $path)) { @@ -461,9 +468,9 @@ protected function updateToCommit($path, $reference, $branch, $date) } // try to checkout branch by name and then reset it so it's on the proper branch name - if (preg_match('{^[a-f0-9]{40}$}', $reference)) { + if (Preg::isMatch('{^[a-f0-9]{40}$}', $reference)) { // add 'v' in front of the branch if it was stripped when generating the pretty name - if (!preg_match('{^\s+composer/'.preg_quote($branch).'$}m', $branches) && preg_match('{^\s+composer/v'.preg_quote($branch).'$}m', $branches)) { + if (!Preg::isMatch('{^\s+composer/'.preg_quote($branch).'$}m', $branches) && Preg::isMatch('{^\s+composer/v'.preg_quote($branch).'$}m', $branches)) { $branch = 'v' . $branch; } @@ -481,12 +488,15 @@ protected function updateToCommit($path, $reference, $branch, $date) return null; } + $exceptionExtra = ''; + // reference was not found (prints "fatal: reference is not a tree: $ref") if (false !== strpos($this->process->getErrorOutput(), $reference)) { $this->io->writeError(' <warning>'.$reference.' is gone (history was rewritten?)</warning>'); + $exceptionExtra = "\nIt looks like the commit hash is not available in the repository, maybe ".($package->isDev() ? 'the commit was removed from the branch' : 'the tag was recreated').'? Run "composer update '.$package->getPrettyName().'" to resolve this.'; } - throw new \RuntimeException(Url::sanitize('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput())); + throw new \RuntimeException(Url::sanitize('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput() . $exceptionExtra)); } /** @@ -510,7 +520,7 @@ protected function updateOriginUrl($path, $url) protected function setPushUrl($path, $url) { // set push url for github projects - if (preg_match('{^(?:https?|git)://'.GitUtil::getGitHubDomainsRegex($this->config).'/([^/]+)/([^/]+?)(?:\.git)?$}', $url, $match)) { + if (Preg::isMatch('{^(?:https?|git)://'.GitUtil::getGitHubDomainsRegex($this->config).'/([^/]+)/([^/]+?)(?:\.git)?$}', $url, $match)) { $protocols = $this->config->get('github-protocols'); $pushUrl = 'git@'.$match[1].':'.$match[2].'/'.$match[3].'.git'; if (!in_array('ssh', $protocols, true)) { @@ -633,7 +643,7 @@ protected function hasMetadataRepository($path) */ protected function getShortHash($reference) { - if (!$this->io->isVerbose() && preg_match('{^[0-9a-f]{40}$}', $reference)) { + if (!$this->io->isVerbose() && Preg::isMatch('{^[0-9a-f]{40}$}', $reference)) { return substr($reference, 0, 10); } diff --git a/core/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php b/core/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php index ffaed55151..5482bf43d0 100644 --- a/core/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php +++ b/core/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php @@ -126,7 +126,7 @@ public function install(PackageInterface $package, $path, $output = true) } } } catch (IOException $e) { - if (in_array(self::STRATEGY_MIRROR, $allowedStrategies)) { + if (in_array(self::STRATEGY_MIRROR, $allowedStrategies, true)) { if ($output) { $this->io->writeError(''); $this->io->writeError(' <error>Symlink failed, fallback to use mirroring!</error>'); @@ -255,7 +255,7 @@ private function computeAllowedStrategies(array $transportOptions) $currentStrategy = self::STRATEGY_SYMLINK; $allowedStrategies = array(self::STRATEGY_SYMLINK, self::STRATEGY_MIRROR); - $mirrorPathRepos = getenv('COMPOSER_MIRROR_PATH_REPOS'); + $mirrorPathRepos = Platform::getEnv('COMPOSER_MIRROR_PATH_REPOS'); if ($mirrorPathRepos) { $currentStrategy = self::STRATEGY_MIRROR; } @@ -272,6 +272,9 @@ private function computeAllowedStrategies(array $transportOptions) // Check we can use junctions safely if we are on Windows if (Platform::isWindows() && self::STRATEGY_SYMLINK === $currentStrategy && !$this->safeJunctions()) { + if (!in_array(self::STRATEGY_MIRROR, $allowedStrategies, true)) { + throw new \RuntimeException('You are on an old Windows / old PHP combo which does not allow Composer to use junctions/symlinks and this path repository has symlink:true in its options so copying is not allowed'); + } $currentStrategy = self::STRATEGY_MIRROR; $allowedStrategies = array(self::STRATEGY_MIRROR); } diff --git a/core/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php b/core/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php index 0c0c5d74d6..c7d0e79855 100644 --- a/core/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php +++ b/core/vendor/composer/composer/src/Composer/Downloader/PerforceDownloader.php @@ -21,7 +21,7 @@ */ class PerforceDownloader extends VcsDownloader { - /** @var Perforce */ + /** @var Perforce|null */ protected $perforce; /** diff --git a/core/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php b/core/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php index fa55960942..0d269121c9 100644 --- a/core/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php +++ b/core/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php @@ -13,6 +13,7 @@ namespace Composer\Downloader; use Composer\Package\PackageInterface; +use Composer\Pcre\Preg; use Composer\Util\Svn as SvnUtil; use Composer\Repository\VcsRepository; use Composer\Util\ProcessExecutor; @@ -98,7 +99,7 @@ public function getLocalChanges(PackageInterface $package, $path) $this->process->execute('svn status --ignore-externals', $output, $path); - return preg_match('{^ *[^X ] +}m', $output) ? $output : null; + return Preg::isMatch('{^ *[^X ] +}m', $output) ? $output : null; } /** @@ -145,7 +146,7 @@ protected function cleanChanges(PackageInterface $package, $path, $update) $changes = array_map(function ($elem) { return ' '.$elem; - }, preg_split('{\s*\r?\n\s*}', $changes)); + }, Preg::split('{\s*\r?\n\s*}', $changes)); $countChanges = count($changes); $this->io->writeError(sprintf(' <error>'.$package->getPrettyName().' has modified file%s:</error>', $countChanges === 1 ? '' : 's')); $this->io->writeError(array_slice($changes, 0, 10)); @@ -192,7 +193,7 @@ protected function cleanChanges(PackageInterface $package, $path, $update) */ protected function getCommitLogs($fromReference, $toReference, $path) { - if (preg_match('{@(\d+)$}', $fromReference) && preg_match('{@(\d+)$}', $toReference)) { + if (Preg::isMatch('{@(\d+)$}', $fromReference) && Preg::isMatch('{@(\d+)$}', $toReference)) { // retrieve the svn base url from the checkout folder $command = sprintf('svn info --non-interactive --xml -- %s', ProcessExecutor::escape($path)); if (0 !== $this->process->execute($command, $output, $path)) { @@ -202,7 +203,7 @@ protected function getCommitLogs($fromReference, $toReference, $path) } $urlPattern = '#<url>(.*)</url>#'; - if (preg_match($urlPattern, $output, $matches)) { + if (Preg::isMatch($urlPattern, $output, $matches)) { $baseUrl = $matches[1]; } else { throw new \RuntimeException( @@ -211,8 +212,8 @@ protected function getCommitLogs($fromReference, $toReference, $path) } // strip paths from references and only keep the actual revision - $fromRevision = preg_replace('{.*@(\d+)$}', '$1', $fromReference); - $toRevision = preg_replace('{.*@(\d+)$}', '$1', $toReference); + $fromRevision = Preg::replace('{.*@(\d+)$}', '$1', $fromReference); + $toRevision = Preg::replace('{.*@(\d+)$}', '$1', $toReference); $command = sprintf('svn log -r%s:%s --incremental', ProcessExecutor::escape($fromRevision), ProcessExecutor::escape($toRevision)); diff --git a/core/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php b/core/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php index 30fa1c9dac..a86d1da6b5 100644 --- a/core/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php +++ b/core/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php @@ -33,7 +33,7 @@ class ZipDownloader extends ArchiveDownloader private static $isWindows; /** @var ZipArchive|null */ - private $zipArchiveObject; + private $zipArchiveObject; // @phpstan-ignore-line helper property that is set via reflection for testing purposes /** * @inheritDoc diff --git a/core/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php b/core/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php index 06e30792c8..74ec3459d1 100644 --- a/core/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php +++ b/core/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php @@ -16,6 +16,7 @@ use Composer\Installer\InstallerEvent; use Composer\IO\IOInterface; use Composer\Composer; +use Composer\Pcre\Preg; use Composer\Util\Platform; use Composer\DependencyResolver\Operation\OperationInterface; use Composer\Repository\RepositoryInterface; @@ -161,7 +162,7 @@ public function dispatchInstallerEvent($eventName, $devMode, $executeOperations, */ protected function doDispatch(Event $event) { - if (getenv('COMPOSER_DEBUG_EVENTS')) { + if (Platform::getEnv('COMPOSER_DEBUG_EVENTS')) { $details = null; if ($event instanceof PackageEvent) { $details = (string) $event->getOperation(); @@ -199,7 +200,7 @@ protected function doDispatch(Event $event) $args = array_merge($script, $event->getArguments()); $flags = $event->getFlags(); if (strpos($callable, '@composer ') === 0) { - $exec = $this->getPhpExecCommand() . ' ' . ProcessExecutor::escape(getenv('COMPOSER_BINARY')) . ' ' . implode(' ', $args); + $exec = $this->getPhpExecCommand() . ' ' . ProcessExecutor::escape(Platform::getEnv('COMPOSER_BINARY')) . ' ' . implode(' ', $args); if (0 !== ($exitCode = $this->executeTty($exec))) { $this->io->writeError(sprintf('<error>Script %s handling the %s event returned with error code '.$exitCode.'</error>', $callable, $event->getName()), true, IOInterface::QUIET); @@ -253,9 +254,9 @@ protected function doDispatch(Event $event) $possibleLocalBinaries = $this->composer->getPackage()->getBinaries(); if ($possibleLocalBinaries) { foreach ($possibleLocalBinaries as $localExec) { - if (preg_match('{\b'.preg_quote($callable).'$}', $localExec)) { + if (Preg::isMatch('{\b'.preg_quote($callable).'$}', $localExec)) { $caller = BinaryInstaller::determineBinaryCaller($localExec); - $exec = preg_replace('{^'.preg_quote($callable).'}', $caller . ' ' . $localExec, $exec); + $exec = Preg::replace('{^'.preg_quote($callable).'}', $caller . ' ' . $localExec, $exec); break; } } @@ -274,13 +275,13 @@ protected function doDispatch(Event $event) if (strpos($exec, '@php ') === 0) { $pathAndArgs = substr($exec, 5); if (Platform::isWindows()) { - $pathAndArgs = preg_replace_callback('{^\S+}', function ($path) { + $pathAndArgs = Preg::replaceCallback('{^\S+}', function ($path) { return str_replace('/', '\\', $path[0]); }, $pathAndArgs); } // match somename (not in quote, and not a qualified path) and if it is not a valid path from CWD then try to find it // in $PATH. This allows support for `@php foo` where foo is a binary name found in PATH but not an actual relative path - $matched = preg_match('{^[^\'"\s/\\\\]+}', $pathAndArgs, $match); + $matched = Preg::isMatch('{^[^\'"\s/\\\\]+}', $pathAndArgs, $match); if ($matched && !file_exists($match[0])) { $finder = new ExecutableFinder; if ($pathToExec = $finder->find($match[0])) { @@ -296,7 +297,7 @@ protected function doDispatch(Event $event) } if (Platform::isWindows()) { - $exec = preg_replace_callback('{^\S+}', function ($path) { + $exec = Preg::replaceCallback('{^\S+}', function ($path) { return str_replace('/', '\\', $path[0]); }, $exec); } @@ -306,7 +307,7 @@ protected function doDispatch(Event $event) // resolution, even if bin-dir contains composer too because the project requires composer/composer // see https://github.com/composer/composer/issues/8748 if (strpos($exec, 'composer ') === 0) { - $exec = $this->getPhpExecCommand() . ' ' . ProcessExecutor::escape(getenv('COMPOSER_BINARY')) . substr($exec, 8); + $exec = $this->getPhpExecCommand() . ' ' . ProcessExecutor::escape(Platform::getEnv('COMPOSER_BINARY')) . substr($exec, 8); } if (0 !== ($exitCode = $this->executeTty($exec))) { @@ -565,17 +566,18 @@ protected function popEvent() */ private function ensureBinDirIsInPath() { - $pathStr = 'PATH'; - if (!isset($_SERVER[$pathStr]) && isset($_SERVER['Path'])) { - $pathStr = 'Path'; + $pathEnv = 'PATH'; + if (false === Platform::getEnv('PATH') && false !== Platform::getEnv('Path')) { + $pathEnv = 'Path'; } // add the bin dir to the PATH to make local binaries of deps usable in scripts $binDir = $this->composer->getConfig()->get('bin-dir'); if (is_dir($binDir)) { $binDir = realpath($binDir); - if (isset($_SERVER[$pathStr]) && !preg_match('{(^|'.PATH_SEPARATOR.')'.preg_quote($binDir).'($|'.PATH_SEPARATOR.')}', $_SERVER[$pathStr])) { - Platform::putEnv($pathStr, $binDir.PATH_SEPARATOR.getenv($pathStr)); + $pathValue = Platform::getEnv($pathEnv); + if (!Preg::isMatch('{(^|'.PATH_SEPARATOR.')'.preg_quote($binDir).'($|'.PATH_SEPARATOR.')}', $pathValue)) { + Platform::putEnv($pathEnv, $binDir.PATH_SEPARATOR.$pathValue); } } } diff --git a/core/vendor/composer/composer/src/Composer/Factory.php b/core/vendor/composer/composer/src/Composer/Factory.php index 7d08ec4d55..ee0b07f3e3 100644 --- a/core/vendor/composer/composer/src/Composer/Factory.php +++ b/core/vendor/composer/composer/src/Composer/Factory.php @@ -56,17 +56,17 @@ class Factory */ protected static function getHomeDir() { - $home = getenv('COMPOSER_HOME'); + $home = Platform::getEnv('COMPOSER_HOME'); if ($home) { return $home; } if (Platform::isWindows()) { - if (!getenv('APPDATA')) { + if (!Platform::getEnv('APPDATA')) { throw new \RuntimeException('The APPDATA or COMPOSER_HOME environment variable must be set for composer to run correctly'); } - return rtrim(strtr(getenv('APPDATA'), '\\', '/'), '/') . '/Composer'; + return rtrim(strtr(Platform::getEnv('APPDATA'), '\\', '/'), '/') . '/Composer'; } $userDir = self::getUserDir(); @@ -74,7 +74,7 @@ protected static function getHomeDir() if (self::useXdg()) { // XDG Base Directory Specifications - $xdgConfig = getenv('XDG_CONFIG_HOME'); + $xdgConfig = Platform::getEnv('XDG_CONFIG_HOME'); if (!$xdgConfig) { $xdgConfig = $userDir . '/.config'; } @@ -101,18 +101,18 @@ protected static function getHomeDir() */ protected static function getCacheDir($home) { - $cacheDir = getenv('COMPOSER_CACHE_DIR'); + $cacheDir = Platform::getEnv('COMPOSER_CACHE_DIR'); if ($cacheDir) { return $cacheDir; } - $homeEnv = getenv('COMPOSER_HOME'); + $homeEnv = Platform::getEnv('COMPOSER_HOME'); if ($homeEnv) { return $homeEnv . '/cache'; } if (Platform::isWindows()) { - if ($cacheDir = getenv('LOCALAPPDATA')) { + if ($cacheDir = Platform::getEnv('LOCALAPPDATA')) { $cacheDir .= '/Composer'; } else { $cacheDir = $home . '/cache'; @@ -136,7 +136,7 @@ protected static function getCacheDir($home) } if (self::useXdg()) { - $xdgCache = getenv('XDG_CACHE_HOME') ?: $userDir . '/.cache'; + $xdgCache = Platform::getEnv('XDG_CACHE_HOME') ?: $userDir . '/.cache'; return $xdgCache . '/composer'; } @@ -150,7 +150,7 @@ protected static function getCacheDir($home) */ protected static function getDataDir($home) { - $homeEnv = getenv('COMPOSER_HOME'); + $homeEnv = Platform::getEnv('COMPOSER_HOME'); if ($homeEnv) { return $homeEnv; } @@ -161,7 +161,7 @@ protected static function getDataDir($home) $userDir = self::getUserDir(); if ($home !== $userDir . '/.composer' && self::useXdg()) { - $xdgData = getenv('XDG_DATA_HOME') ?: $userDir . '/.local/share'; + $xdgData = Platform::getEnv('XDG_DATA_HOME') ?: $userDir . '/.local/share'; return $xdgData . '/composer'; } @@ -186,7 +186,7 @@ public static function createConfig(IOInterface $io = null, $cwd = null) 'home' => $home, 'cache-dir' => self::getCacheDir($home), 'data-dir' => self::getDataDir($home), - ))); + )), Config::SOURCE_DEFAULT); // load global config $file = new JsonFile($config->get('home').'/config.json'); @@ -194,7 +194,7 @@ public static function createConfig(IOInterface $io = null, $cwd = null) if ($io && $io->isDebug()) { $io->writeError('Loading config file ' . $file->getPath()); } - $config->merge($file->read()); + $config->merge($file->read(), $file->getPath()); } $config->setConfigSource(new JsonConfigSource($file)); @@ -220,12 +220,12 @@ public static function createConfig(IOInterface $io = null, $cwd = null) if ($io && $io->isDebug()) { $io->writeError('Loading config file ' . $file->getPath()); } - $config->merge(array('config' => $file->read())); + $config->merge(array('config' => $file->read()), $file->getPath()); } $config->setAuthConfigSource(new JsonConfigSource($file, true)); // load COMPOSER_AUTH environment variable if set - if ($composerAuthEnv = getenv('COMPOSER_AUTH')) { + if ($composerAuthEnv = Platform::getEnv('COMPOSER_AUTH')) { $authData = json_decode($composerAuthEnv, true); if (null === $authData) { @@ -236,7 +236,7 @@ public static function createConfig(IOInterface $io = null, $cwd = null) if ($io && $io->isDebug()) { $io->writeError('Loading auth config from COMPOSER_AUTH'); } - $config->merge(array('config' => $authData)); + $config->merge(array('config' => $authData), 'COMPOSER_AUTH'); } } @@ -248,7 +248,7 @@ public static function createConfig(IOInterface $io = null, $cwd = null) */ public static function getComposerFile() { - return trim(getenv('COMPOSER')) ?: './composer.json'; + return trim(Platform::getEnv('COMPOSER')) ?: './composer.json'; } /** @@ -294,13 +294,14 @@ public static function createOutput() * @param array<string, mixed>|string|null $localConfig either a configuration array or a filename to read from, if null it will * read from the default filename * @param bool $disablePlugins Whether plugins should not be loaded + * @param bool $disableScripts Whether scripts should not be run * @param string|null $cwd * @param bool $fullLoad Whether to initialize everything or only main project stuff (used when loading the global composer) * @throws \InvalidArgumentException * @throws \UnexpectedValueException * @return Composer */ - public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, $cwd = null, $fullLoad = true) + public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, $cwd = null, $fullLoad = true, $disableScripts = false) { $cwd = $cwd ?: (string) getcwd(); @@ -309,6 +310,7 @@ public function createComposer(IOInterface $io, $localConfig = null, $disablePlu $localConfig = static::getComposerFile(); } + $localConfigSource = Config::SOURCE_UNKNOWN; if (is_string($localConfig)) { $composerFile = $localConfig; @@ -340,11 +342,12 @@ public function createComposer(IOInterface $io, $localConfig = null, $disablePlu } $localConfig = $file->read(); + $localConfigSource = $file->getPath(); } // Load config and override with local config/auth config $config = static::createConfig($io, $cwd); - $config->merge($localConfig); + $config->merge($localConfig, $localConfigSource); if (isset($composerFile)) { $io->writeError('Loading config file ' . $composerFile .' ('.realpath($composerFile).')', true, IOInterface::DEBUG); $config->setConfigSource(new JsonConfigSource(new JsonFile(realpath($composerFile), null, $io))); @@ -352,7 +355,7 @@ public function createComposer(IOInterface $io, $localConfig = null, $disablePlu $localAuthFile = new JsonFile(dirname(realpath($composerFile)) . '/auth.json', null, $io); if ($localAuthFile->exists()) { $io->writeError('Loading config file ' . $localAuthFile->getPath(), true, IOInterface::DEBUG); - $config->merge(array('config' => $localAuthFile->read())); + $config->merge(array('config' => $localAuthFile->read()), $localAuthFile->getPath()); $config->setAuthConfigSource(new JsonConfigSource($localAuthFile, true)); } } @@ -380,6 +383,7 @@ public function createComposer(IOInterface $io, $localConfig = null, $disablePlu // initialize event dispatcher $dispatcher = new EventDispatcher($composer, $io, $process); + $dispatcher->setRunScripts(!$disableScripts); $composer->setEventDispatcher($dispatcher); // initialize repository manager @@ -426,7 +430,7 @@ public function createComposer(IOInterface $io, $localConfig = null, $disablePlu if ($fullLoad) { $globalComposer = null; if (realpath($config->get('home')) !== $cwd) { - $globalComposer = $this->createGlobalComposer($io, $config, $disablePlugins); + $globalComposer = $this->createGlobalComposer($io, $config, $disablePlugins, $disableScripts); } $pm = $this->createPluginManager($io, $composer, $globalComposer, $disablePlugins); @@ -458,13 +462,14 @@ public function createComposer(IOInterface $io, $localConfig = null, $disablePlu /** * @param IOInterface $io IO instance * @param bool $disablePlugins Whether plugins should not be loaded + * @param bool $disableScripts Whether scripts should not be executed * @return Composer|null */ - public static function createGlobal(IOInterface $io, $disablePlugins = false) + public static function createGlobal(IOInterface $io, $disablePlugins = false, $disableScripts = false) { $factory = new static(); - return $factory->createGlobalComposer($io, static::createConfig($io), $disablePlugins, true); + return $factory->createGlobalComposer($io, static::createConfig($io), $disablePlugins, $disableScripts, true); } /** @@ -485,15 +490,16 @@ protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $v /** * @param bool $disablePlugins + * @param bool $disableScripts * @param bool $fullLoad * * @return Composer|null */ - protected function createGlobalComposer(IOInterface $io, Config $config, $disablePlugins, $fullLoad = false) + protected function createGlobalComposer(IOInterface $io, Config $config, $disablePlugins, $disableScripts, $fullLoad = false) { $composer = null; try { - $composer = $this->createComposer($io, $config->get('home') . '/composer.json', $disablePlugins, $config->get('home'), $fullLoad); + $composer = $this->createComposer($io, $config->get('home') . '/composer.json', $disablePlugins, $config->get('home'), $fullLoad, $disableScripts); } catch (\Exception $e) { $io->writeError('Failed to initialize global composer: '.$e->getMessage(), true, IOInterface::DEBUG); } @@ -592,7 +598,7 @@ public function createInstallationManager(Loop $loop, IOInterface $io, EventDisp protected function createDefaultInstallers(Installer\InstallationManager $im, Composer $composer, IOInterface $io, ProcessExecutor $process = null) { $fs = new Filesystem($process); - $binaryInstaller = new Installer\BinaryInstaller($io, rtrim($composer->getConfig()->get('bin-dir'), '/'), $composer->getConfig()->get('bin-compat'), $fs); + $binaryInstaller = new Installer\BinaryInstaller($io, rtrim($composer->getConfig()->get('bin-dir'), '/'), $composer->getConfig()->get('bin-compat'), $fs, rtrim($composer->getConfig()->get('vendor-dir'), '/')); $im->addInstaller(new Installer\LibraryInstaller($io, $composer, null, $fs, $binaryInstaller)); $im->addInstaller(new Installer\PluginInstaller($io, $composer, $fs, $binaryInstaller)); @@ -627,13 +633,14 @@ protected function loadRootPackage(RepositoryManager $rm, Config $config, Versio * @param mixed $config either a configuration array or a filename to read from, if null it will read from * the default filename * @param bool $disablePlugins Whether plugins should not be loaded + * @param bool $disableScripts Whether scripts should not be run * @return Composer */ - public static function create(IOInterface $io, $config = null, $disablePlugins = false) + public static function create(IOInterface $io, $config = null, $disablePlugins = false, $disableScripts = false) { $factory = new static(); - return $factory->createComposer($io, $config, $disablePlugins); + return $factory->createComposer($io, $config, $disablePlugins, null, true, $disableScripts); } /** @@ -713,7 +720,7 @@ private static function useXdg() */ private static function getUserDir() { - $home = getenv('HOME'); + $home = Platform::getEnv('HOME'); if (!$home) { throw new \RuntimeException('The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly'); } diff --git a/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreAllPlatformRequirementFilter.php b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreAllPlatformRequirementFilter.php new file mode 100644 index 0000000000..0d64d8236f --- /dev/null +++ b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreAllPlatformRequirementFilter.php @@ -0,0 +1,17 @@ +<?php + +namespace Composer\Filter\PlatformRequirementFilter; + +use Composer\Repository\PlatformRepository; + +final class IgnoreAllPlatformRequirementFilter implements PlatformRequirementFilterInterface +{ + /** + * @param string $req + * @return bool + */ + public function isIgnored($req) + { + return PlatformRepository::isPlatformPackage($req); + } +} diff --git a/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php new file mode 100644 index 0000000000..d6d95a2878 --- /dev/null +++ b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php @@ -0,0 +1,83 @@ +<?php + +namespace Composer\Filter\PlatformRequirementFilter; + +use Composer\Package\BasePackage; +use Composer\Pcre\Preg; +use Composer\Repository\PlatformRepository; +use Composer\Semver\Constraint\Constraint; +use Composer\Semver\Constraint\ConstraintInterface; +use Composer\Semver\Constraint\MatchAllConstraint; +use Composer\Semver\Constraint\MultiConstraint; +use Composer\Semver\Interval; +use Composer\Semver\Intervals; + +final class IgnoreListPlatformRequirementFilter implements PlatformRequirementFilterInterface +{ + /** + * @var non-empty-string + */ + private $ignoreRegex; + + /** + * @var non-empty-string + */ + private $ignoreUpperBoundRegex; + + /** + * @param string[] $reqList + */ + public function __construct(array $reqList) + { + $ignoreAll = $ignoreUpperBound = array(); + foreach ($reqList as $req) { + if (substr($req, -1) === '+') { + $ignoreUpperBound[] = substr($req, 0, -1); + } else { + $ignoreAll[] = $req; + } + } + $this->ignoreRegex = BasePackage::packageNamesToRegexp($ignoreAll); + $this->ignoreUpperBoundRegex = BasePackage::packageNamesToRegexp($ignoreUpperBound); + } + + /** + * @param string $req + * @return bool + */ + public function isIgnored($req) + { + if (!PlatformRepository::isPlatformPackage($req)) { + return false; + } + + return Preg::isMatch($this->ignoreRegex, $req); + } + + /** + * @param string $req + * @return ConstraintInterface + */ + public function filterConstraint($req, ConstraintInterface $constraint) + { + if (!PlatformRepository::isPlatformPackage($req)) { + return $constraint; + } + + if (!Preg::isMatch($this->ignoreUpperBoundRegex, $req)) { + return $constraint; + } + + if (Preg::isMatch($this->ignoreRegex, $req)) { + return new MatchAllConstraint; + } + + $intervals = Intervals::get($constraint); + $last = end($intervals['numeric']); + if ($last !== false && (string) $last->getEnd() !== (string) Interval::untilPositiveInfinity()) { + $constraint = new MultiConstraint(array($constraint, new Constraint('>=', $last->getEnd()->getVersion())), false); + } + + return $constraint; + } +} diff --git a/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreNothingPlatformRequirementFilter.php b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreNothingPlatformRequirementFilter.php new file mode 100644 index 0000000000..94c1a9a97d --- /dev/null +++ b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/IgnoreNothingPlatformRequirementFilter.php @@ -0,0 +1,15 @@ +<?php + +namespace Composer\Filter\PlatformRequirementFilter; + +final class IgnoreNothingPlatformRequirementFilter implements PlatformRequirementFilterInterface +{ + /** + * @param string $req + * @return false + */ + public function isIgnored($req) + { + return false; + } +} diff --git a/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterFactory.php b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterFactory.php new file mode 100644 index 0000000000..3dff764fb3 --- /dev/null +++ b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterFactory.php @@ -0,0 +1,45 @@ +<?php + +namespace Composer\Filter\PlatformRequirementFilter; + +final class PlatformRequirementFilterFactory +{ + /** + * @param mixed $boolOrList + * + * @return PlatformRequirementFilterInterface + */ + public static function fromBoolOrList($boolOrList) + { + if (is_bool($boolOrList)) { + return $boolOrList ? self::ignoreAll() : self::ignoreNothing(); + } + + if (is_array($boolOrList)) { + return new IgnoreListPlatformRequirementFilter($boolOrList); + } + + throw new \InvalidArgumentException( + sprintf( + 'PlatformRequirementFilter: Unknown $boolOrList parameter %s. Please report at https://github.com/composer/composer/issues/new.', + gettype($boolOrList) + ) + ); + } + + /** + * @return PlatformRequirementFilterInterface + */ + public static function ignoreAll() + { + return new IgnoreAllPlatformRequirementFilter(); + } + + /** + * @return PlatformRequirementFilterInterface + */ + public static function ignoreNothing() + { + return new IgnoreNothingPlatformRequirementFilter(); + } +} diff --git a/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterInterface.php b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterInterface.php new file mode 100644 index 0000000000..5efd70a8b8 --- /dev/null +++ b/core/vendor/composer/composer/src/Composer/Filter/PlatformRequirementFilter/PlatformRequirementFilterInterface.php @@ -0,0 +1,12 @@ +<?php + +namespace Composer\Filter\PlatformRequirementFilter; + +interface PlatformRequirementFilterInterface +{ + /** + * @param string $req + * @return bool + */ + public function isIgnored($req); +} diff --git a/core/vendor/composer/composer/src/Composer/IO/BaseIO.php b/core/vendor/composer/composer/src/Composer/IO/BaseIO.php index b1c11a1cbf..d03eab77d1 100644 --- a/core/vendor/composer/composer/src/Composer/IO/BaseIO.php +++ b/core/vendor/composer/composer/src/Composer/IO/BaseIO.php @@ -13,12 +13,13 @@ namespace Composer\IO; use Composer\Config; +use Composer\Pcre\Preg; use Composer\Util\ProcessExecutor; use Psr\Log\LogLevel; abstract class BaseIO implements IOInterface { - /** @var array<string, array{username: string, password: string}> */ + /** @var array<string, array{username: string|null, password: string|null}> */ protected $authentications = array(); /** @@ -129,7 +130,7 @@ public function loadConfiguration(Config $config) foreach ($githubOauth as $domain => $token) { // allowed chars for GH tokens are from https://github.blog/changelog/2021-03-04-authentication-token-format-updates/ // plus dots which were at some point used for GH app integration tokens - if (!preg_match('{^[.A-Za-z0-9_]+$}', $token)) { + if (!Preg::isMatch('{^[.A-Za-z0-9_]+$}', $token)) { throw new \UnexpectedValueException('Your github oauth token for '.$domain.' contains invalid characters: "'.$token.'"'); } $this->checkAndSetAuthentication($domain, $token, 'x-oauth-basic'); @@ -159,7 +160,7 @@ public function loadConfiguration(Config $config) } /** - * @inheritDoc + * @return void */ public function emergency($message, array $context = array()) { @@ -167,7 +168,7 @@ public function emergency($message, array $context = array()) } /** - * @inheritDoc + * @return void */ public function alert($message, array $context = array()) { @@ -175,7 +176,7 @@ public function alert($message, array $context = array()) } /** - * @inheritDoc + * @return void */ public function critical($message, array $context = array()) { @@ -183,7 +184,7 @@ public function critical($message, array $context = array()) } /** - * @inheritDoc + * @return void */ public function error($message, array $context = array()) { @@ -191,7 +192,7 @@ public function error($message, array $context = array()) } /** - * @inheritDoc + * @return void */ public function warning($message, array $context = array()) { @@ -199,7 +200,7 @@ public function warning($message, array $context = array()) } /** - * @inheritDoc + * @return void */ public function notice($message, array $context = array()) { @@ -207,7 +208,7 @@ public function notice($message, array $context = array()) } /** - * @inheritDoc + * @return void */ public function info($message, array $context = array()) { @@ -215,7 +216,7 @@ public function info($message, array $context = array()) } /** - * @inheritDoc + * @return void */ public function debug($message, array $context = array()) { @@ -223,7 +224,7 @@ public function debug($message, array $context = array()) } /** - * @inheritDoc + * @return void */ public function log($level, $message, array $context = array()) { diff --git a/core/vendor/composer/composer/src/Composer/IO/BufferIO.php b/core/vendor/composer/composer/src/Composer/IO/BufferIO.php index ea9864e917..627abec9d5 100644 --- a/core/vendor/composer/composer/src/Composer/IO/BufferIO.php +++ b/core/vendor/composer/composer/src/Composer/IO/BufferIO.php @@ -12,6 +12,7 @@ namespace Composer\IO; +use Composer\Pcre\Preg; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Formatter\OutputFormatterInterface; @@ -55,7 +56,7 @@ public function getOutput() $output = stream_get_contents($this->output->getStream()); - $output = preg_replace_callback("{(?<=^|\n|\x08)(.+?)(\x08+)}", function ($matches) { + $output = Preg::replaceCallback("{(?<=^|\n|\x08)(.+?)(\x08+)}", function ($matches) { $pre = strip_tags($matches[1]); if (strlen($pre) === strlen($matches[2])) { diff --git a/core/vendor/composer/composer/src/Composer/IO/IOInterface.php b/core/vendor/composer/composer/src/Composer/IO/IOInterface.php index cf19321c24..4650e1ed9d 100644 --- a/core/vendor/composer/composer/src/Composer/IO/IOInterface.php +++ b/core/vendor/composer/composer/src/Composer/IO/IOInterface.php @@ -198,7 +198,7 @@ public function select($question, $choices, $default, $attempts = false, $errorM /** * Get all authentication information entered. * - * @return array<string, array{username: string, password: string}> The map of authentication data + * @return array<string, array{username: string|null, password: string|null}> The map of authentication data */ public function getAuthentications(); diff --git a/core/vendor/composer/composer/src/Composer/Installer.php b/core/vendor/composer/composer/src/Composer/Installer.php index 411c1d6e0d..8bd88e5b9d 100644 --- a/core/vendor/composer/composer/src/Composer/Installer.php +++ b/core/vendor/composer/composer/src/Composer/Installer.php @@ -20,6 +20,7 @@ use Composer\DependencyResolver\Operation\UpdateOperation; use Composer\DependencyResolver\Operation\InstallOperation; use Composer\DependencyResolver\Operation\UninstallOperation; +use Composer\DependencyResolver\PoolOptimizer; use Composer\DependencyResolver\Pool; use Composer\DependencyResolver\Request; use Composer\DependencyResolver\Solver; @@ -27,6 +28,9 @@ use Composer\DependencyResolver\PolicyInterface; use Composer\Downloader\DownloadManager; use Composer\EventDispatcher\EventDispatcher; +use Composer\Filter\PlatformRequirementFilter\IgnoreListPlatformRequirementFilter; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; use Composer\Installer\InstallationManager; use Composer\Installer\InstallerEvents; use Composer\Installer\SuggestedPackagesReporter; @@ -150,8 +154,6 @@ class Installer protected $dumpAutoloader = true; /** @var bool */ protected $runScripts = true; - /** @var bool|string[] */ - protected $ignorePlatformReqs = false; /** @var bool */ protected $preferStable = false; /** @var bool */ @@ -177,6 +179,11 @@ class Installer */ protected $suggestedPackagesReporter; + /** + * @var PlatformRequirementFilterInterface + */ + protected $platformRequirementFilter; + /** * @var ?RepositoryInterface */ @@ -207,6 +214,7 @@ public function __construct(IOInterface $io, Config $config, RootPackageInterfac $this->eventDispatcher = $eventDispatcher; $this->autoloadGenerator = $autoloadGenerator; $this->suggestedPackagesReporter = new SuggestedPackagesReporter($this->io); + $this->platformRequirementFilter = PlatformRequirementFilterFactory::ignoreNothing(); $this->writeLock = $config->get('lock'); } @@ -329,7 +337,7 @@ public function run() $this->autoloadGenerator->setClassMapAuthoritative($this->classMapAuthoritative); $this->autoloadGenerator->setApcu($this->apcuAutoloader, $this->apcuAutoloaderPrefix); $this->autoloadGenerator->setRunScripts($this->runScripts); - $this->autoloadGenerator->setIgnorePlatformRequirements($this->ignorePlatformReqs); + $this->autoloadGenerator->setPlatformRequirementFilter($this->platformRequirementFilter); $this->autoloadGenerator->dump($this->config, $localRepo, $this->package, $this->installationManager, 'composer', $this->optimizeAutoloader); } @@ -346,7 +354,7 @@ public function run() $fundingCount++; } } - if ($fundingCount) { + if ($fundingCount > 0) { $this->io->writeError(array( sprintf( "<info>%d package%s you are using %s looking for funding.</info>", @@ -376,6 +384,7 @@ public function run() * @param bool $doInstall * * @return int + * @phpstan-return self::ERROR_* */ protected function doUpdate(InstalledRepositoryInterface $localRepo, $doInstall) { @@ -424,14 +433,14 @@ protected function doUpdate(InstalledRepositoryInterface $localRepo, $doInstall) $request->setUpdateAllowList($this->updateAllowList, $this->updateAllowTransitiveDependencies); } - $pool = $repositorySet->createPool($request, $this->io, $this->eventDispatcher); + $pool = $repositorySet->createPool($request, $this->io, $this->eventDispatcher, $this->createPoolOptimizer($policy)); $this->io->writeError('<info>Updating dependencies</info>'); // solve dependencies $solver = new Solver($policy, $pool, $this->io); try { - $lockTransaction = $solver->solve($request, $this->ignorePlatformReqs); + $lockTransaction = $solver->solve($request, $this->platformRequirementFilter); $ruleSetSize = $solver->getRuleSetSize(); $solver = null; } catch (SolverProblemsException $e) { @@ -453,6 +462,8 @@ protected function doUpdate(InstalledRepositoryInterface $localRepo, $doInstall) $this->io->writeError("Analyzed ".count($pool)." packages to resolve dependencies", true, IOInterface::VERBOSE); $this->io->writeError("Analyzed ".$ruleSetSize." rules to resolve dependencies", true, IOInterface::VERBOSE); + $pool = null; + if (!$lockTransaction->getOperations()) { $this->io->writeError('Nothing to modify in lock file'); } @@ -609,7 +620,7 @@ protected function extractDevPackages(LockTransaction $lockTransaction, Platform $solver = new Solver($policy, $pool, $this->io); try { - $nonDevLockTransaction = $solver->solve($request, $this->ignorePlatformReqs); + $nonDevLockTransaction = $solver->solve($request, $this->platformRequirementFilter); $solver = null; } catch (SolverProblemsException $e) { $err = 'Unable to find a compatible set of packages based on your non-dev requirements alone.'; @@ -623,7 +634,7 @@ protected function extractDevPackages(LockTransaction $lockTransaction, Platform $ghe = new GithubActionError($this->io); $ghe->emit($err."\n".$prettyProblem); - return max(self::ERROR_GENERIC_FAILURE, $e->getCode()); + return $e->getCode(); } $lockTransaction->setNonDevPackages($nonDevLockTransaction); @@ -635,6 +646,7 @@ protected function extractDevPackages(LockTransaction $lockTransaction, Platform * @param InstalledRepositoryInterface $localRepo * @param bool $alreadySolved Whether the function is called as part of an update command or independently * @return int exit code + * @phpstan-return self::ERROR_* */ protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySolved = false) { @@ -674,7 +686,7 @@ protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySo // solve dependencies $solver = new Solver($policy, $pool, $this->io); try { - $lockTransaction = $solver->solve($request, $this->ignorePlatformReqs); + $lockTransaction = $solver->solve($request, $this->platformRequirementFilter); $solver = null; // installing the locked packages on this platform resulted in lock modifying operations, there wasn't a conflict, but the lock file as-is seems to not work on this system @@ -798,15 +810,16 @@ private function createRepositorySet($forUpdate, PlatformRepository $platformRep $rootRequires = array(); foreach ($requires as $req => $constraint) { + if ($constraint instanceof Link) { + $constraint = $constraint->getConstraint(); + } // skip platform requirements from the root package to avoid filtering out existing platform packages - if ((true === $this->ignorePlatformReqs || (is_array($this->ignorePlatformReqs) && in_array($req, $this->ignorePlatformReqs, true))) && PlatformRepository::isPlatformPackage($req)) { + if ($this->platformRequirementFilter->isIgnored($req)) { continue; + } elseif ($this->platformRequirementFilter instanceof IgnoreListPlatformRequirementFilter) { + $constraint = $this->platformRequirementFilter->filterConstraint($req, $constraint); } - if ($constraint instanceof Link) { - $rootRequires[$req] = $constraint->getConstraint(); - } else { - $rootRequires[$req] = $constraint; - } + $rootRequires[$req] = $constraint; } $this->fixedRootPackage = clone $this->package; @@ -993,6 +1006,23 @@ private function mockLocalRepositories(RepositoryManager $rm) ); } + /** + * @return PoolOptimizer|null + */ + private function createPoolOptimizer(PolicyInterface $policy) + { + // Not the best architectural decision here, would need to be able + // to configure from the outside of Installer but this is only + // a debugging tool and should never be required in any other use case + if ('0' === Platform::getEnv('COMPOSER_POOL_OPTIMIZER')) { + $this->io->write('Pool Optimizer was disabled for debugging purposes.', true, IOInterface::DEBUG); + + return null; + } + + return new PoolOptimizer($policy); + } + /** * Create Installer * @@ -1242,16 +1272,23 @@ public function isVerbose() * @param bool|string[] $ignorePlatformReqs * * @return Installer + * + * @deprecated use setPlatformRequirementFilter instead */ public function setIgnorePlatformRequirements($ignorePlatformReqs) { - if (is_array($ignorePlatformReqs)) { - $this->ignorePlatformReqs = array_filter($ignorePlatformReqs, function ($req) { - return PlatformRepository::isPlatformPackage($req); - }); - } else { - $this->ignorePlatformReqs = (bool) $ignorePlatformReqs; - } + trigger_error('Installer::setIgnorePlatformRequirements is deprecated since Composer 2.2, use setPlatformRequirementFilter instead.', E_USER_DEPRECATED); + + return $this->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs)); + } + + /** + * @param PlatformRequirementFilterInterface $platformRequirementFilter + * @return Installer + */ + public function setPlatformRequirementFilter(PlatformRequirementFilterInterface $platformRequirementFilter) + { + $this->platformRequirementFilter = $platformRequirementFilter; return $this; } diff --git a/core/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php b/core/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php index 084bef18a8..417e9be2b1 100644 --- a/core/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php +++ b/core/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php @@ -14,6 +14,7 @@ use Composer\IO\IOInterface; use Composer\Package\PackageInterface; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; use Composer\Util\Platform; use Composer\Util\ProcessExecutor; @@ -36,19 +37,23 @@ class BinaryInstaller protected $io; /** @var Filesystem */ protected $filesystem; + /** @var string|null */ + private $vendorDir; /** * @param IOInterface $io * @param string $binDir * @param string $binCompat * @param Filesystem $filesystem + * @param string|null $vendorDir */ - public function __construct(IOInterface $io, $binDir, $binCompat, Filesystem $filesystem = null) + public function __construct(IOInterface $io, $binDir, $binCompat, Filesystem $filesystem = null, $vendorDir = null) { $this->binDir = $binDir; $this->binCompat = $binCompat; $this->io = $io; $this->filesystem = $filesystem ?: new Filesystem(); + $this->vendorDir = $vendorDir; } /** @@ -72,38 +77,41 @@ public function installBinaries(PackageInterface $package, $installPath, $warnOn $this->io->writeError(' <warning>Skipped installation of bin '.$bin.' for package '.$package->getName().': file not found in package</warning>'); continue; } - - // in case a custom installer returned a relative path for the - // $package, we can now safely turn it into a absolute path (as we - // already checked the binary's existence). The following helpers - // will require absolute paths to work properly. - $binPath = realpath($binPath); - + if (is_dir($binPath)) { + $this->io->writeError(' <warning>Skipped installation of bin '.$bin.' for package '.$package->getName().': found a directory at that path</warning>'); + continue; + } + if (!$this->filesystem->isAbsolutePath($binPath)) { + // in case a custom installer returned a relative path for the + // $package, we can now safely turn it into a absolute path (as we + // already checked the binary's existence). The following helpers + // will require absolute paths to work properly. + $binPath = realpath($binPath); + } $this->initializeBinDir(); $link = $this->binDir.'/'.basename($bin); if (file_exists($link)) { - if (is_link($link)) { - // likely leftover from a previous install, make sure - // that the target is still executable in case this - // is a fresh install of the vendor. - Silencer::call('chmod', $link, 0777 & ~umask()); + if (!is_link($link)) { + if ($warnOnOverwrite) { + $this->io->writeError(' Skipped installation of bin '.$bin.' for package '.$package->getName().': name conflicts with an existing file'); + } + continue; } - if ($warnOnOverwrite) { - $this->io->writeError(' Skipped installation of bin '.$bin.' for package '.$package->getName().': name conflicts with an existing file'); + if (realpath($link) === realpath($binPath)) { + // It is a linked binary from a previous installation, which can be replaced with a proxy file + $this->filesystem->unlink($link); } - continue; } - if ($this->binCompat === "auto") { - if (Platform::isWindows() || Platform::isWindowsSubsystemForLinux()) { - $this->installFullBinaries($binPath, $link, $bin, $package); - } else { - $this->installSymlinkBinaries($binPath, $link); - } - } elseif ($this->binCompat === "full") { + $binCompat = $this->binCompat; + if ($binCompat === "auto" && (Platform::isWindows() || Platform::isWindowsSubsystemForLinux())) { + $binCompat = 'full'; + } + + if ($binCompat === "full") { $this->installFullBinaries($binPath, $link, $bin, $package); - } elseif ($this->binCompat === "symlink") { - $this->installSymlinkBinaries($binPath, $link); + } else { + $this->installUnixyProxyBinaries($binPath, $link); } Silencer::call('chmod', $binPath, 0777 & ~umask()); } @@ -122,10 +130,10 @@ public function removeBinaries(PackageInterface $package) } foreach ($binaries as $bin) { $link = $this->binDir.'/'.basename($bin); - if (is_link($link) || file_exists($link)) { + if (is_link($link) || file_exists($link)) { // still checking for symlinks here for legacy support $this->filesystem->unlink($link); } - if (file_exists($link.'.bat')) { + if (is_file($link.'.bat')) { $this->filesystem->unlink($link.'.bat'); } } @@ -150,7 +158,7 @@ public static function determineBinaryCaller($bin) $handle = fopen($bin, 'r'); $line = fgets($handle); fclose($handle); - if (preg_match('{^#!/(?:usr/bin/env )?(?:[^/]+/)*(.+)$}m', $line, $match)) { + if (Preg::isMatch('{^#!/(?:usr/bin/env )?(?:[^/]+/)*(.+)$}m', $line, $match)) { return trim($match[1]); } @@ -188,19 +196,6 @@ protected function installFullBinaries($binPath, $link, $bin, PackageInterface $ } } - /** - * @param string $binPath - * @param string $link - * - * @return void - */ - protected function installSymlinkBinaries($binPath, $link) - { - if (!$this->filesystem->relativeSymlink($binPath, $link)) { - $this->installUnixyProxyBinaries($binPath, $link); - } - } - /** * @param string $binPath * @param string $link @@ -233,9 +228,21 @@ protected function generateWindowsProxyCode($bin, $link) $binPath = $this->filesystem->findShortestPath($link, $bin); $caller = self::determineBinaryCaller($bin); + // if the target is a php file, we run the unixy proxy file + // to ensure that _composer_autoload_path gets defined, instead + // of running the binary directly + if ($caller === 'php') { + return "@ECHO OFF\r\n". + "setlocal DISABLEDELAYEDEXPANSION\r\n". + "SET BIN_TARGET=%~dp0/".trim(ProcessExecutor::escape(basename($link, '.bat')), '"\'')."\r\n". + "SET COMPOSER_RUNTIME_BIN_DIR=%~dp0\r\n". + "{$caller} \"%BIN_TARGET%\" %*\r\n"; + } + return "@ECHO OFF\r\n". "setlocal DISABLEDELAYEDEXPANSION\r\n". "SET BIN_TARGET=%~dp0/".trim(ProcessExecutor::escape($binPath), '"\'')."\r\n". + "SET COMPOSER_RUNTIME_BIN_DIR=%~dp0\r\n". "{$caller} \"%BIN_TARGET%\" %*\r\n"; } @@ -255,28 +262,30 @@ protected function generateUnixyProxyCode($bin, $link) $binContents = file_get_contents($bin); // For php files, we generate a PHP proxy instead of a shell one, // which allows calling the proxy with a custom php process - if (preg_match('{^(#!.*\r?\n)?<\?php}', $binContents, $match)) { + if (Preg::isMatch('{^(#!.*\r?\n)?[\r\n\t ]*<\?php}', $binContents, $match)) { // carry over the existing shebang if present, otherwise add our own $proxyCode = empty($match[1]) ? '#!/usr/bin/env php' : trim($match[1]); - - $binPathExported = var_export($binPath, true); - - return $proxyCode . "\n" . <<<PROXY -<?php - -/** - * Proxy PHP file generated by Composer - * - * This file includes the referenced bin path ($binPath) using ob_start to remove the shebang if present - * to prevent the shebang from being output on PHP<8 - * - * @generated - */ - -namespace Composer; - -\$binPath = __DIR__ . "/" . $binPathExported; - + $binPathExported = $this->filesystem->findShortestPathCode($link, $bin, false, true); + $streamProxyCode = $streamHint = ''; + $globalsCode = '$GLOBALS[\'_composer_bin_dir\'] = __DIR__;'."\n"; + $phpunitHack1 = $phpunitHack2 = ''; + // Don't expose autoload path when vendor dir was not set in custom installers + if ($this->vendorDir) { + $globalsCode .= '$GLOBALS[\'_composer_autoload_path\'] = ' . $this->filesystem->findShortestPathCode($link, $this->vendorDir . '/autoload.php', false, true).";\n"; + } + // Add workaround for PHPUnit process isolation + if ($this->filesystem->normalizePath($bin) === $this->filesystem->normalizePath($this->vendorDir.'/phpunit/phpunit/phpunit')) { + // workaround issue on PHPUnit 6.5+ running on PHP 8+ + $globalsCode .= '$GLOBALS[\'__PHPUNIT_ISOLATION_EXCLUDE_LIST\'] = $GLOBALS[\'__PHPUNIT_ISOLATION_BLACKLIST\'] = array(realpath('.$binPathExported.'));'."\n"; + // workaround issue on all PHPUnit versions running on PHP <8 + $phpunitHack1 = "'phpvfscomposer://'."; + $phpunitHack2 = ' + $data = str_replace(\'__DIR__\', var_export(dirname($this->realpath), true), $data); + $data = str_replace(\'__FILE__\', var_export($this->realpath, true), $data);'; + } + if (trim($match[0]) !== '<?php') { + $streamHint = ' using a stream wrapper to prevent the shebang from being output on PHP<8'."\n *"; + $streamProxyCode = <<<STREAMPROXY if (PHP_VERSION_ID < 80000) { if (!class_exists('Composer\BinProxyWrapper')) { /** @@ -286,18 +295,17 @@ final class BinProxyWrapper { private \$handle; private \$position; + private \$realpath; public function stream_open(\$path, \$mode, \$options, &\$opened_path) { - // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution - \$opened_path = substr(\$path, 21); - \$opened_path = realpath(\$opened_path) ?: \$opened_path; - \$this->handle = fopen(\$opened_path, \$mode); + // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution + \$opened_path = substr(\$path, 17); + \$this->realpath = realpath(\$opened_path) ?: \$opened_path; + \$opened_path = $phpunitHack1\$this->realpath; + \$this->handle = fopen(\$this->realpath, \$mode); \$this->position = 0; - // remove all traces of this stream wrapper once it has been used - stream_wrapper_unregister('composer-bin-proxy'); - return (bool) \$this->handle; } @@ -307,7 +315,7 @@ public function stream_read(\$count) if (\$this->position === 0) { \$data = preg_replace('{^#!.*\\r?\\n}', '', \$data); - } + }$phpunitHack2 \$this->position += strlen(\$data); @@ -329,6 +337,16 @@ public function stream_lock(\$operation) return \$operation ? flock(\$this->handle, \$operation) : true; } + public function stream_seek(\$offset, \$whence) + { + if (0 === fseek(\$this->handle, \$offset, \$whence)) { + \$this->position = ftell(\$this->handle); + return true; + } + + return false; + } + public function stream_tell() { return \$this->position; @@ -341,23 +359,51 @@ public function stream_eof() public function stream_stat() { - return fstat(\$this->handle); + return array(); } public function stream_set_option(\$option, \$arg1, \$arg2) { return true; } + + public function url_stat(\$path, \$flags) + { + \$path = substr(\$path, 17); + if (file_exists(\$path)) { + return stat(\$path); + } + + return false; + } } } - if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { - include("composer-bin-proxy://" . \$binPath); + if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { + include("phpvfscomposer://" . $binPathExported); exit(0); } } -include \$binPath; +STREAMPROXY; + } + + return $proxyCode . "\n" . <<<PROXY +<?php + +/** + * Proxy PHP file generated by Composer + * + * This file includes the referenced bin path ($binPath) + *$streamHint + * @generated + */ + +namespace Composer; + +$globalsCode +$streamProxyCode +include $binPathExported; PROXY; } @@ -365,7 +411,19 @@ public function stream_set_option(\$option, \$arg1, \$arg2) return <<<PROXY #!/usr/bin/env sh -dir=\$(cd "\${0%[/\\\\]*}" > /dev/null; cd $binDir && pwd) +# Support bash to support `source` with fallback on $0 if this does not run with bash +# https://stackoverflow.com/a/35006505/6512 +selfArg="\$BASH_SOURCE" +if [ -z "\$selfArg" ]; then + selfArg="\$0" +fi + +self=\$(realpath \$selfArg 2> /dev/null) +if [ -z "\$self" ]; then + self="\$selfArg" +fi + +dir=\$(cd "\${self%[/\\\\]*}" > /dev/null; cd $binDir && pwd) if [ -d /proc/cygdrive ]; then case \$(which php) in @@ -376,6 +434,17 @@ public function stream_set_option(\$option, \$arg1, \$arg2) esac fi +export COMPOSER_RUNTIME_BIN_DIR=\$(cd "\${self%[/\\\\]*}" > /dev/null; pwd) + +# If bash is sourcing this file, we have to source the target as well +bashSource="\$BASH_SOURCE" +if [ -n "\$bashSource" ]; then + if [ "\$bashSource" != "\$0" ]; then + source "\${dir}/$binFile" "\$@" + return + fi +fi + "\${dir}/$binFile" "\$@" PROXY; diff --git a/core/vendor/composer/composer/src/Composer/Installer/InstallationManager.php b/core/vendor/composer/composer/src/Composer/Installer/InstallationManager.php index 6429e1b56e..07e6709c75 100644 --- a/core/vendor/composer/composer/src/Composer/Installer/InstallationManager.php +++ b/core/vendor/composer/composer/src/Composer/Installer/InstallationManager.php @@ -488,7 +488,7 @@ private function waitOnPromises(array $promises) if ( $this->outputProgress && $this->io instanceof ConsoleIO - && !getenv('CI') + && !Platform::getEnv('CI') && !$this->io->isDebug() && count($promises) > 1 ) { diff --git a/core/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php b/core/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php index 1d8c743bba..71f45e8e41 100644 --- a/core/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php +++ b/core/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php @@ -14,6 +14,7 @@ use Composer\Composer; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; use Composer\Repository\InstalledRepositoryInterface; use Composer\Package\PackageInterface; use Composer\Util\Filesystem; @@ -63,7 +64,7 @@ public function __construct(IOInterface $io, Composer $composer, $type = 'librar $this->filesystem = $filesystem ?: new Filesystem(); $this->vendorDir = rtrim($composer->getConfig()->get('vendor-dir'), '/'); - $this->binaryInstaller = $binaryInstaller ?: new BinaryInstaller($this->io, rtrim($composer->getConfig()->get('bin-dir'), '/'), $composer->getConfig()->get('bin-compat'), $this->filesystem); + $this->binaryInstaller = $binaryInstaller ?: new BinaryInstaller($this->io, rtrim($composer->getConfig()->get('bin-dir'), '/'), $composer->getConfig()->get('bin-compat'), $this->filesystem, $this->vendorDir); } /** @@ -252,7 +253,7 @@ protected function getPackageBasePath(PackageInterface $package) $targetDir = $package->getTargetDir(); if ($targetDir) { - return preg_replace('{/*'.str_replace('/', '/+', preg_quote($targetDir)).'/?$}', '', $installPath); + return Preg::replace('{/*'.str_replace('/', '/+', preg_quote($targetDir)).'/?$}', '', $installPath); } return $installPath; diff --git a/core/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php b/core/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php index 901852307d..f8fb9d887e 100644 --- a/core/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php +++ b/core/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php @@ -14,6 +14,7 @@ use Composer\IO\IOInterface; use Composer\Package\PackageInterface; +use Composer\Pcre\Preg; use Composer\Repository\InstalledRepository; use Symfony\Component\Console\Formatter\OutputFormatter; @@ -180,7 +181,7 @@ public function outputMinimalistic(InstalledRepository $installedRepo = null, Pa /** * @param InstalledRepository|null $installedRepo If passed in, suggested packages which are installed already will be skipped * @param PackageInterface|null $onlyDependentsOf If passed in, only the suggestions from direct dependents of that package, or from the package itself, will be shown - * @return array[] + * @return mixed[] */ private function getFilteredSuggestions(InstalledRepository $installedRepo = null, PackageInterface $onlyDependentsOf = null) { @@ -232,7 +233,7 @@ private function escapeOutput($string) */ private function removeControlCharacters($string) { - return preg_replace( + return Preg::replace( '/[[:cntrl:]]/', '', str_replace("\n", ' ', $string) diff --git a/core/vendor/composer/composer/src/Composer/Json/JsonFile.php b/core/vendor/composer/composer/src/Composer/Json/JsonFile.php index a83f2fd736..2202530d93 100644 --- a/core/vendor/composer/composer/src/Composer/Json/JsonFile.php +++ b/core/vendor/composer/composer/src/Composer/Json/JsonFile.php @@ -12,6 +12,7 @@ namespace Composer\Json; +use Composer\Pcre\Preg; use JsonSchema\Validator; use Seld\JsonLint\JsonParser; use Seld\JsonLint\ParsingException; @@ -55,7 +56,7 @@ public function __construct($path, HttpDownloader $httpDownloader = null, IOInte { $this->path = $path; - if (null === $httpDownloader && preg_match('{^https?://}i', $path)) { + if (null === $httpDownloader && Preg::isMatch('{^https?://}i', $path)) { throw new \InvalidArgumentException('http urls require a HttpDownloader instance to be passed'); } $this->httpDownloader = $httpDownloader; @@ -148,7 +149,7 @@ public function write(array $hash, $options = 448) $this->filePutContentsIfModified($this->path, static::encode($hash, $options). ($options & self::JSON_PRETTY_PRINT ? "\n" : '')); break; } catch (\Exception $e) { - if ($retries) { + if ($retries > 0) { usleep(500000); continue; } @@ -245,8 +246,8 @@ public static function encode($data, $options = 448) // compact brackets to follow recent php versions if (PHP_VERSION_ID < 50428 || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50512) || (defined('JSON_C_VERSION') && version_compare(phpversion('json'), '1.3.6', '<'))) { - $json = preg_replace('/\[\s+\]/', '[]', $json); - $json = preg_replace('/\{\s+\}/', '{}', $json); + $json = Preg::replace('/\[\s+\]/', '[]', $json); + $json = Preg::replace('/\{\s+\}/', '{}', $json); } return $json; diff --git a/core/vendor/composer/composer/src/Composer/Json/JsonFormatter.php b/core/vendor/composer/composer/src/Composer/Json/JsonFormatter.php index 386e62673a..4f75498ff8 100644 --- a/core/vendor/composer/composer/src/Composer/Json/JsonFormatter.php +++ b/core/vendor/composer/composer/src/Composer/Json/JsonFormatter.php @@ -12,6 +12,8 @@ namespace Composer\Json; +use Composer\Pcre\Preg; + /** * Formats json strings used for php < 5.4 because the json_encode doesn't * supports the flags JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE @@ -66,7 +68,7 @@ public static function format($json, $unescapeUnicode, $unescapeSlashes) if ($unescapeUnicode && function_exists('mb_convert_encoding')) { // https://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha - $buffer = preg_replace_callback('/(\\\\+)u([0-9a-f]{4})/i', function ($match) { + $buffer = Preg::replaceCallback('/(\\\\+)u([0-9a-f]{4})/i', function ($match) { $l = strlen($match[1]); if ($l % 2) { diff --git a/core/vendor/composer/composer/src/Composer/Json/JsonManipulator.php b/core/vendor/composer/composer/src/Composer/Json/JsonManipulator.php index 2d8b1afeb5..f1fcdf520b 100644 --- a/core/vendor/composer/composer/src/Composer/Json/JsonManipulator.php +++ b/core/vendor/composer/composer/src/Composer/Json/JsonManipulator.php @@ -12,6 +12,7 @@ namespace Composer\Json; +use Composer\Pcre\Preg; use Composer\Repository\PlatformRepository; /** @@ -46,7 +47,7 @@ public function __construct($contents) if ($contents === '') { $contents = '{}'; } - if (!$this->pregMatch('#^\{(.*)\}$#s', $contents)) { + if (!Preg::isMatch('#^\{(.*)\}$#s', $contents)) { throw new \InvalidArgumentException('The json file must be an object ({})'); } $this->newline = false !== strpos($contents, "\r\n") ? "\r\n" : "\n"; @@ -80,7 +81,7 @@ public function addLink($type, $package, $constraint, $sortPackages = false) $regex = '{'.self::$DEFINES.'^(?P<start>\s*\{\s*(?:(?&string)\s*:\s*(?&json)\s*,\s*)*?)'. '(?P<property>'.preg_quote(JsonFile::encode($type)).'\s*:\s*)(?P<value>(?&json))(?P<end>.*)}sx'; - if (!$this->pregMatch($regex, $this->contents, $matches)) { + if (!Preg::isMatch($regex, $this->contents, $matches)) { return false; } @@ -89,17 +90,17 @@ public function addLink($type, $package, $constraint, $sortPackages = false) // try to find existing link $packageRegex = str_replace('/', '\\\\?/', preg_quote($package)); $regex = '{'.self::$DEFINES.'"(?P<package>'.$packageRegex.')"(\s*:\s*)(?&string)}ix'; - if ($this->pregMatch($regex, $links, $packageMatches)) { + if (Preg::isMatch($regex, $links, $packageMatches)) { // update existing link $existingPackage = $packageMatches['package']; $packageRegex = str_replace('/', '\\\\?/', preg_quote($existingPackage)); - $links = preg_replace_callback('{'.self::$DEFINES.'"'.$packageRegex.'"(?P<separator>\s*:\s*)(?&string)}ix', function ($m) use ($existingPackage, $constraint) { + $links = Preg::replaceCallback('{'.self::$DEFINES.'"'.$packageRegex.'"(?P<separator>\s*:\s*)(?&string)}ix', function ($m) use ($existingPackage, $constraint) { return JsonFile::encode(str_replace('\\/', '/', $existingPackage)) . $m['separator'] . '"' . $constraint . '"'; }, $links); } else { - if ($this->pregMatch('#^\s*\{\s*\S+.*?(\s*\}\s*)$#s', $links, $match)) { + if (Preg::isMatch('#^\s*\{\s*\S+.*?(\s*\}\s*)$#s', $links, $match)) { // link missing but non empty links - $links = preg_replace( + $links = Preg::replace( '{'.preg_quote($match[1]).'$}', // addcslashes is used to double up backslashes/$ since preg_replace resolves them as back references otherwise, see #1588 addcslashes(',' . $this->newline . $this->indent . $this->indent . JsonFile::encode($package).': '.JsonFile::encode($constraint) . $match[1], '\\$'), @@ -136,7 +137,7 @@ private function sortPackages(array &$packages = array()) { $prefix = function ($requirement) { if (PlatformRepository::isPlatformPackage($requirement)) { - return preg_replace( + return Preg::replace( array( '/^php/', '/^hhvm/', @@ -277,7 +278,7 @@ public function addSubNode($mainNode, $name, $value, $append = true) preg_quote(JsonFile::encode($mainNode)).'\s*:\s*)(?P<content>(?&object))(?P<end>.*)}sx'; try { - if (!$this->pregMatch($nodeRegex, $this->contents, $match)) { + if (!Preg::isMatch($nodeRegex, $this->contents, $match)) { return false; } } catch (\RuntimeException $e) { @@ -297,8 +298,8 @@ public function addSubNode($mainNode, $name, $value, $append = true) // child exists $childRegex = '{'.self::$DEFINES.'(?P<start>"'.preg_quote($name).'"\s*:\s*)(?P<content>(?&json))(?P<end>,?)}x'; - if ($this->pregMatch($childRegex, $children, $matches)) { - $children = preg_replace_callback($childRegex, function ($matches) use ($subName, $value, $that) { + if (Preg::isMatch($childRegex, $children, $matches)) { + $children = Preg::replaceCallback($childRegex, function ($matches) use ($subName, $value, $that) { if ($subName !== null) { $curVal = json_decode($matches['content'], true); if (!is_array($curVal)) { @@ -311,7 +312,7 @@ public function addSubNode($mainNode, $name, $value, $append = true) return $matches['start'] . $that->format($value, 1) . $matches['end']; }, $children); } else { - $this->pregMatch('#^{ (?P<leadingspace>\s*?) (?P<content>\S+.*?)? (?P<trailingspace>\s*) }$#sx', $children, $match); + Preg::match('#^{ (?P<leadingspace>\s*?) (?P<content>\S+.*?)? (?P<trailingspace>\s*) }$#sx', $children, $match); $whitespace = ''; if (!empty($match['trailingspace'])) { @@ -325,7 +326,7 @@ public function addSubNode($mainNode, $name, $value, $append = true) // child missing but non empty children if ($append) { - $children = preg_replace( + $children = Preg::replace( '#'.$whitespace.'}$#', addcslashes(',' . $this->newline . $this->indent . $this->indent . JsonFile::encode($name).': '.$this->format($value, 1) . $whitespace . '}', '\\$'), $children @@ -336,7 +337,7 @@ public function addSubNode($mainNode, $name, $value, $append = true) $whitespace = $match['leadingspace']; } - $children = preg_replace( + $children = Preg::replace( '#^{'.$whitespace.'#', addcslashes('{' . $whitespace . JsonFile::encode($name).': '.$this->format($value, 1) . ',' . $this->newline . $this->indent . $this->indent, '\\$'), $children @@ -352,7 +353,7 @@ public function addSubNode($mainNode, $name, $value, $append = true) } } - $this->contents = preg_replace_callback($nodeRegex, function ($m) use ($children) { + $this->contents = Preg::replaceCallback($nodeRegex, function ($m) use ($children) { return $m['start'] . $children . $m['end']; }, $this->contents); @@ -377,7 +378,7 @@ public function removeSubNode($mainNode, $name) $nodeRegex = '{'.self::$DEFINES.'^(?P<start> \s* \{ \s* (?: (?&string) \s* : (?&json) \s* , \s* )*?'. preg_quote(JsonFile::encode($mainNode)).'\s*:\s*)(?P<content>(?&object))(?P<end>.*)}sx'; try { - if (!$this->pregMatch($nodeRegex, $this->contents, $match)) { + if (!Preg::isMatch($nodeRegex, $this->contents, $match)) { return false; } } catch (\RuntimeException $e) { @@ -406,18 +407,18 @@ public function removeSubNode($mainNode, $name) // try and find a match for the subkey $keyRegex = str_replace('/', '\\\\?/', preg_quote($name)); - if ($this->pregMatch('{"'.$keyRegex.'"\s*:}i', $children)) { + if (Preg::isMatch('{"'.$keyRegex.'"\s*:}i', $children)) { // find best match for the value of "name" - if (preg_match_all('{'.self::$DEFINES.'"'.$keyRegex.'"\s*:\s*(?:(?&json))}x', $children, $matches)) { + if (Preg::isMatchAll('{'.self::$DEFINES.'"'.$keyRegex.'"\s*:\s*(?:(?&json))}x', $children, $matches)) { $bestMatch = ''; foreach ($matches[0] as $match) { if (strlen($bestMatch) < strlen($match)) { $bestMatch = $match; } } - $childrenClean = preg_replace('{,\s*'.preg_quote($bestMatch).'}i', '', $children, -1, $count); + $childrenClean = Preg::replace('{,\s*'.preg_quote($bestMatch).'}i', '', $children, -1, $count); if (1 !== $count) { - $childrenClean = preg_replace('{'.preg_quote($bestMatch).'\s*,?\s*}i', '', $childrenClean, -1, $count); + $childrenClean = Preg::replace('{'.preg_quote($bestMatch).'\s*,?\s*}i', '', $childrenClean, -1, $count); if (1 !== $count) { return false; } @@ -432,12 +433,12 @@ public function removeSubNode($mainNode, $name) } // no child data left, $name was the only key in - $this->pregMatch('#^{ \s*? (?P<content>\S+.*?)? (?P<trailingspace>\s*) }$#sx', $childrenClean, $match); + Preg::match('#^{ \s*? (?P<content>\S+.*?)? (?P<trailingspace>\s*) }$#sx', $childrenClean, $match); if (empty($match['content'])) { $newline = $this->newline; $indent = $this->indent; - $this->contents = preg_replace_callback($nodeRegex, function ($matches) use ($indent, $newline) { + $this->contents = Preg::replaceCallback($nodeRegex, function ($matches) use ($indent, $newline) { return $matches['start'] . '{' . $newline . $indent . '}' . $matches['end']; }, $this->contents); @@ -452,7 +453,7 @@ public function removeSubNode($mainNode, $name) } $that = $this; - $this->contents = preg_replace_callback($nodeRegex, function ($matches) use ($that, $name, $subName, $childrenClean) { + $this->contents = Preg::replaceCallback($nodeRegex, function ($matches) use ($that, $name, $subName, $childrenClean) { if ($subName !== null) { $curVal = json_decode($matches['content'], true); unset($curVal[$name][$subName]); @@ -478,7 +479,7 @@ public function addMainKey($key, $content) // key exists already $regex = '{'.self::$DEFINES.'^(?P<start>\s*\{\s*(?:(?&string)\s*:\s*(?&json)\s*,\s*)*?)'. '(?P<key>'.preg_quote(JsonFile::encode($key)).'\s*:\s*(?&json))(?P<end>.*)}sx'; - if (isset($decoded[$key]) && $this->pregMatch($regex, $this->contents, $matches)) { + if (isset($decoded[$key]) && Preg::isMatch($regex, $this->contents, $matches)) { // invalid match due to un-regexable content, abort if (!@json_decode('{'.$matches['key'].'}')) { return false; @@ -490,8 +491,8 @@ public function addMainKey($key, $content) } // append at the end of the file and keep whitespace - if ($this->pregMatch('#[^{\s](\s*)\}$#', $this->contents, $match)) { - $this->contents = preg_replace( + if (Preg::isMatch('#[^{\s](\s*)\}$#', $this->contents, $match)) { + $this->contents = Preg::replace( '#'.$match[1].'\}$#', addcslashes(',' . $this->newline . $this->indent . JsonFile::encode($key). ': '. $content . $this->newline . '}', '\\$'), $this->contents @@ -501,7 +502,7 @@ public function addMainKey($key, $content) } // append at the end of the file - $this->contents = preg_replace( + $this->contents = Preg::replace( '#\}$#', addcslashes($this->indent . JsonFile::encode($key). ': '.$content . $this->newline . '}', '\\$'), $this->contents @@ -525,19 +526,19 @@ public function removeMainKey($key) // key exists already $regex = '{'.self::$DEFINES.'^(?P<start>\s*\{\s*(?:(?&string)\s*:\s*(?&json)\s*,\s*)*?)'. '(?P<removal>'.preg_quote(JsonFile::encode($key)).'\s*:\s*(?&json))\s*,?\s*(?P<end>.*)}sx'; - if ($this->pregMatch($regex, $this->contents, $matches)) { + if (Preg::isMatch($regex, $this->contents, $matches)) { // invalid match due to un-regexable content, abort if (!@json_decode('{'.$matches['removal'].'}')) { return false; } // check that we are not leaving a dangling comma on the previous line if the last line was removed - if (preg_match('#,\s*$#', $matches['start']) && preg_match('#^\}$#', $matches['end'])) { - $matches['start'] = rtrim(preg_replace('#,(\s*)$#', '$1', $matches['start']), $this->indent); + if (Preg::isMatch('#,\s*$#', $matches['start']) && Preg::isMatch('#^\}$#', $matches['end'])) { + $matches['start'] = rtrim(Preg::replace('#,(\s*)$#', '$1', $matches['start']), $this->indent); } $this->contents = $matches['start'] . $matches['end']; - if (preg_match('#^\{\s*\}\s*$#', $this->contents)) { + if (Preg::isMatch('#^\{\s*\}\s*$#', $this->contents)) { $this->contents = "{\n}"; } @@ -601,47 +602,10 @@ public function format($data, $depth = 0) */ protected function detectIndenting() { - if ($this->pregMatch('{^([ \t]+)"}m', $this->contents, $match)) { + if (Preg::isMatch('{^([ \t]+)"}m', $this->contents, $match)) { $this->indent = $match[1]; } else { $this->indent = ' '; } } - - /** - * @param string $re - * @param string $str - * @param array<string> $matches - * @return int - */ - protected function pregMatch($re, $str, &$matches = array()) - { - $count = preg_match($re, $str, $matches); - - if ($count === false) { - switch (preg_last_error()) { - case PREG_NO_ERROR: - throw new \RuntimeException('Failed to execute regex: PREG_NO_ERROR', PREG_NO_ERROR); - case PREG_INTERNAL_ERROR: - throw new \RuntimeException('Failed to execute regex: PREG_INTERNAL_ERROR', PREG_INTERNAL_ERROR); - case PREG_BACKTRACK_LIMIT_ERROR: - throw new \RuntimeException('Failed to execute regex: PREG_BACKTRACK_LIMIT_ERROR', PREG_BACKTRACK_LIMIT_ERROR); - case PREG_RECURSION_LIMIT_ERROR: - throw new \RuntimeException('Failed to execute regex: PREG_RECURSION_LIMIT_ERROR', PREG_RECURSION_LIMIT_ERROR); - case PREG_BAD_UTF8_ERROR: - throw new \RuntimeException('Failed to execute regex: PREG_BAD_UTF8_ERROR', PREG_BAD_UTF8_ERROR); - case PREG_BAD_UTF8_OFFSET_ERROR: - throw new \RuntimeException('Failed to execute regex: PREG_BAD_UTF8_OFFSET_ERROR', PREG_BAD_UTF8_OFFSET_ERROR); - case 6: // PREG_JIT_STACKLIMIT_ERROR - if (PHP_VERSION_ID > 70000) { - throw new \RuntimeException('Failed to execute regex: PREG_JIT_STACKLIMIT_ERROR', 6); - } - // no break - default: - throw new \RuntimeException('Failed to execute regex: Unknown error'); - } - } - - return $count; - } } diff --git a/core/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php b/core/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php index 96459f8727..4dcb718ba2 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php +++ b/core/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php @@ -12,6 +12,7 @@ namespace Composer\Package\Archiver; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; use FilesystemIterator; use Symfony\Component\Finder\Finder; @@ -49,7 +50,6 @@ public function __construct($sources, array $excludes, $ignoreFilters = false) $filters = array(); } else { $filters = array( - new HgExcludeFilter($sources), new GitExcludeFilter($sources), new ComposerExcludeFilter($sources, $excludes), ); @@ -62,7 +62,7 @@ public function __construct($sources, array $excludes, $ignoreFilters = false) return false; } - $relativePath = preg_replace( + $relativePath = Preg::replace( '#^'.preg_quote($sources, '#').'#', '', $fs->normalizePath($file->getRealPath()) @@ -84,7 +84,8 @@ public function __construct($sources, array $excludes, $ignoreFilters = false) ->in($sources) ->filter($filter) ->ignoreVCS(true) - ->ignoreDotFiles(false); + ->ignoreDotFiles(false) + ->sortByName(); parent::__construct($this->finder->getIterator()); } diff --git a/core/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php b/core/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php index d41d5df1b4..a6682fb3b7 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php +++ b/core/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php @@ -14,6 +14,7 @@ use Composer\Downloader\DownloadManager; use Composer\Package\RootPackageInterface; +use Composer\Pcre\Preg; use Composer\Util\Filesystem; use Composer\Util\Loop; use Composer\Util\SyncHelper; @@ -86,11 +87,11 @@ public function getPackageFilename(CompletePackageInterface $package) if ($package->getArchiveName()) { $baseName = $package->getArchiveName(); } else { - $baseName = preg_replace('#[^a-z0-9-_]#i', '-', $package->getName()); + $baseName = Preg::replace('#[^a-z0-9-_]#i', '-', $package->getName()); } $nameParts = array($baseName); - if (null !== $package->getDistReference() && preg_match('{^[a-f0-9]{40}$}', $package->getDistReference())) { + if (null !== $package->getDistReference() && Preg::isMatch('{^[a-f0-9]{40}$}', $package->getDistReference())) { array_push($nameParts, $package->getDistReference(), $package->getDistType()); } else { array_push($nameParts, $package->getPrettyVersion(), $package->getDistReference()); diff --git a/core/vendor/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php b/core/vendor/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php index 71462ef982..9a9c3b8c2c 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php +++ b/core/vendor/composer/composer/src/Composer/Package/Archiver/BaseExcludeFilter.php @@ -12,6 +12,7 @@ namespace Composer\Package\Archiver; +use Composer\Pcre\Preg; use Symfony\Component\Finder; /** @@ -25,7 +26,7 @@ abstract class BaseExcludeFilter protected $sourcePath; /** - * @var array<array{0: string, 1: bool, 2: bool}> array of [$pattern, $negate, $stripLeadingSlash] arrays + * @var array<array{0: non-empty-string, 1: bool, 2: bool}> array of [$pattern, $negate, $stripLeadingSlash] arrays */ protected $excludePatterns; @@ -59,8 +60,12 @@ public function filter($relativePath, $exclude) $path = $relativePath; } - if (@preg_match($pattern, $path)) { - $exclude = !$negate; + try { + if (Preg::isMatch($pattern, $path)) { + $exclude = !$negate; + } + } catch (\RuntimeException $e) { + // suppressed } } @@ -73,7 +78,7 @@ public function filter($relativePath, $exclude) * @param string[] $lines A set of lines to be parsed * @param callable $lineParser The parser to be used on each line * - * @return array<array{0: string, 1: bool, 2: bool}> Exclude patterns to be used in filter() + * @return array<array{0: non-empty-string, 1: bool, 2: bool}> Exclude patterns to be used in filter() */ protected function parseLines(array $lines, $lineParser) { @@ -101,7 +106,7 @@ function ($pattern) { * * @param string[] $rules A list of exclude rules in gitignore syntax * - * @return array<int, array{0: string, 1: bool, 2: bool}> Exclude patterns + * @return array<int, array{0: non-empty-string, 1: bool, 2: bool}> Exclude patterns */ protected function generatePatterns($rules) { @@ -118,7 +123,7 @@ protected function generatePatterns($rules) * * @param string $rule An exclude rule in gitignore syntax * - * @return array{0: string, 1: bool, 2: bool} An exclude pattern + * @return array{0: non-empty-string, 1: bool, 2: bool} An exclude pattern */ protected function generatePattern($rule) { diff --git a/core/vendor/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php b/core/vendor/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php index f08d460f7a..6a92945299 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php +++ b/core/vendor/composer/composer/src/Composer/Package/Archiver/GitExcludeFilter.php @@ -12,8 +12,10 @@ namespace Composer\Package\Archiver; +use Composer\Pcre\Preg; + /** - * An exclude filter that processes gitignore and gitattributes + * An exclude filter that processes gitattributes * * It respects export-ignore git attributes * @@ -22,7 +24,7 @@ class GitExcludeFilter extends BaseExcludeFilter { /** - * Parses .gitignore and .gitattributes files if they exist + * Parses .gitattributes if it exists * * @param string $sourcePath */ @@ -30,12 +32,6 @@ public function __construct($sourcePath) { parent::__construct($sourcePath); - if (file_exists($sourcePath.'/.gitignore')) { - $this->excludePatterns = $this->parseLines( - file($sourcePath.'/.gitignore'), - array($this, 'parseGitIgnoreLine') - ); - } if (file_exists($sourcePath.'/.gitattributes')) { $this->excludePatterns = array_merge( $this->excludePatterns, @@ -47,18 +43,6 @@ public function __construct($sourcePath) } } - /** - * Callback line parser which process gitignore lines - * - * @param string $line A line from .gitignore - * - * @return array{0: string, 1: bool, 2: bool} An exclude pattern for filter() - */ - public function parseGitIgnoreLine($line) - { - return $this->generatePattern($line); - } - /** * Callback parser which finds export-ignore rules in git attribute lines * @@ -68,12 +52,16 @@ public function parseGitIgnoreLine($line) */ public function parseGitAttributesLine($line) { - $parts = preg_split('#\s+#', $line); + $parts = Preg::split('#\s+#', $line); if (count($parts) == 2 && $parts[1] === 'export-ignore') { return $this->generatePattern($parts[0]); } + if (count($parts) == 2 && $parts[1] === '-export-ignore') { + return $this->generatePattern('!'.$parts[0]); + } + return null; } } diff --git a/core/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php b/core/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php deleted file mode 100644 index 95880475e4..0000000000 --- a/core/vendor/composer/composer/src/Composer/Package/Archiver/HgExcludeFilter.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php - -/* - * This file is part of Composer. - * - * (c) Nils Adermann <naderman@naderman.de> - * Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Package\Archiver; - -use Symfony\Component\Finder; - -/** - * An exclude filter that processes hgignore files - * - * @author Nils Adermann <naderman@naderman.de> - */ -class HgExcludeFilter extends BaseExcludeFilter -{ - const HG_IGNORE_REGEX = 1; - const HG_IGNORE_GLOB = 2; - - /** - * Either HG_IGNORE_REGEX or HG_IGNORE_GLOB - * @var int - */ - protected $patternMode; - - /** - * Parses .hgignore file if it exist - * - * @param string $sourcePath - */ - public function __construct($sourcePath) - { - parent::__construct($sourcePath); - - $this->patternMode = self::HG_IGNORE_REGEX; - - if (file_exists($sourcePath.'/.hgignore')) { - $this->excludePatterns = $this->parseLines( - file($sourcePath.'/.hgignore'), - array($this, 'parseHgIgnoreLine') - ); - } - } - - /** - * Callback line parser which process hgignore lines - * - * @param string $line A line from .hgignore - * - * @return array{0: string, 1: bool, 2: bool}|null An exclude pattern for filter() - */ - public function parseHgIgnoreLine($line) - { - if (preg_match('#^syntax\s*:\s*(glob|regexp)$#', $line, $matches)) { - if ($matches[1] === 'glob') { - $this->patternMode = self::HG_IGNORE_GLOB; - } else { - $this->patternMode = self::HG_IGNORE_REGEX; - } - - return null; - } - - if ($this->patternMode == self::HG_IGNORE_GLOB) { - return $this->patternFromGlob($line); - } - - return $this->patternFromRegex($line); - } - - /** - * Generates an exclude pattern for filter() from a hg glob expression - * - * @param string $line A line from .hgignore in glob mode - * - * @return array{0: string, 1: bool, 2: bool} An exclude pattern for filter() - */ - protected function patternFromGlob($line) - { - $pattern = '#'.substr(Finder\Glob::toRegex($line), 2, -1).'#'; - $pattern = str_replace('[^/]*', '.*', $pattern); - - return array($pattern, false, true); - } - - /** - * Generates an exclude pattern for filter() from a hg regexp expression - * - * @param string $line A line from .hgignore in regexp mode - * - * @return array{0: string, 1: bool, 2: bool} An exclude pattern for filter() - */ - public function patternFromRegex($line) - { - // WTF need to escape the delimiter safely - $pattern = '#'.preg_replace('/((?:\\\\\\\\)*)(\\\\?)#/', '\1\2\2\\#', $line).'#'; - - return array($pattern, false, true); - } -} diff --git a/core/vendor/composer/composer/src/Composer/Package/BasePackage.php b/core/vendor/composer/composer/src/Composer/Package/BasePackage.php index 27a1edb488..a3ec9c570f 100644 --- a/core/vendor/composer/composer/src/Composer/Package/BasePackage.php +++ b/core/vendor/composer/composer/src/Composer/Package/BasePackage.php @@ -254,8 +254,8 @@ public function __clone() * Build a regexp from a package name, expanding * globs as required * * @param string $allowPattern - * @param string $wrap Wrap the cleaned string by the given string - * @return string + * @param non-empty-string $wrap Wrap the cleaned string by the given string + * @return non-empty-string */ public static function packageNameToRegexp($allowPattern, $wrap = '{^%s$}i') { @@ -263,4 +263,23 @@ public static function packageNameToRegexp($allowPattern, $wrap = '{^%s$}i') return sprintf($wrap, $cleanedAllowPattern); } + + /** + * Build a regexp from package names, expanding * globs as required + * + * @param string[] $packageNames + * @param non-empty-string $wrap + * @return non-empty-string + */ + public static function packageNamesToRegexp(array $packageNames, $wrap = '{^(?:%s)$}iD') + { + $packageNames = array_map( + function ($packageName) { + return BasePackage::packageNameToRegexp($packageName, '%s'); + }, + $packageNames + ); + + return sprintf($wrap, implode('|', $packageNames)); + } } diff --git a/core/vendor/composer/composer/src/Composer/Package/Comparer/Comparer.php b/core/vendor/composer/composer/src/Composer/Package/Comparer/Comparer.php index 06ebf7daae..b24661ad31 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Comparer/Comparer.php +++ b/core/vendor/composer/composer/src/Composer/Package/Comparer/Comparer.php @@ -67,12 +67,13 @@ public function getChanged($toString = false, $explicated = false) } if ($toString) { + $strings = array(); foreach ($changed as $sectionKey => $itemSection) { foreach ($itemSection as $itemKey => $item) { - $changed['string'][] = $item."\r\n"; + $strings[] = $item."\r\n"; } } - $changed = implode("\r\n", $changed['string']); + $changed = implode("\r\n", $strings); } return $changed; diff --git a/core/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php b/core/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php index fce22dffbc..bc4a14139d 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php +++ b/core/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php @@ -21,6 +21,7 @@ use Composer\Package\Link; use Composer\Package\RootAliasPackage; use Composer\Package\Version\VersionParser; +use Composer\Pcre\Preg; /** * @author Konstantin Kudryashiv <ever.zet@gmail.com> @@ -112,12 +113,15 @@ private function createObject(array $config, $class) if (!isset($config['name'])) { throw new \UnexpectedValueException('Unknown package has no name defined ('.json_encode($config).').'); } - if (!isset($config['version'])) { + if (!isset($config['version']) || !is_scalar($config['version'])) { throw new \UnexpectedValueException('Package '.$config['name'].' has no version defined.'); } + if (!is_string($config['version'])) { + $config['version'] = (string) $config['version']; + } // handle already normalized versions - if (isset($config['version_normalized'])) { + if (isset($config['version_normalized']) && is_string($config['version_normalized'])) { $version = $config['version_normalized']; // handling of existing repos which need to remain composer v1 compatible, in case the version_normalized contained VersionParser::DEFAULT_BRANCH_ALIAS, we renormalize it @@ -227,7 +231,7 @@ private function configureObject(PackageInterface $package, array $config) } if (!empty($config['time'])) { - $time = preg_match('/^\d++$/D', $config['time']) ? '@'.$config['time'] : $config['time']; + $time = Preg::isMatch('/^\d++$/D', $config['time']) ? '@'.$config['time'] : $config['time']; try { $date = new \DateTime($time, new \DateTimeZone('UTC')); @@ -252,8 +256,10 @@ private function configureObject(PackageInterface $package, array $config) foreach ($config['scripts'] as $event => $listeners) { $config['scripts'][$event] = (array) $listeners; } - if (isset($config['scripts']['composer'])) { - trigger_error('The `composer` script name is reserved for internal use, please avoid defining it', E_USER_DEPRECATED); + foreach (array('composer', 'php', 'putenv') as $reserved) { + if (isset($config['scripts'][$reserved])) { + trigger_error('The `'.$reserved.'` script name is reserved for internal use, please avoid defining it', E_USER_DEPRECATED); + } } $package->setScripts($config['scripts']); } @@ -296,7 +302,7 @@ private function configureObject(PackageInterface $package, array $config) } if ($aliasNormalized = $this->getBranchAlias($config)) { - $prettyAlias = preg_replace('{(\.9{7})+}', '.x', $aliasNormalized); + $prettyAlias = Preg::replace('{(\.9{7})+}', '.x', $aliasNormalized); if ($package instanceof RootPackage) { return new RootAliasPackage($package, $aliasNormalized, $prettyAlias); @@ -327,6 +333,12 @@ private function configureCachedLinks(&$linkCache, $package, array $config) $links = array(); foreach ($config[$type] as $prettyTarget => $constraint) { $target = strtolower($prettyTarget); + + // recursive links are not supported + if ($target === $name) { + continue; + } + if ($constraint === 'self.version') { $links[$target] = $this->createLink($name, $prettyVersion, $opts['method'], $target, $constraint); } else { @@ -358,7 +370,8 @@ public function parseLinks($source, $sourceVersion, $description, $links) { $res = array(); foreach ($links as $target => $constraint) { - $res[strtolower($target)] = $this->createLink($source, $sourceVersion, $description, $target, $constraint); + $target = strtolower($target); + $res[$target] = $this->createLink($source, $sourceVersion, $description, $target, $constraint); } return $res; diff --git a/core/vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php b/core/vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php index ed9a4a88c6..cd061941c9 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php +++ b/core/vendor/composer/composer/src/Composer/Package/Loader/RootPackageLoader.php @@ -16,11 +16,13 @@ use Composer\Config; use Composer\IO\IOInterface; use Composer\Package\RootAliasPackage; +use Composer\Pcre\Preg; use Composer\Repository\RepositoryFactory; use Composer\Package\Version\VersionGuesser; use Composer\Package\Version\VersionParser; use Composer\Package\RootPackage; use Composer\Repository\RepositoryManager; +use Composer\Util\Platform; use Composer\Util\ProcessExecutor; /** @@ -83,8 +85,8 @@ public function load(array $config, $class = 'Composer\Package\RootPackage', $cw $commit = null; // override with env var if available - if (getenv('COMPOSER_ROOT_VERSION')) { - $config['version'] = getenv('COMPOSER_ROOT_VERSION'); + if (Platform::getEnv('COMPOSER_ROOT_VERSION')) { + $config['version'] = Platform::getEnv('COMPOSER_ROOT_VERSION'); } else { $versionData = $this->versionGuesser->guessVersion($config, $cwd ?: getcwd()); if ($versionData) { @@ -195,7 +197,7 @@ public function load(array $config, $class = 'Composer\Package\RootPackage', $cw private function extractAliases(array $requires, array $aliases) { foreach ($requires as $reqName => $reqVersion) { - if (preg_match('{^([^,\s#]+)(?:#[^ ]+)? +as +([^,\s]+)$}', $reqVersion, $match)) { + if (Preg::isMatch('{^([^,\s#]+)(?:#[^ ]+)? +as +([^,\s]+)$}', $reqVersion, $match)) { $aliases[] = array( 'package' => strtolower($reqName), 'version' => $this->versionParser->normalize($match[1], $reqVersion), @@ -231,9 +233,9 @@ public static function extractStabilityFlags(array $requires, $minimumStability, $constraints = array(); // extract all sub-constraints in case it is an OR/AND multi-constraint - $orSplit = preg_split('{\s*\|\|?\s*}', trim($reqVersion)); + $orSplit = Preg::split('{\s*\|\|?\s*}', trim($reqVersion)); foreach ($orSplit as $orConstraint) { - $andSplit = preg_split('{(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)}', $orConstraint); + $andSplit = Preg::split('{(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)}', $orConstraint); foreach ($andSplit as $andConstraint) { $constraints[] = $andConstraint; } @@ -242,7 +244,7 @@ public static function extractStabilityFlags(array $requires, $minimumStability, // parse explicit stability flags to the most unstable $match = false; foreach ($constraints as $constraint) { - if (preg_match('{^[^@]*?@('.implode('|', array_keys($stabilities)).')$}i', $constraint, $match)) { + if (Preg::isMatch('{^[^@]*?@('.implode('|', array_keys($stabilities)).')$}i', $constraint, $match)) { $name = strtolower($reqName); $stability = $stabilities[VersionParser::normalizeStability($match[1])]; @@ -261,8 +263,8 @@ public static function extractStabilityFlags(array $requires, $minimumStability, foreach ($constraints as $constraint) { // infer flags for requirements that have an explicit -dev or -beta version specified but only // for those that are more unstable than the minimumStability or existing flags - $reqVersion = preg_replace('{^([^,\s@]+) as .+$}', '$1', $constraint); - if (preg_match('{^[^,\s@]+$}', $reqVersion) && 'stable' !== ($stabilityName = VersionParser::parseStability($reqVersion))) { + $reqVersion = Preg::replace('{^([^,\s@]+) as .+$}', '$1', $constraint); + if (Preg::isMatch('{^[^,\s@]+$}', $reqVersion) && 'stable' !== ($stabilityName = VersionParser::parseStability($reqVersion))) { $name = strtolower($reqName); $stability = $stabilities[$stabilityName]; if ((isset($stabilityFlags[$name]) && $stabilityFlags[$name] > $stability) || ($minimumStability > $stability)) { @@ -287,8 +289,8 @@ public static function extractStabilityFlags(array $requires, $minimumStability, public static function extractReferences(array $requires, array $references) { foreach ($requires as $reqName => $reqVersion) { - $reqVersion = preg_replace('{^([^,\s@]+) as .+$}', '$1', $reqVersion); - if (preg_match('{^[^,\s@]+?#([a-f0-9]+)$}', $reqVersion, $match) && 'dev' === VersionParser::parseStability($reqVersion)) { + $reqVersion = Preg::replace('{^([^,\s@]+) as .+$}', '$1', $reqVersion); + if (Preg::isMatch('{^[^,\s@]+?#([a-f0-9]+)$}', $reqVersion, $match) && 'dev' === VersionParser::parseStability($reqVersion)) { $name = strtolower($reqName); $references[$name] = $match[1]; } diff --git a/core/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php b/core/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php index a391844006..7fb2c3b793 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php +++ b/core/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php @@ -13,6 +13,7 @@ namespace Composer\Package\Loader; use Composer\Package\BasePackage; +use Composer\Pcre\Preg; use Composer\Semver\Constraint\Constraint; use Composer\Package\Version\VersionParser; use Composer\Repository\PlatformRepository; @@ -37,21 +38,22 @@ class ValidatingArrayLoader implements LoaderInterface private $warnings; /** @var mixed[] */ private $config; - /** @var bool */ - private $strictName; /** @var int One or more of self::CHECK_* constants */ private $flags; /** - * @param bool $strictName + * @param true $strictName * @param int $flags */ public function __construct(LoaderInterface $loader, $strictName = true, VersionParser $parser = null, $flags = 0) { $this->loader = $loader; $this->versionParser = $parser ?: new VersionParser(); - $this->strictName = $strictName; $this->flags = $flags; + + if ($strictName !== true) { // @phpstan-ignore-line + trigger_error('$strictName must be set to true in ValidatingArrayLoader\'s constructor as of 2.2, and it will be removed in 3.0', E_USER_DEPRECATED); + } } /** @@ -63,27 +65,36 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') $this->warnings = array(); $this->config = $config; + $this->validateString('name', true); if ($err = self::hasPackageNamingError($config['name'])) { - $this->warnings[] = 'Deprecation warning: Your package name '.$err.' Make sure you fix this as Composer 2.0 will error.'; - } - - if ($this->strictName) { - $this->validateRegex('name', '[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*', true); - } else { - $this->validateString('name', true); + $this->errors[] = 'name : '.$err; } if (!empty($this->config['version'])) { - try { - $this->versionParser->normalize($this->config['version']); - } catch (\Exception $e) { - $this->errors[] = 'version : invalid value ('.$this->config['version'].'): '.$e->getMessage(); - unset($this->config['version']); + if (!is_scalar($this->config['version'])) { + $this->validateString('version'); + } else { + if (!is_string($this->config['version'])) { + $this->config['version'] = (string) $this->config['version']; + } + try { + $this->versionParser->normalize($this->config['version']); + } catch (\Exception $e) { + $this->errors[] = 'version : invalid value ('.$this->config['version'].'): '.$e->getMessage(); + unset($this->config['version']); + } } } if (!empty($this->config['config']['platform'])) { foreach ((array) $this->config['config']['platform'] as $key => $platform) { + if (false === $platform) { + continue; + } + if (!is_string($platform)) { + $this->errors[] = 'config.platform.' . $key . ' : invalid value ('.gettype($platform).' '.var_export($platform, true).'): expected string or false'; + continue; + } try { $this->versionParser->normalize($platform); } catch (\Exception $e) { @@ -241,9 +252,14 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') foreach (array_keys(BasePackage::$supportedLinkTypes) as $linkType) { if ($this->validateArray($linkType) && isset($this->config[$linkType])) { foreach ($this->config[$linkType] as $package => $constraint) { + if (0 === strcasecmp($package, $this->config['name'])) { + $this->errors[] = $linkType.'.'.$package.' : a package cannot set a '.$linkType.' on itself'; + unset($this->config[$linkType][$package]); + continue; + } if ($err = self::hasPackageNamingError($package, true)) { - $this->warnings[] = 'Deprecation warning: '.$linkType.'.'.$err.' Make sure you fix this as Composer 2.0 will error.'; - } elseif (!preg_match('{^[A-Za-z0-9_./-]+$}', $package)) { + $this->errors[] = $linkType.'.'.$err; + } elseif (!Preg::isMatch('{^[A-Za-z0-9_./-]+$}', $package)) { $this->warnings[] = $linkType.'.'.$package.' : invalid key, package names must be strings containing only [A-Za-z0-9_./-]'; } if (!is_string($constraint)) { @@ -276,6 +292,11 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') $this->warnings[] = $linkType.'.'.$package.' : exact version constraints ('.$constraint.') should be avoided if the package follows semantic versioning'; } } + + if ($linkType === 'conflict' && isset($this->config['replace']) && $keys = array_intersect_key($this->config['replace'], $this->config['conflict'])) { + $this->errors[] = $linkType.'.'.$package.' : you cannot conflict with a package that is also replaced, as replace already creates an implicit conflict rule'; + unset($this->config[$linkType][$package]); + } } } } @@ -340,10 +361,10 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') if (isset($this->config[$srcType]['reference']) && !is_string($this->config[$srcType]['reference']) && !is_int($this->config[$srcType]['reference'])) { $this->errors[] = $srcType . '.reference : should be a string or int, '.gettype($this->config[$srcType]['reference']).' given'; } - if (isset($this->config[$srcType]['reference']) && preg_match('{^\s*-}', (string) $this->config[$srcType]['reference'])) { + if (isset($this->config[$srcType]['reference']) && Preg::isMatch('{^\s*-}', (string) $this->config[$srcType]['reference'])) { $this->errors[] = $srcType . '.reference : must not start with a "-", "'.$this->config[$srcType]['reference'].'" given'; } - if (preg_match('{^\s*-}', $this->config[$srcType]['url'])) { + if (Preg::isMatch('{^\s*-}', $this->config[$srcType]['url'])) { $this->errors[] = $srcType . '.url : must not start with a "-", "'.$this->config[$srcType]['url'].'" given'; } } @@ -435,7 +456,7 @@ public static function hasPackageNamingError($name, $isLink = false) return null; } - if (!preg_match('{^[a-z0-9](?:[_.-]?[a-z0-9]+)*/[a-z0-9](?:(?:[_.]?|-{0,2})[a-z0-9]+)*$}iD', $name)) { + if (!Preg::isMatch('{^[a-z0-9](?:[_.-]?[a-z0-9]+)*/[a-z0-9](?:(?:[_.]?|-{0,2})[a-z0-9]+)*$}iD', $name)) { return $name.' is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$".'; } @@ -445,16 +466,16 @@ public static function hasPackageNamingError($name, $isLink = false) return $name.' is reserved, package and vendor names can not match any of: '.implode(', ', $reservedNames).'.'; } - if (preg_match('{\.json$}', $name)) { + if (Preg::isMatch('{\.json$}', $name)) { return $name.' is invalid, package names can not end in .json, consider renaming it or perhaps using a -json suffix instead.'; } - if (preg_match('{[A-Z]}', $name)) { + if (Preg::isMatch('{[A-Z]}', $name)) { if ($isLink) { return $name.' is invalid, it should not contain uppercase characters. Please use '.strtolower($name).' instead.'; } - $suggestName = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $name); + $suggestName = Preg::replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $name); $suggestName = strtolower($suggestName); return $name.' is invalid, it should not contain uppercase characters. We suggest using '.$suggestName.' instead.'; @@ -479,7 +500,7 @@ private function validateRegex($property, $regex, $mandatory = false) return false; } - if (!preg_match('{^'.$regex.'$}u', $this->config[$property])) { + if (!Preg::isMatch('{^'.$regex.'$}u', $this->config[$property])) { $message = $property.' : invalid value ('.$this->config[$property].'), must match '.$regex; if ($mandatory) { $this->errors[] = $message; @@ -578,7 +599,7 @@ private function validateFlatArray($property, $regex = null, $mandatory = false) continue; } - if ($regex && !preg_match('{^'.$regex.'$}u', $value)) { + if ($regex && !Preg::isMatch('{^'.$regex.'$}u', $value)) { $this->warnings[] = $property.'.'.$key.' : invalid value ('.$value.'), must match '.$regex; unset($this->config[$property][$key]); $pass = false; diff --git a/core/vendor/composer/composer/src/Composer/Package/Locker.php b/core/vendor/composer/composer/src/Composer/Package/Locker.php index e96152338f..7911c4c235 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Locker.php +++ b/core/vendor/composer/composer/src/Composer/Package/Locker.php @@ -14,6 +14,7 @@ use Composer\Json\JsonFile; use Composer\Installer\InstallationManager; +use Composer\Pcre\Preg; use Composer\Repository\LockArrayRepository; use Composer\Util\ProcessExecutor; use Composer\Package\Dumper\ArrayDumper; @@ -492,13 +493,13 @@ private function getPackageTime(PackageInterface $package) case 'git': GitUtil::cleanEnv(); - if (0 === $this->process->execute('git log -n1 --pretty=%ct '.ProcessExecutor::escape($sourceRef).GitUtil::getNoShowSignatureFlag($this->process), $output, $path) && preg_match('{^\s*\d+\s*$}', $output)) { + if (0 === $this->process->execute('git log -n1 --pretty=%ct '.ProcessExecutor::escape($sourceRef).GitUtil::getNoShowSignatureFlag($this->process), $output, $path) && Preg::isMatch('{^\s*\d+\s*$}', $output)) { $datetime = new \DateTime('@'.trim($output), new \DateTimeZone('UTC')); } break; case 'hg': - if (0 === $this->process->execute('hg log --template "{date|hgdate}" -r '.ProcessExecutor::escape($sourceRef), $output, $path) && preg_match('{^\s*(\d+)\s*}', $output, $match)) { + if (0 === $this->process->execute('hg log --template "{date|hgdate}" -r '.ProcessExecutor::escape($sourceRef), $output, $path) && Preg::isMatch('{^\s*(\d+)\s*}', $output, $match)) { $datetime = new \DateTime('@'.$match[1], new \DateTimeZone('UTC')); } break; diff --git a/core/vendor/composer/composer/src/Composer/Package/Package.php b/core/vendor/composer/composer/src/Composer/Package/Package.php index cd447fc3ff..33addc7c0f 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Package.php +++ b/core/vendor/composer/composer/src/Composer/Package/Package.php @@ -13,6 +13,7 @@ namespace Composer\Package; use Composer\Package\Version\VersionParser; +use Composer\Pcre\Preg; use Composer\Util\ComposerMirror; /** @@ -160,7 +161,7 @@ public function getTargetDir() return null; } - return ltrim(preg_replace('{ (?:^|[\\\\/]+) \.\.? (?:[\\\\/]+|$) (?:\.\.? (?:[\\\\/]+|$) )*}x', '/', $this->targetDir), '/'); + return ltrim(Preg::replace('{ (?:^|[\\\\/]+) \.\.? (?:[\\\\/]+|$) (?:\.\.? (?:[\\\\/]+|$) )*}x', '/', $this->targetDir), '/'); } /** @@ -456,6 +457,10 @@ public function getReleaseDate() */ public function setRequires(array $requires) { + if (isset($requires[0])) { // @phpstan-ignore-line + $requires = $this->convertLinksToMap($requires, 'setRequires'); + } + $this->requires = $requires; } @@ -476,6 +481,10 @@ public function getRequires() */ public function setConflicts(array $conflicts) { + if (isset($conflicts[0])) { // @phpstan-ignore-line + $conflicts = $this->convertLinksToMap($conflicts, 'setConflicts'); + } + $this->conflicts = $conflicts; } @@ -497,6 +506,10 @@ public function getConflicts() */ public function setProvides(array $provides) { + if (isset($provides[0])) { // @phpstan-ignore-line + $provides = $this->convertLinksToMap($provides, 'setProvides'); + } + $this->provides = $provides; } @@ -518,6 +531,10 @@ public function getProvides() */ public function setReplaces(array $replaces) { + if (isset($replaces[0])) { // @phpstan-ignore-line + $replaces = $this->convertLinksToMap($replaces, 'setReplaces'); + } + $this->replaces = $replaces; } @@ -539,6 +556,10 @@ public function getReplaces() */ public function setDevRequires(array $devRequires) { + if (isset($devRequires[0])) { // @phpstan-ignore-line + $devRequires = $this->convertLinksToMap($devRequires, 'setDevRequires'); + } + $this->devRequires = $devRequires; } @@ -683,10 +704,10 @@ public function setSourceDistReferences($reference) // TODO generalize this a bit for self-managed/on-prem versions? Some kind of replace token in dist urls which allow this? if ( $this->getDistUrl() !== null - && preg_match('{^https?://(?:(?:www\.)?bitbucket\.org|(api\.)?github\.com|(?:www\.)?gitlab\.com)/}i', $this->getDistUrl()) + && Preg::isMatch('{^https?://(?:(?:www\.)?bitbucket\.org|(api\.)?github\.com|(?:www\.)?gitlab\.com)/}i', $this->getDistUrl()) ) { $this->setDistReference($reference); - $this->setDistUrl(preg_replace('{(?<=/|sha=)[a-f0-9]{40}(?=/|$)}i', $reference, $this->getDistUrl())); + $this->setDistUrl(Preg::replace('{(?<=/|sha=)[a-f0-9]{40}(?=/|$)}i', $reference, $this->getDistUrl())); } elseif ($this->getDistReference()) { // update the dist reference if there was one, but if none was provided ignore it $this->setDistReference($reference); } @@ -752,4 +773,20 @@ protected function getUrls($url, $mirrors, $ref, $type, $urlType) return $urls; } + + /** + * @param array<int, Link> $links + * @param string $source + * @return array<string, Link> + */ + private function convertLinksToMap(array $links, $source) + { + trigger_error('Package::'.$source.' must be called with a map of lowercased package name => Link object, got a indexed array, this is deprecated and you should fix your usage.'); + $newLinks = array(); + foreach ($links as $link) { + $newLinks[$link->getTarget()] = $link; + } + + return $newLinks; + } } diff --git a/core/vendor/composer/composer/src/Composer/Package/PackageInterface.php b/core/vendor/composer/composer/src/Composer/Package/PackageInterface.php index 89dce51013..4dd4d52e6f 100644 --- a/core/vendor/composer/composer/src/Composer/Package/PackageInterface.php +++ b/core/vendor/composer/composer/src/Composer/Package/PackageInterface.php @@ -249,7 +249,7 @@ public function getStability(); * Returns a set of links to packages which need to be installed before * this package can be installed * - * @return array<string, Link> An array of package links defining required packages + * @return array<string, Link> A map of package links defining required packages, indexed by the require package's name */ public function getRequires(); @@ -281,7 +281,7 @@ public function getReplaces(); * Returns a set of links to packages which are required to develop * this package. These are installed if in dev mode. * - * @return array<string, Link> An array of package links defining packages required for development + * @return array<string, Link> A map of package links defining packages required for development, indexed by the require package's name */ public function getDevRequires(); diff --git a/core/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php b/core/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php index 504263a6cc..797a2c0ba3 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php +++ b/core/vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php @@ -13,6 +13,7 @@ namespace Composer\Package\Version; use Composer\Config; +use Composer\Pcre\Preg; use Composer\Repository\Vcs\HgDriver; use Composer\IO\NullIO; use Composer\Semver\VersionParser as SemverVersionParser; @@ -108,12 +109,12 @@ private function postprocess(array $versionData) unset($versionData['feature_version'], $versionData['feature_pretty_version']); } - if ('-dev' === substr($versionData['version'], -4) && preg_match('{\.9{7}}', $versionData['version'])) { - $versionData['pretty_version'] = preg_replace('{(\.9{7})+}', '.x', $versionData['version']); + if ('-dev' === substr($versionData['version'], -4) && Preg::isMatch('{\.9{7}}', $versionData['version'])) { + $versionData['pretty_version'] = Preg::replace('{(\.9{7})+}', '.x', $versionData['version']); } - if (!empty($versionData['feature_version']) && '-dev' === substr($versionData['feature_version'], -4) && preg_match('{\.9{7}}', $versionData['feature_version'])) { - $versionData['feature_pretty_version'] = preg_replace('{(\.9{7})+}', '.x', $versionData['feature_version']); + if (!empty($versionData['feature_version']) && '-dev' === substr($versionData['feature_version'], -4) && Preg::isMatch('{\.9{7}}', $versionData['feature_version'])) { + $versionData['feature_pretty_version'] = Preg::replace('{(\.9{7})+}', '.x', $versionData['feature_version']); } return $versionData; @@ -142,7 +143,7 @@ private function guessGitVersion(array $packageConfig, $path) // find current branch and collect all branch names foreach ($this->process->splitLines($output) as $branch) { - if ($branch && preg_match('{^(?:\* ) *(\(no branch\)|\(detached from \S+\)|\(HEAD detached at \S+\)|\S+) *([a-f0-9]+) .*$}', $branch, $match)) { + if ($branch && Preg::isMatch('{^(?:\* ) *(\(no branch\)|\(detached from \S+\)|\(HEAD detached at \S+\)|\S+) *([a-f0-9]+) .*$}', $branch, $match)) { if ( $match[1] === '(no branch)' || strpos($match[1], '(detached ') === 0 @@ -163,8 +164,8 @@ private function guessGitVersion(array $packageConfig, $path) } } - if ($branch && !preg_match('{^ *.+/HEAD }', $branch)) { - if (preg_match('{^(?:\* )? *((?:remotes/(?:origin|upstream)/)?[^\s/]+) *([a-f0-9]+) .*$}', $branch, $match)) { + if ($branch && !Preg::isMatch('{^ *.+/HEAD }', $branch)) { + if (Preg::isMatch('{^(?:\* )? *((?:remotes/(?:origin|upstream)/)?[^\s/]+) *([a-f0-9]+) .*$}', $branch, $match)) { $branches[] = $match[1]; } } @@ -250,7 +251,7 @@ private function guessHgVersion(array $packageConfig, $path) // re-use the HgDriver to fetch branches (this properly includes bookmarks) $io = new NullIO(); $driver = new HgDriver(array('url' => $path), $io, $this->config, new HttpDownloader($io, $this->config), $this->process); - $branches = array_keys($driver->getBranches()); + $branches = array_map('strval', array_keys($driver->getBranches())); // try to find the best (nearest) version branch to assume this feature's version $result = $this->guessFeatureVersion($packageConfig, $version, $branches, 'hg log -r "not ancestors(\'%candidate%\') and ancestors(\'%branch%\')" --template "{node}\\n"', $path); @@ -284,7 +285,7 @@ private function guessFeatureVersion(array $packageConfig, $version, array $bran if (!isset($packageConfig['extra']['branch-alias'][$version]) || strpos(json_encode($packageConfig), '"self.version"') ) { - $branch = preg_replace('{^dev-}', '', $version); + $branch = Preg::replace('{^dev-}', '', $version); $length = PHP_INT_MAX; // return directly, if branch is configured to be non-feature branch @@ -307,7 +308,7 @@ private function guessFeatureVersion(array $packageConfig, $version, array $bran }); foreach ($branches as $candidate) { - $candidateVersion = preg_replace('{^remotes/\S+/}', '', $candidate); + $candidateVersion = Preg::replace('{^remotes/\S+/}', '', $candidate); // do not compare against itself or other feature branches if ($candidate === $branch || $this->isFeatureBranch($packageConfig, $candidateVersion)) { @@ -346,7 +347,7 @@ private function isFeatureBranch(array $packageConfig, $branchName) $nonFeatureBranches = implode('|', $packageConfig['non-feature-branches']); } - return !preg_match('{^(' . $nonFeatureBranches . '|master|main|latest|next|current|support|tip|trunk|default|develop|\d+\..+)$}', $branchName, $match); + return !Preg::isMatch('{^(' . $nonFeatureBranches . '|master|main|latest|next|current|support|tip|trunk|default|develop|\d+\..+)$}', $branchName, $match); } /** @@ -396,7 +397,7 @@ private function guessSvnVersion(array $packageConfig, $path) $urlPattern = '#<url>.*/(' . $trunkPath . '|(' . $branchesPath . '|' . $tagsPath . ')/(.*))</url>#'; - if (preg_match($urlPattern, $output, $matches)) { + if (Preg::isMatch($urlPattern, $output, $matches)) { if (isset($matches[2]) && ($branchesPath === $matches[2] || $tagsPath === $matches[2])) { // we are in a branches path $version = $this->versionParser->normalizeBranch($matches[3]); diff --git a/core/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php b/core/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php index c848522e2b..2d11bf0e42 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php +++ b/core/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php @@ -12,6 +12,7 @@ namespace Composer\Package\Version; +use Composer\Pcre\Preg; use Composer\Repository\PlatformRepository; use Composer\Semver\VersionParser as SemverVersionParser; use Composer\Semver\Semver; @@ -52,8 +53,8 @@ public function parseNameVersionPairs(array $pairs) $result = array(); for ($i = 0, $count = count($pairs); $i < $count; $i++) { - $pair = preg_replace('{^([^=: ]+)[=: ](.*)$}', '$1 $2', trim($pairs[$i])); - if (false === strpos($pair, ' ') && isset($pairs[$i + 1]) && false === strpos($pairs[$i + 1], '/') && !preg_match('{(?<=[a-z0-9_/-])\*|\*(?=[a-z0-9_/-])}i', $pairs[$i + 1]) && !PlatformRepository::isPlatformPackage($pairs[$i + 1])) { + $pair = Preg::replace('{^([^=: ]+)[=: ](.*)$}', '$1 $2', trim($pairs[$i])); + if (false === strpos($pair, ' ') && isset($pairs[$i + 1]) && false === strpos($pairs[$i + 1], '/') && !Preg::isMatch('{(?<=[a-z0-9_/-])\*|\*(?=[a-z0-9_/-])}i', $pairs[$i + 1]) && !PlatformRepository::isPlatformPackage($pairs[$i + 1])) { $pair .= ' '.$pairs[$i + 1]; $i++; } diff --git a/core/vendor/composer/composer/src/Composer/Package/Version/VersionSelector.php b/core/vendor/composer/composer/src/Composer/Package/Version/VersionSelector.php index 79972999a3..8e4b45faaa 100644 --- a/core/vendor/composer/composer/src/Composer/Package/Version/VersionSelector.php +++ b/core/vendor/composer/composer/src/Composer/Package/Version/VersionSelector.php @@ -12,12 +12,16 @@ namespace Composer\Package\Version; +use Composer\Filter\PlatformRequirementFilter\IgnoreAllPlatformRequirementFilter; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; use Composer\Package\BasePackage; use Composer\Package\AliasPackage; use Composer\Package\PackageInterface; use Composer\Composer; use Composer\Package\Loader\ArrayLoader; use Composer\Package\Dumper\ArrayDumper; +use Composer\Pcre\Preg; use Composer\Repository\RepositorySet; use Composer\Repository\PlatformRepository; use Composer\Semver\Constraint\Constraint; @@ -57,32 +61,37 @@ public function __construct(RepositorySet $repositorySet, PlatformRepository $pl * Given a package name and optional version, returns the latest PackageInterface * that matches. * - * @param string $packageName - * @param string $targetPackageVersion - * @param string $preferredStability - * @param bool|string[] $ignorePlatformReqs - * @param int $repoSetFlags - * + * @param string $packageName + * @param string $targetPackageVersion + * @param string $preferredStability + * @param PlatformRequirementFilterInterface|bool|string[] $platformRequirementFilter + * @param int $repoSetFlags* * @return PackageInterface|false */ - public function findBestCandidate($packageName, $targetPackageVersion = null, $preferredStability = 'stable', $ignorePlatformReqs = false, $repoSetFlags = 0) + public function findBestCandidate($packageName, $targetPackageVersion = null, $preferredStability = 'stable', $platformRequirementFilter = null, $repoSetFlags = 0) { if (!isset(BasePackage::$stabilities[$preferredStability])) { // If you get this, maybe you are still relying on the Composer 1.x signature where the 3rd arg was the php version throw new \UnexpectedValueException('Expected a valid stability name as 3rd argument, got '.$preferredStability); } + if (null === $platformRequirementFilter) { + $platformRequirementFilter = PlatformRequirementFilterFactory::ignoreNothing(); + } elseif (!($platformRequirementFilter instanceof PlatformRequirementFilterInterface)) { + trigger_error('VersionSelector::findBestCandidate with ignored platform reqs as bool|array is deprecated since Composer 2.2, use an instance of PlatformRequirementFilterInterface instead.', E_USER_DEPRECATED); + $platformRequirementFilter = PlatformRequirementFilterFactory::fromBoolOrList($platformRequirementFilter); + } + $constraint = $targetPackageVersion ? $this->getParser()->parseConstraints($targetPackageVersion) : null; $candidates = $this->repositorySet->findPackages(strtolower($packageName), $constraint, $repoSetFlags); - if ($this->platformConstraints && true !== $ignorePlatformReqs) { + if ($this->platformConstraints && !($platformRequirementFilter instanceof IgnoreAllPlatformRequirementFilter)) { $platformConstraints = $this->platformConstraints; - $ignorePlatformReqs = $ignorePlatformReqs ?: array(); - $candidates = array_filter($candidates, function ($pkg) use ($platformConstraints, $ignorePlatformReqs) { + $candidates = array_filter($candidates, function ($pkg) use ($platformConstraints, $platformRequirementFilter) { $reqs = $pkg->getRequires(); foreach ($reqs as $name => $link) { - if (!in_array($name, $ignorePlatformReqs, true)) { + if (!$platformRequirementFilter->isIgnored($name)) { if (isset($platformConstraints[$name])) { foreach ($platformConstraints[$name] as $constraint) { if ($link->getConstraint()->matches($constraint)) { @@ -184,7 +193,7 @@ public function findRecommendedRequireVersion(PackageInterface $package) $dumper = new ArrayDumper(); $extra = $loader->getBranchAlias($dumper->dump($package)); if ($extra && $extra !== VersionParser::DEFAULT_BRANCH_ALIAS) { - $extra = preg_replace('{^(\d+\.\d+\.\d+)(\.9999999)-dev$}', '$1.0', $extra, -1, $count); + $extra = Preg::replace('{^(\d+\.\d+\.\d+)(\.9999999)-dev$}', '$1.0', $extra, -1, $count); if ($count) { $extra = str_replace('.9999999', '.0', $extra); @@ -209,7 +218,7 @@ private function transformVersion($version, $prettyVersion, $stability) $semanticVersionParts = explode('.', $version); // check to see if we have a semver-looking version - if (count($semanticVersionParts) == 4 && preg_match('{^0\D?}', $semanticVersionParts[3])) { + if (count($semanticVersionParts) == 4 && Preg::isMatch('{^0\D?}', $semanticVersionParts[3])) { // remove the last parts (i.e. the patch version number and any extra) if ($semanticVersionParts[0] === '0') { unset($semanticVersionParts[3]); diff --git a/core/vendor/composer/composer/src/Composer/Platform/Version.php b/core/vendor/composer/composer/src/Composer/Platform/Version.php index f3ed82a962..6c9cd8fa57 100644 --- a/core/vendor/composer/composer/src/Composer/Platform/Version.php +++ b/core/vendor/composer/composer/src/Composer/Platform/Version.php @@ -12,6 +12,8 @@ namespace Composer\Platform; +use Composer\Pcre\Preg; + /** * @author Lars Strojny <lars@strojny.net> */ @@ -26,7 +28,7 @@ public static function parseOpenssl($opensslVersion, &$isFips) { $isFips = false; - if (!preg_match('/^(?<version>[0-9.]+)(?<patch>[a-z]{0,2})?(?<suffix>(?:-?(?:dev|pre|alpha|beta|rc|fips)[\d]*)*)?(?<garbage>-\w+)?$/', $opensslVersion, $matches)) { + if (!Preg::isMatch('/^(?<version>[0-9.]+)(?<patch>[a-z]{0,2})?(?<suffix>(?:-?(?:dev|pre|alpha|beta|rc|fips)[\d]*)*)?(?<garbage>-\w+)?$/', $opensslVersion, $matches)) { return null; } @@ -43,7 +45,7 @@ public static function parseOpenssl($opensslVersion, &$isFips) */ public static function parseLibjpeg($libjpegVersion) { - if (!preg_match('/^(?<major>\d+)(?<minor>[a-z]*)$/', $libjpegVersion, $matches)) { + if (!Preg::isMatch('/^(?<major>\d+)(?<minor>[a-z]*)$/', $libjpegVersion, $matches)) { return null; } @@ -56,7 +58,7 @@ public static function parseLibjpeg($libjpegVersion) */ public static function parseZoneinfoVersion($zoneinfoVersion) { - if (!preg_match('/^(?<year>\d{4})(?<revision>[a-z]*)$/', $zoneinfoVersion, $matches)) { + if (!Preg::isMatch('/^(?<year>\d{4})(?<revision>[a-z]*)$/', $zoneinfoVersion, $matches)) { return null; } diff --git a/core/vendor/composer/composer/src/Composer/Plugin/PluginInterface.php b/core/vendor/composer/composer/src/Composer/Plugin/PluginInterface.php index c7c42c5f92..2bbc08f505 100644 --- a/core/vendor/composer/composer/src/Composer/Plugin/PluginInterface.php +++ b/core/vendor/composer/composer/src/Composer/Plugin/PluginInterface.php @@ -32,7 +32,7 @@ interface PluginInterface * * @var string */ - const PLUGIN_API_VERSION = '2.1.0'; + const PLUGIN_API_VERSION = '2.2.0'; /** * Apply plugin modifications to Composer diff --git a/core/vendor/composer/composer/src/Composer/Plugin/PluginManager.php b/core/vendor/composer/composer/src/Composer/Plugin/PluginManager.php index 39052d84f1..c6073561bf 100644 --- a/core/vendor/composer/composer/src/Composer/Plugin/PluginManager.php +++ b/core/vendor/composer/composer/src/Composer/Plugin/PluginManager.php @@ -14,10 +14,13 @@ use Composer\Composer; use Composer\EventDispatcher\EventSubscriberInterface; +use Composer\Installer\InstallerInterface; use Composer\IO\IOInterface; +use Composer\Package\BasePackage; use Composer\Package\CompletePackage; use Composer\Package\Package; use Composer\Package\Version\VersionParser; +use Composer\Pcre\Preg; use Composer\Repository\RepositoryInterface; use Composer\Repository\InstalledRepository; use Composer\Repository\RootPackageRepository; @@ -48,9 +51,19 @@ class PluginManager /** @var array<PluginInterface> */ protected $plugins = array(); - /** @var array<string, PluginInterface> */ + /** @var array<string, PluginInterface|InstallerInterface> */ protected $registeredPlugins = array(); + /** + * @var array<non-empty-string, bool>|null + */ + private $allowPluginRules; + + /** + * @var array<non-empty-string, bool>|null + */ + private $allowGlobalPluginRules; + /** @var int */ private static $classCounter = 0; @@ -69,6 +82,9 @@ public function __construct(IOInterface $io, Composer $composer, Composer $globa $this->globalComposer = $globalComposer; $this->versionParser = new VersionParser(); $this->disablePlugins = $disablePlugins; + + $this->allowPluginRules = $this->parseAllowedPlugins($composer->getConfig()->get('allow-plugins')); + $this->allowGlobalPluginRules = $this->parseAllowedPlugins($globalComposer !== null ? $globalComposer->getConfig()->get('allow-plugins') : false); } /** @@ -83,13 +99,32 @@ public function loadInstalledPlugins() } $repo = $this->composer->getRepositoryManager()->getLocalRepository(); - $globalRepo = $this->globalComposer ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; + $globalRepo = $this->globalComposer !== null ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; $this->loadRepository($repo, false); if ($globalRepo) { $this->loadRepository($globalRepo, true); } } + /** + * Deactivate all plugins from currently installed plugin packages + * + * @return void + */ + public function deactivateInstalledPlugins() + { + if ($this->disablePlugins) { + return; + } + + $repo = $this->composer->getRepositoryManager()->getLocalRepository(); + $globalRepo = $this->globalComposer ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; + $this->deactivateRepository($repo, false); + if ($globalRepo) { + $this->deactivateRepository($globalRepo, true); + } + } + /** * Gets all currently active plugin instances * @@ -130,6 +165,11 @@ public function registerPackage(PackageInterface $package, $failOnMissingClasses return; } + if (!$this->isPluginAllowed($package->getName(), $isGlobalPlugin)) { + $this->io->writeError('Skipped loading "'.$package->getName() . '" '.($isGlobalPlugin ? '(installed globally) ' : '').'as it is not in config.allow-plugins', true, IOInterface::DEBUG); + return; + } + if ($package->getType() === 'composer-plugin') { $requiresComposer = null; foreach ($package->getRequires() as $link) { /** @var Link $link */ @@ -154,7 +194,7 @@ public function registerPackage(PackageInterface $package, $failOnMissingClasses return; } - if ($package->getName() === 'symfony/flex' && preg_match('{^[0-9.]+$}', $package->getVersion()) && version_compare($package->getVersion(), '1.9.8', '<')) { + if ($package->getName() === 'symfony/flex' && Preg::isMatch('{^[0-9.]+$}', $package->getVersion()) && version_compare($package->getVersion(), '1.9.8', '<')) { $this->io->writeError('<warning>The "' . $package->getName() . '" plugin '.($isGlobalPlugin ? '(installed globally) ' : '').'was skipped because it is not compatible with Composer 2+. Make sure to update it to version 1.9.8 or greater.</warning>'); return; @@ -174,9 +214,20 @@ public function registerPackage(PackageInterface $package, $failOnMissingClasses $classes = is_array($extra['class']) ? $extra['class'] : array($extra['class']); $localRepo = $this->composer->getRepositoryManager()->getLocalRepository(); - $globalRepo = $this->globalComposer ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; + $globalRepo = $this->globalComposer !== null ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; $rootPackage = clone $this->composer->getPackage(); + + // clear files autoload rules from the root package as the root dependencies are not + // necessarily all present yet when booting this runtime autoloader + $rootPackageAutoloads = $rootPackage->getAutoload(); + $rootPackageAutoloads['files'] = array(); + $rootPackage->setAutoload($rootPackageAutoloads); + $rootPackageAutoloads = $rootPackage->getDevAutoload(); + $rootPackageAutoloads['files'] = array(); + $rootPackage->setDevAutoload($rootPackageAutoloads); + unset($rootPackageAutoloads); + $rootPackageRepo = new RootPackageRepository($rootPackage); $installedRepo = new InstalledRepository(array($localRepo, $rootPackageRepo)); if ($globalRepo) { @@ -201,6 +252,16 @@ public function registerPackage(PackageInterface $package, $failOnMissingClasses $classLoader = $generator->createLoader($map, $this->composer->getConfig()->get('vendor-dir')); $classLoader->register(false); + foreach ($map['files'] as $fileIdentifier => $file) { + // exclude laminas/laminas-zendframework-bridge:src/autoload.php as it breaks Composer in some conditions + // see https://github.com/composer/composer/issues/10349 and https://github.com/composer/composer/issues/10401 + // this hack can be removed once this deprecated package stop being installed + if ($fileIdentifier === '7e9bd612cc444b3eed788ebbe46263a0') { + continue; + } + \Composer\Autoload\composerRequire($fileIdentifier, $file); + } + foreach ($classes as $class) { if (class_exists($class, false)) { $class = trim($class, '\\'); @@ -211,24 +272,30 @@ public function registerPackage(PackageInterface $package, $failOnMissingClasses if ($separatorPos) { $className = substr($class, $separatorPos + 1); } - $code = preg_replace('{^((?:final\s+)?(?:\s*))class\s+('.preg_quote($className).')}mi', '$1class $2_composer_tmp'.self::$classCounter, $code, 1); + $code = Preg::replace('{^((?:final\s+)?(?:\s*))class\s+('.preg_quote($className).')}mi', '$1class $2_composer_tmp'.self::$classCounter, $code, 1); $code = strtr($code, array( '__FILE__' => var_export($path, true), '__DIR__' => var_export(dirname($path), true), '__CLASS__' => var_export($class, true), )); - $code = preg_replace('/^\s*<\?(php)?/i', '', $code, 1); + $code = Preg::replace('/^\s*<\?(php)?/i', '', $code, 1); eval($code); $class .= '_composer_tmp'.self::$classCounter; self::$classCounter++; } if ($oldInstallerPlugin) { + if (!is_a($class, 'Composer\Installer\InstallerInterface', true)) { + throw new \RuntimeException('Could not activate plugin "'.$package->getName().'" as "'.$class.'" does not implement Composer\Installer\InstallerInterface'); + } $this->io->writeError('<warning>Loading "'.$package->getName() . '" '.($isGlobalPlugin ? '(installed globally) ' : '').'which is a legacy composer-installer built for Composer 1.x, it is likely to cause issues as you are running Composer 2.x.</warning>'); $installer = new $class($this->io, $this->composer); $this->composer->getInstallationManager()->addInstaller($installer); $this->registeredPlugins[$package->getName()] = $installer; } elseif (class_exists($class)) { + if (!is_a($class, 'Composer\Plugin\PluginInterface', true)) { + throw new \RuntimeException('Could not activate plugin "'.$package->getName().'" as "'.$class.'" does not implement Composer\Plugin\PluginInterface'); + } $plugin = new $class(); $this->addPlugin($plugin, $isGlobalPlugin, $package); $this->registeredPlugins[$package->getName()] = $plugin; @@ -256,20 +323,15 @@ public function deactivatePackage(PackageInterface $package) return; } - $oldInstallerPlugin = ($package->getType() === 'composer-installer'); - if (!isset($this->registeredPlugins[$package->getName()])) { return; } - if ($oldInstallerPlugin) { - /** @var \Composer\Installer\InstallerInterface $installer */ - $installer = $this->registeredPlugins[$package->getName()]; - unset($this->registeredPlugins[$package->getName()]); - $this->composer->getInstallationManager()->removeInstaller($installer); + $plugin = $this->registeredPlugins[$package->getName()]; + unset($this->registeredPlugins[$package->getName()]); + if ($plugin instanceof InstallerInterface) { + $this->composer->getInstallationManager()->removeInstaller($plugin); } else { - $plugin = $this->registeredPlugins[$package->getName()]; - unset($this->registeredPlugins[$package->getName()]); $this->removePlugin($plugin); } } @@ -292,16 +354,14 @@ public function uninstallPackage(PackageInterface $package) return; } - $oldInstallerPlugin = ($package->getType() === 'composer-installer'); - if (!isset($this->registeredPlugins[$package->getName()])) { return; } - if ($oldInstallerPlugin) { + $plugin = $this->registeredPlugins[$package->getName()]; + if ($plugin instanceof InstallerInterface) { $this->deactivatePackage($package); } else { - $plugin = $this->registeredPlugins[$package->getName()]; unset($this->registeredPlugins[$package->getName()]); $this->removePlugin($plugin); $this->uninstallPlugin($plugin); @@ -333,6 +393,13 @@ protected function getPluginApiVersion() */ public function addPlugin(PluginInterface $plugin, $isGlobalPlugin = false, PackageInterface $sourcePackage = null) { + if ($sourcePackage === null) { + trigger_error('Calling PluginManager::addPlugin without $sourcePackage is deprecated, if you are using this please get in touch with us to explain the use case', E_USER_DEPRECATED); + } elseif (!$this->isPluginAllowed($sourcePackage->getName(), $isGlobalPlugin)) { + $this->io->writeError('Skipped loading "'.get_class($plugin).' from '.$sourcePackage->getName() . '" '.($isGlobalPlugin ? '(installed globally) ' : '').' as it is not in config.allow-plugins', true, IOInterface::DEBUG); + return; + } + $details = array(); if ($sourcePackage) { $details[] = 'from '.$sourcePackage->getName(); @@ -424,6 +491,34 @@ private function loadRepository(RepositoryInterface $repo, $isGlobalRepo) } } + /** + * Deactivate all plugins and installers from a repository + * + * If a plugin requires another plugin, the required one will be deactivated last + * + * @param RepositoryInterface $repo Repository to scan for plugins to install + * @param bool $isGlobalRepo + * + * @return void + */ + private function deactivateRepository(RepositoryInterface $repo, $isGlobalRepo) + { + $packages = $repo->getPackages(); + $sortedPackages = array_reverse(PackageSorter::sortPackages($packages)); + + foreach ($sortedPackages as $package) { + if (!($package instanceof CompletePackage)) { + continue; + } + if ('composer-plugin' === $package->getType()) { + $this->deactivatePackage($package); + // Backward compatibility + } elseif ('composer-installer' === $package->getType()) { + $this->deactivatePackage($package); + } + } + } + /** * Recursively generates a map of package names to packages for all deps * @@ -545,4 +640,113 @@ public function getPluginCapabilities($capabilityClassName, array $ctorArgs = ar return $capabilities; } + + /** + * @param array<string, bool>|bool|null $allowPluginsConfig + * @return array<non-empty-string, bool>|null + */ + private function parseAllowedPlugins($allowPluginsConfig) + { + if (null === $allowPluginsConfig) { + return null; + } + + if (true === $allowPluginsConfig) { + return array('{}' => true); + } + + if (false === $allowPluginsConfig) { + return array('{^$}D' => false); + } + + $rules = array(); + foreach ($allowPluginsConfig as $pattern => $allow) { + $rules[BasePackage::packageNameToRegexp($pattern)] = $allow; + } + + return $rules; + } + + /** + * @param string $package + * @param bool $isGlobalPlugin + * @return bool + */ + private function isPluginAllowed($package, $isGlobalPlugin) + { + static $warned = array(); + $rules = $isGlobalPlugin ? $this->allowGlobalPluginRules : $this->allowPluginRules; + + if ($rules === null) { + if (!$this->io->isInteractive()) { + if (!isset($warned['all'])) { + $this->io->writeError('<warning>For additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins</warning>'); + $this->io->writeError('<warning>You have until July 2022 to add the setting. Composer will then switch the default behavior to disallow all plugins.</warning>'); + $warned['all'] = true; + } + + // if no config is defined we allow all plugins for BC + return true; + } + + // keep going and prompt the user + $rules = array(); + } + + foreach ($rules as $pattern => $allow) { + if (Preg::isMatch($pattern, $package)) { + return $allow === true; + } + } + + if ($package === 'composer/package-versions-deprecated') { + return false; + } + + if (!isset($warned[$package])) { + if ($this->io->isInteractive()) { + $composer = $isGlobalPlugin && $this->globalComposer !== null ? $this->globalComposer : $this->composer; + + $this->io->writeError('<warning>'.$package.($isGlobalPlugin ? ' (installed globally)' : '').' contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins</warning>'); + while (true) { + switch ($answer = $this->io->ask('Do you trust "<info>'.$package.'</info>" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [<comment>y,n,d,?</comment>] ', '?')) { + case 'y': + case 'n': + case 'd': + $allow = $answer === 'y'; + + // persist answer in current rules to avoid prompting again if the package gets reloaded + if ($isGlobalPlugin) { + $this->allowGlobalPluginRules[BasePackage::packageNameToRegexp($package)] = $allow; + } else { + $this->allowPluginRules[BasePackage::packageNameToRegexp($package)] = $allow; + } + + // persist answer in composer.json if it wasn't simply discarded + if ($answer === 'y' || $answer === 'n') { + $composer->getConfig()->getConfigSource()->addConfigSetting('allow-plugins.'.$package, $allow); + } + + return $allow; + + case '?': + default: + $this->io->writeError(array( + 'y - add package to allow-plugins in composer.json and let it run immediately', + 'n - add package (as disallowed) to allow-plugins in composer.json to suppress further prompts', + 'd - discard this, do not change composer.json and do not allow the plugin to run', + '? - print help' + )); + break; + } + } + } else { + $this->io->writeError('<warning>'.$package.($isGlobalPlugin ? ' (installed globally)' : '').' contains a Composer plugin which is blocked by your allow-plugins config. You may add it to the list if you consider it safe. See https://getcomposer.org/allow-plugins</warning>'); + $this->io->writeError('<warning>You can run "composer '.($isGlobalPlugin ? 'global ' : '').'config --no-plugins allow-plugins.'.$package.' [true|false]" to enable it (true) or keep it disabled and suppress this warning (false)</warning>'); + } + $warned[$package] = true; + } + + return false; + } } diff --git a/core/vendor/composer/composer/src/Composer/Question/StrictConfirmationQuestion.php b/core/vendor/composer/composer/src/Composer/Question/StrictConfirmationQuestion.php index 19432201d8..301bb91b02 100644 --- a/core/vendor/composer/composer/src/Composer/Question/StrictConfirmationQuestion.php +++ b/core/vendor/composer/composer/src/Composer/Question/StrictConfirmationQuestion.php @@ -12,6 +12,7 @@ namespace Composer\Question; +use Composer\Pcre\Preg; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Question\Question; @@ -24,9 +25,9 @@ */ class StrictConfirmationQuestion extends Question { - /** @var string */ + /** @var non-empty-string */ private $trueAnswerRegex; - /** @var string */ + /** @var non-empty-string */ private $falseAnswerRegex; /** @@ -34,8 +35,8 @@ class StrictConfirmationQuestion extends Question * * @param string $question The question to ask to the user * @param bool $default The default answer to return, true or false - * @param string $trueAnswerRegex A regex to match the "yes" answer - * @param string $falseAnswerRegex A regex to match the "no" answer + * @param non-empty-string $trueAnswerRegex A regex to match the "yes" answer + * @param non-empty-string $falseAnswerRegex A regex to match the "no" answer */ public function __construct($question, $default = true, $trueAnswerRegex = '/^y(?:es)?$/i', $falseAnswerRegex = '/^no?$/i') { @@ -66,11 +67,11 @@ private function getDefaultNormalizer() return $default; } - if (preg_match($trueRegex, $answer)) { + if (Preg::isMatch($trueRegex, $answer)) { return true; } - if (preg_match($falseRegex, $answer)) { + if (Preg::isMatch($falseRegex, $answer)) { return false; } diff --git a/core/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php b/core/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php index 1e7d69f733..6a4073ca70 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php @@ -20,6 +20,7 @@ use Composer\Package\CompletePackageInterface; use Composer\Package\Version\VersionParser; use Composer\Package\Version\StabilityFilter; +use Composer\Pcre\Preg; use Composer\Semver\Constraint\ConstraintInterface; use Composer\Semver\Constraint\Constraint; @@ -147,28 +148,43 @@ public function findPackages($name, $constraint = null) */ public function search($query, $mode = 0, $type = null) { - $regex = '{(?:'.implode('|', preg_split('{\s+}', $query)).')}i'; + if ($mode === self::SEARCH_FULLTEXT) { + $regex = '{(?:'.implode('|', Preg::split('{\s+}', preg_quote($query))).')}i'; + } else { + // vendor/name searches expect the caller to have preg_quoted the query + $regex = '{(?:'.implode('|', Preg::split('{\s+}', $query)).')}i'; + } $matches = array(); foreach ($this->getPackages() as $package) { $name = $package->getName(); + if ($mode === self::SEARCH_VENDOR) { + list($name) = explode('/', $name); + } if (isset($matches[$name])) { continue; } - if (preg_match($regex, $name) - || ($mode === self::SEARCH_FULLTEXT && $package instanceof CompletePackageInterface && preg_match($regex, implode(' ', (array) $package->getKeywords()) . ' ' . $package->getDescription())) - ) { - if (null !== $type && $package->getType() !== $type) { - continue; - } + if (null !== $type && $package->getType() !== $type) { + continue; + } - $matches[$name] = array( - 'name' => $package->getPrettyName(), - 'description' => $package instanceof CompletePackageInterface ? $package->getDescription() : null, - ); + if (Preg::isMatch($regex, $name) + || ($mode === self::SEARCH_FULLTEXT && $package instanceof CompletePackageInterface && Preg::isMatch($regex, implode(' ', (array) $package->getKeywords()) . ' ' . $package->getDescription())) + ) { + if ($mode === self::SEARCH_VENDOR) { + $matches[$name] = array( + 'name' => $name, + 'description' => null, + ); + } else { + $matches[$name] = array( + 'name' => $package->getPrettyName(), + 'description' => $package instanceof CompletePackageInterface ? $package->getDescription() : null, + ); - if ($package instanceof CompletePackageInterface && $package->isAbandoned()) { - $matches[$name]['abandoned'] = $package->getReplacementPackage() ?: true; + if ($package instanceof CompletePackageInterface && $package->isAbandoned()) { + $matches[$name]['abandoned'] = $package->getReplacementPackage() ?: true; + } } } } @@ -194,12 +210,13 @@ public function hasPackage(PackageInterface $package) /** * Adds a new package to the repository * - * @param PackageInterface $package - * * @return void */ public function addPackage(PackageInterface $package) { + if (!$package instanceof BasePackage) { + throw new \InvalidArgumentException('Only subclasses of BasePackage are supported'); + } if (null === $this->packages) { $this->initialize(); } diff --git a/core/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php b/core/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php index 715075dea3..e8140162c3 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php @@ -79,7 +79,7 @@ private function scanDirectory($path) $directory = new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS); $iterator = new \RecursiveIteratorIterator($directory); - $regex = new \RegexIterator($iterator, '/^.+\.(zip|phar|tar|gz|tgz)$/i'); + $regex = new \RegexIterator($iterator, '/^.+\.(zip|tar|gz|tgz)$/i'); foreach ($regex as $file) { /* @var $file \SplFileInfo */ if (!$file->isFile()) { diff --git a/core/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php b/core/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php index 113c2074b1..0154a49a52 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php @@ -24,6 +24,7 @@ use Composer\Cache; use Composer\Config; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; use Composer\Plugin\PostFileDownloadEvent; use Composer\Semver\CompilingMatcher; use Composer\Util\HttpDownloader; @@ -79,7 +80,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito protected $hasAvailablePackageList = false; /** @var ?array<string> */ protected $availablePackages = null; - /** @var ?array<string> */ + /** @var ?array<non-empty-string> */ protected $availablePackagePatterns = null; /** @var ?string */ protected $lazyProvidersUrl = null; @@ -101,7 +102,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito private $rootData; /** @var bool */ private $hasPartialPackages = false; - /** @var ?array<string, PackageInterface> */ + /** @var ?array<string, mixed[]> */ private $partialPackagesByName = null; /** @@ -135,7 +136,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito public function __construct(array $repoConfig, IOInterface $io, Config $config, HttpDownloader $httpDownloader, EventDispatcher $eventDispatcher = null) { parent::__construct(); - if (!preg_match('{^[\w.]+\??://}', $repoConfig['url'])) { + if (!Preg::isMatch('{^[\w.]+\??://}', $repoConfig['url'])) { // assume http as the default protocol $repoConfig['url'] = 'http://'.$repoConfig['url']; } @@ -161,13 +162,13 @@ public function __construct(array $repoConfig, IOInterface $io, Config $config, $this->url = $repoConfig['url']; // force url for packagist.org to repo.packagist.org - if (preg_match('{^(?P<proto>https?)://packagist\.org/?$}i', $this->url, $match)) { + if (Preg::isMatch('{^(?P<proto>https?)://packagist\.org/?$}i', $this->url, $match)) { $this->url = $match['proto'].'://repo.packagist.org'; } - $this->baseUrl = rtrim(preg_replace('{(?:/[^/\\\\]+\.json)?(?:[?#].*)?$}', '', $this->url), '/'); + $this->baseUrl = rtrim(Preg::replace('{(?:/[^/\\\\]+\.json)?(?:[?#].*)?$}', '', $this->url), '/'); $this->io = $io; - $this->cache = new Cache($io, $config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->url)), 'a-z0-9.$~'); + $this->cache = new Cache($io, $config->get('cache-repo-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->url)), 'a-z0-9.$~'); $this->cache->setReadOnly($config->get('cache-read-only')); $this->versionParser = new VersionParser(); $this->loader = new ArrayLoader($this->versionParser); @@ -322,7 +323,10 @@ public function getPackages() } if ($this->hasPartialPackages()) { - return array_values($this->partialPackagesByName); + if (!is_array($this->partialPackagesByName)) { + throw new \LogicException('hasPartialPackages failed to initialize $this->partialPackagesByName'); + } + return $this->createPackages($this->partialPackagesByName, 'packages.json inline packages'); } throw new \LogicException('Composer repositories that have lazy providers and no available-packages list can not load the complete list of packages, use getPackageNames instead.'); @@ -336,7 +340,7 @@ public function getPackages() } /** - * @param string|null $packageFilter + * @param string|null $packageFilter Package pattern filter which can include "*" as a wildcard * * @return string[] */ @@ -344,51 +348,120 @@ public function getPackageNames($packageFilter = null) { $hasProviders = $this->hasProviders(); - $packageFilterCb = function ($name) { - return true; - }; - if (null !== $packageFilter) { - $packageFilterRegex = '{^'.str_replace('\\*', '.*?', preg_quote($packageFilter)).'$}i'; - $packageFilterCb = function ($name) use ($packageFilterRegex) { - return (bool) preg_match($packageFilterRegex, $name); - }; + $filterResults = + /** + * @param list<string> $results + * @return list<string> + */ + function (array $results) { + return $results; + } + ; + if (null !== $packageFilter && '' !== $packageFilter) { + $packageFilterRegex = BasePackage::packageNameToRegexp($packageFilter); + $filterResults = + /** + * @param list<string> $results + * @return list<string> + */ + function (array $results) use ($packageFilterRegex) { + /** @var list<string> $results */ + return Preg::grep($packageFilterRegex, $results); + } + ; } if ($this->lazyProvidersUrl) { if (is_array($this->availablePackages)) { - return array_filter(array_keys($this->availablePackages), $packageFilterCb); + return $filterResults(array_keys($this->availablePackages)); } if ($this->listUrl) { - $url = $this->listUrl; - if ($packageFilter) { - $url .= '?filter='.urlencode($packageFilter); - } - - $result = $this->httpDownloader->get($url, $this->options)->decodeJson(); - - return $result['packageNames']; + // no need to call $filterResults here as the $packageFilter is applied in the function itself + return $this->loadPackageList($packageFilter); } - if ($this->hasPartialPackages()) { - return array_filter(array_keys($this->partialPackagesByName), $packageFilterCb); + if ($this->hasPartialPackages() && $this->partialPackagesByName !== null) { + return $filterResults(array_keys($this->partialPackagesByName)); } return array(); } if ($hasProviders) { - return array_filter($this->getProviderNames(), $packageFilterCb); + return $filterResults($this->getProviderNames()); } $names = array(); foreach ($this->getPackages() as $package) { - if ($packageFilterCb($package->getName())) { - $names[] = $package->getPrettyName(); - } + $names[] = $package->getPrettyName(); + } + + return $filterResults($names); + } + + /** + * @return list<string> + */ + private function getVendorNames() + { + $cacheKey = 'vendor-list.txt'; + $cacheAge = $this->cache->getAge($cacheKey); + if (false !== $cacheAge && $cacheAge < 600 && ($cachedData = $this->cache->read($cacheKey)) !== false) { + $cachedData = explode("\n", $cachedData); + + return $cachedData; + } + + $names = $this->getPackageNames(); + + $uniques = array(); + foreach ($names as $name) { + // @phpstan-ignore-next-line + $uniques[substr($name, 0, strpos($name, '/'))] = true; } - return $names; + $vendors = array_keys($uniques); + + if (!$this->cache->isReadOnly()) { + $this->cache->write($cacheKey, implode("\n", $vendors)); + } + + return $vendors; + } + + /** + * @param string|null $packageFilter + * @return list<string> + */ + private function loadPackageList($packageFilter = null) + { + if (null === $this->listUrl) { + throw new \LogicException('Make sure to call loadRootServerFile before loadPackageList'); + } + + $url = $this->listUrl; + if (is_string($packageFilter) && $packageFilter !== '') { + $url .= '?filter='.urlencode($packageFilter); + $result = $this->httpDownloader->get($url, $this->options)->decodeJson(); + + return $result['packageNames']; + } + + $cacheKey = 'package-list.txt'; + $cacheAge = $this->cache->getAge($cacheKey); + if (false !== $cacheAge && $cacheAge < 600 && ($cachedData = $this->cache->read($cacheKey)) !== false) { + $cachedData = explode("\n", $cachedData); + + return $cachedData; + } + + $result = $this->httpDownloader->get($url, $this->options)->decodeJson(); + if (!$this->cache->isReadOnly()) { + $this->cache->write($cacheKey, implode("\n", $result['packageNames'])); + } + + return $result['packageNames']; } public function loadPackages(array $packageNameMap, array $acceptableStabilities, array $stabilityFlags, array $alreadyLoaded = array()) @@ -464,10 +537,10 @@ public function loadPackages(array $packageNameMap, array $acceptableStabilities */ public function search($query, $mode = 0, $type = null) { - $this->loadRootServerFile(); + $this->loadRootServerFile(600); if ($this->searchUrl && $mode === self::SEARCH_FULLTEXT) { - $url = str_replace(array('%query%', '%type%'), array($query, $type), $this->searchUrl); + $url = str_replace(array('%query%', '%type%'), array(urlencode($query), $type), $this->searchUrl); $search = $this->httpDownloader->get($url, $this->options)->decodeJson(); @@ -488,14 +561,38 @@ public function search($query, $mode = 0, $type = null) return $results; } - if ($this->hasProviders() || $this->lazyProvidersUrl) { + if ($mode === self::SEARCH_VENDOR) { $results = array(); - $regex = '{(?:'.implode('|', preg_split('{\s+}', $query)).')}i'; + $regex = '{(?:'.implode('|', Preg::split('{\s+}', $query)).')}i'; - foreach ($this->getPackageNames() as $name) { - if (preg_match($regex, $name)) { + $vendorNames = $this->getVendorNames(); + foreach (Preg::grep($regex, $vendorNames) as $name) { + $results[] = array('name' => $name, 'description' => ''); + } + + return $results; + } + + if ($this->hasProviders() || $this->lazyProvidersUrl) { + // optimize search for "^foo/bar" where at least "^foo/" is present by loading this directly from the listUrl if present + if (Preg::isMatch('{^\^(?P<query>(?P<vendor>[a-z0-9_.-]+)/[a-z0-9_.-]*)\*?$}i', $query, $match) && $this->listUrl !== null) { + $url = $this->listUrl . '?vendor='.urlencode($match['vendor']).'&filter='.urlencode($match['query'].'*'); + $result = $this->httpDownloader->get($url, $this->options)->decodeJson(); + + $results = array(); + foreach ($result['packageNames'] as $name) { $results[] = array('name' => $name, 'description' => ''); } + + return $results; + } + + $results = array(); + $regex = '{(?:'.implode('|', Preg::split('{\s+}', $query)).')}i'; + + $packageNames = $this->getPackageNames(); + foreach (Preg::grep($regex, $packageNames) as $name) { + $results[] = array('name' => $name, 'description' => ''); } return $results; @@ -520,6 +617,9 @@ public function getProviders($packageName) } if ($this->hasPartialPackages()) { + if (!is_array($this->partialPackagesByName)) { + throw new \LogicException('hasPartialPackages failed to initialize $this->partialPackagesByName'); + } foreach ($this->partialPackagesByName as $versions) { foreach ($versions as $candidate) { if (isset($result[$candidate['name']]) || !isset($candidate['provide'][$packageName])) { @@ -793,7 +893,7 @@ private function loadAsyncPackages(array $packageNames, array $acceptableStabili foreach ($packageNames as $name => $constraint) { $name = strtolower($name); - $realName = preg_replace('{~dev$}', '', $name); + $realName = Preg::replace('{~dev$}', '', $name); // skip platform packages, root package and composer-plugin-api if (PlatformRepository::isPlatformPackage($realName) || '__root__' === $realName) { continue; @@ -919,9 +1019,10 @@ private function getPackagesJsonUrl() } /** + * @param int|null $rootMaxAge * @return array<string, mixed> */ - protected function loadRootServerFile() + protected function loadRootServerFile($rootMaxAge = null) { if (null !== $this->rootData) { return $this->rootData; @@ -931,7 +1032,19 @@ protected function loadRootServerFile() throw new \RuntimeException('You must enable the openssl extension in your php.ini to load information from '.$this->url); } - $data = $this->fetchFile($this->getPackagesJsonUrl(), 'packages.json'); + if ($cachedData = $this->cache->read('packages.json')) { + $cachedData = json_decode($cachedData, true); + if ($rootMaxAge !== null && ($age = $this->cache->getAge('packages.json')) !== false && $age <= $rootMaxAge) { + $data = $cachedData; + } elseif (isset($cachedData['last-modified'])) { + $response = $this->fetchFileIfLastModified($this->getPackagesJsonUrl(), 'packages.json', $cachedData['last-modified']); + $data = true === $response ? $cachedData : $response; + } + } + + if (!isset($data)) { + $data = $this->fetchFile($this->getPackagesJsonUrl(), 'packages.json', null, true); + } if (!empty($data['notify-batch'])) { $this->notifyUrl = $this->canonicalizeUrl($data['notify-batch']); @@ -967,12 +1080,6 @@ protected function loadRootServerFile() $this->hasPartialPackages = !empty($data['packages']) && is_array($data['packages']); } - // Horrible hack to workaround https://github.com/composer/composer/issues/9297 and bad mirrors, should be disabled if possible once they fix things - if (!empty($data['metadata-url']) && !empty($data['list']) && $data['metadata-url'] === '/p/%package%.json' && $data['list'] === 'https://packagist.org/packages/list.json') { - $this->io->writeError('<warning>Composer 2 repository support for '.$this->url.' has been disabled due to what seems like a misconfiguration. If this is a packagist.org mirror we recommend removing it as Composer 2 handles network operations much faster and should work fine without.</warning>'); - unset($data['metadata-url']); - } - // metadata-url indicates V2 repo protocol so it takes over from all the V1 types // V2 only has lazyProviders and possibly partial packages, but no ability to process anything else, // V2 also supports async loading @@ -1040,7 +1147,7 @@ protected function loadRootServerFile() private function canonicalizeUrl($url) { if ('/' === $url[0]) { - if (preg_match('{^[^:]++://[^/]*+}', $this->url, $matches)) { + if (Preg::isMatch('{^[^:]++://[^/]*+}', $this->url, $matches)) { return $matches[0] . $url; } @@ -1051,7 +1158,7 @@ private function canonicalizeUrl($url) } /** - * @return array[] + * @return mixed[] */ private function loadDataFromServer() { @@ -1073,7 +1180,7 @@ private function hasPartialPackages() } /** - * @param array{providers?: array, provider-includes?: array} $data + * @param array{providers?: mixed[], provider-includes?: mixed[]} $data * * @return void */ @@ -1103,9 +1210,9 @@ private function loadProviderListings($data) } /** - * @param array[] $data + * @param mixed[] $data * - * @return array[] + * @return mixed[] */ private function loadIncludes($data) { @@ -1150,7 +1257,7 @@ private function loadIncludes($data) * TODO v3 should make this private once we can drop PHP 5.3 support * @private * - * @param array[] $packages + * @param mixed[] $packages * @param string|null $source * * @return list<CompletePackage|CompleteAliasPackage> @@ -1200,7 +1307,7 @@ protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $store } // url-encode $ signs in URLs as bad proxies choke on them - if (($pos = strpos($filename, '$')) && preg_match('{^https?://}i', $filename)) { + if (($pos = strpos($filename, '$')) && Preg::isMatch('{^https?://}i', $filename)) { $filename = substr($filename, 0, $pos) . '%24' . substr($filename, $pos + 1); } @@ -1226,7 +1333,7 @@ protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $store $filename = str_replace('http://', 'https://', $filename); } - if ($retries) { + if ($retries > 0) { usleep(100000); continue; @@ -1267,19 +1374,6 @@ protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $store throw $e; } - // try to detect offline state (if dns resolution fails it is pretty likely to keep failing) and avoid retrying in that case - if ($e instanceof TransportException && $e->getStatusCode() === null) { - $responseInfo = $e->getResponseInfo(); - if (isset($responseInfo['namelookup_time']) && $responseInfo['namelookup_time'] == 0) { - $retries = 0; - } - } - - if ($retries) { - usleep(100000); - continue; - } - if ($e instanceof RepositorySecurityException) { throw $e; } @@ -1314,71 +1408,61 @@ protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $store */ private function fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime) { - $retries = 3; - while ($retries--) { - try { - $options = $this->options; - if ($this->eventDispatcher) { - $preFileDownloadEvent = new PreFileDownloadEvent(PluginEvents::PRE_FILE_DOWNLOAD, $this->httpDownloader, $filename, 'metadata', array('repository' => $this)); - $preFileDownloadEvent->setTransportOptions($this->options); - $this->eventDispatcher->dispatch($preFileDownloadEvent->getName(), $preFileDownloadEvent); - $filename = $preFileDownloadEvent->getProcessedUrl(); - $options = $preFileDownloadEvent->getTransportOptions(); - } - - if (isset($options['http']['header'])) { - $options['http']['header'] = (array) $options['http']['header']; - } - $options['http']['header'][] = 'If-Modified-Since: '.$lastModifiedTime; - $response = $this->httpDownloader->get($filename, $options); - $json = (string) $response->getBody(); - if ($json === '' && $response->getStatusCode() === 304) { - return true; - } - - if ($this->eventDispatcher) { - $postFileDownloadEvent = new PostFileDownloadEvent(PluginEvents::POST_FILE_DOWNLOAD, null, null, $filename, 'metadata', array('response' => $response, 'repository' => $this)); - $this->eventDispatcher->dispatch($postFileDownloadEvent->getName(), $postFileDownloadEvent); - } + try { + $options = $this->options; + if ($this->eventDispatcher) { + $preFileDownloadEvent = new PreFileDownloadEvent(PluginEvents::PRE_FILE_DOWNLOAD, $this->httpDownloader, $filename, 'metadata', array('repository' => $this)); + $preFileDownloadEvent->setTransportOptions($this->options); + $this->eventDispatcher->dispatch($preFileDownloadEvent->getName(), $preFileDownloadEvent); + $filename = $preFileDownloadEvent->getProcessedUrl(); + $options = $preFileDownloadEvent->getTransportOptions(); + } - $data = $response->decodeJson(); - HttpDownloader::outputWarnings($this->io, $this->url, $data); + if (isset($options['http']['header'])) { + $options['http']['header'] = (array) $options['http']['header']; + } + $options['http']['header'][] = 'If-Modified-Since: '.$lastModifiedTime; + $response = $this->httpDownloader->get($filename, $options); + $json = (string) $response->getBody(); + if ($json === '' && $response->getStatusCode() === 304) { + return true; + } - $lastModifiedDate = $response->getHeader('last-modified'); - $response->collect(); - if ($lastModifiedDate) { - $data['last-modified'] = $lastModifiedDate; - $json = JsonFile::encode($data, 0); - } - if (!$this->cache->isReadOnly()) { - $this->cache->write($cacheKey, $json); - } + if ($this->eventDispatcher) { + $postFileDownloadEvent = new PostFileDownloadEvent(PluginEvents::POST_FILE_DOWNLOAD, null, null, $filename, 'metadata', array('response' => $response, 'repository' => $this)); + $this->eventDispatcher->dispatch($postFileDownloadEvent->getName(), $postFileDownloadEvent); + } - return $data; - } catch (\Exception $e) { - if ($e instanceof \LogicException) { - throw $e; - } + $data = $response->decodeJson(); + HttpDownloader::outputWarnings($this->io, $this->url, $data); - if ($e instanceof TransportException && $e->getStatusCode() === 404) { - throw $e; - } + $lastModifiedDate = $response->getHeader('last-modified'); + $response->collect(); + if ($lastModifiedDate) { + $data['last-modified'] = $lastModifiedDate; + $json = JsonFile::encode($data, 0); + } + if (!$this->cache->isReadOnly()) { + $this->cache->write($cacheKey, $json); + } - if ($retries) { - usleep(100000); - continue; - } + return $data; + } catch (\Exception $e) { + if ($e instanceof \LogicException) { + throw $e; + } - if (!$this->degradedMode) { - $this->io->writeError('<warning>'.$this->url.' could not be fully loaded ('.$e->getMessage().'), package information was loaded from the local cache and may be out of date</warning>'); - } - $this->degradedMode = true; + if ($e instanceof TransportException && $e->getStatusCode() === 404) { + throw $e; + } - return true; + if (!$this->degradedMode) { + $this->io->writeError('<warning>'.$this->url.' could not be fully loaded ('.$e->getMessage().'), package information was loaded from the local cache and may be out of date</warning>'); } - } + $this->degradedMode = true; - throw new \LogicException('Should not happen'); + return true; + } } /** @@ -1390,8 +1474,6 @@ private function fetchFileIfLastModified($filename, $cacheKey, $lastModifiedTime */ private function asyncFetchFile($filename, $cacheKey, $lastModifiedTime = null) { - $retries = 3; - if (isset($this->packagesNotFoundCache[$filename])) { return \React\Promise\resolve(array('packages' => array())); } @@ -1462,32 +1544,13 @@ private function asyncFetchFile($filename, $cacheKey, $lastModifiedTime = null) return $data; }; - $reject = function ($e) use (&$retries, $httpDownloader, $filename, $options, &$reject, $accept, $io, $url, &$degradedMode, $repo, $lastModifiedTime) { + $reject = function ($e) use ($filename, $accept, $io, $url, &$degradedMode, $repo, $lastModifiedTime) { if ($e instanceof TransportException && $e->getStatusCode() === 404) { $repo->packagesNotFoundCache[$filename] = true; return false; } - // special error code returned when network is being artificially disabled - if ($e instanceof TransportException && $e->getStatusCode() === 499) { - $retries = 0; - } - - // try to detect offline state (if dns resolution fails it is pretty likely to keep failing) and avoid retrying in that case - if ($e instanceof TransportException && $e->getStatusCode() === null) { - $responseInfo = $e->getResponseInfo(); - if (isset($responseInfo['namelookup_time']) && $responseInfo['namelookup_time'] == 0) { - $retries = 0; - } - } - - if (--$retries > 0) { - usleep(100000); - - return $httpDownloader->add($filename, $options)->then($accept, $reject); - } - if (!$degradedMode) { $io->writeError('<warning>'.$url.' could not be fully loaded ('.$e->getMessage().'), package information was loaded from the local cache and may be out of date</warning>'); } @@ -1549,7 +1612,7 @@ protected function lazyProvidersRepoContains($name) if (is_array($this->availablePackagePatterns)) { foreach ($this->availablePackagePatterns as $providerRegex) { - if (preg_match($providerRegex, $name)) { + if (Preg::isMatch($providerRegex, $name)) { return true; } } diff --git a/core/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php b/core/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php index 6f130ce053..6138514fcc 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php @@ -36,6 +36,8 @@ class FilesystemRepository extends WritableArrayRepository private $rootPackage; /** @var Filesystem */ private $filesystem; + /** @var bool|null */ + private $devMode = null; /** * Initializes filesystem repository. @@ -56,6 +58,14 @@ public function __construct(JsonFile $repositoryFile, $dumpVersions = false, Roo } } + /** + * @return bool|null true if dev requirements were installed, false if --no-dev was used, null if yet unknown + */ + public function getDevMode() + { + return $this->devMode; + } + /** * Initializes repository (reads file, or remote address). */ @@ -78,6 +88,9 @@ protected function initialize() if (isset($data['dev-package-names'])) { $this->setDevPackageNames($data['dev-package-names']); } + if (isset($data['dev'])) { + $this->devMode = $data['dev']; + } if (!is_array($packages)) { throw new \UnexpectedValueException('Could not parse package list from the repository'); diff --git a/core/vendor/composer/composer/src/Composer/Repository/FilterRepository.php b/core/vendor/composer/composer/src/Composer/Repository/FilterRepository.php index 429659129a..03fce779f3 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/FilterRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/FilterRepository.php @@ -14,6 +14,7 @@ use Composer\Package\PackageInterface; use Composer\Package\BasePackage; +use Composer\Pcre\Preg; /** * Filters which packages are seen as canonical on this repo by loadPackages @@ -24,7 +25,7 @@ class FilterRepository implements RepositoryInterface { /** @var ?string */ private $only = null; - /** @var ?string */ + /** @var ?non-empty-string */ private $exclude = null; /** @var bool */ private $canonical = true; @@ -40,17 +41,13 @@ public function __construct(RepositoryInterface $repo, array $options) if (!is_array($options['only'])) { throw new \InvalidArgumentException('"only" key for repository '.$repo->getRepoName().' should be an array'); } - $this->only = '{^(?:'.implode('|', array_map(function ($val) { - return BasePackage::packageNameToRegexp($val, '%s'); - }, $options['only'])) .')$}iD'; + $this->only = BasePackage::packageNamesToRegexp($options['only']); } if (isset($options['exclude'])) { if (!is_array($options['exclude'])) { throw new \InvalidArgumentException('"exclude" key for repository '.$repo->getRepoName().' should be an array'); } - $this->exclude = '{^(?:'.implode('|', array_map(function ($val) { - return BasePackage::packageNameToRegexp($val, '%s'); - }, $options['exclude'])) .')$}iD'; + $this->exclude = BasePackage::packageNamesToRegexp($options['exclude']); } if ($this->exclude && $this->only) { throw new \InvalidArgumentException('Only one of "only" and "exclude" can be specified for repository '.$repo->getRepoName()); @@ -206,9 +203,13 @@ private function isAllowed($name) } if ($this->only) { - return (bool) preg_match($this->only, $name); + return Preg::isMatch($this->only, $name); + } + + if ($this->exclude === null) { + return true; } - return !preg_match($this->exclude, $name); + return !Preg::isMatch($this->exclude, $name); } } diff --git a/core/vendor/composer/composer/src/Composer/Repository/InstalledRepositoryInterface.php b/core/vendor/composer/composer/src/Composer/Repository/InstalledRepositoryInterface.php index b5d8a264e3..a25d7369e2 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/InstalledRepositoryInterface.php +++ b/core/vendor/composer/composer/src/Composer/Repository/InstalledRepositoryInterface.php @@ -21,6 +21,11 @@ */ interface InstalledRepositoryInterface extends WritableRepositoryInterface { + /** + * @return bool|null true if dev requirements were installed, false if --no-dev was used, null if yet unknown + */ + public function getDevMode(); + /** * @return bool true if packages were never installed in this repository */ diff --git a/core/vendor/composer/composer/src/Composer/Repository/PackageRepository.php b/core/vendor/composer/composer/src/Composer/Repository/PackageRepository.php index 06f987d435..b787931cac 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/PackageRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/PackageRepository.php @@ -14,6 +14,7 @@ use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ValidatingArrayLoader; +use Composer\Pcre\Preg; /** * Package repository. @@ -28,7 +29,7 @@ class PackageRepository extends ArrayRepository /** * Initializes filesystem repository. * - * @param array{package: array} $config package definition + * @param array{package: mixed[]} $config package definition */ public function __construct(array $config) { @@ -48,7 +49,7 @@ protected function initialize() { parent::initialize(); - $loader = new ValidatingArrayLoader(new ArrayLoader(null, true), false); + $loader = new ValidatingArrayLoader(new ArrayLoader(null, true), true); foreach ($this->config as $package) { try { $package = $loader->load($package); @@ -62,6 +63,6 @@ protected function initialize() public function getRepoName() { - return preg_replace('{^array }', 'package ', parent::getRepoName()); + return Preg::replace('{^array }', 'package ', parent::getRepoName()); } } diff --git a/core/vendor/composer/composer/src/Composer/Repository/PathRepository.php b/core/vendor/composer/composer/src/Composer/Repository/PathRepository.php index afdf847493..d2a81cee77 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/PathRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/PathRepository.php @@ -15,9 +15,12 @@ use Composer\Config; use Composer\IO\IOInterface; use Composer\Json\JsonFile; +use Composer\Package\CompleteAliasPackage; +use Composer\Package\CompletePackage; use Composer\Package\Loader\ArrayLoader; use Composer\Package\Version\VersionGuesser; use Composer\Package\Version\VersionParser; +use Composer\Pcre\Preg; use Composer\Util\Platform; use Composer\Util\ProcessExecutor; use Composer\Util\Filesystem; @@ -95,7 +98,7 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn /** * Initializes path repository. * - * @param array{url: string, options?: array{symlink?: bool, relative?: bool, versions?: array<string, string>}} $repoConfig + * @param array{url?: string, options?: array{symlink?: bool, relative?: bool, versions?: array<string, string>}} $repoConfig * @param IOInterface $io * @param Config $config */ @@ -141,9 +144,9 @@ protected function initialize() $urlMatches = $this->getUrlMatches(); if (empty($urlMatches)) { - if (preg_match('{[*{}]}', $this->url)) { + if (Preg::isMatch('{[*{}]}', $this->url)) { $url = $this->url; - while (preg_match('{[*{}]}', $url)) { + while (Preg::isMatch('{[*{}]}', $url)) { $url = dirname($url); } // the parent directory before any wildcard exists, so we assume it is correctly configured but simply empty @@ -170,8 +173,9 @@ protected function initialize() 'url' => $url, 'reference' => sha1($json . serialize($this->options)), ); - $package['transport-options'] = $this->options; - unset($package['transport-options']['versions']); + + // copy symlink/relative options to transport options + $package['transport-options'] = array_intersect_key($this->options, array('symlink' => true, 'relative' => true)); // use the version provided as option if available if (isset($package['name'], $this->options['versions'][$package['name']])) { @@ -179,7 +183,7 @@ protected function initialize() } // carry over the root package version if this path repo is in the same git repository as root package - if (!isset($package['version']) && ($rootVersion = getenv('COMPOSER_ROOT_VERSION'))) { + if (!isset($package['version']) && ($rootVersion = Platform::getEnv('COMPOSER_ROOT_VERSION'))) { if ( 0 === $this->process->execute('git rev-parse HEAD', $ref1, $path) && 0 === $this->process->execute('git rev-parse HEAD', $ref2) @@ -194,6 +198,7 @@ protected function initialize() $package['dist']['reference'] = trim($output); } + $needsAlias = false; if (!isset($package['version'])) { $versionData = $this->versionGuesser->guessVersion($package, $path); if (is_array($versionData) && $versionData['pretty_version']) { @@ -205,11 +210,16 @@ protected function initialize() $package['version'] = $versionData['pretty_version']; } else { - $package['version'] = 'dev-master'; + $package['version'] = 'dev-main'; + $needsAlias = true; } } $package = $this->loader->load($package); + if ($needsAlias && $package instanceof CompletePackage) { + // keep a dev-master alias to dev-main for BC + $package = new CompleteAliasPackage($package, 'dev-master', 'dev-master'); + } $this->addPackage($package); } } diff --git a/core/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php b/core/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php index d34f557d55..916145ee1b 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php @@ -18,6 +18,7 @@ use Composer\Package\Link; use Composer\Package\PackageInterface; use Composer\Package\Version\VersionParser; +use Composer\Pcre\Preg; use Composer\Platform\HhvmDetector; use Composer\Platform\Runtime; use Composer\Platform\Version; @@ -31,7 +32,7 @@ */ class PlatformRepository extends ArrayRepository { - const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer-(?:plugin|runtime)-api)$}iD'; + const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer(?:-(?:plugin|runtime)-api)?)$}iD'; /** * @var ?string @@ -48,23 +49,36 @@ class PlatformRepository extends ArrayRepository * * Keyed by package name (lowercased) * - * @var array<string, array{name: string, version: string}> + * @var array<string, array{name: string, version: string|false}> */ private $overrides = array(); + /** + * Stores which packages have been disabled and their actual version + * + * @var array<string, CompletePackageInterface> + */ + private $disabledPackages = array(); + /** @var Runtime */ private $runtime; /** @var HhvmDetector */ private $hhvmDetector; /** - * @param array<string, string> $overrides + * @param array<string, string|false> $overrides */ public function __construct(array $packages = array(), array $overrides = array(), Runtime $runtime = null, HhvmDetector $hhvmDetector = null) { $this->runtime = $runtime ?: new Runtime(); $this->hhvmDetector = $hhvmDetector ?: new HhvmDetector(); foreach ($overrides as $name => $version) { + if (!is_string($version) && false !== $version) { // @phpstan-ignore-line + throw new \UnexpectedValueException('config.platform.'.$name.' should be a string or false, but got '.gettype($version).' '.var_export($version, true)); + } + if ($name === 'php' && $version === false) { + throw new \UnexpectedValueException('config.platform.'.$name.' cannot be set to false as you cannot disable php entirely.'); + } $this->overrides[strtolower($name)] = array('name' => $name, 'version' => $version); } parent::__construct($packages); @@ -75,6 +89,23 @@ public function getRepoName() return 'platform repo'; } + /** + * @param string $name + * @return boolean + */ + public function isPlatformPackageDisabled($name) + { + return isset($this->disabledPackages[$name]); + } + + /** + * @return array<string, CompletePackageInterface> + */ + public function getDisabledPackages() + { + return $this->disabledPackages; + } + protected function initialize() { parent::initialize(); @@ -89,9 +120,17 @@ protected function initialize() throw new \InvalidArgumentException('Invalid platform package name in config.platform: '.$override['name']); } - $this->addOverriddenPackage($override); + if ($override['version'] !== false) { + $this->addOverriddenPackage($override); + } } + $prettyVersion = Composer::getVersion(); + $version = $this->versionParser->normalize($prettyVersion); + $composer = new CompletePackage('composer', $version, $prettyVersion); + $composer->setDescription('Composer package'); + $this->addPackage($composer); + $prettyVersion = PluginInterface::PLUGIN_API_VERSION; $version = $this->versionParser->normalize($prettyVersion); $composerPluginApi = new CompletePackage('composer-plugin-api', $version, $prettyVersion); @@ -108,7 +147,7 @@ protected function initialize() $prettyVersion = $this->runtime->getConstant('PHP_VERSION'); $version = $this->versionParser->normalize($prettyVersion); } catch (\UnexpectedValueException $e) { - $prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', $this->runtime->getConstant('PHP_VERSION')); + $prettyVersion = Preg::replace('#^([^~+-]+).*$#', '$1', $this->runtime->getConstant('PHP_VERSION')); $version = $this->versionParser->normalize($prettyVersion); } @@ -167,12 +206,12 @@ protected function initialize() $info = $this->runtime->getExtensionInfo($name); // librabbitmq version => 0.9.0 - if (preg_match('/^librabbitmq version => (?<version>.+)$/im', $info, $librabbitmqMatches)) { + if (Preg::isMatch('/^librabbitmq version => (?<version>.+)$/im', $info, $librabbitmqMatches)) { $this->addLibrary($name.'-librabbitmq', $librabbitmqMatches['version'], 'AMQP librabbitmq version'); } // AMQP protocol version => 0-9-1 - if (preg_match('/^AMQP protocol version => (?<version>.+)$/im', $info, $protocolMatches)) { + if (Preg::isMatch('/^AMQP protocol version => (?<version>.+)$/im', $info, $protocolMatches)) { $this->addLibrary($name.'-protocol', str_replace('-', '.', $protocolMatches['version']), 'AMQP protocol version'); } break; @@ -181,7 +220,7 @@ protected function initialize() $info = $this->runtime->getExtensionInfo($name); // BZip2 Version => 1.0.6, 6-Sept-2010 - if (preg_match('/^BZip2 Version => (?<version>.*),/im', $info, $matches)) { + if (Preg::isMatch('/^BZip2 Version => (?<version>.*),/im', $info, $matches)) { $this->addLibrary($name, $matches['version']); } break; @@ -193,7 +232,7 @@ protected function initialize() $info = $this->runtime->getExtensionInfo($name); // SSL Version => OpenSSL/1.0.1t - if (preg_match('{^SSL Version => (?<library>[^/]+)/(?<version>.+)$}im', $info, $sslMatches)) { + if (Preg::isMatch('{^SSL Version => (?<library>[^/]+)/(?<version>.+)$}im', $info, $sslMatches)) { $library = strtolower($sslMatches['library']); if ($library === 'openssl') { $parsedVersion = Version::parseOpenssl($sslMatches['version'], $isFips); @@ -204,12 +243,12 @@ protected function initialize() } // libSSH Version => libssh2/1.4.3 - if (preg_match('{^libSSH Version => (?<library>[^/]+)/(?<version>.+?)(?:/.*)?$}im', $info, $sshMatches)) { + if (Preg::isMatch('{^libSSH Version => (?<library>[^/]+)/(?<version>.+?)(?:/.*)?$}im', $info, $sshMatches)) { $this->addLibrary($name.'-'.strtolower($sshMatches['library']), $sshMatches['version'], 'curl '.$sshMatches['library'].' version'); } // ZLib Version => 1.2.8 - if (preg_match('{^ZLib Version => (?<version>.+)$}im', $info, $zlibMatches)) { + if (Preg::isMatch('{^ZLib Version => (?<version>.+)$}im', $info, $zlibMatches)) { $this->addLibrary($name.'-zlib', $zlibMatches['version'], 'curl zlib version'); } break; @@ -218,14 +257,14 @@ protected function initialize() $info = $this->runtime->getExtensionInfo($name); // timelib version => 2018.03 - if (preg_match('/^timelib version => (?<version>.+)$/im', $info, $timelibMatches)) { + if (Preg::isMatch('/^timelib version => (?<version>.+)$/im', $info, $timelibMatches)) { $this->addLibrary($name.'-timelib', $timelibMatches['version'], 'date timelib version'); } // Timezone Database => internal - if (preg_match('/^Timezone Database => (?<source>internal|external)$/im', $info, $zoneinfoSourceMatches)) { + if (Preg::isMatch('/^Timezone Database => (?<source>internal|external)$/im', $info, $zoneinfoSourceMatches)) { $external = $zoneinfoSourceMatches['source'] === 'external'; - if (preg_match('/^"Olson" Timezone Database Version => (?<version>.+?)(\.system)?$/im', $info, $zoneinfoMatches)) { + if (Preg::isMatch('/^"Olson" Timezone Database Version => (?<version>.+?)(\.system)?$/im', $info, $zoneinfoMatches)) { // If the timezonedb is provided by ext/timezonedb, register that version as a replacement if ($external && in_array('timezonedb', $loadedExtensions, true)) { $this->addLibrary('timezonedb-zoneinfo', $zoneinfoMatches['version'], 'zoneinfo ("Olson") database for date (replaced by timezonedb)', array($name.'-zoneinfo')); @@ -240,7 +279,7 @@ protected function initialize() $info = $this->runtime->getExtensionInfo($name); // libmagic => 537 - if (preg_match('/^libmagic => (?<version>.+)$/im', $info, $magicMatches)) { + if (Preg::isMatch('/^libmagic => (?<version>.+)$/im', $info, $magicMatches)) { $this->addLibrary($name.'-libmagic', $magicMatches['version'], 'fileinfo libmagic version'); } break; @@ -250,19 +289,19 @@ protected function initialize() $info = $this->runtime->getExtensionInfo($name); - if (preg_match('/^libJPEG Version => (?<version>.+?)(?: compatible)?$/im', $info, $libjpegMatches)) { + if (Preg::isMatch('/^libJPEG Version => (?<version>.+?)(?: compatible)?$/im', $info, $libjpegMatches)) { $this->addLibrary($name.'-libjpeg', Version::parseLibjpeg($libjpegMatches['version']), 'libjpeg version for gd'); } - if (preg_match('/^libPNG Version => (?<version>.+)$/im', $info, $libpngMatches)) { + if (Preg::isMatch('/^libPNG Version => (?<version>.+)$/im', $info, $libpngMatches)) { $this->addLibrary($name.'-libpng', $libpngMatches['version'], 'libpng version for gd'); } - if (preg_match('/^FreeType Version => (?<version>.+)$/im', $info, $freetypeMatches)) { + if (Preg::isMatch('/^FreeType Version => (?<version>.+)$/im', $info, $freetypeMatches)) { $this->addLibrary($name.'-freetype', $freetypeMatches['version'], 'freetype version for gd'); } - if (preg_match('/^libXpm Version => (?<versionId>\d+)$/im', $info, $libxpmMatches)) { + if (Preg::isMatch('/^libXpm Version => (?<versionId>\d+)$/im', $info, $libxpmMatches)) { $this->addLibrary($name.'-libxpm', Version::convertLibxpmVersionId($libxpmMatches['versionId']), 'libxpm version for gd'); } @@ -283,12 +322,12 @@ protected function initialize() // Truthy check is for testing only so we can make the condition fail if ($this->runtime->hasConstant('INTL_ICU_VERSION')) { $this->addLibrary('icu', $this->runtime->getConstant('INTL_ICU_VERSION'), $description); - } elseif (preg_match('/^ICU version => (?<version>.+)$/im', $info, $matches)) { + } elseif (Preg::isMatch('/^ICU version => (?<version>.+)$/im', $info, $matches)) { $this->addLibrary('icu', $matches['version'], $description); } // ICU TZData version => 2019c - if (preg_match('/^ICU TZData version => (?<version>.*)$/im', $info, $zoneinfoMatches)) { + if (Preg::isMatch('/^ICU TZData version => (?<version>.*)$/im', $info, $zoneinfoMatches)) { $this->addLibrary('icu-zoneinfo', Version::parseZoneinfoVersion($zoneinfoMatches['version']), 'zoneinfo ("Olson") database for icu'); } @@ -307,7 +346,7 @@ protected function initialize() $imageMagickVersion = $this->runtime->construct('Imagick')->getVersion(); // 6.x: ImageMagick 6.2.9 08/24/06 Q16 http://www.imagemagick.org // 7.x: ImageMagick 7.0.8-34 Q16 x86_64 2019-03-23 https://imagemagick.org - preg_match('/^ImageMagick (?<version>[\d.]+)(?:-(?<patch>\d+))?/', $imageMagickVersion['versionString'], $matches); + Preg::match('/^ImageMagick (?<version>[\d.]+)(?:-(?<patch>\d+))?/', $imageMagickVersion['versionString'], $matches); $version = $matches['version']; if (isset($matches['patch'])) { $version .= '.'.$matches['patch']; @@ -319,7 +358,7 @@ protected function initialize() case 'ldap': $info = $this->runtime->getExtensionInfo($name); - if (preg_match('/^Vendor Version => (?<versionId>\d+)$/im', $info, $matches) && preg_match('/^Vendor Name => (?<vendor>.+)$/im', $info, $vendorMatches)) { + if (Preg::isMatch('/^Vendor Version => (?<versionId>\d+)$/im', $info, $matches) && Preg::isMatch('/^Vendor Name => (?<vendor>.+)$/im', $info, $vendorMatches)) { $this->addLibrary($name.'-'.strtolower($vendorMatches['vendor']), Version::convertOpenldapVersionId($matches['versionId']), $vendorMatches['vendor'].' version of ldap'); } break; @@ -337,7 +376,7 @@ protected function initialize() $info = $this->runtime->getExtensionInfo($name); // libmbfl version => 1.3.2 - if (preg_match('/^libmbfl version => (?<version>.+)$/im', $info, $libmbflMatches)) { + if (Preg::isMatch('/^libmbfl version => (?<version>.+)$/im', $info, $libmbflMatches)) { $this->addLibrary($name.'-libmbfl', $libmbflMatches['version'], 'mbstring libmbfl version'); } @@ -346,7 +385,7 @@ protected function initialize() // Multibyte regex (oniguruma) version => 5.9.5 // oniguruma version => 6.9.0 - } elseif (preg_match('/^(?:oniguruma|Multibyte regex \(oniguruma\)) version => (?<version>.+)$/im', $info, $onigurumaMatches)) { + } elseif (Preg::isMatch('/^(?:oniguruma|Multibyte regex \(oniguruma\)) version => (?<version>.+)$/im', $info, $onigurumaMatches)) { $this->addLibrary($name.'-oniguruma', $onigurumaMatches['version'], 'mbstring oniguruma version'); } @@ -356,26 +395,26 @@ protected function initialize() $info = $this->runtime->getExtensionInfo($name); // libmemcached version => 1.0.18 - if (preg_match('/^libmemcached version => (?<version>.+)$/im', $info, $matches)) { + if (Preg::isMatch('/^libmemcached version => (?<version>.+)$/im', $info, $matches)) { $this->addLibrary($name.'-libmemcached', $matches['version'], 'libmemcached version'); } break; case 'openssl': // OpenSSL 1.1.1g 21 Apr 2020 - if (preg_match('{^(?:OpenSSL|LibreSSL)?\s*(?<version>\S+)}i', $this->runtime->getConstant('OPENSSL_VERSION_TEXT'), $matches)) { + if (Preg::isMatch('{^(?:OpenSSL|LibreSSL)?\s*(?<version>\S+)}i', $this->runtime->getConstant('OPENSSL_VERSION_TEXT'), $matches)) { $parsedVersion = Version::parseOpenssl($matches['version'], $isFips); $this->addLibrary($name.($isFips ? '-fips' : ''), $parsedVersion, $this->runtime->getConstant('OPENSSL_VERSION_TEXT'), array(), $isFips ? array($name) : array()); } break; case 'pcre': - $this->addLibrary($name, preg_replace('{^(\S+).*}', '$1', $this->runtime->getConstant('PCRE_VERSION'))); + $this->addLibrary($name, Preg::replace('{^(\S+).*}', '$1', $this->runtime->getConstant('PCRE_VERSION'))); $info = $this->runtime->getExtensionInfo($name); // PCRE Unicode Version => 12.1.0 - if (preg_match('/^PCRE Unicode Version => (?<version>.+)$/im', $info, $pcreUnicodeMatches)) { + if (Preg::isMatch('/^PCRE Unicode Version => (?<version>.+)$/im', $info, $pcreUnicodeMatches)) { $this->addLibrary($name.'-unicode', $pcreUnicodeMatches['version'], 'PCRE Unicode version support'); } @@ -385,7 +424,7 @@ protected function initialize() case 'pdo_mysql': $info = $this->runtime->getExtensionInfo($name); - if (preg_match('/^(?:Client API version|Version) => mysqlnd (?<version>.+?) /mi', $info, $matches)) { + if (Preg::isMatch('/^(?:Client API version|Version) => mysqlnd (?<version>.+?) /mi', $info, $matches)) { $this->addLibrary($name.'-mysqlnd', $matches['version'], 'mysqlnd library version for '.$name); } break; @@ -393,11 +432,11 @@ protected function initialize() case 'mongodb': $info = $this->runtime->getExtensionInfo($name); - if (preg_match('/^libmongoc bundled version => (?<version>.+)$/im', $info, $libmongocMatches)) { + if (Preg::isMatch('/^libmongoc bundled version => (?<version>.+)$/im', $info, $libmongocMatches)) { $this->addLibrary($name.'-libmongoc', $libmongocMatches['version'], 'libmongoc version of mongodb'); } - if (preg_match('/^libbson bundled version => (?<version>.+)$/im', $info, $libbsonMatches)) { + if (Preg::isMatch('/^libbson bundled version => (?<version>.+)$/im', $info, $libbsonMatches)) { $this->addLibrary($name.'-libbson', $libbsonMatches['version'], 'libbson version of mongodb'); } break; @@ -406,7 +445,7 @@ protected function initialize() case 'pdo_pgsql': $info = $this->runtime->getExtensionInfo($name); - if (preg_match('/^PostgreSQL\(libpq\) Version => (?<version>.*)$/im', $info, $matches)) { + if (Preg::isMatch('/^PostgreSQL\(libpq\) Version => (?<version>.*)$/im', $info, $matches)) { $this->addLibrary($name.'-libpq', $matches['version'], 'libpq for '.$name); } break; @@ -422,7 +461,7 @@ protected function initialize() case 'pdo_sqlite': $info = $this->runtime->getExtensionInfo($name); - if (preg_match('/^SQLite Library => (?<version>.+)$/im', $info, $matches)) { + if (Preg::isMatch('/^SQLite Library => (?<version>.+)$/im', $info, $matches)) { $this->addLibrary($name.'-sqlite', $matches['version']); } break; @@ -430,7 +469,7 @@ protected function initialize() case 'ssh2': $info = $this->runtime->getExtensionInfo($name); - if (preg_match('/^libssh2 version => (?<version>.+)$/im', $info, $matches)) { + if (Preg::isMatch('/^libssh2 version => (?<version>.+)$/im', $info, $matches)) { $this->addLibrary($name.'-libssh2', $matches['version']); } break; @@ -439,7 +478,7 @@ protected function initialize() $this->addLibrary('libxslt', $this->runtime->getConstant('LIBXSLT_DOTTED_VERSION'), null, array('xsl')); $info = $this->runtime->getExtensionInfo('xsl'); - if (preg_match('/^libxslt compiled against libxml Version => (?<version>.+)$/im', $info, $matches)) { + if (Preg::isMatch('/^libxslt compiled against libxml Version => (?<version>.+)$/im', $info, $matches)) { $this->addLibrary('libxslt-libxml', $matches['version'], 'libxml version libxslt is compiled against'); } break; @@ -447,7 +486,7 @@ protected function initialize() case 'yaml': $info = $this->runtime->getExtensionInfo('yaml'); - if (preg_match('/^LibYAML Version => (?<version>.+)$/im', $info, $matches)) { + if (Preg::isMatch('/^LibYAML Version => (?<version>.+)$/im', $info, $matches)) { $this->addLibrary($name.'-libyaml', $matches['version'], 'libyaml version of yaml'); } break; @@ -463,7 +502,7 @@ protected function initialize() $this->addLibrary($name, $this->runtime->getConstant('ZLIB_VERSION')); // Linked Version => 1.2.8 - } elseif (preg_match('/^Linked Version => (?<version>.+)$/im', $this->runtime->getExtensionInfo($name), $matches)) { + } elseif (Preg::isMatch('/^Linked Version => (?<version>.+)$/im', $this->runtime->getExtensionInfo($name), $matches)) { $this->addLibrary($name, $matches['version']); } break; @@ -479,7 +518,7 @@ protected function initialize() $prettyVersion = $hhvmVersion; $version = $this->versionParser->normalize($prettyVersion); } catch (\UnexpectedValueException $e) { - $prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', $hhvmVersion); + $prettyVersion = Preg::replace('#^([^~+-]+).*$#', '$1', $hhvmVersion); $version = $this->versionParser->normalize($prettyVersion); } @@ -494,8 +533,17 @@ protected function initialize() */ public function addPackage(PackageInterface $package) { + if (!$package instanceof CompletePackage) { + throw new \UnexpectedValueException('Expected CompletePackage but got '.get_class($package)); + } + // Skip if overridden if (isset($this->overrides[$package->getName()])) { + if ($this->overrides[$package->getName()]['version'] === false) { + $this->addDisabledPackage($package); + return; + } + $overrider = $this->findPackage($package->getName(), '*'); if ($package->getVersion() === $overrider->getVersion()) { $actualText = 'same as actual'; @@ -511,6 +559,11 @@ public function addPackage(PackageInterface $package) // Skip if PHP is overridden and we are adding a php-* package if (isset($this->overrides['php']) && 0 === strpos($package->getName(), 'php-')) { + if (isset($this->overrides[$package->getName()]) && $this->overrides[$package->getName()]['version'] === false) { + $this->addDisabledPackage($package); + return; + } + $overrider = $this->addOverriddenPackage($this->overrides['php'], $package->getPrettyName()); if ($package->getVersion() === $overrider->getVersion()) { $actualText = 'same as actual'; @@ -546,6 +599,17 @@ private function addOverriddenPackage(array $override, $name = null) return $package; } + /** + * @return void + */ + private function addDisabledPackage(CompletePackage $package) + { + $package->setDescription($package->getDescription().'. <warning>Package disabled via config.platform</warning>'); + $package->setExtra(array('config.platform' => true)); + + $this->disabledPackages[$package->getName()] = $package; + } + /** * Parses the version and adds a new package to the repository * @@ -562,7 +626,7 @@ private function addExtension($name, $prettyVersion) $version = $this->versionParser->normalize($prettyVersion); } catch (\UnexpectedValueException $e) { $extraDescription = ' (actual version: '.$prettyVersion.')'; - if (preg_match('{^(\d+\.\d+\.\d+(?:\.\d+)?)}', $prettyVersion, $match)) { + if (Preg::isMatch('{^(\d+\.\d+\.\d+(?:\.\d+)?)}', $prettyVersion, $match)) { $prettyVersion = $match[1]; } else { $prettyVersion = '0'; @@ -616,11 +680,18 @@ private function addLibrary($name, $prettyVersion, $description = null, array $r $lib = new CompletePackage('lib-'.$name, $version, $prettyVersion); $lib->setDescription($description); - $links = function ($alias) use ($name, $version, $lib) { - return new Link('lib-'.$name, 'lib-'.$alias, new Constraint('=', $version), Link::TYPE_REPLACE, $lib->getPrettyVersion()); - }; - $lib->setReplaces(array_map($links, $replaces)); - $lib->setProvides(array_map($links, $provides)); + $replaceLinks = array(); + foreach ($replaces as $replace) { + $replace = strtolower($replace); + $replaceLinks[$replace] = new Link('lib-'.$name, 'lib-'.$replace, new Constraint('=', $version), Link::TYPE_REPLACE, $lib->getPrettyVersion()); + } + $provideLinks = array(); + foreach ($provides as $provide) { + $provide = strtolower($provide); + $provideLinks[$provide] = new Link('lib-'.$name, 'lib-'.$provide, new Constraint('=', $version), Link::TYPE_PROVIDE, $lib->getPrettyVersion()); + } + $lib->setReplaces($replaceLinks); + $lib->setProvides($provideLinks); $this->addPackage($lib); } @@ -639,7 +710,7 @@ public static function isPlatformPackage($name) return $cache[$name]; } - return $cache[$name] = (bool) preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $name); + return $cache[$name] = Preg::isMatch(PlatformRepository::PLATFORM_PACKAGE_REGEX, $name); } /** @@ -656,4 +727,14 @@ public static function getPlatformPhpVersion() { return self::$lastSeenPlatformPhp; } + + public function search($query, $mode = 0, $type = null) + { + // suppress vendor search as there are no vendors to match in platform packages + if ($mode === self::SEARCH_VENDOR) { + return array(); + } + + return parent::search($query, $mode, $type); + } } diff --git a/core/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php b/core/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php index 713d4d9c0d..5891d0f7ac 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php +++ b/core/vendor/composer/composer/src/Composer/Repository/RepositoryFactory.php @@ -16,6 +16,7 @@ use Composer\IO\IOInterface; use Composer\Config; use Composer\EventDispatcher\EventDispatcher; +use Composer\Pcre\Preg; use Composer\Util\HttpDownloader; use Composer\Util\ProcessExecutor; use Composer\Json\JsonFile; @@ -81,7 +82,7 @@ public static function createRepo(IOInterface $io, Config $config, array $repoCo if (!$rm) { $rm = static::manager($io, $config, Factory::createHttpDownloader($io, $config)); } - $repos = static::createRepos($rm, array($repoConfig)); + $repos = self::createRepos($rm, array($repoConfig)); return reset($repos); } @@ -107,7 +108,7 @@ public static function defaultRepos(IOInterface $io = null, Config $config = nul $rm = static::manager($io, $config, Factory::createHttpDownloader($io, $config)); } - return static::createRepos($rm, $config->getRepositories()); + return self::createRepos($rm, $config->getRepositories()); } /** @@ -125,6 +126,7 @@ public static function manager(IOInterface $io, Config $config, HttpDownloader $ $rm->setRepositoryClass('package', 'Composer\Repository\PackageRepository'); $rm->setRepositoryClass('pear', 'Composer\Repository\PearRepository'); $rm->setRepositoryClass('git', 'Composer\Repository\VcsRepository'); + $rm->setRepositoryClass('bitbucket', 'Composer\Repository\VcsRepository'); $rm->setRepositoryClass('git-bitbucket', 'Composer\Repository\VcsRepository'); $rm->setRepositoryClass('github', 'Composer\Repository\VcsRepository'); $rm->setRepositoryClass('gitlab', 'Composer\Repository\VcsRepository'); @@ -132,7 +134,6 @@ public static function manager(IOInterface $io, Config $config, HttpDownloader $ $rm->setRepositoryClass('fossil', 'Composer\Repository\VcsRepository'); $rm->setRepositoryClass('perforce', 'Composer\Repository\VcsRepository'); $rm->setRepositoryClass('hg', 'Composer\Repository\VcsRepository'); - $rm->setRepositoryClass('hg-bitbucket', 'Composer\Repository\VcsRepository'); $rm->setRepositoryClass('artifact', 'Composer\Repository\ArtifactRepository'); $rm->setRepositoryClass('path', 'Composer\Repository\PathRepository'); @@ -179,7 +180,7 @@ private static function createRepos(RepositoryManager $rm, array $repoConfigs) */ public static function generateRepositoryName($index, array $repo, array $existingRepos) { - $name = is_int($index) && isset($repo['url']) ? preg_replace('{^https?://}i', '', $repo['url']) : $index; + $name = is_int($index) && isset($repo['url']) ? Preg::replace('{^https?://}i', '', $repo['url']) : $index; while (isset($existingRepos[$name])) { $name .= '2'; } diff --git a/core/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php b/core/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php index e8be2a07c8..7972e9417c 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php +++ b/core/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php @@ -27,6 +27,7 @@ interface RepositoryInterface extends \Countable { const SEARCH_FULLTEXT = 0; const SEARCH_NAME = 1; + const SEARCH_VENDOR = 2; /** * Checks if specified package registered (installed). @@ -85,11 +86,11 @@ public function loadPackages(array $packageNameMap, array $acceptableStabilities /** * Searches the repository for packages containing the query * - * @param string $query search query - * @param int $mode a set of SEARCH_* constants to search on, implementations should do a best effort only + * @param string $query search query, for SEARCH_NAME and SEARCH_VENDOR regular expressions metacharacters are supported by implementations, and user input should be escaped through preg_quote by callers + * @param int $mode a set of SEARCH_* constants to search on, implementations should do a best effort only, default is SEARCH_FULLTEXT * @param string $type The type of package to search for. Defaults to all types of packages * - * @return array[] an array of array('name' => '...', 'description' => '...'|null) + * @return array[] an array of array('name' => '...', 'description' => '...'|null, 'abandoned' => 'string'|true|unset) For SEARCH_VENDOR the name will be in "vendor" form * @phpstan-return list<array{name: string, description: ?string, abandoned?: string|true}> */ public function search($query, $mode = 0, $type = null); diff --git a/core/vendor/composer/composer/src/Composer/Repository/RepositorySet.php b/core/vendor/composer/composer/src/Composer/Repository/RepositorySet.php index 44ae258e7a..31028f271f 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/RepositorySet.php +++ b/core/vendor/composer/composer/src/Composer/Repository/RepositorySet.php @@ -12,6 +12,8 @@ namespace Composer\Repository; +use Composer\DependencyResolver\PoolOptimizer; +use Composer\DependencyResolver\PolicyInterface; use Composer\DependencyResolver\Pool; use Composer\DependencyResolver\PoolBuilder; use Composer\DependencyResolver\Request; @@ -244,9 +246,9 @@ public function isPackageAcceptable($names, $stability) * * @return Pool */ - public function createPool(Request $request, IOInterface $io, EventDispatcher $eventDispatcher = null) + public function createPool(Request $request, IOInterface $io, EventDispatcher $eventDispatcher = null, PoolOptimizer $poolOptimizer = null) { - $poolBuilder = new PoolBuilder($this->acceptableStabilities, $this->stabilityFlags, $this->rootAliases, $this->rootReferences, $io, $eventDispatcher); + $poolBuilder = new PoolBuilder($this->acceptableStabilities, $this->stabilityFlags, $this->rootAliases, $this->rootReferences, $io, $eventDispatcher, $poolOptimizer); foreach ($this->repositories as $repo) { if (($repo instanceof InstalledRepositoryInterface || $repo instanceof InstalledRepository) && !$this->allowInstalledRepositories) { diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php deleted file mode 100644 index 596d7437ba..0000000000 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php +++ /dev/null @@ -1,475 +0,0 @@ -<?php - -/* - * This file is part of Composer. - * - * (c) Nils Adermann <naderman@naderman.de> - * Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Repository\Vcs; - -use Composer\Cache; -use Composer\Downloader\TransportException; -use Composer\Json\JsonFile; -use Composer\Util\Bitbucket; -use Composer\Util\Http\Response; - -abstract class BitbucketDriver extends VcsDriver -{ - /** @var string */ - protected $owner; - /** @var string */ - protected $repository; - /** @var bool */ - protected $hasIssues = false; - /** @var ?string */ - protected $rootIdentifier; - /** @var array<string, string> Map of tag name to identifier */ - protected $tags; - /** @var array<string, string> Map of branch name to identifier */ - protected $branches; - /** @var string */ - protected $branchesUrl = ''; - /** @var string */ - protected $tagsUrl = ''; - /** @var string */ - protected $homeUrl = ''; - /** @var string */ - protected $website = ''; - /** @var string */ - protected $cloneHttpsUrl = ''; - - /** - * @var ?VcsDriver - */ - protected $fallbackDriver = null; - /** @var string|null if set either git or hg */ - protected $vcsType; - - /** - * @inheritDoc - */ - public function initialize() - { - preg_match('#^https?://bitbucket\.org/([^/]+)/([^/]+?)(\.git|/?)$#i', $this->url, $match); - $this->owner = $match[1]; - $this->repository = $match[2]; - $this->originUrl = 'bitbucket.org'; - $this->cache = new Cache( - $this->io, - implode('/', array( - $this->config->get('cache-repo-dir'), - $this->originUrl, - $this->owner, - $this->repository, - )) - ); - $this->cache->setReadOnly($this->config->get('cache-read-only')); - } - - /** - * @inheritDoc - */ - public function getUrl() - { - if ($this->fallbackDriver) { - return $this->fallbackDriver->getUrl(); - } - - return $this->cloneHttpsUrl; - } - - /** - * Attempts to fetch the repository data via the BitBucket API and - * sets some parameters which are used in other methods - * - * @return bool - * @phpstan-impure - */ - protected function getRepoData() - { - $resource = sprintf( - 'https://api.bitbucket.org/2.0/repositories/%s/%s?%s', - $this->owner, - $this->repository, - http_build_query( - array('fields' => '-project,-owner'), - '', - '&' - ) - ); - - $repoData = $this->fetchWithOAuthCredentials($resource, true)->decodeJson(); - if ($this->fallbackDriver) { - return false; - } - $this->parseCloneUrls($repoData['links']['clone']); - - $this->hasIssues = !empty($repoData['has_issues']); - $this->branchesUrl = $repoData['links']['branches']['href']; - $this->tagsUrl = $repoData['links']['tags']['href']; - $this->homeUrl = $repoData['links']['html']['href']; - $this->website = $repoData['website']; - $this->vcsType = $repoData['scm']; - - return true; - } - - /** - * @inheritDoc - */ - public function getComposerInformation($identifier) - { - if ($this->fallbackDriver) { - return $this->fallbackDriver->getComposerInformation($identifier); - } - - if (!isset($this->infoCache[$identifier])) { - if ($this->shouldCache($identifier) && $res = $this->cache->read($identifier)) { - $composer = JsonFile::parseJson($res); - } else { - $composer = $this->getBaseComposerInformation($identifier); - - if ($this->shouldCache($identifier)) { - $this->cache->write($identifier, json_encode($composer)); - } - } - - if ($composer) { - // specials for bitbucket - if (!isset($composer['support']['source'])) { - $label = array_search( - $identifier, - $this->getTags() - ) ?: array_search( - $identifier, - $this->getBranches() - ) ?: $identifier; - - if (array_key_exists($label, $tags = $this->getTags())) { - $hash = $tags[$label]; - } elseif (array_key_exists($label, $branches = $this->getBranches())) { - $hash = $branches[$label]; - } - - if (!isset($hash)) { - $composer['support']['source'] = sprintf( - 'https://%s/%s/%s/src', - $this->originUrl, - $this->owner, - $this->repository - ); - } else { - $composer['support']['source'] = sprintf( - 'https://%s/%s/%s/src/%s/?at=%s', - $this->originUrl, - $this->owner, - $this->repository, - $hash, - $label - ); - } - } - if (!isset($composer['support']['issues']) && $this->hasIssues) { - $composer['support']['issues'] = sprintf( - 'https://%s/%s/%s/issues', - $this->originUrl, - $this->owner, - $this->repository - ); - } - if (!isset($composer['homepage'])) { - $composer['homepage'] = empty($this->website) ? $this->homeUrl : $this->website; - } - } - - $this->infoCache[$identifier] = $composer; - } - - return $this->infoCache[$identifier]; - } - - /** - * @inheritDoc - */ - public function getFileContent($file, $identifier) - { - if ($this->fallbackDriver) { - return $this->fallbackDriver->getFileContent($file, $identifier); - } - - if (strpos($identifier, '/') !== false) { - $branches = $this->getBranches(); - if (isset($branches[$identifier])) { - $identifier = $branches[$identifier]; - } - } - - $resource = sprintf( - 'https://api.bitbucket.org/2.0/repositories/%s/%s/src/%s/%s', - $this->owner, - $this->repository, - $identifier, - $file - ); - - return $this->fetchWithOAuthCredentials($resource)->getBody(); - } - - /** - * @inheritDoc - */ - public function getChangeDate($identifier) - { - if ($this->fallbackDriver) { - return $this->fallbackDriver->getChangeDate($identifier); - } - - if (strpos($identifier, '/') !== false) { - $branches = $this->getBranches(); - if (isset($branches[$identifier])) { - $identifier = $branches[$identifier]; - } - } - - $resource = sprintf( - 'https://api.bitbucket.org/2.0/repositories/%s/%s/commit/%s?fields=date', - $this->owner, - $this->repository, - $identifier - ); - $commit = $this->fetchWithOAuthCredentials($resource)->decodeJson(); - - return new \DateTime($commit['date']); - } - - /** - * @inheritDoc - */ - public function getSource($identifier) - { - if ($this->fallbackDriver) { - return $this->fallbackDriver->getSource($identifier); - } - - return array('type' => $this->vcsType, 'url' => $this->getUrl(), 'reference' => $identifier); - } - - /** - * @inheritDoc - */ - public function getDist($identifier) - { - if ($this->fallbackDriver) { - return $this->fallbackDriver->getDist($identifier); - } - - $url = sprintf( - 'https://bitbucket.org/%s/%s/get/%s.zip', - $this->owner, - $this->repository, - $identifier - ); - - return array('type' => 'zip', 'url' => $url, 'reference' => $identifier, 'shasum' => ''); - } - - /** - * @inheritDoc - */ - public function getTags() - { - if ($this->fallbackDriver) { - return $this->fallbackDriver->getTags(); - } - - if (null === $this->tags) { - $this->tags = array(); - $resource = sprintf( - '%s?%s', - $this->tagsUrl, - http_build_query( - array( - 'pagelen' => 100, - 'fields' => 'values.name,values.target.hash,next', - 'sort' => '-target.date', - ), - '', - '&' - ) - ); - $hasNext = true; - while ($hasNext) { - $tagsData = $this->fetchWithOAuthCredentials($resource)->decodeJson(); - foreach ($tagsData['values'] as $data) { - $this->tags[$data['name']] = $data['target']['hash']; - } - if (empty($tagsData['next'])) { - $hasNext = false; - } else { - $resource = $tagsData['next']; - } - } - if ($this->vcsType === 'hg') { - unset($this->tags['tip']); - } - } - - return $this->tags; - } - - /** - * @inheritDoc - */ - public function getBranches() - { - if ($this->fallbackDriver) { - return $this->fallbackDriver->getBranches(); - } - - if (null === $this->branches) { - $this->branches = array(); - $resource = sprintf( - '%s?%s', - $this->branchesUrl, - http_build_query( - array( - 'pagelen' => 100, - 'fields' => 'values.name,values.target.hash,values.heads,next', - 'sort' => '-target.date', - ), - '', - '&' - ) - ); - $hasNext = true; - while ($hasNext) { - $branchData = $this->fetchWithOAuthCredentials($resource)->decodeJson(); - foreach ($branchData['values'] as $data) { - // skip headless branches which seem to be deleted branches that bitbucket nevertheless returns in the API - if ($this->vcsType === 'hg' && empty($data['heads'])) { - continue; - } - - $this->branches[$data['name']] = $data['target']['hash']; - } - if (empty($branchData['next'])) { - $hasNext = false; - } else { - $resource = $branchData['next']; - } - } - } - - return $this->branches; - } - - /** - * Get the remote content. - * - * @param string $url The URL of content - * @param bool $fetchingRepoData - * - * @return Response The result - * - * @phpstan-impure - */ - protected function fetchWithOAuthCredentials($url, $fetchingRepoData = false) - { - try { - return parent::getContents($url); - } catch (TransportException $e) { - $bitbucketUtil = new Bitbucket($this->io, $this->config, $this->process, $this->httpDownloader); - - if (403 === $e->getCode() || (401 === $e->getCode() && strpos($e->getMessage(), 'Could not authenticate against') === 0)) { - if (!$this->io->hasAuthentication($this->originUrl) - && $bitbucketUtil->authorizeOAuth($this->originUrl) - ) { - return parent::getContents($url); - } - - if (!$this->io->isInteractive() && $fetchingRepoData) { - $this->attemptCloneFallback(); - - return new Response(array('url' => 'dummy'), 200, array(), 'null'); - } - } - - throw $e; - } - } - - /** - * Generate an SSH URL - * - * @return string - */ - abstract protected function generateSshUrl(); - - /** - * @phpstan-impure - * - * @return true - * @throws \RuntimeException - */ - protected function attemptCloneFallback() - { - try { - $this->setupFallbackDriver($this->generateSshUrl()); - - return true; - } catch (\RuntimeException $e) { - $this->fallbackDriver = null; - - $this->io->writeError( - '<error>Failed to clone the ' . $this->generateSshUrl() . ' repository, try running in interactive mode' - . ' so that you can enter your Bitbucket OAuth consumer credentials</error>' - ); - throw $e; - } - } - - /** - * @param string $url - * @return void - */ - abstract protected function setupFallbackDriver($url); - - /** - * @param array<array{name: string, href: string}> $cloneLinks - * @return void - */ - protected function parseCloneUrls(array $cloneLinks) - { - foreach ($cloneLinks as $cloneLink) { - if ($cloneLink['name'] === 'https') { - // Format: https://(user@)bitbucket.org/{user}/{repo} - // Strip username from URL (only present in clone URL's for private repositories) - $this->cloneHttpsUrl = preg_replace('/https:\/\/([^@]+@)?/', 'https://', $cloneLink['href']); - } - } - } - - /** - * @return (array{name: string}&mixed[])|null - */ - protected function getMainBranchData() - { - $resource = sprintf( - 'https://api.bitbucket.org/2.0/repositories/%s/%s?fields=mainbranch', - $this->owner, - $this->repository - ); - - $data = $this->fetchWithOAuthCredentials($resource)->decodeJson(); - if (isset($data['mainbranch'])) { - return $data['mainbranch']; - } - - return null; - } -} diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php index e78c399a82..66a50bdff6 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php @@ -14,6 +14,7 @@ use Composer\Cache; use Composer\Config; +use Composer\Pcre\Preg; use Composer\Util\ProcessExecutor; use Composer\Util\Filesystem; use Composer\IO\IOInterface; @@ -54,7 +55,7 @@ public function initialize() throw new \RuntimeException('FossilDriver requires a usable cache directory, and it looks like you set it to be disabled'); } - $localName = preg_replace('{[^a-z0-9]}i', '-', $this->url); + $localName = Preg::replace('{[^a-z0-9]}i', '-', $this->url); $this->repoFile = $this->config->get('cache-repo-dir') . '/' . $localName . '.fossil'; $this->checkoutDir = $this->config->get('cache-vcs-dir') . '/' . $localName . '/'; @@ -208,7 +209,7 @@ public function getBranches() $this->process->execute('fossil branch list', $output, $this->checkoutDir); foreach ($this->process->splitLines($output) as $branch) { - $branch = trim(preg_replace('/^\*/', '', trim($branch))); + $branch = trim(Preg::replace('/^\*/', '', trim($branch))); $branches[$branch] = $branch; } @@ -223,11 +224,11 @@ public function getBranches() */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { - if (preg_match('#(^(?:https?|ssh)://(?:[^@]@)?(?:chiselapp\.com|fossil\.))#i', $url)) { + if (Preg::isMatch('#(^(?:https?|ssh)://(?:[^@]@)?(?:chiselapp\.com|fossil\.))#i', $url)) { return true; } - if (preg_match('!/fossil/|\.fossil!', $url)) { + if (Preg::isMatch('!/fossil/|\.fossil!', $url)) { return true; } diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php index df80ea25c7..6942048995 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php @@ -14,65 +14,434 @@ use Composer\Config; use Composer\IO\IOInterface; +use Composer\Cache; +use Composer\Downloader\TransportException; +use Composer\Json\JsonFile; +use Composer\Pcre\Preg; +use Composer\Util\Bitbucket; +use Composer\Util\Http\Response; /** * @author Per Bernhardt <plb@webfactory.de> */ -class GitBitbucketDriver extends BitbucketDriver +class GitBitbucketDriver extends VcsDriver { + /** @var string */ + protected $owner; + /** @var string */ + protected $repository; + /** @var bool */ + private $hasIssues = false; + /** @var ?string */ + private $rootIdentifier; + /** @var array<string, string> Map of tag name to identifier */ + private $tags; + /** @var array<string, string> Map of branch name to identifier */ + private $branches; + /** @var string */ + private $branchesUrl = ''; + /** @var string */ + private $tagsUrl = ''; + /** @var string */ + private $homeUrl = ''; + /** @var string */ + private $website = ''; + /** @var string */ + private $cloneHttpsUrl = ''; + + /** + * @var ?VcsDriver + */ + protected $fallbackDriver = null; + /** @var string|null if set either git or hg */ + private $vcsType; + /** * @inheritDoc */ - public function getRootIdentifier() + public function initialize() + { + Preg::match('#^https?://bitbucket\.org/([^/]+)/([^/]+?)(\.git|/?)?$#i', $this->url, $match); + $this->owner = $match[1]; + $this->repository = $match[2]; + $this->originUrl = 'bitbucket.org'; + $this->cache = new Cache( + $this->io, + implode('/', array( + $this->config->get('cache-repo-dir'), + $this->originUrl, + $this->owner, + $this->repository, + )) + ); + $this->cache->setReadOnly($this->config->get('cache-read-only')); + } + + /** + * @inheritDoc + */ + public function getUrl() { if ($this->fallbackDriver) { - return $this->fallbackDriver->getRootIdentifier(); + return $this->fallbackDriver->getUrl(); } - if (null === $this->rootIdentifier) { - if (!$this->getRepoData()) { - if (!$this->fallbackDriver) { - throw new \LogicException('A fallback driver should be setup if getRepoData returns false'); + return $this->cloneHttpsUrl; + } + + /** + * Attempts to fetch the repository data via the BitBucket API and + * sets some parameters which are used in other methods + * + * @return bool + * @phpstan-impure + */ + protected function getRepoData() + { + $resource = sprintf( + 'https://api.bitbucket.org/2.0/repositories/%s/%s?%s', + $this->owner, + $this->repository, + http_build_query( + array('fields' => '-project,-owner'), + '', + '&' + ) + ); + + $repoData = $this->fetchWithOAuthCredentials($resource, true)->decodeJson(); + if ($this->fallbackDriver) { + return false; + } + $this->parseCloneUrls($repoData['links']['clone']); + + $this->hasIssues = !empty($repoData['has_issues']); + $this->branchesUrl = $repoData['links']['branches']['href']; + $this->tagsUrl = $repoData['links']['tags']['href']; + $this->homeUrl = $repoData['links']['html']['href']; + $this->website = $repoData['website']; + $this->vcsType = $repoData['scm']; + + return true; + } + + /** + * @inheritDoc + */ + public function getComposerInformation($identifier) + { + if ($this->fallbackDriver) { + return $this->fallbackDriver->getComposerInformation($identifier); + } + + if (!isset($this->infoCache[$identifier])) { + if ($this->shouldCache($identifier) && $res = $this->cache->read($identifier)) { + $composer = JsonFile::parseJson($res); + } else { + $composer = $this->getBaseComposerInformation($identifier); + + if ($this->shouldCache($identifier)) { + $this->cache->write($identifier, json_encode($composer)); } + } - return $this->fallbackDriver->getRootIdentifier(); + if ($composer) { + // specials for bitbucket + if (!isset($composer['support']['source'])) { + $label = array_search( + $identifier, + $this->getTags() + ) ?: array_search( + $identifier, + $this->getBranches() + ) ?: $identifier; + + if (array_key_exists($label, $tags = $this->getTags())) { + $hash = $tags[$label]; + } elseif (array_key_exists($label, $branches = $this->getBranches())) { + $hash = $branches[$label]; + } + + if (!isset($hash)) { + $composer['support']['source'] = sprintf( + 'https://%s/%s/%s/src', + $this->originUrl, + $this->owner, + $this->repository + ); + } else { + $composer['support']['source'] = sprintf( + 'https://%s/%s/%s/src/%s/?at=%s', + $this->originUrl, + $this->owner, + $this->repository, + $hash, + $label + ); + } + } + if (!isset($composer['support']['issues']) && $this->hasIssues) { + $composer['support']['issues'] = sprintf( + 'https://%s/%s/%s/issues', + $this->originUrl, + $this->owner, + $this->repository + ); + } + if (!isset($composer['homepage'])) { + $composer['homepage'] = empty($this->website) ? $this->homeUrl : $this->website; + } } - if ($this->vcsType !== 'git') { - throw new \RuntimeException( - $this->url.' does not appear to be a git repository, use '. - $this->cloneHttpsUrl.' if this is a mercurial bitbucket repository' - ); + $this->infoCache[$identifier] = $composer; + } + + return $this->infoCache[$identifier]; + } + + /** + * @inheritDoc + */ + public function getFileContent($file, $identifier) + { + if ($this->fallbackDriver) { + return $this->fallbackDriver->getFileContent($file, $identifier); + } + + if (strpos($identifier, '/') !== false) { + $branches = $this->getBranches(); + if (isset($branches[$identifier])) { + $identifier = $branches[$identifier]; } + } - $mainBranchData = $this->getMainBranchData(); - $this->rootIdentifier = !empty($mainBranchData['name']) ? $mainBranchData['name'] : 'master'; + $resource = sprintf( + 'https://api.bitbucket.org/2.0/repositories/%s/%s/src/%s/%s', + $this->owner, + $this->repository, + $identifier, + $file + ); + + return $this->fetchWithOAuthCredentials($resource)->getBody(); + } + + /** + * @inheritDoc + */ + public function getChangeDate($identifier) + { + if ($this->fallbackDriver) { + return $this->fallbackDriver->getChangeDate($identifier); } - return $this->rootIdentifier; + if (strpos($identifier, '/') !== false) { + $branches = $this->getBranches(); + if (isset($branches[$identifier])) { + $identifier = $branches[$identifier]; + } + } + + $resource = sprintf( + 'https://api.bitbucket.org/2.0/repositories/%s/%s/commit/%s?fields=date', + $this->owner, + $this->repository, + $identifier + ); + $commit = $this->fetchWithOAuthCredentials($resource)->decodeJson(); + + return new \DateTime($commit['date']); } /** * @inheritDoc */ - public static function supports(IOInterface $io, Config $config, $url, $deep = false) + public function getSource($identifier) { - if (!preg_match('#^https?://bitbucket\.org/([^/]+)/(.+?)\.git$#i', $url)) { - return false; + if ($this->fallbackDriver) { + return $this->fallbackDriver->getSource($identifier); } - if (!extension_loaded('openssl')) { - $io->writeError('Skipping Bitbucket git driver for '.$url.' because the OpenSSL PHP extension is missing.', true, IOInterface::VERBOSE); + return array('type' => $this->vcsType, 'url' => $this->getUrl(), 'reference' => $identifier); + } - return false; + /** + * @inheritDoc + */ + public function getDist($identifier) + { + if ($this->fallbackDriver) { + return $this->fallbackDriver->getDist($identifier); } - return true; + $url = sprintf( + 'https://bitbucket.org/%s/%s/get/%s.zip', + $this->owner, + $this->repository, + $identifier + ); + + return array('type' => 'zip', 'url' => $url, 'reference' => $identifier, 'shasum' => ''); } /** * @inheritDoc */ + public function getTags() + { + if ($this->fallbackDriver) { + return $this->fallbackDriver->getTags(); + } + + if (null === $this->tags) { + $tags = array(); + $resource = sprintf( + '%s?%s', + $this->tagsUrl, + http_build_query( + array( + 'pagelen' => 100, + 'fields' => 'values.name,values.target.hash,next', + 'sort' => '-target.date', + ), + '', + '&' + ) + ); + $hasNext = true; + while ($hasNext) { + $tagsData = $this->fetchWithOAuthCredentials($resource)->decodeJson(); + foreach ($tagsData['values'] as $data) { + $tags[$data['name']] = $data['target']['hash']; + } + if (empty($tagsData['next'])) { + $hasNext = false; + } else { + $resource = $tagsData['next']; + } + } + + $this->tags = $tags; + } + + return $this->tags; + } + + /** + * @inheritDoc + */ + public function getBranches() + { + if ($this->fallbackDriver) { + return $this->fallbackDriver->getBranches(); + } + + if (null === $this->branches) { + $branches = array(); + $resource = sprintf( + '%s?%s', + $this->branchesUrl, + http_build_query( + array( + 'pagelen' => 100, + 'fields' => 'values.name,values.target.hash,values.heads,next', + 'sort' => '-target.date', + ), + '', + '&' + ) + ); + $hasNext = true; + while ($hasNext) { + $branchData = $this->fetchWithOAuthCredentials($resource)->decodeJson(); + foreach ($branchData['values'] as $data) { + $branches[$data['name']] = $data['target']['hash']; + } + if (empty($branchData['next'])) { + $hasNext = false; + } else { + $resource = $branchData['next']; + } + } + + $this->branches = $branches; + } + + return $this->branches; + } + + /** + * Get the remote content. + * + * @param string $url The URL of content + * @param bool $fetchingRepoData + * + * @return Response The result + * + * @phpstan-impure + */ + protected function fetchWithOAuthCredentials($url, $fetchingRepoData = false) + { + try { + return parent::getContents($url); + } catch (TransportException $e) { + $bitbucketUtil = new Bitbucket($this->io, $this->config, $this->process, $this->httpDownloader); + + if (403 === $e->getCode() || (401 === $e->getCode() && strpos($e->getMessage(), 'Could not authenticate against') === 0)) { + if (!$this->io->hasAuthentication($this->originUrl) + && $bitbucketUtil->authorizeOAuth($this->originUrl) + ) { + return parent::getContents($url); + } + + if (!$this->io->isInteractive() && $fetchingRepoData) { + $this->attemptCloneFallback(); + + return new Response(array('url' => 'dummy'), 200, array(), 'null'); + } + } + + throw $e; + } + } + + /** + * Generate an SSH URL + * + * @return string + */ + protected function generateSshUrl() + { + return 'git@' . $this->originUrl . ':' . $this->owner.'/'.$this->repository.'.git'; + } + + /** + * @phpstan-impure + * + * @return true + * @throws \RuntimeException + */ + protected function attemptCloneFallback() + { + try { + $this->setupFallbackDriver($this->generateSshUrl()); + + return true; + } catch (\RuntimeException $e) { + $this->fallbackDriver = null; + + $this->io->writeError( + '<error>Failed to clone the ' . $this->generateSshUrl() . ' repository, try running in interactive mode' + . ' so that you can enter your Bitbucket OAuth consumer credentials</error>' + ); + throw $e; + } + } + + /** + * @param string $url + * @return void + */ protected function setupFallbackDriver($url) { $this->fallbackDriver = new GitDriver( @@ -85,11 +454,88 @@ protected function setupFallbackDriver($url) $this->fallbackDriver->initialize(); } + /** + * @param array<array{name: string, href: string}> $cloneLinks + * @return void + */ + protected function parseCloneUrls(array $cloneLinks) + { + foreach ($cloneLinks as $cloneLink) { + if ($cloneLink['name'] === 'https') { + // Format: https://(user@)bitbucket.org/{user}/{repo} + // Strip username from URL (only present in clone URL's for private repositories) + $this->cloneHttpsUrl = Preg::replace('/https:\/\/([^@]+@)?/', 'https://', $cloneLink['href']); + } + } + } + + /** + * @return (array{name: string}&mixed[])|null + */ + protected function getMainBranchData() + { + $resource = sprintf( + 'https://api.bitbucket.org/2.0/repositories/%s/%s?fields=mainbranch', + $this->owner, + $this->repository + ); + + $data = $this->fetchWithOAuthCredentials($resource)->decodeJson(); + if (isset($data['mainbranch'])) { + return $data['mainbranch']; + } + + return null; + } + /** * @inheritDoc */ - protected function generateSshUrl() + public function getRootIdentifier() { - return 'git@' . $this->originUrl . ':' . $this->owner.'/'.$this->repository.'.git'; + if ($this->fallbackDriver) { + return $this->fallbackDriver->getRootIdentifier(); + } + + if (null === $this->rootIdentifier) { + if (!$this->getRepoData()) { + if (!$this->fallbackDriver) { + throw new \LogicException('A fallback driver should be setup if getRepoData returns false'); + } + + return $this->fallbackDriver->getRootIdentifier(); + } + + if ($this->vcsType !== 'git') { + throw new \RuntimeException( + $this->url.' does not appear to be a git repository, use '. + $this->cloneHttpsUrl.' but remember that Bitbucket no longer supports the mercurial repositories. '. + 'https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket' + ); + } + + $mainBranchData = $this->getMainBranchData(); + $this->rootIdentifier = !empty($mainBranchData['name']) ? $mainBranchData['name'] : 'master'; + } + + return $this->rootIdentifier; + } + + /** + * @inheritDoc + */ + public static function supports(IOInterface $io, Config $config, $url, $deep = false) + { + if (!Preg::isMatch('#^https?://bitbucket\.org/([^/]+)/([^/]+?)(\.git|/?)?$#i', $url)) { + return false; + } + + if (!extension_loaded('openssl')) { + $io->writeError('Skipping Bitbucket git driver for '.$url.' because the OpenSSL PHP extension is missing.', true, IOInterface::VERBOSE); + + return false; + } + + return true; } } diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php index dd0bab0f5a..b91508acd1 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php @@ -12,6 +12,7 @@ namespace Composer\Repository\Vcs; +use Composer\Pcre\Preg; use Composer\Util\ProcessExecutor; use Composer\Util\Filesystem; use Composer\Util\Url; @@ -25,9 +26,9 @@ */ class GitDriver extends VcsDriver { - /** @var array<string, string> Map of tag name to identifier */ + /** @var array<int|string, string> Map of tag name (can be turned to an int by php if it is a numeric name) to identifier */ protected $tags; - /** @var array<string, string> Map of branch name to identifier */ + /** @var array<int|string, string> Map of branch name (can be turned to an int by php if it is a numeric name) to identifier */ protected $branches; /** @var string */ protected $rootIdentifier; @@ -40,7 +41,7 @@ class GitDriver extends VcsDriver public function initialize() { if (Filesystem::isLocalPath($this->url)) { - $this->url = preg_replace('{[\\/]\.git/?$}', '', $this->url); + $this->url = Preg::replace('{[\\/]\.git/?$}', '', $this->url); if (!is_dir($this->url)) { throw new \RuntimeException('Failed to read package information from '.$this->url.' as the path does not exist'); } @@ -51,7 +52,7 @@ public function initialize() throw new \RuntimeException('GitDriver requires a usable cache directory, and it looks like you set it to be disabled'); } - $this->repoDir = $this->config->get('cache-vcs-dir') . '/' . preg_replace('{[^a-z0-9.]}i', '-', $this->url) . '/'; + $this->repoDir = $this->config->get('cache-vcs-dir') . '/' . Preg::replace('{[^a-z0-9.]}i', '-', $this->url) . '/'; GitUtil::cleanEnv(); @@ -62,7 +63,7 @@ public function initialize() throw new \RuntimeException('Can not clone '.$this->url.' to access package information. The "'.dirname($this->repoDir).'" directory is not writable by the current user.'); } - if (preg_match('{^ssh://[^@]+@[^:]+:[^0-9]+}', $this->url)) { + if (Preg::isMatch('{^ssh://[^@]+@[^:]+:[^0-9]+}', $this->url)) { throw new \InvalidArgumentException('The source URL '.$this->url.' is invalid, ssh URLs should have a port number after ":".'."\n".'Use ssh://git@example.com:22/path or just git@example.com:path if you do not want to provide a password or custom port.'); } @@ -80,7 +81,7 @@ public function initialize() $this->getTags(); $this->getBranches(); - $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', Url::sanitize($cacheUrl))); + $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', Url::sanitize($cacheUrl))); $this->cache->setReadOnly($this->config->get('cache-read-only')); } @@ -97,7 +98,7 @@ public function getRootIdentifier() $branches = $this->process->splitLines($output); if (!in_array('* master', $branches)) { foreach ($branches as $branch) { - if ($branch && preg_match('{^\* +(\S+)}', $branch, $match)) { + if ($branch && Preg::isMatch('{^\* +(\S+)}', $branch, $match)) { $this->rootIdentifier = $match[1]; break; } @@ -170,8 +171,8 @@ public function getTags() $this->process->execute('git show-ref --tags --dereference', $output, $this->repoDir); foreach ($output = $this->process->splitLines($output) as $tag) { - if ($tag && preg_match('{^([a-f0-9]{40}) refs/tags/(\S+?)(\^\{\})?$}', $tag, $match)) { - $this->tags[$match[2]] = $match[1]; + if ($tag && Preg::isMatch('{^([a-f0-9]{40}) refs/tags/(\S+?)(\^\{\})?$}', $tag, $match)) { + $this->tags[$match[2]] = (string) $match[1]; } } } @@ -189,8 +190,8 @@ public function getBranches() $this->process->execute('git branch --no-color --no-abbrev -v', $output, $this->repoDir); foreach ($this->process->splitLines($output) as $branch) { - if ($branch && !preg_match('{^ *[^/]+/HEAD }', $branch)) { - if (preg_match('{^(?:\* )? *(\S+) *([a-f0-9]+)(?: .*)?$}', $branch, $match)) { + if ($branch && !Preg::isMatch('{^ *[^/]+/HEAD }', $branch)) { + if (Preg::isMatch('{^(?:\* )? *(\S+) *([a-f0-9]+)(?: .*)?$}', $branch, $match)) { $branches[$match[1]] = $match[2]; } } @@ -207,7 +208,7 @@ public function getBranches() */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { - if (preg_match('#(^git://|\.git/?$|git(?:olite)?@|//git\.|//github.com/)#i', $url)) { + if (Preg::isMatch('#(^git://|\.git/?$|git(?:olite)?@|//git\.|//github.com/)#i', $url)) { return true; } diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php index f186bb6f59..e95492a66c 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php @@ -17,6 +17,7 @@ use Composer\Json\JsonFile; use Composer\Cache; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; use Composer\Util\GitHub; use Composer\Util\Http\Response; @@ -58,7 +59,7 @@ class GitHubDriver extends VcsDriver */ public function initialize() { - preg_match('#^(?:(?:https?|git)://([^/]+)/|git@([^:]+):/?)([^/]+)/(.+?)(?:\.git|/)?$#', $this->url, $match); + Preg::match('#^(?:(?:https?|git)://([^/]+)/|git@([^:]+):/?)([^/]+)/(.+?)(?:\.git|/)?$#', $this->url, $match); $this->owner = $match[3]; $this->repository = $match[4]; $this->originUrl = strtolower(!empty($match[1]) ? $match[1] : $match[2]); @@ -227,20 +228,20 @@ private function getFundingInfo() $result = array(); $key = null; - foreach (preg_split('{\r?\n}', $funding) as $line) { + foreach (Preg::split('{\r?\n}', $funding) as $line) { $line = trim($line); - if (preg_match('{^(\w+)\s*:\s*(.+)$}', $line, $match)) { - if (preg_match('{^\[(.*)\](?:\s*#.*)?$}', $match[2], $match2)) { - foreach (array_map('trim', preg_split('{[\'"]?\s*,\s*[\'"]?}', $match2[1])) as $item) { + if (Preg::isMatch('{^(\w+)\s*:\s*(.+)$}', $line, $match)) { + if (Preg::isMatch('{^\[(.*)\](?:\s*#.*)?$}', $match[2], $match2)) { + foreach (array_map('trim', Preg::split('{[\'"]?\s*,\s*[\'"]?}', $match2[1])) as $item) { $result[] = array('type' => $match[1], 'url' => trim($item, '"\' ')); } - } elseif (preg_match('{^([^#].*?)(\s+#.*)?$}', $match[2], $match2)) { + } elseif (Preg::isMatch('{^([^#].*?)(\s+#.*)?$}', $match[2], $match2)) { $result[] = array('type' => $match[1], 'url' => trim($match2[1], '"\' ')); } $key = null; - } elseif (preg_match('{^(\w+)\s*:\s*#\s*$}', $line, $match)) { + } elseif (Preg::isMatch('{^(\w+)\s*:\s*#\s*$}', $line, $match)) { $key = $match[1]; - } elseif ($key && preg_match('{^-\s*(.+)(\s+#.*)?$}', $line, $match)) { + } elseif ($key && Preg::isMatch('{^-\s*(.+)(\s+#.*)?$}', $line, $match)) { $result[] = array('type' => $key, 'url' => trim($match[1], '"\' ')); } } @@ -322,18 +323,20 @@ public function getTags() return $this->gitDriver->getTags(); } if (null === $this->tags) { - $this->tags = array(); + $tags = array(); $resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/tags?per_page=100'; do { $response = $this->getContents($resource); $tagsData = $response->decodeJson(); foreach ($tagsData as $tag) { - $this->tags[$tag['name']] = $tag['commit']['sha']; + $tags[$tag['name']] = $tag['commit']['sha']; } $resource = $this->getNextPage($response); } while ($resource); + + $this->tags = $tags; } return $this->tags; @@ -348,7 +351,7 @@ public function getBranches() return $this->gitDriver->getBranches(); } if (null === $this->branches) { - $this->branches = array(); + $branches = array(); $resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads?per_page=100'; do { @@ -357,12 +360,14 @@ public function getBranches() foreach ($branchData as $branch) { $name = substr($branch['ref'], 11); if ($name !== 'gh-pages') { - $this->branches[$name] = $branch['object']['sha']; + $branches[$name] = $branch['object']['sha']; } } $resource = $this->getNextPage($response); } while ($resource); + + $this->branches = $branches; } return $this->branches; @@ -373,12 +378,12 @@ public function getBranches() */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { - if (!preg_match('#^((?:https?|git)://([^/]+)/|git@([^:]+):/?)([^/]+)/(.+?)(?:\.git|/)?$#', $url, $matches)) { + if (!Preg::isMatch('#^((?:https?|git)://([^/]+)/|git@([^:]+):/?)([^/]+)/(.+?)(?:\.git|/)?$#', $url, $matches)) { return false; } $originUrl = !empty($matches[2]) ? $matches[2] : $matches[3]; - if (!in_array(strtolower(preg_replace('{^www\.}i', '', $originUrl)), $config->get('github-domains'))) { + if (!in_array(strtolower(Preg::replace('{^www\.}i', '', $originUrl)), $config->get('github-domains'))) { return false; } @@ -604,7 +609,7 @@ protected function getNextPage(Response $response) $links = explode(',', $header); foreach ($links as $link) { - if (preg_match('{<(.+?)>; *rel="next"}', $link, $match)) { + if (Preg::isMatch('{<(.+?)>; *rel="next"}', $link, $match)) { return $match[1]; } } diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php index cfecee898a..3c45b4e737 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php @@ -17,6 +17,7 @@ use Composer\IO\IOInterface; use Composer\Json\JsonFile; use Composer\Downloader\TransportException; +use Composer\Pcre\Preg; use Composer\Util\HttpDownloader; use Composer\Util\GitLab; use Composer\Util\Http\Response; @@ -45,7 +46,7 @@ class GitLabDriver extends VcsDriver private $project; /** - * @var array<string, mixed[]> Keeps commits returned by GitLab API + * @var array<string|int, mixed[]> Keeps commits returned by GitLab API as commit id => info */ private $commits = array(); @@ -92,7 +93,7 @@ class GitLabDriver extends VcsDriver */ public function initialize() { - if (!preg_match(self::URL_REGEX, $this->url, $match)) { + if (!Preg::isMatch(self::URL_REGEX, $this->url, $match)) { throw new \InvalidArgumentException('The URL provided is invalid. It must be the HTTP URL of a GitLab project.'); } @@ -119,7 +120,7 @@ public function initialize() } $this->namespace = implode('/', $urlParts); - $this->repository = preg_replace('#(\.git)$#', '', $match['repo']); + $this->repository = Preg::replace('#(\.git)$#', '', $match['repo']); $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->namespace.'/'.$this->repository); $this->cache->setReadOnly($this->config->get('cache-read-only')); @@ -162,8 +163,12 @@ public function getComposerInformation($identifier) if ($composer) { // specials for gitlab (this data is only available if authentication is provided) - if (!isset($composer['support']['issues']) && isset($this->project['_links']['issues'])) { - $composer['support']['issues'] = $this->project['_links']['issues']; + if (!isset($composer['support']['source']) && isset($this->project['web_url'])) { + $label = array_search($identifier, $this->getTags(), true) ?: array_search($identifier, $this->getBranches(), true) ?: $identifier; + $composer['support']['source'] = sprintf('%s/-/tree/%s', $this->project['web_url'], $label); + } + if (!isset($composer['support']['issues']) && !empty($this->project['issues_enabled']) && isset($this->project['web_url'])) { + $composer['support']['issues'] = sprintf('%s/-/issues', $this->project['web_url']); } if (!isset($composer['abandoned']) && !empty($this->project['archived'])) { $composer['abandoned'] = true; @@ -186,7 +191,7 @@ public function getFileContent($file, $identifier) } // Convert the root identifier to a cacheable commit id - if (!preg_match('{[a-f0-9]{40}}i', $identifier)) { + if (!Preg::isMatch('{[a-f0-9]{40}}i', $identifier)) { $branches = $this->getBranches(); if (isset($branches[$identifier])) { $identifier = $branches[$identifier]; @@ -499,6 +504,11 @@ protected function getContents($url, $fetchingRepoData = false) // force auth as the unauthenticated version of the API is broken if (!isset($json['default_branch'])) { + // GitLab allows you to disable the repository inside a project to use a project only for issues and wiki + if (isset($json['repository_access_level']) && $json['repository_access_level'] === 'disabled') { + throw new TransportException('The GitLab repository is disabled in the project', 400); + } + if (!empty($json['id'])) { $this->isPrivate = false; } @@ -560,7 +570,7 @@ protected function getContents($url, $fetchingRepoData = false) */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { - if (!preg_match(self::URL_REGEX, $url, $match)) { + if (!Preg::isMatch(self::URL_REGEX, $url, $match)) { return false; } @@ -590,7 +600,7 @@ protected function getNextPage(Response $response) $links = explode(',', $header); foreach ($links as $link) { - if (preg_match('{<(.+?)>; *rel="next"}', $link, $match)) { + if (Preg::isMatch('{<(.+?)>; *rel="next"}', $link, $match)) { return $match[1]; } } @@ -625,7 +635,7 @@ private static function determineOrigin(array $configuredDomains, $guessedDomain while (null !== ($part = array_shift($urlParts))) { $guessedDomain .= '/' . $part; - if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array(preg_replace('{:\d+}', '', $guessedDomain), $configuredDomains))) { + if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array(Preg::replace('{:\d+}', '', $guessedDomain), $configuredDomains))) { return $guessedDomain; } } diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php deleted file mode 100644 index bd6734690c..0000000000 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -/* - * This file is part of Composer. - * - * (c) Nils Adermann <naderman@naderman.de> - * Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Repository\Vcs; - -use Composer\Config; -use Composer\IO\IOInterface; - -/** - * @author Per Bernhardt <plb@webfactory.de> - */ -class HgBitbucketDriver extends BitbucketDriver -{ - /** - * @inheritDoc - */ - public function getRootIdentifier() - { - if ($this->fallbackDriver) { - return $this->fallbackDriver->getRootIdentifier(); - } - - if (null === $this->rootIdentifier) { - if (!$this->getRepoData()) { - if (!$this->fallbackDriver) { - throw new \LogicException('A fallback driver should be setup if getRepoData returns false'); - } - - return $this->fallbackDriver->getRootIdentifier(); - } - - if ($this->vcsType !== 'hg') { - throw new \RuntimeException( - $this->url.' does not appear to be a mercurial repository, use '. - $this->cloneHttpsUrl.' if this is a git bitbucket repository' - ); - } - - $mainBranchData = $this->getMainBranchData(); - $this->rootIdentifier = !empty($mainBranchData['name']) ? $mainBranchData['name'] : 'default'; - } - - return $this->rootIdentifier; - } - - /** - * @inheritDoc - */ - public static function supports(IOInterface $io, Config $config, $url, $deep = false) - { - if (!preg_match('#^https?://bitbucket\.org/([^/]+)/([^/]+)/?$#i', $url)) { - return false; - } - - if (!extension_loaded('openssl')) { - $io->writeError('Skipping Bitbucket hg driver for '.$url.' because the OpenSSL PHP extension is missing.', true, IOInterface::VERBOSE); - - return false; - } - - return true; - } - - /** - * @inheritDoc - */ - protected function setupFallbackDriver($url) - { - $this->fallbackDriver = new HgDriver( - array('url' => $url), - $this->io, - $this->config, - $this->httpDownloader, - $this->process - ); - $this->fallbackDriver->initialize(); - } - - /** - * @inheritDoc - */ - protected function generateSshUrl() - { - return 'ssh://hg@' . $this->originUrl . '/' . $this->owner.'/'.$this->repository; - } -} diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php index b1f63afd4f..73bc426e53 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php @@ -14,6 +14,7 @@ use Composer\Config; use Composer\Cache; +use Composer\Pcre\Preg; use Composer\Util\Hg as HgUtils; use Composer\Util\ProcessExecutor; use Composer\Util\Filesystem; @@ -46,7 +47,7 @@ public function initialize() } $cacheDir = $this->config->get('cache-vcs-dir'); - $this->repoDir = $cacheDir . '/' . preg_replace('{[^a-z0-9]}i', '-', $this->url) . '/'; + $this->repoDir = $cacheDir . '/' . Preg::replace('{[^a-z0-9]}i', '-', $this->url) . '/'; $fs = new Filesystem(); $fs->ensureDirectoryExists($cacheDir); @@ -162,7 +163,7 @@ public function getTags() $this->process->execute('hg tags', $output, $this->repoDir); foreach ($this->process->splitLines($output) as $tag) { - if ($tag && preg_match('(^([^\s]+)\s+\d+:(.*)$)', $tag, $match)) { + if ($tag && Preg::isMatch('(^([^\s]+)\s+\d+:(.*)$)', $tag, $match)) { $tags[$match[1]] = $match[2]; } } @@ -185,14 +186,14 @@ public function getBranches() $this->process->execute('hg branches', $output, $this->repoDir); foreach ($this->process->splitLines($output) as $branch) { - if ($branch && preg_match('(^([^\s]+)\s+\d+:([a-f0-9]+))', $branch, $match)) { + if ($branch && Preg::isMatch('(^([^\s]+)\s+\d+:([a-f0-9]+))', $branch, $match)) { $branches[$match[1]] = $match[2]; } } $this->process->execute('hg bookmarks', $output, $this->repoDir); foreach ($this->process->splitLines($output) as $branch) { - if ($branch && preg_match('(^(?:[\s*]*)([^\s]+)\s+\d+:(.*)$)', $branch, $match)) { + if ($branch && Preg::isMatch('(^(?:[\s*]*)([^\s]+)\s+\d+:(.*)$)', $branch, $match)) { $bookmarks[$match[1]] = $match[2]; } } @@ -209,7 +210,7 @@ public function getBranches() */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { - if (preg_match('#(^(?:https?|ssh)://(?:[^@]+@)?bitbucket.org|https://(?:.*?)\.kilnhg.com)#i', $url)) { + if (Preg::isMatch('#(^(?:https?|ssh)://(?:[^@]+@)?bitbucket.org|https://(?:.*?)\.kilnhg.com)#i', $url)) { return true; } diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php index 3a8c99758a..75a61037c5 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php @@ -15,6 +15,7 @@ use Composer\Config; use Composer\Cache; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; use Composer\Util\ProcessExecutor; use Composer\Util\Perforce; @@ -160,7 +161,7 @@ public function getContents($url) */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { - if ($deep || preg_match('#\b(perforce|p4)\b#i', $url)) { + if ($deep || Preg::isMatch('#\b(perforce|p4)\b#i', $url)) { return Perforce::checkServerExists($url, new ProcessExecutor($io)); } diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php index f375c900a4..c54b048382 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php @@ -15,6 +15,7 @@ use Composer\Cache; use Composer\Config; use Composer\Json\JsonFile; +use Composer\Pcre\Preg; use Composer\Util\ProcessExecutor; use Composer\Util\Filesystem; use Composer\Util\Url; @@ -82,7 +83,7 @@ public function initialize() $this->baseUrl = substr($this->url, 0, $pos); } - $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->baseUrl))); + $this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.Preg::replace('{[^a-z0-9.]}i', '-', Url::sanitize($this->baseUrl))); $this->cache->setReadOnly($this->config->get('cache-read-only')); $this->getBranches(); @@ -126,7 +127,7 @@ public function getDist($identifier) */ protected function shouldCache($identifier) { - return $this->cache && preg_match('{@\d+$}', $identifier); + return $this->cache && Preg::isMatch('{@\d+$}', $identifier); } /** @@ -168,7 +169,7 @@ public function getFileContent($file, $identifier) { $identifier = '/' . trim($identifier, '/') . '/'; - preg_match('{^(.+?)(@\d+)?/$}', $identifier, $match); + Preg::match('{^(.+?)(@\d+)?/$}', $identifier, $match); if (!empty($match[2])) { $path = $match[1]; $rev = $match[2]; @@ -197,7 +198,7 @@ public function getChangeDate($identifier) { $identifier = '/' . trim($identifier, '/') . '/'; - preg_match('{^(.+?)(@\d+)?/$}', $identifier, $match); + Preg::match('{^(.+?)(@\d+)?/$}', $identifier, $match); if (!empty($match[2])) { $path = $match[1]; $rev = $match[2]; @@ -208,7 +209,7 @@ public function getChangeDate($identifier) $output = $this->execute('svn info', $this->baseUrl . $path . $rev); foreach ($this->process->splitLines($output) as $line) { - if ($line && preg_match('{^Last Changed Date: ([^(]+)}', $line, $match)) { + if ($line && Preg::isMatch('{^Last Changed Date: ([^(]+)}', $line, $match)) { return new \DateTime($match[1], new \DateTimeZone('UTC')); } } @@ -222,16 +223,16 @@ public function getChangeDate($identifier) public function getTags() { if (null === $this->tags) { - $this->tags = array(); + $tags = array(); if ($this->tagsPath !== false) { $output = $this->execute('svn ls --verbose', $this->baseUrl . '/' . $this->tagsPath); if ($output) { foreach ($this->process->splitLines($output) as $line) { $line = trim($line); - if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) { + if ($line && Preg::isMatch('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) { if (isset($match[1], $match[2]) && $match[2] !== './') { - $this->tags[rtrim($match[2], '/')] = $this->buildIdentifier( + $tags[rtrim($match[2], '/')] = $this->buildIdentifier( '/' . $this->tagsPath . '/' . $match[2], $match[1] ); @@ -240,6 +241,8 @@ public function getTags() } } } + + $this->tags = $tags; } return $this->tags; @@ -251,7 +254,7 @@ public function getTags() public function getBranches() { if (null === $this->branches) { - $this->branches = array(); + $branches = array(); if (false === $this->trunkPath) { $trunkParent = $this->baseUrl . '/'; @@ -263,13 +266,13 @@ public function getBranches() if ($output) { foreach ($this->process->splitLines($output) as $line) { $line = trim($line); - if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) { + if ($line && Preg::isMatch('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) { if (isset($match[1], $match[2]) && $match[2] === './') { - $this->branches['trunk'] = $this->buildIdentifier( + $branches['trunk'] = $this->buildIdentifier( '/' . $this->trunkPath, $match[1] ); - $this->rootIdentifier = $this->branches['trunk']; + $this->rootIdentifier = $branches['trunk']; break; } } @@ -282,9 +285,9 @@ public function getBranches() if ($output) { foreach ($this->process->splitLines(trim($output)) as $line) { $line = trim($line); - if ($line && preg_match('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) { + if ($line && Preg::isMatch('{^\s*(\S+).*?(\S+)\s*$}', $line, $match)) { if (isset($match[1], $match[2]) && $match[2] !== './') { - $this->branches[rtrim($match[2], '/')] = $this->buildIdentifier( + $branches[rtrim($match[2], '/')] = $this->buildIdentifier( '/' . $this->branchesPath . '/' . $match[2], $match[1] ); @@ -293,6 +296,8 @@ public function getBranches() } } } + + $this->branches = $branches; } return $this->branches; @@ -304,7 +309,7 @@ public function getBranches() public static function supports(IOInterface $io, Config $config, $url, $deep = false) { $url = self::normalizeUrl($url); - if (preg_match('#(^svn://|^svn\+ssh://|svn\.)#i', $url)) { + if (Preg::isMatch('#(^svn://|^svn\+ssh://|svn\.)#i', $url)) { return true; } diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php index 060e20a4b3..510e7efe8a 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php @@ -17,6 +17,7 @@ use Composer\Config; use Composer\IO\IOInterface; use Composer\Json\JsonFile; +use Composer\Pcre\Preg; use Composer\Util\ProcessExecutor; use Composer\Util\HttpDownloader; use Composer\Util\Filesystem; @@ -80,7 +81,7 @@ final public function __construct(array $repoConfig, IOInterface $io, Config $co */ protected function shouldCache($identifier) { - return $this->cache && preg_match('{^[a-f0-9]{40}$}iD', $identifier); + return $this->cache && Preg::isMatch('{^[a-f0-9]{40}$}iD', $identifier); } /** diff --git a/core/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriverInterface.php b/core/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriverInterface.php index cdddd022b9..b8c5e842d2 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriverInterface.php +++ b/core/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriverInterface.php @@ -62,14 +62,14 @@ public function getRootIdentifier(); /** * Return list of branches in the repository * - * @return array<string, string> Branch names as keys, identifiers as values + * @return array<int|string, string> Branch names as keys, identifiers as values */ public function getBranches(); /** * Return list of tags in the repository * - * @return array<string, string> Tag names as keys, identifiers as values + * @return array<int|string, string> Tag names as keys, identifiers as values */ public function getTags(); diff --git a/core/vendor/composer/composer/src/Composer/Repository/VcsRepository.php b/core/vendor/composer/composer/src/Composer/Repository/VcsRepository.php index 8469a33c82..65b4dc2817 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/VcsRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/VcsRepository.php @@ -13,6 +13,7 @@ namespace Composer\Repository; use Composer\Downloader\TransportException; +use Composer\Pcre\Preg; use Composer\Repository\Vcs\VcsDriverInterface; use Composer\Package\Version\VersionParser; use Composer\Package\Loader\ArrayLoader; @@ -66,7 +67,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt private $versionCache; /** @var string[] */ private $emptyReferences = array(); - /** @var array<'tags'|'branches', array<string, \Throwable>> */ + /** @var array<'tags'|'branches', array<string, TransportException>> */ private $versionTransportExceptions = array(); /** @@ -79,9 +80,9 @@ public function __construct(array $repoConfig, IOInterface $io, Config $config, $this->drivers = $drivers ?: array( 'github' => 'Composer\Repository\Vcs\GitHubDriver', 'gitlab' => 'Composer\Repository\Vcs\GitLabDriver', + 'bitbucket' => 'Composer\Repository\Vcs\GitBitbucketDriver', 'git-bitbucket' => 'Composer\Repository\Vcs\GitBitbucketDriver', 'git' => 'Composer\Repository\Vcs\GitDriver', - 'hg-bitbucket' => 'Composer\Repository\Vcs\HgBitbucketDriver', 'hg' => 'Composer\Repository\Vcs\HgDriver', 'perforce' => 'Composer\Repository\Vcs\PerforceDriver', 'fossil' => 'Composer\Repository\Vcs\FossilDriver', @@ -180,7 +181,7 @@ public function getEmptyReferences() } /** - * @return array<'tags'|'branches', array<string, \Throwable>> + * @return array<'tags'|'branches', array<string, TransportException>> */ public function getVersionTransportExceptions() { @@ -212,12 +213,17 @@ protected function initialize() $this->packageName = !empty($data['name']) ? $data['name'] : null; } } catch (\Exception $e) { + if ($e instanceof TransportException && $this->shouldRethrowTransportException($e)) { + throw $e; + } + if ($isVeryVerbose) { $this->io->writeError('<error>Skipped parsing '.$driver->getRootIdentifier().', '.$e->getMessage().'</error>'); } } foreach ($driver->getTags() as $tag => $identifier) { + $tag = (string) $tag; $msg = 'Reading composer.json of <info>' . ($this->packageName ?: $this->url) . '</info> (<comment>' . $tag . '</comment>)'; if ($isVeryVerbose) { $this->io->writeError($msg); @@ -266,8 +272,8 @@ protected function initialize() } // make sure tag packages have no -dev flag - $data['version'] = preg_replace('{[.-]?dev$}i', '', $data['version']); - $data['version_normalized'] = preg_replace('{(^dev-|[.-]?dev$)}i', '', $data['version_normalized']); + $data['version'] = Preg::replace('{[.-]?dev$}i', '', $data['version']); + $data['version_normalized'] = Preg::replace('{(^dev-|[.-]?dev$)}i', '', $data['version_normalized']); // make sure tag do not contain the default-branch marker unset($data['default-branch']); @@ -275,7 +281,7 @@ protected function initialize() // broken package, version doesn't match tag if ($data['version_normalized'] !== $parsedTag) { if ($isVeryVerbose) { - if (preg_match('{(^dev-|[.-]?dev$)}i', $parsedTag)) { + if (Preg::isMatch('{(^dev-|[.-]?dev$)}i', $parsedTag)) { $this->io->writeError('<warning>Skipped tag '.$tag.', invalid tag name, tags can not use dev prefixes or suffixes</warning>'); } else { $this->io->writeError('<warning>Skipped tag '.$tag.', tag ('.$parsedTag.') does not match version ('.$data['version_normalized'].') in composer.json</warning>'); @@ -303,7 +309,7 @@ protected function initialize() if ($e->getCode() === 404) { $this->emptyReferences[] = $identifier; } - if (in_array($e->getCode(), array(401, 403, 429), true)) { + if ($this->shouldRethrowTransportException($e)) { throw $e; } } @@ -325,6 +331,7 @@ protected function initialize() } foreach ($branches as $branch => $identifier) { + $branch = (string) $branch; $msg = 'Reading composer.json of <info>' . ($this->packageName ?: $this->url) . '</info> (<comment>' . $branch . '</comment>)'; if ($isVeryVerbose) { $this->io->writeError($msg); @@ -344,7 +351,7 @@ protected function initialize() $version = 'dev-' . $branch; } else { $prefix = strpos($branch, 'v') === 0 ? 'v' : ''; - $version = $prefix . preg_replace('{(\.9{7})+}', '.x', $parsedBranch); + $version = $prefix . Preg::replace('{(\.9{7})+}', '.x', $parsedBranch); } $cachedPackage = $this->getCachedPackageVersion($version, $identifier, $isVerbose, $isVeryVerbose, $driver->getRootIdentifier() === $branch); @@ -392,7 +399,7 @@ protected function initialize() if ($e->getCode() === 404) { $this->emptyReferences[] = $identifier; } - if (in_array($e->getCode(), array(401, 403, 429), true)) { + if ($this->shouldRethrowTransportException($e)) { throw $e; } if ($isVeryVerbose) { @@ -531,4 +538,12 @@ private function getCachedPackageVersion($version, $identifier, $isVerbose, $isV return null; } + + /** + * @return bool + */ + private function shouldRethrowTransportException(TransportException $e) + { + return in_array($e->getCode(), array(401, 403, 429), true) || $e->getCode() >= 500; + } } diff --git a/core/vendor/composer/composer/src/Composer/Repository/WritableArrayRepository.php b/core/vendor/composer/composer/src/Composer/Repository/WritableArrayRepository.php index 2cf2f576ac..722cc68f11 100644 --- a/core/vendor/composer/composer/src/Composer/Repository/WritableArrayRepository.php +++ b/core/vendor/composer/composer/src/Composer/Repository/WritableArrayRepository.php @@ -27,6 +27,17 @@ class WritableArrayRepository extends ArrayRepository implements WritableReposit */ protected $devPackageNames = array(); + /** @var bool|null */ + private $devMode = null; + + /** + * @return bool|null true if dev requirements were installed, false if --no-dev was used, null if yet unknown + */ + public function getDevMode() + { + return $this->devMode; + } + /** * @inheritDoc */ @@ -48,6 +59,7 @@ public function getDevPackageNames() */ public function write($devMode, InstallationManager $installationManager) { + $this->devMode = $devMode; } /** @@ -55,6 +67,7 @@ public function write($devMode, InstallationManager $installationManager) */ public function reload() { + $this->devMode = null; } /** diff --git a/core/vendor/composer/composer/src/Composer/SelfUpdate/Keys.php b/core/vendor/composer/composer/src/Composer/SelfUpdate/Keys.php index 808b8766d7..64666f2512 100644 --- a/core/vendor/composer/composer/src/Composer/SelfUpdate/Keys.php +++ b/core/vendor/composer/composer/src/Composer/SelfUpdate/Keys.php @@ -12,6 +12,8 @@ namespace Composer\SelfUpdate; +use Composer\Pcre\Preg; + /** * @author Jordi Boggiano <j.boggiano@seld.be> */ @@ -24,7 +26,7 @@ class Keys */ public static function fingerprint($path) { - $hash = strtoupper(hash('sha256', preg_replace('{\s}', '', file_get_contents($path)))); + $hash = strtoupper(hash('sha256', Preg::replace('{\s}', '', file_get_contents($path)))); return implode(' ', array( substr($hash, 0, 8), diff --git a/core/vendor/composer/composer/src/Composer/Util/AuthHelper.php b/core/vendor/composer/composer/src/Composer/Util/AuthHelper.php index 6f6f2447d2..28c4aba681 100644 --- a/core/vendor/composer/composer/src/Composer/Util/AuthHelper.php +++ b/core/vendor/composer/composer/src/Composer/Util/AuthHelper.php @@ -15,6 +15,7 @@ use Composer\Config; use Composer\IO\IOInterface; use Composer\Downloader\TransportException; +use Composer\Pcre\Preg; /** * @author Jordi Boggiano <j.boggiano@seld.be> @@ -91,6 +92,20 @@ public function promptAuthIfNeeded($url, $origin, $statusCode, $reason = null, $ $message = "\n"; $rateLimited = $gitHubUtil->isRateLimited($headers); + $requiresSso = $gitHubUtil->requiresSso($headers); + + if ($requiresSso) { + $ssoUrl = $gitHubUtil->getSsoUrl($headers); + $message = 'GitHub API token requires SSO authorization. Authorize this token at ' . $ssoUrl . "\n"; + $this->io->writeError($message); + if (!$this->io->isInteractive()) { + throw new TransportException('Could not authenticate against ' . $origin, 403); + } + $this->io->ask('After authorizing your token, confirm that you would like to retry the request'); + + return array('retry' => true, 'storeAuth' => $storeAuth); + } + if ($rateLimited) { $rateLimit = $gitHubUtil->getRateLimit($headers); if ($this->io->hasAuthentication($origin)) { @@ -209,7 +224,7 @@ public function addAuthenticationHeader(array $headers, $origin, $url) $headers[] = 'Authorization: Bearer '.$auth['username']; } elseif ('github.com' === $origin && 'x-oauth-basic' === $auth['password']) { // only add the access_token if it is actually a github API URL - if (preg_match('{^https?://api\.github\.com/}', $url)) { + if (Preg::isMatch('{^https?://api\.github\.com/}', $url)) { $headers[] = 'Authorization: token '.$auth['username']; $authenticationDisplayMessage = 'Using GitHub token authentication'; } diff --git a/core/vendor/composer/composer/src/Composer/Util/ComposerMirror.php b/core/vendor/composer/composer/src/Composer/Util/ComposerMirror.php index 047c9c29b9..f066685183 100644 --- a/core/vendor/composer/composer/src/Composer/Util/ComposerMirror.php +++ b/core/vendor/composer/composer/src/Composer/Util/ComposerMirror.php @@ -12,6 +12,8 @@ namespace Composer\Util; +use Composer\Pcre\Preg; + /** * Composer mirror utilities * @@ -32,7 +34,7 @@ class ComposerMirror public static function processUrl($mirrorUrl, $packageName, $version, $reference, $type, $prettyVersion = null) { if ($reference) { - $reference = preg_match('{^([a-f0-9]*|%reference%)$}', $reference) ? $reference : md5($reference); + $reference = Preg::isMatch('{^([a-f0-9]*|%reference%)$}', $reference) ? $reference : md5($reference); } $version = strpos($version, '/') === false ? $version : md5($version); @@ -56,12 +58,12 @@ public static function processUrl($mirrorUrl, $packageName, $version, $reference */ public static function processGitUrl($mirrorUrl, $packageName, $url, $type) { - if (preg_match('#^(?:(?:https?|git)://github\.com/|git@github\.com:)([^/]+)/(.+?)(?:\.git)?$#', $url, $match)) { + if (Preg::isMatch('#^(?:(?:https?|git)://github\.com/|git@github\.com:)([^/]+)/(.+?)(?:\.git)?$#', $url, $match)) { $url = 'gh-'.$match[1].'/'.$match[2]; - } elseif (preg_match('#^https://bitbucket\.org/([^/]+)/(.+?)(?:\.git)?/?$#', $url, $match)) { + } elseif (Preg::isMatch('#^https://bitbucket\.org/([^/]+)/(.+?)(?:\.git)?/?$#', $url, $match)) { $url = 'bb-'.$match[1].'/'.$match[2]; } else { - $url = preg_replace('{[^a-z0-9_.-]}i', '-', trim($url, '/')); + $url = Preg::replace('{[^a-z0-9_.-]}i', '-', trim($url, '/')); } return str_replace( diff --git a/core/vendor/composer/composer/src/Composer/Util/ConfigValidator.php b/core/vendor/composer/composer/src/Composer/Util/ConfigValidator.php index b64f48d4b9..aab3e32205 100644 --- a/core/vendor/composer/composer/src/Composer/Util/ConfigValidator.php +++ b/core/vendor/composer/composer/src/Composer/Util/ConfigValidator.php @@ -18,6 +18,7 @@ use Composer\Json\JsonValidationException; use Composer\IO\IOInterface; use Composer\Json\JsonFile; +use Composer\Pcre\Preg; use Composer\Spdx\SpdxLicenses; /** @@ -93,12 +94,12 @@ public function validate($file, $arrayLoaderValidationFlags = ValidatingArrayLoa foreach ($licenses as $license) { $spdxLicense = $licenseValidator->getLicenseByIdentifier($license); if ($spdxLicense && $spdxLicense[3]) { - if (preg_match('{^[AL]?GPL-[123](\.[01])?\+$}i', $license)) { + if (Preg::isMatch('{^[AL]?GPL-[123](\.[01])?\+$}i', $license)) { $warnings[] = sprintf( 'License "%s" is a deprecated SPDX license identifier, use "'.str_replace('+', '', $license).'-or-later" instead', $license ); - } elseif (preg_match('{^[AL]?GPL-[123](\.[01])?$}i', $license)) { + } elseif (Preg::isMatch('{^[AL]?GPL-[123](\.[01])?$}i', $license)) { $warnings[] = sprintf( 'License "%s" is a deprecated SPDX license identifier, use "'.$license.'-only" or "'.$license.'-or-later" instead', $license @@ -117,8 +118,8 @@ public function validate($file, $arrayLoaderValidationFlags = ValidatingArrayLoa $warnings[] = 'The version field is present, it is recommended to leave it out if the package is published on Packagist.'; } - if (!empty($manifest['name']) && preg_match('{[A-Z]}', $manifest['name'])) { - $suggestName = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $manifest['name']); + if (!empty($manifest['name']) && Preg::isMatch('{[A-Z]}', $manifest['name'])) { + $suggestName = Preg::replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $manifest['name']); $suggestName = strtolower($suggestName); $publishErrors[] = sprintf( @@ -162,7 +163,7 @@ public function validate($file, $arrayLoaderValidationFlags = ValidatingArrayLoa $requireDev = isset($manifest['require-dev']) ? $manifest['require-dev'] : array(); $packages = array_merge($require, $requireDev); foreach ($packages as $package => $version) { - if (preg_match('/#/', $version) === 1) { + if (Preg::isMatch('/#/', $version)) { $warnings[] = sprintf( 'The package "%s" is pointing to a commit-ref, this is bad practice and can cause unforeseen issues.', $package diff --git a/core/vendor/composer/composer/src/Composer/Util/ErrorHandler.php b/core/vendor/composer/composer/src/Composer/Util/ErrorHandler.php index 7933f04e08..1bb7d43011 100644 --- a/core/vendor/composer/composer/src/Composer/Util/ErrorHandler.php +++ b/core/vendor/composer/composer/src/Composer/Util/ErrorHandler.php @@ -13,6 +13,7 @@ namespace Composer\Util; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; /** * Convert PHP errors into exceptions @@ -55,7 +56,7 @@ public static function handle($level, $message, $file, $line) if (self::$io) { // ignore symfony/* deprecation warnings // TODO remove in 2.3 - if (preg_match('{^Return type of Symfony\\\\.*ReturnTypeWillChange}is', $message)) { + if (Preg::isMatch('{^Return type of Symfony\\\\.*ReturnTypeWillChange}is', $message)) { return true; } if (strpos(strtr($file, '\\', '/'), 'vendor/symfony/') !== false) { diff --git a/core/vendor/composer/composer/src/Composer/Util/Filesystem.php b/core/vendor/composer/composer/src/Composer/Util/Filesystem.php index bf2ee1dda0..91b1cbe489 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Filesystem.php +++ b/core/vendor/composer/composer/src/Composer/Util/Filesystem.php @@ -12,6 +12,7 @@ namespace Composer\Util; +use Composer\Pcre\Preg; use React\Promise\PromiseInterface; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; @@ -176,7 +177,7 @@ public function removeDirectoryAsync($directory) * @param string $directory * @param bool $fallbackToPhp * - * @return bool|null Returns null, when no edge case was hit. Otherwise a bool whether removal was successfull + * @return bool|null Returns null, when no edge case was hit. Otherwise a bool whether removal was successful */ private function removeEdgeCases($directory, $fallbackToPhp = true) { @@ -196,7 +197,7 @@ private function removeEdgeCases($directory, $fallbackToPhp = true) return true; } - if (preg_match('{^(?:[a-z]:)?[/\\\\]+$}i', $directory)) { + if (Preg::isMatch('{^(?:[a-z]:)?[/\\\\]+$}i', $directory)) { throw new \RuntimeException('Aborting an attempted deletion of '.$directory.', this was probably not intended, if it is a real use case please report it.'); } @@ -464,7 +465,7 @@ public function findShortestPath($from, $to, $directories = false) } $commonPath = $to; - while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath)) { + while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !Preg::isMatch('{^[a-z]:/?$}i', $commonPath)) { $commonPath = strtr(\dirname($commonPath), '\\', '/'); } @@ -503,7 +504,7 @@ public function findShortestPathCode($from, $to, $directories = false, $staticCo } $commonPath = $to; - while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) { + while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !Preg::isMatch('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) { $commonPath = strtr(\dirname($commonPath), '\\', '/'); } @@ -578,7 +579,7 @@ public function normalizePath($path) } // extract a prefix being a protocol://, protocol:, protocol://drive: or simply drive: - if (preg_match('{^( [0-9a-z]{2,}+: (?: // (?: [a-z]: )? )? | [a-z]: )}ix', $path, $match)) { + if (Preg::isMatch('{^( [0-9a-z]{2,}+: (?: // (?: [a-z]: )? )? | [a-z]: )}ix', $path, $match)) { $prefix = $match[1]; $path = substr($path, \strlen($prefix)); } @@ -612,7 +613,7 @@ public function normalizePath($path) */ public static function trimTrailingSlash($path) { - if (!preg_match('{^[/\\\\]+$}', $path)) { + if (!Preg::isMatch('{^[/\\\\]+$}', $path)) { $path = rtrim($path, '/\\'); } @@ -627,7 +628,7 @@ public static function trimTrailingSlash($path) */ public static function isLocalPath($path) { - return (bool) preg_match('{^(file://(?!//)|/(?!/)|/?[a-z]:[\\\\/]|\.\.[\\\\/]|[a-z0-9_.-]+[\\\\/])}i', $path); + return Preg::isMatch('{^(file://(?!//)|/(?!/)|/?[a-z]:[\\\\/]|\.\.[\\\\/]|[a-z0-9_.-]+[\\\\/])}i', $path); } /** @@ -638,10 +639,10 @@ public static function isLocalPath($path) public static function getPlatformPath($path) { if (Platform::isWindows()) { - $path = preg_replace('{^(?:file:///([a-z]):?/)}i', 'file://$1:/', $path); + $path = Preg::replace('{^(?:file:///([a-z]):?/)}i', 'file://$1:/', $path); } - return (string) preg_replace('{^file://}i', '', $path); + return (string) Preg::replace('{^file://}i', '', $path); } /** diff --git a/core/vendor/composer/composer/src/Composer/Util/Git.php b/core/vendor/composer/composer/src/Composer/Util/Git.php index a350629db5..19f411bbae 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Git.php +++ b/core/vendor/composer/composer/src/Composer/Util/Git.php @@ -14,6 +14,7 @@ use Composer\Config; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; /** * @author Jordi Boggiano <j.boggiano@seld.be> @@ -58,14 +59,14 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) $cwd = null; } - if (preg_match('{^ssh://[^@]+@[^:]+:[^0-9]+}', $url)) { + if (Preg::isMatch('{^ssh://[^@]+@[^:]+:[^0-9]+}', $url)) { throw new \InvalidArgumentException('The source URL ' . $url . ' is invalid, ssh URLs should have a port number after ":".' . "\n" . 'Use ssh://git@example.com:22/path or just git@example.com:path if you do not want to provide a password or custom port.'); } if (!$initialClone) { // capture username/password from URL if there is one and we have no auth configured yet $this->process->execute('git remote -v', $output, $cwd); - if (preg_match('{^(?:composer|origin)\s+https?://(.+):(.+)@([^/]+)}im', $output, $match) && !$this->io->hasAuthentication($match[3])) { + if (Preg::isMatch('{^(?:composer|origin)\s+https?://(.+):(.+)@([^/]+)}im', $output, $match) && !$this->io->hasAuthentication($match[3])) { $this->io->setAuthentication($match[3], rawurldecode($match[1]), rawurldecode($match[2])); } } @@ -75,7 +76,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) throw new \RuntimeException('Config value "github-protocols" must be an array, got ' . gettype($protocols)); } // public github, autoswitch protocols - if (preg_match('{^(?:https?|git)://' . self::getGitHubDomainsRegex($this->config) . '/(.*)}', $url, $match)) { + if (Preg::isMatch('{^(?:https?|git)://' . self::getGitHubDomainsRegex($this->config) . '/(.*)}', $url, $match)) { $messages = array(); foreach ($protocols as $protocol) { if ('ssh' === $protocol) { @@ -87,7 +88,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) if (0 === $this->process->execute(call_user_func($commandCallable, $protoUrl), $ignoredOutput, $cwd)) { return; } - $messages[] = '- ' . $protoUrl . "\n" . preg_replace('#^#m', ' ', $this->process->getErrorOutput()); + $messages[] = '- ' . $protoUrl . "\n" . Preg::replace('#^#m', ' ', $this->process->getErrorOutput()); if ($initialClone && isset($origCwd)) { $this->filesystem->removeDirectory($origCwd); @@ -101,7 +102,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) } // if we have a private github url and the ssh protocol is disabled then we skip it and directly fallback to https - $bypassSshForGitHub = preg_match('{^git@' . self::getGitHubDomainsRegex($this->config) . ':(.+?)\.git$}i', $url) && !in_array('ssh', $protocols, true); + $bypassSshForGitHub = Preg::isMatch('{^git@' . self::getGitHubDomainsRegex($this->config) . ':(.+?)\.git$}i', $url) && !in_array('ssh', $protocols, true); $command = call_user_func($commandCallable, $url); @@ -110,8 +111,8 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) if ($bypassSshForGitHub || 0 !== $this->process->execute($command, $ignoredOutput, $cwd)) { $errorMsg = $this->process->getErrorOutput(); // private github repository without ssh key access, try https with auth - if (preg_match('{^git@' . self::getGitHubDomainsRegex($this->config) . ':(.+?)\.git$}i', $url, $match) - || preg_match('{^https?://' . self::getGitHubDomainsRegex($this->config) . '/(.*?)(?:\.git)?$}i', $url, $match) + if (Preg::isMatch('{^git@' . self::getGitHubDomainsRegex($this->config) . ':(.+?)\.git$}i', $url, $match) + || Preg::isMatch('{^https?://' . self::getGitHubDomainsRegex($this->config) . '/(.*?)(?:\.git)?$}i', $url, $match) ) { if (!$this->io->hasAuthentication($match[1])) { $gitHubUtil = new GitHub($this->io, $this->config, $this->process); @@ -133,7 +134,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) $credentials = array(rawurlencode($auth['username']), rawurlencode($auth['password'])); $errorMsg = $this->process->getErrorOutput(); } - } elseif (preg_match('{^https://(bitbucket\.org)/(.*?)(?:\.git)?$}i', $url, $match)) { //bitbucket oauth + } elseif (Preg::isMatch('{^https://(bitbucket\.org)/(.*?)(?:\.git)?$}i', $url, $match)) { //bitbucket oauth $bitbucketUtil = new Bitbucket($this->io, $this->config, $this->process); if (!$this->io->hasAuthentication($match[1])) { @@ -178,8 +179,8 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) $errorMsg = $this->process->getErrorOutput(); } } elseif ( - preg_match('{^(git)@' . self::getGitLabDomainsRegex($this->config) . ':(.+?\.git)$}i', $url, $match) - || preg_match('{^(https?)://' . self::getGitLabDomainsRegex($this->config) . '/(.*)}i', $url, $match) + Preg::isMatch('{^(git)@' . self::getGitLabDomainsRegex($this->config) . ':(.+?\.git)$}i', $url, $match) + || Preg::isMatch('{^(https?)://' . self::getGitLabDomainsRegex($this->config) . '/(.*)}i', $url, $match) ) { if ($match[1] === 'git') { $match[1] = 'https'; @@ -273,7 +274,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) */ public function syncMirror($url, $dir) { - if (getenv('COMPOSER_DISABLE_NETWORK') && getenv('COMPOSER_DISABLE_NETWORK') !== 'prime') { + if (Platform::getEnv('COMPOSER_DISABLE_NETWORK') && Platform::getEnv('COMPOSER_DISABLE_NETWORK') !== 'prime') { $this->io->writeError('<warning>Aborting git mirror sync of '.$url.' as network is disabled</warning>'); return false; @@ -283,7 +284,7 @@ public function syncMirror($url, $dir) if (is_dir($dir) && 0 === $this->process->execute('git rev-parse --git-dir', $output, $dir) && trim($output) === '.') { try { $commandCallable = function ($url) { - $sanitizedUrl = preg_replace('{://([^@]+?):(.+?)@}', '://', $url); + $sanitizedUrl = Preg::replace('{://([^@]+?):(.+?)@}', '://', $url); return sprintf('git remote set-url origin -- %s && git remote update --prune origin && git remote set-url origin -- %s && git gc --auto', ProcessExecutor::escape($url), ProcessExecutor::escape($sanitizedUrl)); }; @@ -369,7 +370,7 @@ private function checkRefIsInMirror($dir, $ref) */ private function isAuthenticationFailure($url, &$match) { - if (!preg_match('{^(https?://)([^/]+)(.*)$}i', $url, $match)) { + if (!Preg::isMatch('{^(https?://)([^/]+)(.*)$}i', $url, $match)) { return false; } @@ -401,20 +402,20 @@ public static function cleanEnv() } // added in git 1.7.1, prevents prompting the user for username/password - if (getenv('GIT_ASKPASS') !== 'echo') { + if (Platform::getEnv('GIT_ASKPASS') !== 'echo') { Platform::putEnv('GIT_ASKPASS', 'echo'); } // clean up rogue git env vars in case this is running in a git hook - if (getenv('GIT_DIR')) { + if (Platform::getEnv('GIT_DIR')) { Platform::clearEnv('GIT_DIR'); } - if (getenv('GIT_WORK_TREE')) { + if (Platform::getEnv('GIT_WORK_TREE')) { Platform::clearEnv('GIT_WORK_TREE'); } // Run processes with predictable LANGUAGE - if (getenv('LANGUAGE') !== 'C') { + if (Platform::getEnv('LANGUAGE') !== 'C') { Platform::putEnv('LANGUAGE', 'C'); } @@ -465,7 +466,7 @@ public static function getVersion(ProcessExecutor $process) { if (false === self::$version) { self::$version = null; - if (0 === $process->execute('git --version', $output) && preg_match('/^git version (\d+(?:\.\d+)+)/m', $output, $matches)) { + if (0 === $process->execute('git --version', $output) && Preg::isMatch('/^git version (\d+(?:\.\d+)+)/m', $output, $matches)) { self::$version = $matches[1]; } } diff --git a/core/vendor/composer/composer/src/Composer/Util/GitHub.php b/core/vendor/composer/composer/src/Composer/Util/GitHub.php index 190b50fe14..2dd53e3506 100644 --- a/core/vendor/composer/composer/src/Composer/Util/GitHub.php +++ b/core/vendor/composer/composer/src/Composer/Util/GitHub.php @@ -16,6 +16,7 @@ use Composer\IO\IOInterface; use Composer\Config; use Composer\Downloader\TransportException; +use Composer\Pcre\Preg; /** * @author Jordi Boggiano <j.boggiano@seld.be> @@ -170,6 +171,28 @@ public function getRateLimit(array $headers) return $rateLimit; } + /** + * Extract SSO URL from response. + * + * @param string[] $headers Headers from Composer\Downloader\TransportException. + * + * @return string|null + */ + public function getSsoUrl(array $headers) + { + foreach ($headers as $header) { + $header = trim($header); + if (false === stripos($header, 'x-github-sso: required')) { + continue; + } + if (Preg::isMatch('{\burl=(?P<url>[^\s;]+)}', $header, $match)) { + return $match['url']; + } + } + + return null; + } + /** * Finds whether a request failed due to rate limiting * @@ -180,7 +203,27 @@ public function getRateLimit(array $headers) public function isRateLimited(array $headers) { foreach ($headers as $header) { - if (preg_match('{^X-RateLimit-Remaining: *0$}i', trim($header))) { + if (Preg::isMatch('{^X-RateLimit-Remaining: *0$}i', trim($header))) { + return true; + } + } + + return false; + } + + /** + * Finds whether a request failed due to lacking SSO authorization + * + * @see https://docs.github.com/en/rest/overview/other-authentication-methods#authenticating-for-saml-sso + * + * @param string[] $headers Headers from Composer\Downloader\TransportException. + * + * @return bool + */ + public function requiresSso(array $headers) + { + foreach ($headers as $header) { + if (Preg::isMatch('{^X-GitHub-SSO: required}i', trim($header))) { return true; } } diff --git a/core/vendor/composer/composer/src/Composer/Util/GitLab.php b/core/vendor/composer/composer/src/Composer/Util/GitLab.php index f81a469c2f..4c1376ad4b 100644 --- a/core/vendor/composer/composer/src/Composer/Util/GitLab.php +++ b/core/vendor/composer/composer/src/Composer/Util/GitLab.php @@ -16,6 +16,7 @@ use Composer\Config; use Composer\Factory; use Composer\Downloader\TransportException; +use Composer\Pcre\Preg; /** * @author Roshan Gautam <roshan.gautam@hotmail.com> @@ -57,7 +58,7 @@ public function __construct(IOInterface $io, Config $config, ProcessExecutor $pr public function authorizeOAuth($originUrl) { // before composer 1.9, origin URLs had no port number in them - $bcOriginUrl = preg_replace('{:\d+}', '', $originUrl); + $bcOriginUrl = Preg::replace('{:\d+}', '', $originUrl); if (!in_array($originUrl, $this->config->get('gitlab-domains'), true) && !in_array($bcOriginUrl, $this->config->get('gitlab-domains'), true)) { return false; diff --git a/core/vendor/composer/composer/src/Composer/Util/Hg.php b/core/vendor/composer/composer/src/Composer/Util/Hg.php index 94f1313f9c..73e3a8e520 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Hg.php +++ b/core/vendor/composer/composer/src/Composer/Util/Hg.php @@ -14,6 +14,7 @@ use Composer\Config; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; /** * @author Jonas Renaudot <jonas.renaudot@gmail.com> @@ -64,7 +65,7 @@ public function runCommand($commandCallable, $url, $cwd) } // Try with the authentication information available - if (preg_match('{^(https?)://((.+)(?:\:(.+))?@)?([^/]+)(/.*)?}mi', $url, $match) && $this->io->hasAuthentication($match[5])) { + if (Preg::isMatch('{^(https?)://((.+)(?:\:(.+))?@)?([^/]+)(/.*)?}mi', $url, $match) && $this->io->hasAuthentication($match[5])) { $auth = $this->io->getAuthentication($match[5]); $authenticatedUrl = $match[1] . '://' . rawurlencode($auth['username']) . ':' . rawurlencode($auth['password']) . '@' . $match[5] . (!empty($match[6]) ? $match[6] : null); @@ -106,7 +107,7 @@ public static function getVersion(ProcessExecutor $process) { if (false === self::$version) { self::$version = null; - if (0 === $process->execute('hg --version', $output) && preg_match('/^.+? (\d+(?:\.\d+)+)\)?\r?\n/', $output, $matches)) { + if (0 === $process->execute('hg --version', $output) && Preg::isMatch('/^.+? (\d+(?:\.\d+)+)\)?\r?\n/', $output, $matches)) { self::$version = $matches[1]; } } diff --git a/core/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php b/core/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php index 2ecc6e9b6a..96f0dfe8ec 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php +++ b/core/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php @@ -16,6 +16,7 @@ use Composer\Downloader\MaxFileSizeExceededException; use Composer\IO\IOInterface; use Composer\Downloader\TransportException; +use Composer\Pcre\Preg; use Composer\Util\StreamContextFactory; use Composer\Util\AuthHelper; use Composer\Util\Url; @@ -26,7 +27,7 @@ * @internal * @author Jordi Boggiano <j.boggiano@seld.be> * @author Nicolas Grekas <p@tchwork.com> - * @phpstan-type Attributes array{retryAuthFailure: bool, redirects: int, storeAuth: bool} + * @phpstan-type Attributes array{retryAuthFailure: bool, redirects: int, retries: int, storeAuth: bool} * @phpstan-type Job array{url: string, origin: string, attributes: Attributes, options: mixed[], progress: mixed[], curlHandle: resource, filename: string|false, headerHandle: resource, bodyHandle: resource, resolve: callable, reject: callable} */ class CurlDownloader @@ -47,6 +48,8 @@ class CurlDownloader private $selectTimeout = 5.0; /** @var int */ private $maxRedirects = 20; + /** @var int */ + private $maxRetries = 3; /** @var ProxyManager */ private $proxyManager; /** @var bool */ @@ -149,7 +152,7 @@ public function download($resolve, $reject, $origin, $url, $options, $copyTo = n * @param mixed[] $options * @param ?string $copyTo * - * @param array{retryAuthFailure?: bool, redirects?: int, storeAuth?: bool} $attributes + * @param array{retryAuthFailure?: bool, redirects?: int, retries?: int, storeAuth?: bool} $attributes * * @return int internal job id */ @@ -158,18 +161,22 @@ private function initDownload($resolve, $reject, $origin, $url, $options, $copyT $attributes = array_merge(array( 'retryAuthFailure' => true, 'redirects' => 0, + 'retries' => 0, 'storeAuth' => false, ), $attributes); $originalOptions = $options; // check URL can be accessed (i.e. is not insecure), but allow insecure Packagist calls to $hashed providers as file integrity is verified with sha256 - if (!preg_match('{^http://(repo\.)?packagist\.org/p/}', $url) || (false === strpos($url, '$') && false === strpos($url, '%24'))) { + if (!Preg::isMatch('{^http://(repo\.)?packagist\.org/p/}', $url) || (false === strpos($url, '$') && false === strpos($url, '%24'))) { $this->config->prohibitUrlByConfig($url, $this->io); } $curlHandle = curl_init(); $headerHandle = fopen('php://temp/maxmemory:32768', 'w+b'); + if (false === $headerHandle) { + throw new \RuntimeException('Failed to open a temp stream to store curl headers'); + } if ($copyTo) { $errorMessage = ''; @@ -178,7 +185,7 @@ private function initDownload($resolve, $reject, $origin, $url, $options, $copyT if ($errorMessage) { $errorMessage .= "\n"; } - $errorMessage .= preg_replace('{^fopen\(.*?\): }', '', $msg); + $errorMessage .= Preg::replace('{^fopen\(.*?\): }', '', $msg); }); $bodyHandle = fopen($copyTo.'~', 'w+b'); restore_error_handler(); @@ -267,7 +274,7 @@ private function initDownload($resolve, $reject, $origin, $url, $options, $copyT $usingProxy = $proxy->getFormattedUrl(' using proxy (%s)'); $ifModified = false !== stripos(implode(',', $options['http']['header']), 'if-modified-since:') ? ' if modified' : ''; - if ($attributes['redirects'] === 0) { + if ($attributes['redirects'] === 0 && $attributes['retries'] === 0) { $this->io->writeError('Downloading ' . Url::sanitize($url) . $usingProxy . $ifModified, true, IOInterface::DEBUG); } @@ -283,10 +290,10 @@ private function initDownload($resolve, $reject, $origin, $url, $options, $copyT */ public function abortRequest($id) { - if (isset($this->jobs[$id], $this->jobs[$id]['handle'])) { + if (isset($this->jobs[$id], $this->jobs[$id]['curlHandle'])) { $job = $this->jobs[$id]; - curl_multi_remove_handle($this->multiHandle, $job['handle']); - curl_close($job['handle']); + curl_multi_remove_handle($this->multiHandle, $job['curlHandle']); + curl_close($job['curlHandle']); if (is_resource($job['headerHandle'])) { fclose($job['headerHandle']); } @@ -346,6 +353,18 @@ public function tick() } $progress['error_code'] = $errno; + if ( + (!isset($job['options']['http']['method']) || $job['options']['http']['method'] === 'GET') + && ( + in_array($errno, array(7 /* CURLE_COULDNT_CONNECT */, 16 /* CURLE_HTTP2 */, 92 /* CURLE_HTTP2_STREAM */), true) + || ($errno === 35 /* CURLE_SSL_CONNECT_ERROR */ && false !== strpos($error, 'Connection reset by peer')) + ) && $job['attributes']['retries'] < $this->maxRetries + ) { + $this->io->writeError('Retrying ('.($job['attributes']['retries'] + 1).') ' . Url::sanitize($job['url']) . ' due to curl error '. $errno, true, IOInterface::DEBUG); + $this->restartJob($job, $job['url'], array('retries' => $job['attributes']['retries'] + 1)); + continue; + } + if ($errno === 28 /* CURLE_OPERATION_TIMEDOUT */ && isset($progress['namelookup_time']) && $progress['namelookup_time'] == 0 && !$timeoutWarning) { $timeoutWarning = true; $this->io->writeError('<warning>A connection timeout was encountered. If you intend to run Composer without connecting to the internet, run the command again prefixed with COMPOSER_DISABLE_NETWORK=1 to make Composer run in offline mode.</warning>'); @@ -400,6 +419,16 @@ public function tick() // fail 4xx and 5xx responses and capture the response if ($statusCode >= 400 && $statusCode <= 599) { + if ( + (!isset($job['options']['http']['method']) || $job['options']['http']['method'] === 'GET') + && in_array($statusCode, array(423, 425, 500, 502, 503, 504, 507, 510), true) + && $job['attributes']['retries'] < $this->maxRetries + ) { + $this->io->writeError('Retrying ('.($job['attributes']['retries'] + 1).') ' . Url::sanitize($job['url']) . ' due to status code '. $statusCode, true, IOInterface::DEBUG); + $this->restartJob($job, $job['url'], array('retries' => $job['attributes']['retries'] + 1)); + continue; + } + throw $this->failResponse($job, $response, $response->getStatusMessage()); } @@ -475,11 +504,11 @@ private function handleRedirect(array $job, Response $response) $urlHost = parse_url($job['url'], PHP_URL_HOST); // Replace path using hostname as an anchor. - $targetUrl = preg_replace('{^(.+(?://|@)'.preg_quote($urlHost).'(?::\d+)?)(?:[/\?].*)?$}', '\1'.$locationHeader, $job['url']); + $targetUrl = Preg::replace('{^(.+(?://|@)'.preg_quote($urlHost).'(?::\d+)?)(?:[/\?].*)?$}', '\1'.$locationHeader, $job['url']); } else { // Relative path; e.g. foo // This actually differs from PHP which seems to add duplicate slashes. - $targetUrl = preg_replace('{^(.+/)[^/?]*(?:\?.*)?$}', '\1'.$locationHeader, $job['url']); + $targetUrl = Preg::replace('{^(.+/)[^/?]*(?:\?.*)?$}', '\1'.$locationHeader, $job['url']); } } @@ -515,7 +544,7 @@ private function isAuthenticatedRetryNeeded(array $job, Response $response) && !$this->authHelper->isPublicBitBucketDownload($job['url']) && substr($job['url'], -4) === '.zip' && (!$locationHeader || substr($locationHeader, -4) !== '.zip') - && preg_match('{^text/html\b}i', $response->getHeader('content-type')) + && Preg::isMatch('{^text/html\b}i', $response->getHeader('content-type')) ) { $needsAuthRetry = 'Bitbucket requires authentication and it was not provided'; } diff --git a/core/vendor/composer/composer/src/Composer/Util/Http/ProxyHelper.php b/core/vendor/composer/composer/src/Composer/Util/Http/ProxyHelper.php index 001fb9b83a..febcfc73d8 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Http/ProxyHelper.php +++ b/core/vendor/composer/composer/src/Composer/Util/Http/ProxyHelper.php @@ -156,8 +156,8 @@ private static function checkProxy($proxyUrl, $envName) /** * Formats a url from its component parts * - * @param array{scheme: string, host: string, port?: int, user?: string, pass?: string} $proxy - * @param bool $includeAuth + * @param array{scheme?: string, host: string, port?: int, user?: string, pass?: string} $proxy + * @param bool $includeAuth * * @return string The formatted value */ diff --git a/core/vendor/composer/composer/src/Composer/Util/Http/ProxyManager.php b/core/vendor/composer/composer/src/Composer/Util/Http/ProxyManager.php index 00ecd398d9..352ab8d356 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Http/ProxyManager.php +++ b/core/vendor/composer/composer/src/Composer/Util/Http/ProxyManager.php @@ -34,8 +34,6 @@ class ProxyManager private $hasProxy; /** @var ?string */ private $info = null; - /** @var ?string */ - private $lastProxy = null; /** @var ?NoProxyPattern */ private $noProxyHandler = null; @@ -188,14 +186,6 @@ private function setData($url, $scheme) */ private function noProxy($requestUrl) { - if ($this->noProxyHandler) { - if ($this->noProxyHandler->test($requestUrl)) { - $this->lastProxy = 'excluded by no_proxy'; - - return true; - } - } - - return false; + return $this->noProxyHandler && $this->noProxyHandler->test($requestUrl); } } diff --git a/core/vendor/composer/composer/src/Composer/Util/Http/Response.php b/core/vendor/composer/composer/src/Composer/Util/Http/Response.php index 5f3cf73e53..d94638ae40 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Http/Response.php +++ b/core/vendor/composer/composer/src/Composer/Util/Http/Response.php @@ -13,6 +13,7 @@ namespace Composer\Util\Http; use Composer\Json\JsonFile; +use Composer\Pcre\Preg; use Composer\Util\HttpDownloader; /** @@ -37,7 +38,7 @@ class Response */ public function __construct(array $request, $code, array $headers, $body) { - if (!isset($request['url'])) { + if (!isset($request['url'])) { // @phpstan-ignore-line throw new \LogicException('url key missing from request array'); } $this->request = $request; @@ -61,7 +62,7 @@ public function getStatusMessage() { $value = null; foreach ($this->headers as $header) { - if (preg_match('{^HTTP/\S+ \d+}i', $header)) { + if (Preg::isMatch('{^HTTP/\S+ \d+}i', $header)) { // In case of redirects, headers contain the headers of all responses // so we can not return directly and need to keep iterating $value = $header; @@ -123,7 +124,7 @@ public static function findHeaderValue(array $headers, $name) { $value = null; foreach ($headers as $header) { - if (preg_match('{^'.preg_quote($name).':\s*(.+?)\s*$}i', $header, $match)) { + if (Preg::isMatch('{^'.preg_quote($name).':\s*(.+?)\s*$}i', $header, $match)) { $value = $match[1]; } } diff --git a/core/vendor/composer/composer/src/Composer/Util/HttpDownloader.php b/core/vendor/composer/composer/src/Composer/Util/HttpDownloader.php index 1706dab9f5..6b3e7d61d0 100644 --- a/core/vendor/composer/composer/src/Composer/Util/HttpDownloader.php +++ b/core/vendor/composer/composer/src/Composer/Util/HttpDownloader.php @@ -15,6 +15,7 @@ use Composer\Config; use Composer\IO\IOInterface; use Composer\Downloader\TransportException; +use Composer\Pcre\Preg; use Composer\Util\Http\Response; use Composer\Util\Http\CurlDownloader; use Composer\Composer; @@ -70,7 +71,7 @@ public function __construct(IOInterface $io, Config $config, array $options = ar { $this->io = $io; - $this->disabled = (bool) getenv('COMPOSER_DISABLE_NETWORK'); + $this->disabled = (bool) Platform::getEnv('COMPOSER_DISABLE_NETWORK'); // Setup TLS options // The cafile option can be set via config.json @@ -88,7 +89,7 @@ public function __construct(IOInterface $io, Config $config, array $options = ar $this->rfs = new RemoteFilesystem($io, $config, $options, $disableTls); - if (is_numeric($maxJobs = getenv('COMPOSER_MAX_PARALLEL_HTTP'))) { + if (is_numeric($maxJobs = Platform::getEnv('COMPOSER_MAX_PARALLEL_HTTP'))) { $this->maxJobs = max(1, min(50, (int) $maxJobs)); } } @@ -226,7 +227,7 @@ private function addJob($request, $sync = false) } // capture username/password from URL if there is one - if (preg_match('{^https?://([^:/]+):([^@/]+)@([^/]+)}i', $request['url'], $match)) { + if (Preg::isMatch('{^https?://([^:/]+):([^@/]+)@([^/]+)}i', $request['url'], $match)) { $this->io->setAuthentication($job['origin'], rawurldecode($match[1]), rawurldecode($match[2])); } @@ -448,11 +449,12 @@ private function getResponse($index) * @internal * * @param string $url - * @param array{warning?: string, info?: string, warning-versions?: string, info-versions?: string} $data + * @param array{warning?: string, info?: string, warning-versions?: string, info-versions?: string, warnings?: array<array{versions: string, message: string}>, infos?: array<array{versions: string, message: string}>} $data * @return void */ public static function outputWarnings(IOInterface $io, $url, $data) { + // legacy warning/info keys foreach (array('warning', 'info') as $type) { if (empty($data[$type])) { continue; @@ -469,6 +471,25 @@ public static function outputWarnings(IOInterface $io, $url, $data) $io->writeError('<'.$type.'>'.ucfirst($type).' from '.Url::sanitize($url).': '.$data[$type].'</'.$type.'>'); } + + // modern Composer 2.2+ format with support for multiple warning/info messages + foreach (array('warnings', 'infos') as $key) { + if (empty($data[$key])) { + continue; + } + + $versionParser = new VersionParser(); + foreach ($data[$key] as $spec) { + $type = substr($key, 0, -1); + $constraint = $versionParser->parseConstraints($spec['versions']); + $composer = new Constraint('==', $versionParser->normalize(Composer::getVersion())); + if (!$constraint->matches($composer)) { + continue; + } + + $io->writeError('<'.$type.'>'.ucfirst($type).' from '.Url::sanitize($url).': '.$spec['message'].'</'.$type.'>'); + } + } } /** @@ -516,7 +537,7 @@ private function canUseCurl(array $job) return false; } - if (!preg_match('{^https?://}i', $job['request']['url'])) { + if (!Preg::isMatch('{^https?://}i', $job['request']['url'])) { return false; } diff --git a/core/vendor/composer/composer/src/Composer/Util/NoProxyPattern.php b/core/vendor/composer/composer/src/Composer/Util/NoProxyPattern.php index 21f7c4fcaa..e8f14997b8 100644 --- a/core/vendor/composer/composer/src/Composer/Util/NoProxyPattern.php +++ b/core/vendor/composer/composer/src/Composer/Util/NoProxyPattern.php @@ -12,6 +12,7 @@ namespace Composer\Util; +use Composer\Pcre\Preg; use stdClass; /** @@ -39,7 +40,7 @@ class NoProxyPattern */ public function __construct($pattern) { - $this->hostNames = preg_split('{[\s,]+}', $pattern, -1, PREG_SPLIT_NO_EMPTY); + $this->hostNames = Preg::split('{[\s,]+}', $pattern, -1, PREG_SPLIT_NO_EMPTY); $this->noproxy = empty($this->hostNames) || '*' === $this->hostNames[0]; } @@ -158,6 +159,15 @@ protected function matchRange(stdClass $network, stdClass $target) $net = unpack('C*', $network->ip); $mask = unpack('C*', $network->netmask); $ip = unpack('C*', $target->ip); + if (false === $net) { + throw new \RuntimeException('Could not parse network IP '.$network->ip); + } + if (false === $mask) { + throw new \RuntimeException('Could not parse netmask '.$network->netmask); + } + if (false === $ip) { + throw new \RuntimeException('Could not parse target IP '.$target->ip); + } for ($i = 1; $i < 17; ++$i) { if (($net[$i] & $mask[$i]) !== ($ip[$i] & $mask[$i])) { @@ -303,6 +313,12 @@ private function ipGetNetwork($rangeIp, $size, $prefix) $mask = unpack('C*', $netmask); $ip = unpack('C*', $rangeIp); $net = ''; + if (false === $mask) { + throw new \RuntimeException('Could not parse netmask '.$netmask); + } + if (false === $ip) { + throw new \RuntimeException('Could not parse range IP '.$rangeIp); + } for ($i = 1; $i < 17; ++$i) { $net .= chr($ip[$i] & $mask[$i]); diff --git a/core/vendor/composer/composer/src/Composer/Util/Perforce.php b/core/vendor/composer/composer/src/Composer/Util/Perforce.php index 7d3929c94e..d8ee9436ba 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Perforce.php +++ b/core/vendor/composer/composer/src/Composer/Util/Perforce.php @@ -13,6 +13,7 @@ namespace Composer\Util; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; use Symfony\Component\Process\Process; /** @@ -26,7 +27,7 @@ class Perforce protected $path; /** @var ?string */ protected $p4Depot; - /** @var string */ + /** @var ?string */ protected $p4Client; /** @var ?string */ protected $p4User; @@ -34,7 +35,7 @@ class Perforce protected $p4Password; /** @var string */ protected $p4Port; - /** @var string */ + /** @var ?string */ protected $p4Stream; /** @var string */ protected $p4ClientSpec; @@ -54,7 +55,7 @@ class Perforce /** @var IOInterface */ protected $io; - /** @var Filesystem */ + /** @var ?Filesystem */ protected $filesystem; /** @@ -634,7 +635,7 @@ public function getBranches() foreach ($resArray as $line) { $resBits = explode(' ', $line); if (count($resBits) > 4) { - $branch = preg_replace('/[^A-Za-z0-9 ]/', '', $resBits[4]); + $branch = Preg::replace('/[^A-Za-z0-9 ]/', '', $resBits[4]); $possibleBranches[$branch] = $resBits[1]; } } @@ -743,7 +744,7 @@ public function getCommitLogs($fromReference, $toReference) */ public function getFilesystem() { - if (empty($this->filesystem)) { + if (null === $this->filesystem) { $this->filesystem = new Filesystem($this->process); } diff --git a/core/vendor/composer/composer/src/Composer/Util/Platform.php b/core/vendor/composer/composer/src/Composer/Util/Platform.php index 8f8ed2682c..756c115063 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Platform.php +++ b/core/vendor/composer/composer/src/Composer/Util/Platform.php @@ -12,6 +12,8 @@ namespace Composer\Util; +use Composer\Pcre\Preg; + /** * Platform helper for uniform platform-specific tests. * @@ -24,6 +26,24 @@ class Platform /** @var ?bool */ private static $isWindowsSubsystemForLinux = null; + /** + * getenv() equivalent but reads from the runtime global variables first + * + * @param string $name + * @return string|false + */ + public static function getEnv($name) + { + if (array_key_exists($name, $_SERVER)) { + return (string) $_SERVER[$name]; + } + if (array_key_exists($name, $_ENV)) { + return (string) $_ENV[$name]; + } + + return getenv($name); + } + /** * putenv() equivalent but updates the runtime global variables too * @@ -58,17 +78,17 @@ public static function clearEnv($name) */ public static function expandPath($path) { - if (preg_match('#^~[\\/]#', $path)) { + if (Preg::isMatch('#^~[\\/]#', $path)) { return self::getUserDirectory() . substr($path, 1); } - return preg_replace_callback('#^(\$|(?P<percent>%))(?P<var>\w++)(?(percent)%)(?P<path>.*)#', function ($matches) { + return Preg::replaceCallback('#^(\$|(?P<percent>%))(?P<var>\w++)(?(percent)%)(?P<path>.*)#', function ($matches) { // Treat HOME as an alias for USERPROFILE on Windows for legacy reasons if (Platform::isWindows() && $matches['var'] == 'HOME') { - return (getenv('HOME') ?: getenv('USERPROFILE')) . $matches['path']; + return (Platform::getEnv('HOME') ?: Platform::getEnv('USERPROFILE')) . $matches['path']; } - return getenv($matches['var']) . $matches['path']; + return Platform::getEnv($matches['var']) . $matches['path']; }, $path); } @@ -78,11 +98,11 @@ public static function expandPath($path) */ public static function getUserDirectory() { - if (false !== ($home = getenv('HOME'))) { + if (false !== ($home = self::getEnv('HOME'))) { return $home; } - if (self::isWindows() && false !== ($home = getenv('USERPROFILE'))) { + if (self::isWindows() && false !== ($home = self::getEnv('USERPROFILE'))) { return $home; } @@ -159,7 +179,7 @@ public static function isTty($fd = null) // detect msysgit/mingw and assume this is a tty because detection // does not work correctly, see https://github.com/composer/composer/issues/9690 - if (in_array(strtoupper(getenv('MSYSTEM') ?: ''), array('MINGW32', 'MINGW64'), true)) { + if (in_array(strtoupper(self::getEnv('MSYSTEM') ?: ''), array('MINGW32', 'MINGW64'), true)) { return true; } @@ -211,7 +231,7 @@ private static function isVirtualBoxGuest() } } - if (getenv('COMPOSER_RUNTIME_ENV') === 'virtualbox') { + if (self::getEnv('COMPOSER_RUNTIME_ENV') === 'virtualbox') { return self::$isVirtualBoxGuest = true; } diff --git a/core/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php b/core/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php index ddcf13139f..16352bbcf7 100644 --- a/core/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php +++ b/core/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php @@ -13,6 +13,7 @@ namespace Composer\Util; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; use Symfony\Component\Process\Process; use Symfony\Component\Process\Exception\RuntimeException; use React\Promise\Promise; @@ -101,18 +102,7 @@ public function executeTty($command, $cwd = null) */ private function doExecute($command, $cwd, $tty, &$output = null) { - if ($this->io && $this->io->isDebug()) { - $safeCommand = preg_replace_callback('{://(?P<user>[^:/\s]+):(?P<password>[^@\s/]+)@}i', function ($m) { - // if the username looks like a long (12char+) hex string, or a modern github token (e.g. ghp_xxx) we obfuscate that - if (preg_match('{^([a-f0-9]{12,}|gh[a-z]_[a-zA-Z0-9_]+)$}', $m['user'])) { - return '://***:***@'; - } - - return '://'.$m['user'].':***@'; - }, $command); - $safeCommand = preg_replace("{--password (.*[^\\\\]\') }", '--password \'***\' ', $safeCommand); - $this->io->writeError('Executing command ('.($cwd ?: 'CWD').'): '.$safeCommand); - } + $this->outputCommandRun($command, $cwd, false); // TODO in 2.2, these two checks can be dropped as Symfony 4+ supports them out of the box // make sure that null translate to the proper directory in case the dir is a symlink @@ -248,17 +238,7 @@ private function startJob($id) $command = $job['command']; $cwd = $job['cwd']; - if ($this->io && $this->io->isDebug()) { - $safeCommand = preg_replace_callback('{://(?P<user>[^:/\s]+):(?P<password>[^@\s/]+)@}i', function ($m) { - if (preg_match('{^[a-f0-9]{12,}$}', $m['user'])) { - return '://***:***@'; - } - - return '://'.$m['user'].':***@'; - }, $command); - $safeCommand = preg_replace("{--password (.*[^\\\\]\') }", '--password \'***\' ', $safeCommand); - $this->io->writeError('Executing async command ('.($cwd ?: 'CWD').'): '.$safeCommand); - } + $this->outputCommandRun($command, $cwd, true); // TODO in 2.2, these two checks can be dropped as Symfony 4+ supports them out of the box // make sure that null translate to the proper directory in case the dir is a symlink @@ -341,6 +321,8 @@ public function countActiveJobs($index = null) if (!$job['process']->isRunning()) { call_user_func($job['resolve'], $job['process']); } + + $job['process']->checkTimeout(); } if ($this->runningJobs < $this->maxJobs) { @@ -384,7 +366,7 @@ public function splitLines($output) { $output = trim((string) $output); - return $output === '' ? array() : preg_split('{\r?\n}', $output); + return $output === '' ? array() : Preg::split('{\r?\n}', $output); } /** @@ -453,6 +435,33 @@ public static function escape($argument) return self::escapeArgument($argument); } + /** + * @param string $command + * @param ?string $cwd + * @param bool $async + * @return void + */ + private function outputCommandRun($command, $cwd, $async) + { + if (null === $this->io || !$this->io->isDebug()) { + return; + } + + $safeCommand = Preg::replaceCallback('{://(?P<user>[^:/\s]+):(?P<password>[^@\s/]+)@}i', function ($m) { + // if the username looks like a long (12char+) hex string, or a modern github token (e.g. ghp_xxx) we obfuscate that + if (Preg::isMatch('{^([a-f0-9]{12,}|gh[a-z]_[a-zA-Z0-9_]+)$}', $m['user'])) { + return '://***:***@'; + } + if (Preg::isMatch('{^[a-f0-9]{12,}$}', $m['user'])) { + return '://***:***@'; + } + + return '://'.$m['user'].':***@'; + }, $command); + $safeCommand = Preg::replace("{--password (.*[^\\\\]\') }", '--password \'***\' ', $safeCommand); + $this->io->writeError('Executing'.($async ? ' async' : '').' command ('.($cwd ?: 'CWD').'): '.$safeCommand); + } + /** * Escapes a string to be used as a shell argument for Symfony Process. * @@ -482,20 +491,20 @@ private static function escapeArgument($argument) $argument = strtr($argument, "\n", ' '); $quote = strpbrk($argument, " \t") !== false; - $argument = preg_replace('/(\\\\*)"/', '$1$1\\"', $argument, -1, $dquotes); - $meta = $dquotes || preg_match('/%[^%]+%|![^!]+!/', $argument); + $argument = Preg::replace('/(\\\\*)"/', '$1$1\\"', $argument, -1, $dquotes); + $meta = $dquotes || Preg::isMatch('/%[^%]+%|![^!]+!/', $argument); if (!$meta && !$quote) { $quote = strpbrk($argument, '^&|<>()') !== false; } if ($quote) { - $argument = '"'.preg_replace('/(\\\\*)$/', '$1$1', $argument).'"'; + $argument = '"'.Preg::replace('/(\\\\*)$/', '$1$1', $argument).'"'; } if ($meta) { - $argument = preg_replace('/(["^&|<>()%])/', '^$1', $argument); - $argument = preg_replace('/(!)/', '^^$1', $argument); + $argument = Preg::replace('/(["^&|<>()%])/', '^$1', $argument); + $argument = Preg::replace('/(!)/', '^^$1', $argument); } return $argument; diff --git a/core/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php b/core/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php index 205c34a539..f359649750 100644 --- a/core/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php +++ b/core/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php @@ -17,6 +17,7 @@ use Composer\IO\IOInterface; use Composer\Downloader\TransportException; use Composer\CaBundle\CaBundle; +use Composer\Pcre\Preg; use Composer\Util\Http\Response; use Composer\Util\Http\ProxyManager; @@ -177,7 +178,7 @@ public static function findStatusCode(array $headers) { $value = null; foreach ($headers as $header) { - if (preg_match('{^HTTP/\S+ (\d+)}i', $header, $match)) { + if (Preg::isMatch('{^HTTP/\S+ (\d+)}i', $header, $match)) { // In case of redirects, http_response_headers contains the headers of all responses // so we can not return directly and need to keep iterating $value = (int) $match[1]; @@ -195,7 +196,7 @@ public function findStatusMessage(array $headers) { $value = null; foreach ($headers as $header) { - if (preg_match('{^HTTP/\S+ \d+}i', $header)) { + if (Preg::isMatch('{^HTTP/\S+ \d+}i', $header)) { // In case of redirects, http_response_headers contains the headers of all responses // so we can not return directly and need to keep iterating $value = $header; @@ -281,7 +282,7 @@ protected function get($originUrl, $fileUrl, $additionalOptions = array(), $file unset($origFileUrl, $proxy, $usingProxy); // Check for secure HTTP, but allow insecure Packagist calls to $hashed providers as file integrity is verified with sha256 - if ((!preg_match('{^http://(repo\.)?packagist\.org/p/}', $fileUrl) || (false === strpos($fileUrl, '$') && false === strpos($fileUrl, '%24'))) && empty($degradedPackagist)) { + if ((!Preg::isMatch('{^http://(repo\.)?packagist\.org/p/}', $fileUrl) || (false === strpos($fileUrl, '$') && false === strpos($fileUrl, '%24'))) && empty($degradedPackagist)) { $this->config->prohibitUrlByConfig($fileUrl, $this->io); } @@ -296,7 +297,7 @@ protected function get($originUrl, $fileUrl, $additionalOptions = array(), $file if ($errorMessage) { $errorMessage .= "\n"; } - $errorMessage .= preg_replace('{^file_get_contents\(.*?\): }', '', $msg); + $errorMessage .= Preg::replace('{^file_get_contents\(.*?\): }', '', $msg); return true; }); @@ -386,7 +387,7 @@ protected function get($originUrl, $fileUrl, $additionalOptions = array(), $file && !$this->authHelper->isPublicBitBucketDownload($fileUrl) && substr($fileUrl, -4) === '.zip' && (!$locationHeader || substr(parse_url($locationHeader, PHP_URL_PATH), -4) !== '.zip') - && $contentType && preg_match('{^text/html\b}i', $contentType) + && $contentType && Preg::isMatch('{^text/html\b}i', $contentType) ) { $result = false; if ($retryAuthFailure) { @@ -463,7 +464,7 @@ protected function get($originUrl, $fileUrl, $additionalOptions = array(), $file if ($errorMessage) { $errorMessage .= "\n"; } - $errorMessage .= preg_replace('{^file_put_contents\(.*?\): }', '', $msg); + $errorMessage .= Preg::replace('{^file_put_contents\(.*?\): }', '', $msg); return true; }); @@ -752,11 +753,11 @@ private function handleRedirect(array $http_response_header, array $additionalOp $urlHost = parse_url($this->fileUrl, PHP_URL_HOST); // Replace path using hostname as an anchor. - $targetUrl = preg_replace('{^(.+(?://|@)'.preg_quote($urlHost).'(?::\d+)?)(?:[/\?].*)?$}', '\1'.$locationHeader, $this->fileUrl); + $targetUrl = Preg::replace('{^(.+(?://|@)'.preg_quote($urlHost).'(?::\d+)?)(?:[/\?].*)?$}', '\1'.$locationHeader, $this->fileUrl); } else { // Relative path; e.g. foo // This actually differs from PHP which seems to add duplicate slashes. - $targetUrl = preg_replace('{^(.+/)[^/?]*(?:\?.*)?$}', '\1'.$locationHeader, $this->fileUrl); + $targetUrl = Preg::replace('{^(.+/)[^/?]*(?:\?.*)?$}', '\1'.$locationHeader, $this->fileUrl); } } diff --git a/core/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php b/core/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php index 9cab3b2fe9..4fc3316fa4 100644 --- a/core/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php +++ b/core/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php @@ -60,7 +60,7 @@ public static function getContext($url, array $defaultOptions = array(), array $ * @param string $url * @param mixed[] $options * @param bool $forCurl When true, will not add proxy values as these are handled separately - * @phpstan-return array{http: array{header: string[], proxy?: string, request_fulluri: bool}, ssl: array} + * @phpstan-return array{http: array{header: string[], proxy?: string, request_fulluri: bool}, ssl?: mixed[]} * @return array formatted as a stream context array */ public static function initOptions($url, array $options, $forCurl = false) @@ -122,7 +122,7 @@ function_exists('php_uname') ? php_uname('r') : 'Unknown', $phpVersion, $httpVersion, $platformPhpVersion ? '; Platform-PHP '.$platformPhpVersion : '', - getenv('CI') ? '; CI' : '' + Platform::getEnv('CI') ? '; CI' : '' ); } diff --git a/core/vendor/composer/composer/src/Composer/Util/Svn.php b/core/vendor/composer/composer/src/Composer/Util/Svn.php index 0bc489de62..d6b6d044ca 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Svn.php +++ b/core/vendor/composer/composer/src/Composer/Util/Svn.php @@ -14,6 +14,7 @@ use Composer\Config; use Composer\IO\IOInterface; +use Composer\Pcre\Preg; /** * @author Till Klampaeckel <till@php.net> @@ -216,8 +217,10 @@ protected function doAuthDance() $this->io->writeError("The Subversion server ({$this->url}) requested credentials:"); $this->hasAuth = true; - $this->credentials['username'] = $this->io->ask("Username: "); - $this->credentials['password'] = $this->io->askAndHideAnswer("Password: "); + $this->credentials = array( + 'username' => (string) $this->io->ask("Username: ", ''), + 'password' => (string) $this->io->askAndHideAnswer("Password: "), + ); $this->cacheCredentials = $this->io->askConfirmation("Should Subversion cache these credentials? (yes/no) "); @@ -283,7 +286,7 @@ protected function getPassword() throw new \LogicException("No svn auth detected."); } - return isset($this->credentials['password']) ? $this->credentials['password'] : ''; + return $this->credentials['password']; } /** @@ -344,8 +347,10 @@ private function createAuthFromConfig() $host = parse_url($this->url, PHP_URL_HOST); if (isset($authConfig[$host])) { - $this->credentials['username'] = $authConfig[$host]['username']; - $this->credentials['password'] = $authConfig[$host]['password']; + $this->credentials = array( + 'username' => $authConfig[$host]['username'], + 'password' => $authConfig[$host]['password'], + ); return $this->hasAuth = true; } @@ -365,10 +370,10 @@ private function createAuthFromUrl() return $this->hasAuth = false; } - $this->credentials['username'] = $uri['user']; - if (!empty($uri['pass'])) { - $this->credentials['password'] = $uri['pass']; - } + $this->credentials = array( + 'username' => $uri['user'], + 'password' => !empty($uri['pass']) ? $uri['pass'] : '', + ); return $this->hasAuth = true; } @@ -382,7 +387,7 @@ public function binaryVersion() { if (!self::$version) { if (0 === $this->process->execute('svn --version', $output)) { - if (preg_match('{(\d+(?:\.\d+)+)}', $output, $match)) { + if (Preg::isMatch('{(\d+(?:\.\d+)+)}', $output, $match)) { self::$version = $match[1]; } } diff --git a/core/vendor/composer/composer/src/Composer/Util/TlsHelper.php b/core/vendor/composer/composer/src/Composer/Util/TlsHelper.php index 01166d7b34..1ba0f806d1 100644 --- a/core/vendor/composer/composer/src/Composer/Util/TlsHelper.php +++ b/core/vendor/composer/composer/src/Composer/Util/TlsHelper.php @@ -13,6 +13,7 @@ namespace Composer\Util; use Composer\CaBundle\CaBundle; +use Composer\Pcre\Preg; /** * @author Chris Smith <chris@cs278.org> @@ -75,7 +76,7 @@ public static function getCertificateNames($certificate) $subjectAltNames = array(); if (isset($info['extensions']['subjectAltName'])) { - $subjectAltNames = preg_split('{\s*,\s*}', $info['extensions']['subjectAltName']); + $subjectAltNames = Preg::split('{\s*,\s*}', $info['extensions']['subjectAltName']); $subjectAltNames = array_filter(array_map(function ($name) { if (0 === strpos($name, 'DNS:')) { return strtolower(ltrim(substr($name, 4))); @@ -198,7 +199,7 @@ private static function certNameMatcher($certName) $wildcardRegex = "{^{$wildcardRegex}$}"; return function ($hostname) use ($wildcardRegex) { - return 1 === preg_match($wildcardRegex, $hostname); + return Preg::isMatch($wildcardRegex, $hostname); }; } diff --git a/core/vendor/composer/composer/src/Composer/Util/Url.php b/core/vendor/composer/composer/src/Composer/Util/Url.php index 7a281c9248..c2ee924657 100644 --- a/core/vendor/composer/composer/src/Composer/Util/Url.php +++ b/core/vendor/composer/composer/src/Composer/Util/Url.php @@ -13,6 +13,7 @@ namespace Composer\Util; use Composer\Config; +use Composer\Pcre\Preg; /** * @author Jordi Boggiano <j.boggiano@seld.be> @@ -30,30 +31,30 @@ public static function updateDistReference(Config $config, $url, $ref) $host = parse_url($url, PHP_URL_HOST); if ($host === 'api.github.com' || $host === 'github.com' || $host === 'www.github.com') { - if (preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/(zip|tar)ball/(.+)$}i', $url, $match)) { + if (Preg::isMatch('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/(zip|tar)ball/(.+)$}i', $url, $match)) { // update legacy github archives to API calls with the proper reference $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $ref; - } elseif (preg_match('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/archive/.+\.(zip|tar)(?:\.gz)?$}i', $url, $match)) { + } elseif (Preg::isMatch('{^https?://(?:www\.)?github\.com/([^/]+)/([^/]+)/archive/.+\.(zip|tar)(?:\.gz)?$}i', $url, $match)) { // update current github web archives to API calls with the proper reference $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $ref; - } elseif (preg_match('{^https?://api\.github\.com/repos/([^/]+)/([^/]+)/(zip|tar)ball(?:/.+)?$}i', $url, $match)) { + } elseif (Preg::isMatch('{^https?://api\.github\.com/repos/([^/]+)/([^/]+)/(zip|tar)ball(?:/.+)?$}i', $url, $match)) { // update api archives to the proper reference $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $ref; } } elseif ($host === 'bitbucket.org' || $host === 'www.bitbucket.org') { - if (preg_match('{^https?://(?:www\.)?bitbucket\.org/([^/]+)/([^/]+)/get/(.+)\.(zip|tar\.gz|tar\.bz2)$}i', $url, $match)) { + if (Preg::isMatch('{^https?://(?:www\.)?bitbucket\.org/([^/]+)/([^/]+)/get/(.+)\.(zip|tar\.gz|tar\.bz2)$}i', $url, $match)) { // update Bitbucket archives to the proper reference $url = 'https://bitbucket.org/' . $match[1] . '/'. $match[2] . '/get/' . $ref . '.' . $match[4]; } } elseif ($host === 'gitlab.com' || $host === 'www.gitlab.com') { - if (preg_match('{^https?://(?:www\.)?gitlab\.com/api/v[34]/projects/([^/]+)/repository/archive\.(zip|tar\.gz|tar\.bz2|tar)\?sha=.+$}i', $url, $match)) { + if (Preg::isMatch('{^https?://(?:www\.)?gitlab\.com/api/v[34]/projects/([^/]+)/repository/archive\.(zip|tar\.gz|tar\.bz2|tar)\?sha=.+$}i', $url, $match)) { // update Gitlab archives to the proper reference $url = 'https://gitlab.com/api/v4/projects/' . $match[1] . '/repository/archive.' . $match[2] . '?sha=' . $ref; } } elseif (in_array($host, $config->get('github-domains'), true)) { - $url = preg_replace('{(/repos/[^/]+/[^/]+/(zip|tar)ball)(?:/.+)?$}i', '$1/'.$ref, $url); + $url = Preg::replace('{(/repos/[^/]+/[^/]+/(zip|tar)ball)(?:/.+)?$}i', '$1/'.$ref, $url); } elseif (in_array($host, $config->get('gitlab-domains'), true)) { - $url = preg_replace('{(/api/v[34]/projects/[^/]+/repository/archive\.(?:zip|tar\.gz|tar\.bz2|tar)\?sha=).+$}i', '${1}'.$ref, $url); + $url = Preg::replace('{(/api/v[34]/projects/[^/]+/repository/archive\.(?:zip|tar\.gz|tar\.bz2|tar)\?sha=).+$}i', '${1}'.$ref, $url); } return $url; @@ -111,11 +112,11 @@ public static function sanitize($url) { // GitHub repository rename result in redirect locations containing the access_token as GET parameter // e.g. https://api.github.com/repositories/9999999999?access_token=github_token - $url = preg_replace('{([&?]access_token=)[^&]+}', '$1***', $url); + $url = Preg::replace('{([&?]access_token=)[^&]+}', '$1***', $url); - $url = preg_replace_callback('{^(?P<prefix>[a-z0-9]+://)?(?P<user>[^:/\s@]+):(?P<password>[^@\s/]+)@}i', function ($m) { + $url = Preg::replaceCallback('{^(?P<prefix>[a-z0-9]+://)?(?P<user>[^:/\s@]+):(?P<password>[^@\s/]+)@}i', function ($m) { // if the username looks like a long (12char+) hex string, or a modern github token (e.g. ghp_xxx) we obfuscate that - if (preg_match('{^([a-f0-9]{12,}|gh[a-z]_[a-zA-Z0-9_]+)$}', $m['user'])) { + if (Preg::isMatch('{^([a-f0-9]{12,}|gh[a-z]_[a-zA-Z0-9_]+)$}', $m['user'])) { return $m['prefix'].'***:***@'; } diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index 8cf804b943..b0ae6ef6ea 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -81,22 +81,23 @@ }, { "name": "composer/composer", - "version": "2.1.12", - "version_normalized": "2.1.12.0", + "version": "2.2.6", + "version_normalized": "2.2.6.0", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0" + "reference": "ce785a18c0fb472421e52d958bab339247cb0e82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0", - "reference": "6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0", + "url": "https://api.github.com/repos/composer/composer/zipball/ce785a18c0fb472421e52d958bab339247cb0e82", + "reference": "ce785a18c0fb472421e52d958bab339247cb0e82", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", "composer/metadata-minifier": "^1.0", + "composer/pcre": "^1.0", "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^2.0", @@ -106,7 +107,7 @@ "react/promise": "^1.2 || ^2.7", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" @@ -120,14 +121,14 @@ "ext-zip": "Enabling the zip extension allows you to unzip archives", "ext-zlib": "Allow gzip compression of HTTP requests" }, - "time": "2021-11-09T15:02:04+00:00", + "time": "2022-02-04T16:00:38+00:00", "bin": [ "bin/composer" ], "type": "library", "extra": { "branch-alias": { - "dev-main": "2.1-dev" + "dev-main": "2.2-dev" } }, "installation-source": "dist", @@ -162,7 +163,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.1.12" + "source": "https://github.com/composer/composer/tree/2.2.6" }, "funding": [ { @@ -1133,37 +1134,37 @@ }, { "name": "egulias/email-validator", - "version": "3.1.2", - "version_normalized": "3.1.2.0", + "version": "2.1.25", + "version_normalized": "2.1.25.0", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "ee0db30118f661fb166bcffbf5d82032df484697" + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ee0db30118f661fb166bcffbf5d82032df484697", - "reference": "ee0db30118f661fb166bcffbf5d82032df484697", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4", + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4", "shasum": "" }, "require": { - "doctrine/lexer": "^1.2", - "php": ">=7.2", - "symfony/polyfill-intl-idn": "^1.15" + "doctrine/lexer": "^1.0.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.10" }, "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^8.5.8|^9.3.3", - "vimeo/psalm": "^4" + "dominicsayers/isemail": "^3.0.7", + "phpunit/phpunit": "^4.8.36|^7.5.15", + "satooshi/php-coveralls": "^1.0.1" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" }, - "time": "2021-10-11T09:18:27+00:00", + "time": "2020-12-29T14:50:06+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.1.x-dev" } }, "installation-source": "dist", @@ -1192,7 +1193,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/3.1.2" + "source": "https://github.com/egulias/EmailValidator/tree/2.1.25" }, "funding": [ { @@ -1736,34 +1737,34 @@ }, { "name": "illuminate/bus", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "b8eeab8d43bc4085e882bfc8583cab6ced4c29e8" + "reference": "917798f4a21c5eed1f83f9b434ce94f9c4fa8432" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/b8eeab8d43bc4085e882bfc8583cab6ced4c29e8", - "reference": "b8eeab8d43bc4085e882bfc8583cab6ced4c29e8", + "url": "https://api.github.com/repos/illuminate/bus/zipball/917798f4a21c5eed1f83f9b434ce94f9c4fa8432", + "reference": "917798f4a21c5eed1f83f9b434ce94f9c4fa8432", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/pipeline": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/pipeline": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "suggest": { "illuminate/queue": "Required to use closures when chaining jobs (^7.0)." }, - "time": "2022-02-12T17:47:05+00:00", + "time": "2022-01-10T22:25:47+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -1792,41 +1793,41 @@ }, { "name": "illuminate/cache", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", - "reference": "52ead4fcaf61d900a17990b06af5656755ca30e2" + "reference": "341b4f98a0de928d5af990f4e75acb5b34948569" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/cache/zipball/52ead4fcaf61d900a17990b06af5656755ca30e2", - "reference": "52ead4fcaf61d900a17990b06af5656755ca30e2", + "url": "https://api.github.com/repos/illuminate/cache/zipball/341b4f98a0de928d5af990f4e75acb5b34948569", + "reference": "341b4f98a0de928d5af990f4e75acb5b34948569", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "provide": { - "psr/simple-cache-implementation": "1.0|2.0|3.0" + "psr/simple-cache-implementation": "1.0" }, "suggest": { "ext-memcached": "Required to use the memcache cache driver.", - "illuminate/database": "Required to use the database cache driver (^9.0).", - "illuminate/filesystem": "Required to use the file cache driver (^9.0).", - "illuminate/redis": "Required to use the redis cache driver (^9.0).", - "symfony/cache": "Required to use PSR-6 cache bridge (^6.0)." + "illuminate/database": "Required to use the database cache driver (^8.0).", + "illuminate/filesystem": "Required to use the file cache driver (^8.0).", + "illuminate/redis": "Required to use the redis cache driver (^8.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.4)." }, - "time": "2022-02-14T17:27:32+00:00", + "time": "2022-01-27T17:47:01+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -1855,33 +1856,32 @@ }, { "name": "illuminate/collections", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "707ab36191228b1a4cf322985796ff7aab5578c1" + "reference": "5cf7ed1c0a1b8049576b29f5cab5c822149aaa91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/707ab36191228b1a4cf322985796ff7aab5578c1", - "reference": "707ab36191228b1a4cf322985796ff7aab5578c1", + "url": "https://api.github.com/repos/illuminate/collections/zipball/5cf7ed1c0a1b8049576b29f5cab5c822149aaa91", + "reference": "5cf7ed1c0a1b8049576b29f5cab5c822149aaa91", "shasum": "" }, "require": { - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "php": "^8.0.2" + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "php": "^7.3|^8.0" }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^6.0)." + "symfony/var-dumper": "Required to use the dump method (^5.4)." }, - "time": "2022-02-09T21:49:11+00:00", + "time": "2022-02-15T14:40:58+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -1911,80 +1911,31 @@ }, "install-path": "../illuminate/collections" }, - { - "name": "illuminate/conditionable", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/illuminate/conditionable.git", - "reference": "4f7e3d67ceda9a6188757501748982ea9ed5f69a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/conditionable/zipball/4f7e3d67ceda9a6188757501748982ea9ed5f69a", - "reference": "4f7e3d67ceda9a6188757501748982ea9ed5f69a", - "shasum": "" - }, - "require": { - "php": "^8.0.2" - }, - "time": "2022-02-09T14:26:32+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Conditionable package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "install-path": "../illuminate/conditionable" - }, { "name": "illuminate/config", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", - "reference": "d2dc74fdcc89239e1910a8d08b2b2e5ad26a043c" + "reference": "feac56ab7a5c70cf2dc60dffe4323eb9851f51a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/config/zipball/d2dc74fdcc89239e1910a8d08b2b2e5ad26a043c", - "reference": "d2dc74fdcc89239e1910a8d08b2b2e5ad26a043c", + "url": "https://api.github.com/repos/illuminate/config/zipball/feac56ab7a5c70cf2dc60dffe4323eb9851f51a8", + "reference": "feac56ab7a5c70cf2dc60dffe4323eb9851f51a8", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "php": "^7.3|^8.0" }, - "time": "2022-02-01T16:16:50+00:00", + "time": "2022-01-31T15:57:46+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2013,41 +1964,41 @@ }, { "name": "illuminate/console", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", - "reference": "cb3486758b07ae824bc763592d414973a17658b7" + "reference": "d93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/console/zipball/cb3486758b07ae824bc763592d414973a17658b7", - "reference": "cb3486758b07ae824bc763592d414973a17658b7", + "url": "https://api.github.com/repos/illuminate/console/zipball/d93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf", + "reference": "d93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/console": "^6.0", - "symfony/process": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/console": "^5.4", + "symfony/process": "^5.4" }, "suggest": { - "dragonmantank/cron-expression": "Required to use scheduler (^3.1).", - "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^7.2).", - "illuminate/bus": "Required to use the scheduled job dispatcher (^9.0).", - "illuminate/container": "Required to use the scheduler (^9.0).", - "illuminate/filesystem": "Required to use the generator command (^9.0).", - "illuminate/queue": "Required to use closures for scheduled jobs (^9.0)." - }, - "time": "2022-02-01T14:44:21+00:00", + "dragonmantank/cron-expression": "Required to use scheduler (^3.0.2).", + "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^6.5.5|^7.0.1).", + "illuminate/bus": "Required to use the scheduled job dispatcher (^8.0).", + "illuminate/container": "Required to use the scheduler (^8.0).", + "illuminate/filesystem": "Required to use the generator command (^8.0).", + "illuminate/queue": "Required to use closures for scheduled jobs (^8.0)." + }, + "time": "2022-01-07T19:50:44+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2076,32 +2027,32 @@ }, { "name": "illuminate/container", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "b249d566e8f93b9255d84f4c06a8cc7db24c900c" + "reference": "14062628d05f75047c5a1360b9350028427d568e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/b249d566e8f93b9255d84f4c06a8cc7db24c900c", - "reference": "b249d566e8f93b9255d84f4c06a8cc7db24c900c", + "url": "https://api.github.com/repos/illuminate/container/zipball/14062628d05f75047c5a1360b9350028427d568e", + "reference": "14062628d05f75047c5a1360b9350028427d568e", "shasum": "" }, "require": { - "illuminate/contracts": "^9.0", - "php": "^8.0.2", - "psr/container": "^1.1.1|^2.0.1" + "illuminate/contracts": "^8.0", + "php": "^7.3|^8.0", + "psr/container": "^1.0" }, "provide": { - "psr/container-implementation": "1.1|2.0" + "psr/container-implementation": "1.0" }, - "time": "2022-02-05T18:02:43+00:00", + "time": "2022-02-02T21:03:35+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2130,29 +2081,29 @@ }, { "name": "illuminate/contracts", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "c2e3cf2eda10fd3332af0b4a43481cc0af98c437" + "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/c2e3cf2eda10fd3332af0b4a43481cc0af98c437", - "reference": "c2e3cf2eda10fd3332af0b4a43481cc0af98c437", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", + "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", "shasum": "" }, "require": { - "php": "^8.0.2", - "psr/container": "^1.1.1|^2.0.1", - "psr/simple-cache": "^1.0|^2.0|^3.0" + "php": "^7.3|^8.0", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" }, - "time": "2022-02-11T14:24:50+00:00", + "time": "2022-01-13T14:47:47+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2181,43 +2132,43 @@ }, { "name": "illuminate/database", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "9a65ca2100cada21ab2e65032821e5d3264da008" + "reference": "463de5a2028138d7f4749f072bb809288d8bd2fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/9a65ca2100cada21ab2e65032821e5d3264da008", - "reference": "9a65ca2100cada21ab2e65032821e5d3264da008", + "url": "https://api.github.com/repos/illuminate/database/zipball/463de5a2028138d7f4749f072bb809288d8bd2fe", + "reference": "463de5a2028138d7f4749f072bb809288d8bd2fe", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/console": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/console": "^5.4" }, "suggest": { "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", - "illuminate/console": "Required to use the database commands (^9.0).", - "illuminate/events": "Required to use the observers with Eloquent (^9.0).", - "illuminate/filesystem": "Required to use the migrations (^9.0).", - "illuminate/pagination": "Required to paginate the result set (^9.0).", - "symfony/finder": "Required to use Eloquent model factories (^6.0)." + "illuminate/console": "Required to use the database commands (^8.0).", + "illuminate/events": "Required to use the observers with Eloquent (^8.0).", + "illuminate/filesystem": "Required to use the migrations (^8.0).", + "illuminate/pagination": "Required to paginate the result set (^8.0).", + "symfony/finder": "Required to use Eloquent model factories (^5.4)." }, - "time": "2022-02-12T23:43:59+00:00", + "time": "2022-02-14T17:09:29+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2252,33 +2203,33 @@ }, { "name": "illuminate/events", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", - "reference": "b58e0e9b5afc3770505a2694c50afb23d973a75e" + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/events/zipball/b58e0e9b5afc3770505a2694c50afb23d973a75e", - "reference": "b58e0e9b5afc3770505a2694c50afb23d973a75e", + "url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d", + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d", "shasum": "" }, "require": { - "illuminate/bus": "^9.0", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" - }, - "time": "2022-02-01T14:44:21+00:00", + "illuminate/bus": "^8.0", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "time": "2021-09-15T14:32:50+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2310,43 +2261,43 @@ }, { "name": "illuminate/filesystem", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "8fbb541a9d45ca5dcd459bde9fb23082371f48a9" + "reference": "73db3e9a233ed587ba54f52ab8580f3c7bc872b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/8fbb541a9d45ca5dcd459bde9fb23082371f48a9", - "reference": "8fbb541a9d45ca5dcd459bde9fb23082371f48a9", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/73db3e9a233ed587ba54f52ab8580f3c7bc872b2", + "reference": "73db3e9a233ed587ba54f52ab8580f3c7bc872b2", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/finder": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/finder": "^5.4" }, "suggest": { "ext-ftp": "Required to use the Flysystem FTP driver.", "illuminate/http": "Required for handling uploaded files (^7.0).", - "league/flysystem": "Required to use the Flysystem local driver (^3.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", - "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", - "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", + "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", + "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", + "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", - "symfony/mime": "Required to enable support for guessing extensions (^6.0)." + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", + "symfony/mime": "Required to enable support for guessing extensions (^5.4)." }, - "time": "2022-02-10T16:13:07+00:00", + "time": "2022-01-15T15:00:40+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2375,39 +2326,39 @@ }, { "name": "illuminate/http", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", - "reference": "e0248518e2292eb46a4f019396569f760a07ab5e" + "reference": "3966c05c38096e15cb86e44201fc5f5731d1f3ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/http/zipball/e0248518e2292eb46a4f019396569f760a07ab5e", - "reference": "e0248518e2292eb46a4f019396569f760a07ab5e", + "url": "https://api.github.com/repos/illuminate/http/zipball/3966c05c38096e15cb86e44201fc5f5731d1f3ad", + "reference": "3966c05c38096e15cb86e44201fc5f5731d1f3ad", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/session": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/mime": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/session": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/mime": "^5.4" }, "suggest": { "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", - "guzzlehttp/guzzle": "Required to use the HTTP Client (^7.2)." + "guzzlehttp/guzzle": "Required to use the HTTP Client (^6.5.5|^7.0.1)." }, - "time": "2022-02-12T23:43:59+00:00", + "time": "2022-02-12T19:11:00+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2436,30 +2387,30 @@ }, { "name": "illuminate/log", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/log.git", - "reference": "fd12e6928cfdf5303124cbe167a8ce16308502cb" + "reference": "1dbdc6aca24d1d2b5903f865bb206039d4b800b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/log/zipball/fd12e6928cfdf5303124cbe167a8ce16308502cb", - "reference": "fd12e6928cfdf5303124cbe167a8ce16308502cb", + "url": "https://api.github.com/repos/illuminate/log/zipball/1dbdc6aca24d1d2b5903f865bb206039d4b800b2", + "reference": "1dbdc6aca24d1d2b5903f865bb206039d4b800b2", "shasum": "" }, "require": { - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", "monolog/monolog": "^2.0", - "php": "^8.0.2" + "php": "^7.3|^8.0" }, - "time": "2022-02-03T09:06:04+00:00", + "time": "2022-01-10T15:22:22+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2488,27 +2439,27 @@ }, { "name": "illuminate/macroable", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", - "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354" + "reference": "aed81891a6e046fdee72edd497f822190f61c162" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/25a2c6dac2b7541ecbadef952702e84ae15f5354", - "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", + "reference": "aed81891a6e046fdee72edd497f822190f61c162", "shasum": "" }, "require": { - "php": "^8.0.2" + "php": "^7.3|^8.0" }, - "time": "2022-02-01T14:44:21+00:00", + "time": "2021-11-16T13:57:03+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2537,31 +2488,31 @@ }, { "name": "illuminate/pagination", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", - "reference": "c4b992cebde5d0cb5091613f2df7ecf850d96dec" + "reference": "a0a5784a052663fb044baed95f56801b57c2d002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/pagination/zipball/c4b992cebde5d0cb5091613f2df7ecf850d96dec", - "reference": "c4b992cebde5d0cb5091613f2df7ecf850d96dec", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/a0a5784a052663fb044baed95f56801b57c2d002", + "reference": "a0a5784a052663fb044baed95f56801b57c2d002", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, - "time": "2022-02-15T14:56:31+00:00", + "time": "2022-01-05T15:05:14+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2590,29 +2541,29 @@ }, { "name": "illuminate/pipeline", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", - "reference": "723820323d87a2c22f017ce7ea124d08e4b65f29" + "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/pipeline/zipball/723820323d87a2c22f017ce7ea124d08e4b65f29", - "reference": "723820323d87a2c22f017ce7ea124d08e4b65f29", + "url": "https://api.github.com/repos/illuminate/pipeline/zipball/23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", + "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", "shasum": "" }, "require": { - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, - "time": "2022-02-01T14:44:21+00:00", + "time": "2021-03-26T18:39:16+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2641,35 +2592,35 @@ }, { "name": "illuminate/redis", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/redis.git", - "reference": "54371f29284d4035fb837b56360f5e9c6c8e520f" + "reference": "0fee121324054226823a59623fab3d98ad88fbd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/redis/zipball/54371f29284d4035fb837b56360f5e9c6c8e520f", - "reference": "54371f29284d4035fb837b56360f5e9c6c8e520f", + "url": "https://api.github.com/repos/illuminate/redis/zipball/0fee121324054226823a59623fab3d98ad88fbd5", + "reference": "0fee121324054226823a59623fab3d98ad88fbd5", "shasum": "" }, "require": { - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "suggest": { "ext-redis": "Required to use the phpredis connector (^4.0|^5.0).", "predis/predis": "Required to use the predis connector (^1.1.9)." }, - "time": "2022-02-09T14:35:47+00:00", + "time": "2022-01-24T02:32:30+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2698,44 +2649,44 @@ }, { "name": "illuminate/routing", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/routing.git", - "reference": "66cf35da072e1bb528ef34434a5e968e29e34f58" + "reference": "791f1a5a626f421b101b64551cf2bc422e541049" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/routing/zipball/66cf35da072e1bb528ef34434a5e968e29e34f58", - "reference": "66cf35da072e1bb528ef34434a5e968e29e34f58", + "url": "https://api.github.com/repos/illuminate/routing/zipball/791f1a5a626f421b101b64551cf2bc422e541049", + "reference": "791f1a5a626f421b101b64551cf2bc422e541049", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/http": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/pipeline": "^9.0", - "illuminate/session": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/routing": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/http": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/pipeline": "^8.0", + "illuminate/session": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/routing": "^5.4" }, "suggest": { - "illuminate/console": "Required to use the make commands (^9.0).", + "illuminate/console": "Required to use the make commands (^8.0).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." }, - "time": "2022-02-15T14:35:32+00:00", + "time": "2022-01-13T18:41:16+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2764,37 +2715,37 @@ }, { "name": "illuminate/session", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", - "reference": "bbda6e9c6fbb61c522fcd5e0a196735b0c628ae5" + "reference": "9c9988d7229d888c098eebbbb9fcb8c68580411c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/session/zipball/bbda6e9c6fbb61c522fcd5e0a196735b0c628ae5", - "reference": "bbda6e9c6fbb61c522fcd5e0a196735b0c628ae5", + "url": "https://api.github.com/repos/illuminate/session/zipball/9c9988d7229d888c098eebbbb9fcb8c68580411c", + "reference": "9c9988d7229d888c098eebbbb9fcb8c68580411c", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2", - "symfony/finder": "^6.0", - "symfony/http-foundation": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/finder": "^5.4", + "symfony/http-foundation": "^5.4" }, "suggest": { - "illuminate/console": "Required to use the session:table command (^9.0)." + "illuminate/console": "Required to use the session:table command (^8.0)." }, - "time": "2022-02-01T14:44:21+00:00", + "time": "2022-01-13T18:28:06+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2823,47 +2774,46 @@ }, { "name": "illuminate/support", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "cb117bc9a3358d60ade85e5a13d6b82f40ee6049" + "reference": "fe5469faa982e2dd8c2f5978b23cf881e3715d1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/cb117bc9a3358d60ade85e5a13d6b82f40ee6049", - "reference": "cb117bc9a3358d60ade85e5a13d6b82f40ee6049", + "url": "https://api.github.com/repos/illuminate/support/zipball/fe5469faa982e2dd8c2f5978b23cf881e3715d1b", + "reference": "fe5469faa982e2dd8c2f5978b23cf881e3715d1b", "shasum": "" }, "require": { - "doctrine/inflector": "^2.0", + "doctrine/inflector": "^1.4|^2.0", "ext-json": "*", "ext-mbstring": "*", - "illuminate/collections": "^9.0", - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", "nesbot/carbon": "^2.53.1", - "php": "^8.0.2", - "voku/portable-ascii": "^2.0" + "php": "^7.3|^8.0", + "voku/portable-ascii": "^1.6.1" }, "conflict": { "tightenco/collect": "<5.5.33" }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^9.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", + "illuminate/filesystem": "Required to use the composer class (^8.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", - "symfony/process": "Required to use the composer class (^6.0).", - "symfony/var-dumper": "Required to use the dd function (^6.0).", + "symfony/process": "Required to use the composer class (^5.4).", + "symfony/var-dumper": "Required to use the dd function (^5.4).", "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, - "time": "2022-02-14T17:31:22+00:00", + "time": "2022-02-07T21:23:13+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2895,33 +2845,33 @@ }, { "name": "illuminate/translation", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/translation.git", - "reference": "8bdac1ceea6be67e8f1c93ad68ac4abe1f91df3f" + "reference": "c10a68f37f590dc8c1c1fe5b6ad3f09381282137" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/translation/zipball/8bdac1ceea6be67e8f1c93ad68ac4abe1f91df3f", - "reference": "8bdac1ceea6be67e8f1c93ad68ac4abe1f91df3f", + "url": "https://api.github.com/repos/illuminate/translation/zipball/c10a68f37f590dc8c1c1fe5b6ad3f09381282137", + "reference": "c10a68f37f590dc8c1c1fe5b6ad3f09381282137", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" - }, - "time": "2022-02-01T14:44:21+00:00", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "time": "2021-10-30T16:01:33+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -2950,41 +2900,41 @@ }, { "name": "illuminate/validation", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/validation.git", - "reference": "805f5fd17a75ce24d7e39a833000ea698d55a695" + "reference": "49b1cfd3a32f04255eed68fc1c304659de50e374" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/validation/zipball/805f5fd17a75ce24d7e39a833000ea698d55a695", - "reference": "805f5fd17a75ce24d7e39a833000ea698d55a695", + "url": "https://api.github.com/repos/illuminate/validation/zipball/49b1cfd3a32f04255eed68fc1c304659de50e374", + "reference": "49b1cfd3a32f04255eed68fc1c304659de50e374", "shasum": "" }, "require": { - "egulias/email-validator": "^3.1", + "egulias/email-validator": "^2.1.10", "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "illuminate/translation": "^9.0", - "php": "^8.0.2", - "symfony/http-foundation": "^6.0", - "symfony/mime": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "illuminate/translation": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.4", + "symfony/mime": "^5.4" }, "suggest": { "ext-bcmath": "Required to use the multiple_of validation rule.", - "illuminate/database": "Required to use the database presence verifier (^9.0)." + "illuminate/database": "Required to use the database presence verifier (^8.0)." }, - "time": "2022-02-11T14:35:03+00:00", + "time": "2022-02-01T16:13:18+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -3013,35 +2963,35 @@ }, { "name": "illuminate/view", - "version": "v9.1.0", - "version_normalized": "9.1.0.0", + "version": "v8.83.1", + "version_normalized": "8.83.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", - "reference": "b580a1bcfa76900a59108f86e5cd3ac6c9a3d722" + "reference": "f9f3ab882025d61d72a6383679fcadd08e79fbcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/view/zipball/b580a1bcfa76900a59108f86e5cd3ac6c9a3d722", - "reference": "b580a1bcfa76900a59108f86e5cd3ac6c9a3d722", + "url": "https://api.github.com/repos/illuminate/view/zipball/f9f3ab882025d61d72a6383679fcadd08e79fbcf", + "reference": "f9f3ab882025d61d72a6383679fcadd08e79fbcf", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/events": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "php": "^8.0.2" - }, - "time": "2022-02-10T15:02:11+00:00", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/events": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "time": "2022-02-02T21:02:36+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "installation-source": "dist", @@ -3784,29 +3734,24 @@ }, { "name": "psr/container", - "version": "2.0.2", - "version_normalized": "2.0.2.0", + "version": "1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { "php": ">=7.4.0" }, - "time": "2021-11-05T16:47:00+00:00", + "time": "2021-11-05T16:50:12+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -3834,7 +3779,7 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, "install-path": "../psr/container" }, @@ -4115,27 +4060,27 @@ }, { "name": "psr/simple-cache", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "1.0.1", + "version_normalized": "1.0.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, - "time": "2021-10-29T13:26:27+00:00", + "time": "2017-10-23T01:57:42+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", @@ -4151,7 +4096,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -4163,7 +4108,7 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + "source": "https://github.com/php-fig/simple-cache/tree/master" }, "install-path": "../psr/simple-cache" }, @@ -5110,43 +5055,47 @@ }, { "name": "symfony/console", - "version": "v6.0.3", - "version_normalized": "6.0.3.0", + "version": "v5.4.3", + "version_normalized": "5.4.3.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "22e8efd019c3270c4f79376234a3f8752cd25490" + "reference": "a2a86ec353d825c75856c6fd14fac416a7bdb6b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/22e8efd019c3270c4f79376234a3f8752cd25490", - "reference": "22e8efd019c3270c4f79376234a3f8752cd25490", + "url": "https://api.github.com/repos/symfony/console/zipball/a2a86ec353d825c75856c6fd14fac416a7bdb6b8", + "reference": "a2a86ec353d825c75856c6fd14fac416a7bdb6b8", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/string": "^5.1|^6.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -5154,7 +5103,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2022-01-26T17:23:29+00:00", + "time": "2022-01-26T16:28:35+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5188,7 +5137,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.3" + "source": "https://github.com/symfony/console/tree/v5.4.3" }, "funding": [ { @@ -5586,23 +5535,25 @@ }, { "name": "symfony/finder", - "version": "v6.0.3", - "version_normalized": "6.0.3.0", + "version": "v5.4.3", + "version_normalized": "5.4.3.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8661b74dbabc23223f38c9b99d3f8ade71170430" + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8661b74dbabc23223f38c9b99d3f8ade71170430", - "reference": "8661b74dbabc23223f38c9b99d3f8ade71170430", + "url": "https://api.github.com/repos/symfony/finder/zipball/231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, - "time": "2022-01-26T17:23:29+00:00", + "time": "2022-01-26T16:34:36+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5630,7 +5581,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.0.3" + "source": "https://github.com/symfony/finder/tree/v5.4.3" }, "funding": [ { @@ -5650,34 +5601,35 @@ }, { "name": "symfony/http-foundation", - "version": "v6.0.3", - "version_normalized": "6.0.3.0", + "version": "v5.4.3", + "version_normalized": "5.4.3.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "ad157299ced81a637fade1efcadd688d6deba5c1" + "reference": "ef409ff341a565a3663157d4324536746d49a0c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ad157299ced81a637fade1efcadd688d6deba5c1", - "reference": "ad157299ced81a637fade1efcadd688d6deba5c1", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ef409ff341a565a3663157d4324536746d49a0c7", + "reference": "ef409ff341a565a3663157d4324536746d49a0c7", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.1" + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "predis/predis": "~1.0", - "symfony/cache": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/mime": "^5.4|^6.0" + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0" }, "suggest": { "symfony/mime": "To use the file extension guesser" }, - "time": "2022-01-02T09:55:41+00:00", + "time": "2022-01-02T09:53:40+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5705,7 +5657,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.0.3" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.3" }, "funding": [ { @@ -5725,61 +5677,64 @@ }, { "name": "symfony/http-kernel", - "version": "v6.0.4", - "version_normalized": "6.0.4.0", + "version": "v5.4.4", + "version_normalized": "5.4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "9dce179ce52b0f4f669c07fd5e465e5d809a5d3b" + "reference": "49f40347228c773688a0488feea0175aa7f4d268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9dce179ce52b0f4f669c07fd5e465e5d809a5d3b", - "reference": "9dce179ce52b0f4f669c07fd5e465e5d809a5d3b", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/49f40347228c773688a0488feea0175aa7f4d268", + "reference": "49f40347228c773688a0488feea0175aa7f4d268", "shasum": "" }, "require": { - "php": ">=8.0.2", - "psr/log": "^1|^2|^3", - "symfony/error-handler": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/polyfill-ctype": "^1.8" + "php": ">=7.2.5", + "psr/log": "^1|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^5.0|^6.0", + "symfony/http-foundation": "^5.3.7|^6.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16" }, "conflict": { "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.4", - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/doctrine-bridge": "<5.4", - "symfony/form": "<5.4", - "symfony/http-client": "<5.4", - "symfony/mailer": "<5.4", - "symfony/messenger": "<5.4", - "symfony/translation": "<5.4", - "symfony/twig-bridge": "<5.4", - "symfony/validator": "<5.4", + "symfony/cache": "<5.0", + "symfony/config": "<5.0", + "symfony/console": "<4.4", + "symfony/dependency-injection": "<5.3", + "symfony/doctrine-bridge": "<5.0", + "symfony/form": "<5.0", + "symfony/http-client": "<5.0", + "symfony/mailer": "<5.0", + "symfony/messenger": "<5.0", + "symfony/translation": "<5.0", + "symfony/twig-bridge": "<5.0", + "symfony/validator": "<5.0", "twig/twig": "<2.13" }, "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/dom-crawler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", + "symfony/config": "^5.0|^6.0", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/css-selector": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.3|^6.0", + "symfony/dom-crawler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^5.4|^6.0", - "symfony/routing": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/routing": "^4.4|^5.0|^6.0", + "symfony/stopwatch": "^4.4|^5.0|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", "symfony/translation-contracts": "^1.1|^2|^3", "twig/twig": "^2.13|^3.0.4" }, @@ -5789,7 +5744,7 @@ "symfony/console": "", "symfony/dependency-injection": "" }, - "time": "2022-01-29T18:12:46+00:00", + "time": "2022-01-29T18:08:07+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5817,7 +5772,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.0.4" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.4" }, "funding": [ { @@ -5837,39 +5792,41 @@ }, { "name": "symfony/mime", - "version": "v6.0.3", - "version_normalized": "6.0.3.0", + "version": "v5.4.3", + "version_normalized": "5.4.3.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "2cd9601efd040e56f43360daa68f3c6b0534923a" + "reference": "e1503cfb5c9a225350f549d3bb99296f4abfb80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/2cd9601efd040e56f43360daa68f3c6b0534923a", - "reference": "2cd9601efd040e56f43360daa68f3c6b0534923a", + "url": "https://api.github.com/repos/symfony/mime/zipball/e1503cfb5c9a225350f549d3bb99296f4abfb80f", + "reference": "e1503cfb5c9a225350f549d3bb99296f4abfb80f", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16" }, "conflict": { "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<5.4" + "symfony/mailer": "<4.4" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0" + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/property-access": "^4.4|^5.1|^6.0", + "symfony/property-info": "^4.4|^5.1|^6.0", + "symfony/serializer": "^5.2|^6.0" }, - "time": "2022-01-02T09:55:41+00:00", + "time": "2022-01-02T09:53:40+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5901,7 +5858,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.0.3" + "source": "https://github.com/symfony/mime/tree/v5.4.3" }, "funding": [ { @@ -6430,6 +6387,88 @@ ], "install-path": "../symfony/polyfill-php72" }, + { + "name": "symfony/polyfill-php73", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2021-06-05T21:20:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php73" + }, { "name": "symfony/polyfill-php80", "version": "v1.24.0", @@ -6518,23 +6557,24 @@ }, { "name": "symfony/process", - "version": "v6.0.3", - "version_normalized": "6.0.3.0", + "version": "v5.4.3", + "version_normalized": "5.4.3.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "298ed357274c1868c20a0061df256a1250a6c4af" + "reference": "553f50487389a977eb31cf6b37faae56da00f753" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/298ed357274c1868c20a0061df256a1250a6c4af", - "reference": "298ed357274c1868c20a0061df256a1250a6c4af", + "url": "https://api.github.com/repos/symfony/process/zipball/553f50487389a977eb31cf6b37faae56da00f753", + "reference": "553f50487389a977eb31cf6b37faae56da00f753", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, - "time": "2022-01-26T17:23:29+00:00", + "time": "2022-01-26T16:28:35+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6562,7 +6602,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.0.3" + "source": "https://github.com/symfony/process/tree/v5.4.3" }, "funding": [ { @@ -6582,36 +6622,38 @@ }, { "name": "symfony/routing", - "version": "v6.0.3", - "version_normalized": "6.0.3.0", + "version": "v5.4.3", + "version_normalized": "5.4.3.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "b1debdf7a40e6bc7eee0f363ab9dd667fe04f099" + "reference": "44b29c7a94e867ccde1da604792f11a469958981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/b1debdf7a40e6bc7eee0f363ab9dd667fe04f099", - "reference": "b1debdf7a40e6bc7eee0f363ab9dd667fe04f099", + "url": "https://api.github.com/repos/symfony/routing/zipball/44b29c7a94e867ccde1da604792f11a469958981", + "reference": "44b29c7a94e867ccde1da604792f11a469958981", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "conflict": { "doctrine/annotations": "<1.12", - "symfony/config": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/yaml": "<5.4" + "symfony/config": "<5.3", + "symfony/dependency-injection": "<4.4", + "symfony/yaml": "<4.4" }, "require-dev": { "doctrine/annotations": "^1.12", "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "symfony/config": "^5.3|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0" }, "suggest": { "symfony/config": "For using the all-in-one router or any loader", @@ -6619,7 +6661,7 @@ "symfony/http-foundation": "For using a Symfony Request object", "symfony/yaml": "For using the YAML loader" }, - "time": "2022-01-02T09:55:41+00:00", + "time": "2022-01-02T09:53:40+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6653,7 +6695,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.0.3" + "source": "https://github.com/symfony/routing/tree/v5.4.3" }, "funding": [ { @@ -6673,22 +6715,22 @@ }, { "name": "symfony/service-contracts", - "version": "v3.0.0", - "version_normalized": "3.0.0.0", + "version": "v2.4.1", + "version_normalized": "2.4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603" + "reference": "d664541b99d6fb0247ec5ff32e87238582236204" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603", - "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d664541b99d6fb0247ec5ff32e87238582236204", + "reference": "d664541b99d6fb0247ec5ff32e87238582236204", "shasum": "" }, "require": { - "php": ">=8.0.2", - "psr/container": "^2.0" + "php": ">=7.2.5", + "psr/container": "^1.1" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -6696,11 +6738,11 @@ "suggest": { "symfony/service-implementation": "" }, - "time": "2021-11-04T17:53:12+00:00", + "time": "2021-11-04T16:37:19+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -6738,7 +6780,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.0.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.4.1" }, "funding": [ { @@ -7276,17 +7318,17 @@ }, { "name": "voku/portable-ascii", - "version": "2.0.0", - "version_normalized": "2.0.0.0", + "version": "1.6.1", + "version_normalized": "1.6.1.0", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "9bd89e83cecdf8c37b64909454249eaed98b2c89" + "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/9bd89e83cecdf8c37b64909454249eaed98b2c89", - "reference": "9bd89e83cecdf8c37b64909454249eaed98b2c89", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a", + "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a", "shasum": "" }, "require": { @@ -7298,7 +7340,7 @@ "suggest": { "ext-intl": "Use Intl for transliterator_transliterate() support" }, - "time": "2022-01-24T18:59:03+00:00", + "time": "2022-01-24T18:55:24+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7325,7 +7367,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/2.0.0" + "source": "https://github.com/voku/portable-ascii/tree/1.6.1" }, "funding": [ { diff --git a/core/vendor/composer/installed.php b/core/vendor/composer/installed.php index 096e3cc17d..2a95f94112 100644 --- a/core/vendor/composer/installed.php +++ b/core/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'fc03d29b8ecc6a7748762cd51755170db1f778b8', + 'reference' => 'd1c6e692fccc0b04438bcc9201420d37c6c22a01', 'name' => 'evolutioncms/core', 'dev' => true, ), @@ -20,12 +20,12 @@ 'dev_requirement' => false, ), 'composer/composer' => array( - 'pretty_version' => '2.1.12', - 'version' => '2.1.12.0', + 'pretty_version' => '2.2.6', + 'version' => '2.2.6.0', 'type' => 'library', 'install_path' => __DIR__ . '/./composer', 'aliases' => array(), - 'reference' => '6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0', + 'reference' => 'ce785a18c0fb472421e52d958bab339247cb0e82', 'dev_requirement' => false, ), 'composer/metadata-minifier' => array( @@ -137,12 +137,12 @@ 'dev_requirement' => false, ), 'egulias/email-validator' => array( - 'pretty_version' => '3.1.2', - 'version' => '3.1.2.0', + 'pretty_version' => '2.1.25', + 'version' => '2.1.25.0', 'type' => 'library', 'install_path' => __DIR__ . '/../egulias/email-validator', 'aliases' => array(), - 'reference' => 'ee0db30118f661fb166bcffbf5d82032df484697', + 'reference' => '0dbf5d78455d4d6a41d186da50adc1122ec066f4', 'dev_requirement' => false, ), 'evolution-cms/salo' => array( @@ -178,7 +178,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'fc03d29b8ecc6a7748762cd51755170db1f778b8', + 'reference' => 'd1c6e692fccc0b04438bcc9201420d37c6c22a01', 'dev_requirement' => false, ), 'graham-campbell/result-type' => array( @@ -218,210 +218,201 @@ 'dev_requirement' => false, ), 'illuminate/bus' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/bus', 'aliases' => array(), - 'reference' => 'b8eeab8d43bc4085e882bfc8583cab6ced4c29e8', + 'reference' => '917798f4a21c5eed1f83f9b434ce94f9c4fa8432', 'dev_requirement' => false, ), 'illuminate/cache' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/cache', 'aliases' => array(), - 'reference' => '52ead4fcaf61d900a17990b06af5656755ca30e2', + 'reference' => '341b4f98a0de928d5af990f4e75acb5b34948569', 'dev_requirement' => false, ), 'illuminate/collections' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/collections', 'aliases' => array(), - 'reference' => '707ab36191228b1a4cf322985796ff7aab5578c1', - 'dev_requirement' => false, - ), - 'illuminate/conditionable' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../illuminate/conditionable', - 'aliases' => array(), - 'reference' => '4f7e3d67ceda9a6188757501748982ea9ed5f69a', + 'reference' => '5cf7ed1c0a1b8049576b29f5cab5c822149aaa91', 'dev_requirement' => false, ), 'illuminate/config' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/config', 'aliases' => array(), - 'reference' => 'd2dc74fdcc89239e1910a8d08b2b2e5ad26a043c', + 'reference' => 'feac56ab7a5c70cf2dc60dffe4323eb9851f51a8', 'dev_requirement' => false, ), 'illuminate/console' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/console', 'aliases' => array(), - 'reference' => 'cb3486758b07ae824bc763592d414973a17658b7', + 'reference' => 'd93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf', 'dev_requirement' => false, ), 'illuminate/container' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), - 'reference' => 'b249d566e8f93b9255d84f4c06a8cc7db24c900c', + 'reference' => '14062628d05f75047c5a1360b9350028427d568e', 'dev_requirement' => false, ), 'illuminate/contracts' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), - 'reference' => 'c2e3cf2eda10fd3332af0b4a43481cc0af98c437', + 'reference' => '5e0fd287a1b22a6b346a9f7cd484d8cf0234585d', 'dev_requirement' => false, ), 'illuminate/database' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/database', 'aliases' => array(), - 'reference' => '9a65ca2100cada21ab2e65032821e5d3264da008', + 'reference' => '463de5a2028138d7f4749f072bb809288d8bd2fe', 'dev_requirement' => false, ), 'illuminate/events' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/events', 'aliases' => array(), - 'reference' => 'b58e0e9b5afc3770505a2694c50afb23d973a75e', + 'reference' => 'b7f06cafb6c09581617f2ca05d69e9b159e5a35d', 'dev_requirement' => false, ), 'illuminate/filesystem' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/filesystem', 'aliases' => array(), - 'reference' => '8fbb541a9d45ca5dcd459bde9fb23082371f48a9', + 'reference' => '73db3e9a233ed587ba54f52ab8580f3c7bc872b2', 'dev_requirement' => false, ), 'illuminate/http' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/http', 'aliases' => array(), - 'reference' => 'e0248518e2292eb46a4f019396569f760a07ab5e', + 'reference' => '3966c05c38096e15cb86e44201fc5f5731d1f3ad', 'dev_requirement' => false, ), 'illuminate/log' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/log', 'aliases' => array(), - 'reference' => 'fd12e6928cfdf5303124cbe167a8ce16308502cb', + 'reference' => '1dbdc6aca24d1d2b5903f865bb206039d4b800b2', 'dev_requirement' => false, ), 'illuminate/macroable' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/macroable', 'aliases' => array(), - 'reference' => '25a2c6dac2b7541ecbadef952702e84ae15f5354', + 'reference' => 'aed81891a6e046fdee72edd497f822190f61c162', 'dev_requirement' => false, ), 'illuminate/pagination' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pagination', 'aliases' => array(), - 'reference' => 'c4b992cebde5d0cb5091613f2df7ecf850d96dec', + 'reference' => 'a0a5784a052663fb044baed95f56801b57c2d002', 'dev_requirement' => false, ), 'illuminate/pipeline' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pipeline', 'aliases' => array(), - 'reference' => '723820323d87a2c22f017ce7ea124d08e4b65f29', + 'reference' => '23aeff5b26ae4aee3f370835c76bd0f4e93f71d2', 'dev_requirement' => false, ), 'illuminate/redis' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/redis', 'aliases' => array(), - 'reference' => '54371f29284d4035fb837b56360f5e9c6c8e520f', + 'reference' => '0fee121324054226823a59623fab3d98ad88fbd5', 'dev_requirement' => false, ), 'illuminate/routing' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/routing', 'aliases' => array(), - 'reference' => '66cf35da072e1bb528ef34434a5e968e29e34f58', + 'reference' => '791f1a5a626f421b101b64551cf2bc422e541049', 'dev_requirement' => false, ), 'illuminate/session' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/session', 'aliases' => array(), - 'reference' => 'bbda6e9c6fbb61c522fcd5e0a196735b0c628ae5', + 'reference' => '9c9988d7229d888c098eebbbb9fcb8c68580411c', 'dev_requirement' => false, ), 'illuminate/support' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/support', 'aliases' => array(), - 'reference' => 'cb117bc9a3358d60ade85e5a13d6b82f40ee6049', + 'reference' => 'fe5469faa982e2dd8c2f5978b23cf881e3715d1b', 'dev_requirement' => false, ), 'illuminate/translation' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/translation', 'aliases' => array(), - 'reference' => '8bdac1ceea6be67e8f1c93ad68ac4abe1f91df3f', + 'reference' => 'c10a68f37f590dc8c1c1fe5b6ad3f09381282137', 'dev_requirement' => false, ), 'illuminate/validation' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/validation', 'aliases' => array(), - 'reference' => '805f5fd17a75ce24d7e39a833000ea698d55a695', + 'reference' => '49b1cfd3a32f04255eed68fc1c304659de50e374', 'dev_requirement' => false, ), 'illuminate/view' => array( - 'pretty_version' => 'v9.1.0', - 'version' => '9.1.0.0', + 'pretty_version' => 'v8.83.1', + 'version' => '8.83.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/view', 'aliases' => array(), - 'reference' => 'b580a1bcfa76900a59108f86e5cd3ac6c9a3d722', + 'reference' => 'f9f3ab882025d61d72a6383679fcadd08e79fbcf', 'dev_requirement' => false, ), 'james-heinrich/phpthumb' => array( @@ -506,18 +497,18 @@ 'dev_requirement' => false, ), 'psr/container' => array( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', + 'pretty_version' => '1.1.2', + 'version' => '1.1.2.0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', + 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', 'dev_requirement' => false, ), 'psr/container-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '1.1|2.0', + 0 => '1.0', ), ), 'psr/event-dispatcher' => array( @@ -592,23 +583,23 @@ 'psr/log-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '1.0.0 || 2.0.0 || 3.0.0', - 1 => '1.0|2.0|3.0', + 0 => '1.0|2.0', + 1 => '1.0.0 || 2.0.0 || 3.0.0', ), ), 'psr/simple-cache' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), - 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', + 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', 'dev_requirement' => false, ), 'psr/simple-cache-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '1.0|2.0|3.0', + 0 => '1.0', ), ), 'ralouphie/getallheaders' => array( @@ -684,12 +675,12 @@ 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v6.0.3', - 'version' => '6.0.3.0', + 'pretty_version' => 'v5.4.3', + 'version' => '5.4.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), - 'reference' => '22e8efd019c3270c4f79376234a3f8752cd25490', + 'reference' => 'a2a86ec353d825c75856c6fd14fac416a7bdb6b8', 'dev_requirement' => false, ), 'symfony/deprecation-contracts' => array( @@ -744,39 +735,39 @@ 'dev_requirement' => false, ), 'symfony/finder' => array( - 'pretty_version' => 'v6.0.3', - 'version' => '6.0.3.0', + 'pretty_version' => 'v5.4.3', + 'version' => '5.4.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), - 'reference' => '8661b74dbabc23223f38c9b99d3f8ade71170430', + 'reference' => '231313534dded84c7ecaa79d14bc5da4ccb69b7d', 'dev_requirement' => false, ), 'symfony/http-foundation' => array( - 'pretty_version' => 'v6.0.3', - 'version' => '6.0.3.0', + 'pretty_version' => 'v5.4.3', + 'version' => '5.4.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-foundation', 'aliases' => array(), - 'reference' => 'ad157299ced81a637fade1efcadd688d6deba5c1', + 'reference' => 'ef409ff341a565a3663157d4324536746d49a0c7', 'dev_requirement' => false, ), 'symfony/http-kernel' => array( - 'pretty_version' => 'v6.0.4', - 'version' => '6.0.4.0', + 'pretty_version' => 'v5.4.4', + 'version' => '5.4.4.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-kernel', 'aliases' => array(), - 'reference' => '9dce179ce52b0f4f669c07fd5e465e5d809a5d3b', + 'reference' => '49f40347228c773688a0488feea0175aa7f4d268', 'dev_requirement' => false, ), 'symfony/mime' => array( - 'pretty_version' => 'v6.0.3', - 'version' => '6.0.3.0', + 'pretty_version' => 'v5.4.3', + 'version' => '5.4.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/mime', 'aliases' => array(), - 'reference' => '2cd9601efd040e56f43360daa68f3c6b0534923a', + 'reference' => 'e1503cfb5c9a225350f549d3bb99296f4abfb80f', 'dev_requirement' => false, ), 'symfony/polyfill-ctype' => array( @@ -833,6 +824,15 @@ 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', 'dev_requirement' => false, ), + 'symfony/polyfill-php73' => array( + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php73', + 'aliases' => array(), + 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5', + 'dev_requirement' => false, + ), 'symfony/polyfill-php80' => array( 'pretty_version' => 'v1.24.0', 'version' => '1.24.0.0', @@ -843,30 +843,30 @@ 'dev_requirement' => false, ), 'symfony/process' => array( - 'pretty_version' => 'v6.0.3', - 'version' => '6.0.3.0', + 'pretty_version' => 'v5.4.3', + 'version' => '5.4.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), - 'reference' => '298ed357274c1868c20a0061df256a1250a6c4af', + 'reference' => '553f50487389a977eb31cf6b37faae56da00f753', 'dev_requirement' => false, ), 'symfony/routing' => array( - 'pretty_version' => 'v6.0.3', - 'version' => '6.0.3.0', + 'pretty_version' => 'v5.4.3', + 'version' => '5.4.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/routing', 'aliases' => array(), - 'reference' => 'b1debdf7a40e6bc7eee0f363ab9dd667fe04f099', + 'reference' => '44b29c7a94e867ccde1da604792f11a469958981', 'dev_requirement' => false, ), 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.0.0', - 'version' => '3.0.0.0', + 'pretty_version' => 'v2.4.1', + 'version' => '2.4.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), - 'reference' => '36715ebf9fb9db73db0cb24263c79077c6fe8603', + 'reference' => 'd664541b99d6fb0247ec5ff32e87238582236204', 'dev_requirement' => false, ), 'symfony/string' => array( @@ -930,12 +930,12 @@ 'dev_requirement' => false, ), 'voku/portable-ascii' => array( - 'pretty_version' => '2.0.0', - 'version' => '2.0.0.0', + 'pretty_version' => '1.6.1', + 'version' => '1.6.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../voku/portable-ascii', 'aliases' => array(), - 'reference' => '9bd89e83cecdf8c37b64909454249eaed98b2c89', + 'reference' => '87337c91b9dfacee02452244ee14ab3c43bc485a', 'dev_requirement' => false, ), 'wikimedia/composer-merge-plugin' => array( diff --git a/core/vendor/egulias/email-validator/CHANGELOG.md b/core/vendor/egulias/email-validator/CHANGELOG.md deleted file mode 100644 index 83fd62e024..0000000000 --- a/core/vendor/egulias/email-validator/CHANGELOG.md +++ /dev/null @@ -1,33 +0,0 @@ -# EmailValidator v3 Changelog - -## New Features - -* Access to local part and domain part from EmailParser -* Validations outside of the scope of the RFC will be considered "extra" validations, thus opening the door for adding new; will live in their own folder "extra" (as requested in #248, #195, #183). - -## Breacking changes - -* PHP version upgraded to match Symfony's (as of 12/2020). -* DNSCheckValidation now fails for missing MX records. While the RFC argues that the existence of only A records to be valid, starting in v3 they will be considered invalid. -* Emails domain part are now intenteded to be RFC 1035 compliant, rendering previous valid emails (e.g example@examp&) invalid. - -## PHP versions upgrade policy -PHP version upgrade requirement will happen via MINOR (3.x) version upgrades of the library, following the adoption level by major frameworks. - -## Changes -* #235 -* #215 -* #130 -* #258 -* #188 -* #181 -* #217 -* #214 -* #249 -* #236 -* #257 -* #210 - -## Thanks -To contributors, be it with PRs, reporting issues or supporting otherwise. - diff --git a/core/vendor/egulias/email-validator/CONTRIBUTING.md b/core/vendor/egulias/email-validator/CONTRIBUTING.md deleted file mode 100644 index 7b79e10816..0000000000 --- a/core/vendor/egulias/email-validator/CONTRIBUTING.md +++ /dev/null @@ -1,153 +0,0 @@ -# Contributing - -When contributing to this repository make sure to follow the Pull request process below. -Reduce to the minimum 3rd party dependencies. - -Please note we have a [code of conduct](#Code of Conduct), please follow it in all your interactions with the project. - -## Pull Request Process - -When doing a PR to v2 remember that you also have to do the PR port to v3, or tests confirming the bug is not reproducible. - -1. Supported version is v3. If you are fixing a bug in v2, please port to v3 -2. Use the title as a brief description of the changes -3. Describe the changes you are proposing - 1. If adding an extra validation state the benefits of adding it and the problem is solving - 2. Document in the readme, by adding it to the list -4. Provide appropiate tests for the code you are submitting: aim to keep the existing coverage percentage. -5. Add your Twitter handle (if you have) so we can thank you there. - -## License -By contributing, you agree that your contributions will be licensed under its MIT License. - -## Code of Conduct - -### Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -### Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -### Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -### Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -### Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at <emailvalidatorrfc.ccreport@gmail.com>. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -#### Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -#### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -#### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -#### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -#### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -### Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available -at [https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/core/vendor/egulias/email-validator/LICENSE b/core/vendor/egulias/email-validator/LICENSE index 1f0f2678a0..c34d2c197d 100644 --- a/core/vendor/egulias/email-validator/LICENSE +++ b/core/vendor/egulias/email-validator/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2021 Eduardo Gulias Davis +Copyright (c) 2013-2016 Eduardo Gulias Davis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/core/vendor/egulias/email-validator/composer.json b/core/vendor/egulias/email-validator/composer.json index d598d1b622..a275696ab2 100644 --- a/core/vendor/egulias/email-validator/composer.json +++ b/core/vendor/egulias/email-validator/composer.json @@ -9,18 +9,18 @@ ], "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.1.x-dev" } }, "require": { - "php": ">=7.2", - "doctrine/lexer": "^1.2", - "symfony/polyfill-intl-idn": "^1.15" + "php": ">=5.5", + "doctrine/lexer": "^1.0.1", + "symfony/polyfill-intl-idn": "^1.10" }, "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^8.5.8|^9.3.3", - "vimeo/psalm": "^4" + "dominicsayers/isemail": "^3.0.7", + "phpunit/phpunit": "^4.8.36|^7.5.15", + "satooshi/php-coveralls": "^1.0.1" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" diff --git a/core/vendor/egulias/email-validator/composer.lock b/core/vendor/egulias/email-validator/composer.lock deleted file mode 100644 index c575e7fce8..0000000000 --- a/core/vendor/egulias/email-validator/composer.lock +++ /dev/null @@ -1,4440 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "a77d36b64bc1213fecf4d4f92d759c3b", - "packages": [ - { - "name": "doctrine/lexer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2020-05-25T17:44:05+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/2d63434d922daf7da8dd863e7907e67ee3031483", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-22T09:19:47+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-22T09:19:47+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - } - ], - "packages-dev": [ - { - "name": "amphp/amp", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/amphp/amp.git", - "reference": "efca2b32a7580087adb8aabbff6be1dc1bb924a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/efca2b32a7580087adb8aabbff6be1dc1bb924a9", - "reference": "efca2b32a7580087adb8aabbff6be1dc1bb924a9", - "shasum": "" - }, - "require": { - "php": ">=7" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6.0.9 | ^7", - "psalm/phar": "^3.11@dev", - "react/promise": "^2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Amp\\": "lib" - }, - "files": [ - "lib/functions.php", - "lib/Internal/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Lowrey", - "email": "rdlowrey@php.net" - }, - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "http://amphp.org/amp", - "keywords": [ - "async", - "asynchronous", - "awaitable", - "concurrency", - "event", - "event-loop", - "future", - "non-blocking", - "promise" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2021-01-10T17:06:37+00:00" - }, - { - "name": "amphp/byte-stream", - "version": "v1.8.0", - "source": { - "type": "git", - "url": "https://github.com/amphp/byte-stream.git", - "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/f0c20cf598a958ba2aa8c6e5a71c697d652c7088", - "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.4", - "friendsofphp/php-cs-fixer": "^2.3", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6 || ^7 || ^8", - "psalm/phar": "^3.11.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Amp\\ByteStream\\": "lib" - }, - "files": [ - "lib/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", - "keywords": [ - "amp", - "amphp", - "async", - "io", - "non-blocking", - "stream" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/master" - }, - "time": "2020-06-29T18:35:05+00:00" - }, - { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.1", - "source": { - "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "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.1" - }, - "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": "2020-11-11T10:22:58+00:00" - }, - { - "name": "composer/semver", - "version": "3.2.4", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", - "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.54", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.4" - }, - "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": "2020-11-13T08:59:24+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f28d44c286812c714741478d968104c5e604a1d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4", - "reference": "f28d44c286812c714741478d968104c5e604a1d4", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "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.5" - }, - "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": "2020-11-13T08:04:11+00:00" - }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "v0.1.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "support": { - "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", - "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" - }, - "time": "2019-12-04T15:06:13+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2020-11-10T18:47:58+00:00" - }, - { - "name": "felixfbecker/advanced-json-rpc", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "06f0b06043c7438959dbdeed8bb3f699a19be22e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/06f0b06043c7438959dbdeed8bb3f699a19be22e", - "reference": "06f0b06043c7438959dbdeed8bb3f699a19be22e", - "shasum": "" - }, - "require": { - "netresearch/jsonmapper": "^1.0 || ^2.0", - "php": "^7.1 || ^8.0", - "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "AdvancedJsonRpc\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "A more advanced JSONRPC implementation", - "support": { - "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", - "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.0" - }, - "time": "2021-01-10T17:48:47+00:00" - }, - { - "name": "felixfbecker/language-server-protocol", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/9d846d1f5cf101deee7a61c8ba7caa0a975cd730", - "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpstan/phpstan": "*", - "squizlabs/php_codesniffer": "^3.1", - "vimeo/psalm": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "LanguageServerProtocol\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "PHP classes for the Language Server Protocol", - "keywords": [ - "language", - "microsoft", - "php", - "server" - ], - "support": { - "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/1.5.1" - }, - "time": "2021-02-22T14:02:09+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "7.2.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0aa74dfb41ae110835923ef10a9d803a22d50e79", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.4", - "guzzlehttp/psr7": "^1.7", - "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0" - }, - "provide": { - "psr/http-client-implementation": "1.0" - }, - "require-dev": { - "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", - "psr/log": "^1.1" - }, - "suggest": { - "ext-curl": "Required for CURL handler support", - "ext-intl": "Required for Internationalized Domain Name (IDN) support", - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.1-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "psr-18", - "psr-7", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.2.0" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://github.com/alexeyshockov", - "type": "github" - }, - { - "url": "https://github.com/gmponos", - "type": "github" - } - ], - "time": "2020-10-10T11:47:56+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "60d379c243457e073cff02bc323a2a86cb355631" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", - "reference": "60d379c243457e073cff02bc323a2a86cb355631", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.0" - }, - "time": "2020-09-30T07:37:28+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.7.0" - }, - "time": "2020-09-30T07:37:11+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.10.2", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2020-11-13T09:40:50+00:00" - }, - { - "name": "netresearch/jsonmapper", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e0f1e33a71587aca81be5cffbb9746510e1fe04e", - "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0", - "squizlabs/php_codesniffer": "~3.5" - }, - "type": "library", - "autoload": { - "psr-0": { - "JsonMapper": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "OSL-3.0" - ], - "authors": [ - { - "name": "Christian Weiske", - "email": "cweiske@cweiske.de", - "homepage": "http://github.com/cweiske/jsonmapper/", - "role": "Developer" - } - ], - "description": "Map nested JSON structures onto PHP classes", - "support": { - "email": "cweiske@cweiske.de", - "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/master" - }, - "time": "2020-04-16T18:48:43+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.10.4", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4" - }, - "time": "2020-12-20T10:01:03+00:00" - }, - { - "name": "openlss/lib-array2xml", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nullivex/lib-array2xml.git", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "LSS": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Bryan Tong", - "email": "bryan@nullivex.com", - "homepage": "https://www.nullivex.com" - }, - { - "name": "Tony Butler", - "email": "spudz76@gmail.com", - "homepage": "https://www.nullivex.com" - } - ], - "description": "Array2XML conversion library credit to lalit.org", - "homepage": "https://www.nullivex.com", - "keywords": [ - "array", - "array conversion", - "xml", - "xml conversion" - ], - "support": { - "issues": "https://github.com/nullivex/lib-array2xml/issues", - "source": "https://github.com/nullivex/lib-array2xml/tree/master" - }, - "time": "2019-03-29T20:06:56+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" - }, - "time": "2020-06-27T14:33:11+00:00" - }, - { - "name": "phar-io/version", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.1.0" - }, - "time": "2021-02-23T14:00:09+00:00" - }, - { - "name": "php-coveralls/php-coveralls", - "version": "v2.4.3", - "source": { - "type": "git", - "url": "https://github.com/php-coveralls/php-coveralls.git", - "reference": "909381bd40a17ae6e9076051f0d73293c1c091af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/909381bd40a17ae6e9076051f0d73293c1c091af", - "reference": "909381bd40a17ae6e9076051f0d73293c1c091af", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-simplexml": "*", - "guzzlehttp/guzzle": "^6.0 || ^7.0", - "php": "^5.5 || ^7.0 || ^8.0", - "psr/log": "^1.0", - "symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0", - "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0", - "symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0 || ^8.0 || ^9.0", - "sanmai/phpunit-legacy-adapter": "^6.1 || ^8.0" - }, - "suggest": { - "symfony/http-kernel": "Allows Symfony integration" - }, - "bin": [ - "bin/php-coveralls" - ], - "type": "library", - "autoload": { - "psr-4": { - "PhpCoveralls\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp", - "role": "Original creator" - }, - { - "name": "Takashi Matsuo", - "email": "tmatsuo@google.com" - }, - { - "name": "Google Inc" - }, - { - "name": "Dariusz Ruminski", - "email": "dariusz.ruminski@gmail.com", - "homepage": "https://github.com/keradus" - }, - { - "name": "Contributors", - "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/php-coveralls/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "support": { - "issues": "https://github.com/php-coveralls/php-coveralls/issues", - "source": "https://github.com/php-coveralls/php-coveralls/tree/v2.4.3" - }, - "time": "2020-12-24T09:17:03+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.2.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" - }, - "time": "2020-09-03T19:13:55+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" - }, - "time": "2020-09-17T18:55:26+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.12.2", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "245710e971a030f42e08f4912863805570f23d39" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", - "reference": "245710e971a030f42e08f4912863805570f23d39", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.12.2" - }, - "time": "2020-12-19T10:15:11+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "7.0.14", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "bb7c9a210c72e4709cdde67f8b7362f672f2225c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bb7c9a210c72e4709cdde67f8b7362f672f2225c", - "reference": "bb7c9a210c72e4709cdde67f8b7362f672f2225c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": ">=7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.1 || ^4.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.14" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-12-02T13:39:03+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4b49fb70f067272b659ef0174ff9ca40fdaa6357", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:25:21+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:20:02+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "3.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "472b687829041c24b25f475e14c2f38a09edf1c2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/472b687829041c24b25f475e14c2f38a09edf1c2", - "reference": "472b687829041c24b25f475e14c2f38a09edf1c2", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "abandoned": true, - "time": "2020-11-30T08:38:46+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "8.5.14", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c25f79895d27b6ecd5abfa63de1606b786a461a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c25f79895d27b6ecd5abfa63de1606b786a461a3", - "reference": "c25f79895d27b6ecd5abfa63de1606b786a461a3", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.1", - "phar-io/version": "^3.0.2", - "php": ">=7.2", - "phpspec/prophecy": "^1.10.3", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.2", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.14" - }, - "funding": [ - { - "url": "https://phpunit.de/donate.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-01-17T07:37:30+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" - }, - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/http-client", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client/tree/master" - }, - "time": "2020-06-29T06:28:15+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "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": "http://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.3" - }, - "time": "2020-03-23T09:12:05+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:15:22+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:04:30+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:59:04+00:00" - }, - { - "name": "sebastian/environment", - "version": "4.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:53:42+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/6b853149eab67d4da22291d36f5b0631c0fd856e", - "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:47:53+00:00" - }, - { - "name": "sebastian/global-state", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/474fb9edb7ab891665d3bfc6317f42a0a150454b", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:43:24+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:40:27+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:37:18+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:34:24+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:30:19+00:00" - }, - { - "name": "sebastian/type", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:25:11+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "symfony/config", - "version": "v5.2.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "50e0e1314a3b2609d32b6a5a0d0fb5342494c4ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/50e0e1314a3b2609d32b6a5a0d0fb5342494c4ab", - "reference": "50e0e1314a3b2609d32b6a5a0d0fb5342494c4ab", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/filesystem": "^4.4|^5.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.15" - }, - "conflict": { - "symfony/finder": "<4.4" - }, - "require-dev": { - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/finder": "^4.4|^5.0", - "symfony/messenger": "^4.4|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/yaml": "^4.4|^5.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "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": "Helps you find, load, combine, autofill and validate configuration values of any kind", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/config/tree/v5.2.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": "2021-01-27T10:15:41+00:00" - }, - { - "name": "symfony/console", - "version": "v5.2.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "89d4b176d12a2946a1ae4e34906a025b7b6b135a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/89d4b176d12a2946a1ae4e34906a025b7b6b135a", - "reference": "89d4b176d12a2946a1ae4e34906a025b7b6b135a", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" - }, - "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "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" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "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": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v5.2.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": "2021-01-28T22:06:19+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/master" - }, - "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": "2020-09-07T11:33:47+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v5.2.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "262d033b57c73e8b59cd6e68a45c528318b15038" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/262d033b57c73e8b59cd6e68a45c528318b15038", - "reference": "262d033b57c73e8b59cd6e68a45c528318b15038", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8" - }, - "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.2.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": "2021-01-27T10:01:46+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5601e09b69f26c1828b13b6bb87cb07cddba3170", - "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-22T09:19:47+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-22T09:19:47+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/master" - }, - "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": "2020-09-07T11:33:47+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v5.2.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b12274acfab9d9850c52583d136a24398cdf1a0c", - "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1.0|^2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "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 a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.2.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": "2021-01-27T10:15:41+00:00" - }, - { - "name": "symfony/string", - "version": "v5.2.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "c95468897f408dd0aca2ff582074423dd0455122" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/c95468897f408dd0aca2ff582074423dd0455122", - "reference": "c95468897f408dd0aca2ff582074423dd0455122", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" - }, - "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "files": [ - "Resources/functions.php" - ], - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v5.2.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": "2021-01-25T15:14:59+00:00" - }, - { - "name": "symfony/yaml", - "version": "v5.2.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "338cddc6d74929f6adf19ca5682ac4b8e109cdb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/338cddc6d74929f6adf19ca5682ac4b8e109cdb0", - "reference": "338cddc6d74929f6adf19ca5682ac4b8e109cdb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<4.4" - }, - "require-dev": { - "symfony/console": "^4.4|^5.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "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": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v5.2.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": "2021-02-03T04:42:09+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2020-07-12T23:59:07+00:00" - }, - { - "name": "vimeo/psalm", - "version": "4.6.2", - "source": { - "type": "git", - "url": "https://github.com/vimeo/psalm.git", - "reference": "bca09d74adc704c4eaee36a3c3e9d379e290fc3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/bca09d74adc704c4eaee36a3c3e9d379e290fc3b", - "reference": "bca09d74adc704c4eaee36a3c3e9d379e290fc3b", - "shasum": "" - }, - "require": { - "amphp/amp": "^2.1", - "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", - "dnoegel/php-xdg-base-dir": "^0.1.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.10.1", - "openlss/lib-array2xml": "^1.0", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.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||^6.0", - "ext-curl": "*", - "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": "^9.0", - "psalm/plugin-phpunit": "^0.13", - "slevomat/coding-standard": "^6.3.11", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3", - "weirdan/prophecy-shim": "^1.0 || ^2.0" - }, - "suggest": { - "ext-igbinary": "^2.0.5" - }, - "bin": [ - "psalm", - "psalm-language-server", - "psalm-plugin", - "psalm-refactor", - "psalter" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev", - "dev-3.x": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psalm\\": "src/Psalm/" - }, - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthew Brown" - } - ], - "description": "A static analysis tool for finding errors in PHP applications", - "keywords": [ - "code", - "inspection", - "php" - ], - "support": { - "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.6.2" - }, - "time": "2021-02-26T02:24:18+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" - }, - "time": "2020-07-08T17:02:28+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "time": "2015-12-17T08:42:14+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.2" - }, - "platform-dev": [], - "plugin-api-version": "2.0.0" -} diff --git a/core/vendor/egulias/email-validator/src/EmailLexer.php b/core/vendor/egulias/email-validator/src/EmailLexer.php index 41e9ea948b..59dcd5876f 100644 --- a/core/vendor/egulias/email-validator/src/EmailLexer.php +++ b/core/vendor/egulias/email-validator/src/EmailLexer.php @@ -7,52 +7,37 @@ class EmailLexer extends AbstractLexer { //ASCII values - const S_EMPTY = null; + const C_DEL = 127; const C_NUL = 0; - const S_HTAB = 9; - const S_LF = 10; - const S_CR = 13; - const S_SP = 32; - const EXCLAMATION = 33; - const S_DQUOTE = 34; - const NUMBER_SIGN = 35; - const DOLLAR = 36; - const PERCENTAGE = 37; - const AMPERSAND = 38; - const S_SQUOTE = 39; - const S_OPENPARENTHESIS = 40; - const S_CLOSEPARENTHESIS = 41; - const ASTERISK = 42; - const S_PLUS = 43; - const S_COMMA = 44; - const S_HYPHEN = 45; - const S_DOT = 46; - const S_SLASH = 47; - const S_COLON = 58; - const S_SEMICOLON = 59; - const S_LOWERTHAN = 60; - const S_EQUAL = 61; - const S_GREATERTHAN = 62; - const QUESTIONMARK = 63; const S_AT = 64; - const S_OPENBRACKET = 91; const S_BACKSLASH = 92; - const S_CLOSEBRACKET = 93; - const CARET = 94; - const S_UNDERSCORE = 95; + const S_DOT = 46; + const S_DQUOTE = 34; + const S_SQUOTE = 39; const S_BACKTICK = 96; - const S_OPENCURLYBRACES = 123; - const S_PIPE = 124; - const S_CLOSECURLYBRACES = 125; - const S_TILDE = 126; - const C_DEL = 127; - const INVERT_QUESTIONMARK= 168; - const INVERT_EXCLAMATION = 173; + const S_OPENPARENTHESIS = 49; + const S_CLOSEPARENTHESIS = 261; + const S_OPENBRACKET = 262; + const S_CLOSEBRACKET = 263; + const S_HYPHEN = 264; + const S_COLON = 265; + const S_DOUBLECOLON = 266; + const S_SP = 267; + const S_HTAB = 268; + const S_CR = 269; + const S_LF = 270; + const S_IPV6TAG = 271; + const S_LOWERTHAN = 272; + const S_GREATERTHAN = 273; + const S_COMMA = 274; + const S_SEMICOLON = 275; + const S_OPENQBRACKET = 276; + const S_CLOSEQBRACKET = 277; + const S_SLASH = 278; + const S_EMPTY = null; const GENERIC = 300; - const S_IPV6TAG = 301; + const CRLF = 301; const INVALID = 302; - const CRLF = 1310; - const S_DOUBLECOLON = 5858; const ASCII_INVALID_FROM = 127; const ASCII_INVALID_TO = 199; @@ -62,8 +47,6 @@ class EmailLexer extends AbstractLexer * @var array */ protected $charValue = array( - '{' => self::S_OPENCURLYBRACES, - '}' => self::S_CLOSECURLYBRACES, '(' => self::S_OPENPARENTHESIS, ')' => self::S_CLOSEPARENTHESIS, '<' => self::S_LOWERTHAN, @@ -88,23 +71,10 @@ class EmailLexer extends AbstractLexer "\n" => self::S_LF, "\r\n" => self::CRLF, 'IPv6' => self::S_IPV6TAG, + '{' => self::S_OPENQBRACKET, + '}' => self::S_CLOSEQBRACKET, '' => self::S_EMPTY, '\0' => self::C_NUL, - '*' => self::ASTERISK, - '!' => self::EXCLAMATION, - '&' => self::AMPERSAND, - '^' => self::CARET, - '$' => self::DOLLAR, - '%' => self::PERCENTAGE, - '~' => self::S_TILDE, - '|' => self::S_PIPE, - '_' => self::S_UNDERSCORE, - '=' => self::S_EQUAL, - '+' => self::S_PLUS, - '¿' => self::INVERT_QUESTIONMARK, - '?' => self::QUESTIONMARK, - '#' => self::NUMBER_SIGN, - '¡' => self::INVERT_EXCLAMATION, ); /** @@ -124,9 +94,7 @@ class EmailLexer extends AbstractLexer * * @var array * - * @psalm-suppress NonInvariantDocblockPropertyType * @psalm-var array{value:string, type:null|int, position:int} - * @psalm-suppress NonInvariantDocblockPropertyType */ public $token; @@ -146,16 +114,6 @@ class EmailLexer extends AbstractLexer 'position' => 0, ]; - /** - * @var string - */ - private $accumulator = ''; - - /** - * @var bool - */ - private $hasToRecord = false; - public function __construct() { $this->previous = $this->token = self::$nullToken; @@ -215,18 +173,10 @@ public function getPrevious() */ public function moveNext() { - if ($this->hasToRecord && $this->previous === self::$nullToken) { - $this->accumulator .= $this->token['value']; - } - $this->previous = $this->token; $hasNext = parent::moveNext(); $this->token = $this->token ?: self::$nullToken; - if ($this->hasToRecord) { - $this->accumulator .= $this->token['value']; - } - return $hasNext; } @@ -238,7 +188,7 @@ public function moveNext() protected function getCatchablePatterns() { return array( - '[a-zA-Z]+[46]?', //ASCII and domain literal + '[a-zA-Z_]+[46]?', //ASCII and domain literal '[^\x00-\x7F]', //UTF-8 '[0-9]+', '\r\n', @@ -255,9 +205,7 @@ protected function getCatchablePatterns() */ protected function getNonCatchablePatterns() { - return [ - '[\xA0-\xff]+', - ]; + return array('[\xA0-\xff]+'); } /** @@ -269,38 +217,28 @@ protected function getNonCatchablePatterns() */ protected function getType(&$value) { - $encoded = $value; - - if (mb_detect_encoding($value, 'auto', true) !== 'UTF-8') { - $encoded = utf8_encode($value); - } - - if ($this->isValid($encoded)) { - return $this->charValue[$encoded]; + if ($this->isNullType($value)) { + return self::C_NUL; } - if ($this->isNullType($encoded)) { - return self::C_NUL; + if ($this->isValid($value)) { + return $this->charValue[$value]; } - if ($this->isInvalidChar($encoded)) { + if ($this->isUTF8Invalid($value)) { $this->hasInvalidTokens = true; return self::INVALID; } - return self::GENERIC; } - protected function isInvalidChar(string $value) : bool - { - if(preg_match("/[^\p{S}\p{C}\p{Cc}]+/iu", $value) ) { - return false; - } - return true; - } - - protected function isValid(string $value) : bool + /** + * @param string $value + * + * @return bool + */ + protected function isValid($value) { if (isset($this->charValue[$value])) { return true; @@ -322,7 +260,11 @@ protected function isNullType($value) return false; } - protected function isUTF8Invalid(string $value) : bool + /** + * @param string $value + * @return bool + */ + protected function isUTF8Invalid($value) { if (preg_match('/\p{Cc}+/u', $value)) { return true; @@ -338,24 +280,4 @@ protected function getModifiers() { return 'iu'; } - - public function getAccumulatedValues() : string - { - return $this->accumulator; - } - - public function startRecording() : void - { - $this->hasToRecord = true; - } - - public function stopRecording() : void - { - $this->hasToRecord = false; - } - - public function clearRecorded() : void - { - $this->accumulator = ''; - } } diff --git a/core/vendor/egulias/email-validator/src/EmailParser.php b/core/vendor/egulias/email-validator/src/EmailParser.php index c78f74a98e..6b7bad6692 100644 --- a/core/vendor/egulias/email-validator/src/EmailParser.php +++ b/core/vendor/egulias/email-validator/src/EmailParser.php @@ -2,19 +2,26 @@ namespace Egulias\EmailValidator; -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Parser\LocalPart; +use Egulias\EmailValidator\Exception\ExpectingATEXT; +use Egulias\EmailValidator\Exception\NoLocalPart; use Egulias\EmailValidator\Parser\DomainPart; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Result\InvalidEmail; +use Egulias\EmailValidator\Parser\LocalPart; use Egulias\EmailValidator\Warning\EmailTooLong; -use Egulias\EmailValidator\Result\Reason\NoLocalPart; -class EmailParser extends Parser +/** + * EmailParser + * + * @author Eduardo Gulias Davis <me@egulias.com> + */ +class EmailParser { const EMAIL_MAX_LENGTH = 254; + /** + * @var array + */ + protected $warnings = []; + /** * @var string */ @@ -24,65 +31,104 @@ class EmailParser extends Parser * @var string */ protected $localPart = ''; + /** + * @var EmailLexer + */ + protected $lexer; - public function parse(string $str) : Result - { - $result = parent::parse($str); + /** + * @var LocalPart + */ + protected $localPartParser; - $this->addLongEmailWarning($this->localPart, $this->domainPart); + /** + * @var DomainPart + */ + protected $domainPartParser; - return $result; + public function __construct(EmailLexer $lexer) + { + $this->lexer = $lexer; + $this->localPartParser = new LocalPart($this->lexer); + $this->domainPartParser = new DomainPart($this->lexer); } - - protected function preLeftParsing(): Result + + /** + * @param string $str + * @return array + */ + public function parse($str) { + $this->lexer->setInput($str); + if (!$this->hasAtToken()) { - return new InvalidEmail(new NoLocalPart(), $this->lexer->token["value"]); + throw new NoLocalPart(); } - return new ValidEmail(); - } - protected function parseLeftFromAt(): Result - { - return $this->processLocalPart(); - } - protected function parseRightFromAt(): Result - { - return $this->processDomainPart(); + $this->localPartParser->parse($str); + $this->domainPartParser->parse($str); + + $this->setParts($str); + + if ($this->lexer->hasInvalidTokens()) { + throw new ExpectingATEXT(); + } + + return array('local' => $this->localPart, 'domain' => $this->domainPart); } - private function processLocalPart() : Result + /** + * @return Warning\Warning[] + */ + public function getWarnings() { - $localPartParser = new LocalPart($this->lexer); - $localPartResult = $localPartParser->parse(); - $this->localPart = $localPartParser->localPart(); - $this->warnings = array_merge($localPartParser->getWarnings(), $this->warnings); + $localPartWarnings = $this->localPartParser->getWarnings(); + $domainPartWarnings = $this->domainPartParser->getWarnings(); + $this->warnings = array_merge($localPartWarnings, $domainPartWarnings); + + $this->addLongEmailWarning($this->localPart, $this->domainPart); - return $localPartResult; + return $this->warnings; } - private function processDomainPart() : Result + /** + * @return string + */ + public function getParsedDomainPart() { - $domainPartParser = new DomainPart($this->lexer); - $domainPartResult = $domainPartParser->parse(); - $this->domainPart = $domainPartParser->domainPart(); - $this->warnings = array_merge($domainPartParser->getWarnings(), $this->warnings); - - return $domainPartResult; + return $this->domainPart; } - public function getDomainPart() : string + /** + * @param string $email + */ + protected function setParts($email) { - return $this->domainPart; + $parts = explode('@', $email); + $this->domainPart = $this->domainPartParser->getDomainPart(); + $this->localPart = $parts[0]; } - public function getLocalPart() : string + /** + * @return bool + */ + protected function hasAtToken() { - return $this->localPart; + $this->lexer->moveNext(); + $this->lexer->moveNext(); + if ($this->lexer->token['type'] === EmailLexer::S_AT) { + return false; + } + + return true; } - private function addLongEmailWarning(string $localPart, string $parsedDomainPart) : void + /** + * @param string $localPart + * @param string $parsedDomainPart + */ + protected function addLongEmailWarning($localPart, $parsedDomainPart) { if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAIL_MAX_LENGTH) { $this->warnings[EmailTooLong::CODE] = new EmailTooLong(); diff --git a/core/vendor/egulias/email-validator/src/EmailValidator.php b/core/vendor/egulias/email-validator/src/EmailValidator.php index 5a2e5c822e..a30f21dcd3 100644 --- a/core/vendor/egulias/email-validator/src/EmailValidator.php +++ b/core/vendor/egulias/email-validator/src/EmailValidator.php @@ -2,7 +2,7 @@ namespace Egulias\EmailValidator; -use Egulias\EmailValidator\Result\InvalidEmail; +use Egulias\EmailValidator\Exception\InvalidEmail; use Egulias\EmailValidator\Validation\EmailValidation; class EmailValidator @@ -15,12 +15,12 @@ class EmailValidator /** * @var Warning\Warning[] */ - private $warnings = []; + protected $warnings = []; /** - * @var ?InvalidEmail + * @var InvalidEmail|null */ - private $error; + protected $error; public function __construct() { @@ -32,7 +32,7 @@ public function __construct() * @param EmailValidation $emailValidation * @return bool */ - public function isValid(string $email, EmailValidation $emailValidation) + public function isValid($email, EmailValidation $emailValidation) { $isValid = $emailValidation->isValid($email, $this->lexer); $this->warnings = $emailValidation->getWarnings(); diff --git a/core/vendor/egulias/email-validator/src/Exception/AtextAfterCFWS.php b/core/vendor/egulias/email-validator/src/Exception/AtextAfterCFWS.php new file mode 100644 index 0000000000..97f41a2caa --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/AtextAfterCFWS.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class AtextAfterCFWS extends InvalidEmail +{ + const CODE = 133; + const REASON = "ATEXT found after CFWS"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/CRLFAtTheEnd.php b/core/vendor/egulias/email-validator/src/Exception/CRLFAtTheEnd.php new file mode 100644 index 0000000000..ec23bc718c --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/CRLFAtTheEnd.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class CRLFAtTheEnd extends InvalidEmail +{ + const CODE = 149; + const REASON = "CRLF at the end"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/CRLFX2.php b/core/vendor/egulias/email-validator/src/Exception/CRLFX2.php new file mode 100644 index 0000000000..6bd377ee70 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/CRLFX2.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class CRLFX2 extends InvalidEmail +{ + const CODE = 148; + const REASON = "Folding whitespace CR LF found twice"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/CRNoLF.php b/core/vendor/egulias/email-validator/src/Exception/CRNoLF.php new file mode 100644 index 0000000000..9c9f73944c --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/CRNoLF.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class CRNoLF extends InvalidEmail +{ + const CODE = 150; + const REASON = "Missing LF after CR"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/CharNotAllowed.php b/core/vendor/egulias/email-validator/src/Exception/CharNotAllowed.php new file mode 100644 index 0000000000..ea20ce591d --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/CharNotAllowed.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class CharNotAllowed extends InvalidEmail +{ + const CODE = 201; + const REASON = "Non allowed character in domain"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/CommaInDomain.php b/core/vendor/egulias/email-validator/src/Exception/CommaInDomain.php new file mode 100644 index 0000000000..e9245d9663 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/CommaInDomain.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class CommaInDomain extends InvalidEmail +{ + const CODE = 200; + const REASON = "Comma ',' is not allowed in domain part"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/ConsecutiveAt.php b/core/vendor/egulias/email-validator/src/Exception/ConsecutiveAt.php new file mode 100644 index 0000000000..165ff57a9f --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/ConsecutiveAt.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class ConsecutiveAt extends InvalidEmail +{ + const CODE = 128; + const REASON = "Consecutive AT"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/ConsecutiveDot.php b/core/vendor/egulias/email-validator/src/Exception/ConsecutiveDot.php new file mode 100644 index 0000000000..949af3b59b --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/ConsecutiveDot.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class ConsecutiveDot extends InvalidEmail +{ + const CODE = 132; + const REASON = "Consecutive DOT"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/DomainAcceptsNoMail.php b/core/vendor/egulias/email-validator/src/Exception/DomainAcceptsNoMail.php new file mode 100644 index 0000000000..40a99705ce --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/DomainAcceptsNoMail.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class DomainAcceptsNoMail extends InvalidEmail +{ + const CODE = 154; + const REASON = 'Domain accepts no mail (Null MX, RFC7505)'; +} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Exception/DomainHyphened.php b/core/vendor/egulias/email-validator/src/Exception/DomainHyphened.php new file mode 100644 index 0000000000..6f5868603f --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/DomainHyphened.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class DomainHyphened extends InvalidEmail +{ + const CODE = 144; + const REASON = "Hyphen found in domain"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/DotAtEnd.php b/core/vendor/egulias/email-validator/src/Exception/DotAtEnd.php new file mode 100644 index 0000000000..05ade77d0a --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/DotAtEnd.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class DotAtEnd extends InvalidEmail +{ + const CODE = 142; + const REASON = "Dot at the end"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/DotAtStart.php b/core/vendor/egulias/email-validator/src/Exception/DotAtStart.php new file mode 100644 index 0000000000..7772df7f88 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/DotAtStart.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class DotAtStart extends InvalidEmail +{ + const CODE = 141; + const REASON = "Found DOT at start"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/ExpectingAT.php b/core/vendor/egulias/email-validator/src/Exception/ExpectingAT.php new file mode 100644 index 0000000000..36d633c1a0 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/ExpectingAT.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class ExpectingAT extends InvalidEmail +{ + const CODE = 202; + const REASON = "Expecting AT '@' "; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/ExpectingATEXT.php b/core/vendor/egulias/email-validator/src/Exception/ExpectingATEXT.php new file mode 100644 index 0000000000..095d9db745 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/ExpectingATEXT.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class ExpectingATEXT extends InvalidEmail +{ + const CODE = 137; + const REASON = "Expecting ATEXT"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/ExpectingCTEXT.php b/core/vendor/egulias/email-validator/src/Exception/ExpectingCTEXT.php new file mode 100644 index 0000000000..63b870a4af --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/ExpectingCTEXT.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class ExpectingCTEXT extends InvalidEmail +{ + const CODE = 139; + const REASON = "Expecting CTEXT"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/ExpectingDTEXT.php b/core/vendor/egulias/email-validator/src/Exception/ExpectingDTEXT.php new file mode 100644 index 0000000000..6a5bb9bfe8 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/ExpectingDTEXT.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class ExpectingDTEXT extends InvalidEmail +{ + const CODE = 129; + const REASON = "Expected DTEXT"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/ExpectingDomainLiteralClose.php b/core/vendor/egulias/email-validator/src/Exception/ExpectingDomainLiteralClose.php new file mode 100644 index 0000000000..81aad4277d --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/ExpectingDomainLiteralClose.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class ExpectingDomainLiteralClose extends InvalidEmail +{ + const CODE = 137; + const REASON = "Closing bracket ']' for domain literal not found"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/ExpectingQPair.php b/core/vendor/egulias/email-validator/src/Exception/ExpectingQPair.php new file mode 100644 index 0000000000..a738eeb62f --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/ExpectingQPair.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class ExpectingQPair extends InvalidEmail +{ + const CODE = 136; + const REASON = "Expecting QPAIR"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/InvalidEmail.php b/core/vendor/egulias/email-validator/src/Exception/InvalidEmail.php new file mode 100644 index 0000000000..1c0218e9e2 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/InvalidEmail.php @@ -0,0 +1,14 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +abstract class InvalidEmail extends \InvalidArgumentException +{ + const REASON = "Invalid email"; + const CODE = 0; + + public function __construct() + { + parent::__construct(static::REASON, static::CODE); + } +} diff --git a/core/vendor/egulias/email-validator/src/Exception/LocalOrReservedDomain.php b/core/vendor/egulias/email-validator/src/Exception/LocalOrReservedDomain.php new file mode 100644 index 0000000000..695b05a46d --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/LocalOrReservedDomain.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class LocalOrReservedDomain extends InvalidEmail +{ + const CODE = 153; + const REASON = 'Local, mDNS or reserved domain (RFC2606, RFC6762)'; +} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Exception/NoDNSRecord.php b/core/vendor/egulias/email-validator/src/Exception/NoDNSRecord.php new file mode 100644 index 0000000000..0aa5fa7890 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/NoDNSRecord.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class NoDNSRecord extends InvalidEmail +{ + const CODE = 5; + const REASON = 'No MX or A DSN record was found for this email'; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/NoDomainPart.php b/core/vendor/egulias/email-validator/src/Exception/NoDomainPart.php new file mode 100644 index 0000000000..05a2604c0d --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/NoDomainPart.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class NoDomainPart extends InvalidEmail +{ + const CODE = 131; + const REASON = "No Domain part"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/NoLocalPart.php b/core/vendor/egulias/email-validator/src/Exception/NoLocalPart.php new file mode 100644 index 0000000000..07c14b8445 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/NoLocalPart.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class NoLocalPart extends InvalidEmail +{ + const CODE = 130; + const REASON = "No local part"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/UnclosedComment.php b/core/vendor/egulias/email-validator/src/Exception/UnclosedComment.php new file mode 100644 index 0000000000..86b2b09622 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/UnclosedComment.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class UnclosedComment extends InvalidEmail +{ + const CODE = 146; + const REASON = "No closing comment token found"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/UnclosedQuotedString.php b/core/vendor/egulias/email-validator/src/Exception/UnclosedQuotedString.php new file mode 100644 index 0000000000..730a39dd3f --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/UnclosedQuotedString.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class UnclosedQuotedString extends InvalidEmail +{ + const CODE = 145; + const REASON = "Unclosed quoted string"; +} diff --git a/core/vendor/egulias/email-validator/src/Exception/UnopenedComment.php b/core/vendor/egulias/email-validator/src/Exception/UnopenedComment.php new file mode 100644 index 0000000000..cff12d9253 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Exception/UnopenedComment.php @@ -0,0 +1,9 @@ +<?php + +namespace Egulias\EmailValidator\Exception; + +class UnopenedComment extends InvalidEmail +{ + const CODE = 152; + const REASON = "No opening comment token found"; +} diff --git a/core/vendor/egulias/email-validator/src/MessageIDParser.php b/core/vendor/egulias/email-validator/src/MessageIDParser.php deleted file mode 100644 index 9b029e1438..0000000000 --- a/core/vendor/egulias/email-validator/src/MessageIDParser.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -namespace Egulias\EmailValidator; - -use Egulias\EmailValidator\Parser; -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Parser\IDLeftPart; -use Egulias\EmailValidator\Parser\IDRightPart; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Warning\EmailTooLong; -use Egulias\EmailValidator\Result\Reason\NoLocalPart; - -class MessageIDParser extends Parser -{ - - const EMAILID_MAX_LENGTH = 254; - - /** - * @var string - */ - protected $idLeft = ''; - - /** - * @var string - */ - protected $idRight = ''; - - public function parse(string $str) : Result - { - $result = parent::parse($str); - - $this->addLongEmailWarning($this->idLeft, $this->idRight); - - return $result; - } - - protected function preLeftParsing(): Result - { - if (!$this->hasAtToken()) { - return new InvalidEmail(new NoLocalPart(), $this->lexer->token["value"]); - } - return new ValidEmail(); - } - - protected function parseLeftFromAt(): Result - { - return $this->processIDLeft(); - } - - protected function parseRightFromAt(): Result - { - return $this->processIDRight(); - } - - private function processIDLeft() : Result - { - $localPartParser = new IDLeftPart($this->lexer); - $localPartResult = $localPartParser->parse(); - $this->idLeft = $localPartParser->localPart(); - $this->warnings = array_merge($localPartParser->getWarnings(), $this->warnings); - - return $localPartResult; - } - - private function processIDRight() : Result - { - $domainPartParser = new IDRightPart($this->lexer); - $domainPartResult = $domainPartParser->parse(); - $this->idRight = $domainPartParser->domainPart(); - $this->warnings = array_merge($domainPartParser->getWarnings(), $this->warnings); - - return $domainPartResult; - } - - public function getLeftPart() : string - { - return $this->idLeft; - } - - public function getRightPart() : string - { - return $this->idRight; - } - - private function addLongEmailWarning(string $localPart, string $parsedDomainPart) : void - { - if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAILID_MAX_LENGTH) { - $this->warnings[EmailTooLong::CODE] = new EmailTooLong(); - } - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser.php b/core/vendor/egulias/email-validator/src/Parser.php deleted file mode 100644 index b1905f9abf..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Egulias\EmailValidator; - -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\ExpectingATEXT; - -abstract class Parser -{ - /** - * @var Warning\Warning[] - */ - protected $warnings = []; - - /** - * @var EmailLexer - */ - protected $lexer; - - /** - * id-left "@" id-right - */ - abstract protected function parseRightFromAt() : Result; - abstract protected function parseLeftFromAt() : Result; - abstract protected function preLeftParsing() : Result; - - - public function __construct(EmailLexer $lexer) - { - $this->lexer = $lexer; - } - - public function parse(string $str) : Result - { - $this->lexer->setInput($str); - - if ($this->lexer->hasInvalidTokens()) { - return new InvalidEmail(new ExpectingATEXT("Invalid tokens found"), $this->lexer->token["value"]); - } - - $preParsingResult = $this->preLeftParsing(); - if ($preParsingResult->isInvalid()) { - return $preParsingResult; - } - - $localPartResult = $this->parseLeftFromAt(); - - if ($localPartResult->isInvalid()) { - return $localPartResult; - } - - $domainPartResult = $this->parseRightFromAt(); - - if ($domainPartResult->isInvalid()) { - return $domainPartResult; - } - - return new ValidEmail(); - } - - /** - * @return Warning\Warning[] - */ - public function getWarnings() : array - { - return $this->warnings; - } - - protected function hasAtToken() : bool - { - $this->lexer->moveNext(); - $this->lexer->moveNext(); - - return $this->lexer->token['type'] !== EmailLexer::S_AT; - } -} diff --git a/core/vendor/egulias/email-validator/src/Parser/Comment.php b/core/vendor/egulias/email-validator/src/Parser/Comment.php deleted file mode 100644 index ffa61281f8..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/Comment.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Parser; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Warning\QuotedPart; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Parser\CommentStrategy\CommentStrategy; -use Egulias\EmailValidator\Result\Reason\UnclosedComment; -use Egulias\EmailValidator\Result\Reason\UnOpenedComment; -use Egulias\EmailValidator\Warning\Comment as WarningComment; - -class Comment extends PartParser -{ - /** - * @var int - */ - private $openedParenthesis = 0; - - /** - * @var CommentStrategy - */ - private $commentStrategy; - - public function __construct(EmailLexer $lexer, CommentStrategy $commentStrategy) - { - $this->lexer = $lexer; - $this->commentStrategy = $commentStrategy; - } - - public function parse() : Result - { - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->openedParenthesis++; - if($this->noClosingParenthesis()) { - return new InvalidEmail(new UnclosedComment(), $this->lexer->token['value']); - } - } - - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { - return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']); - } - - $this->warnings[WarningComment::CODE] = new WarningComment(); - - $moreTokens = true; - while ($this->commentStrategy->exitCondition($this->lexer, $this->openedParenthesis) && $moreTokens){ - - if ($this->lexer->isNextToken(EmailLexer::S_OPENPARENTHESIS)) { - $this->openedParenthesis++; - } - $this->warnEscaping(); - if($this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { - $this->openedParenthesis--; - } - $moreTokens = $this->lexer->moveNext(); - } - - if($this->openedParenthesis >= 1) { - return new InvalidEmail(new UnclosedComment(), $this->lexer->token['value']); - } else if ($this->openedParenthesis < 0) { - return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']); - } - - $finalValidations = $this->commentStrategy->endOfLoopValidations($this->lexer); - - $this->warnings = array_merge($this->warnings, $this->commentStrategy->getWarnings()); - - return $finalValidations; - } - - - /** - * @return bool - */ - private function warnEscaping() : bool - { - //Backslash found - if ($this->lexer->token['type'] !== EmailLexer::S_BACKSLASH) { - return false; - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::C_DEL))) { - return false; - } - - $this->warnings[QuotedPart::CODE] = - new QuotedPart($this->lexer->getPrevious()['type'], $this->lexer->token['type']); - return true; - - } - - private function noClosingParenthesis() : bool - { - try { - $this->lexer->find(EmailLexer::S_CLOSEPARENTHESIS); - return false; - } catch (\RuntimeException $e) { - return true; - } - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser/CommentStrategy/CommentStrategy.php b/core/vendor/egulias/email-validator/src/Parser/CommentStrategy/CommentStrategy.php deleted file mode 100644 index c388efd65c..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/CommentStrategy/CommentStrategy.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Parser\CommentStrategy; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\Result; - -interface CommentStrategy -{ - /** - * Return "true" to continue, "false" to exit - */ - public function exitCondition(EmailLexer $lexer, int $openedParenthesis) : bool; - - public function endOfLoopValidations(EmailLexer $lexer) : Result; - - public function getWarnings() : array; -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser/CommentStrategy/DomainComment.php b/core/vendor/egulias/email-validator/src/Parser/CommentStrategy/DomainComment.php deleted file mode 100644 index b34ce29ad8..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/CommentStrategy/DomainComment.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Parser\CommentStrategy; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\ExpectingATEXT; - -class DomainComment implements CommentStrategy -{ - public function exitCondition(EmailLexer $lexer, int $openedParenthesis) : bool - { - if (($openedParenthesis === 0 && $lexer->isNextToken(EmailLexer::S_DOT))){ // || !$internalLexer->moveNext()) { - return false; - } - - return true; - } - - public function endOfLoopValidations(EmailLexer $lexer) : Result - { - //test for end of string - if (!$lexer->isNextToken(EmailLexer::S_DOT)) { - return new InvalidEmail(new ExpectingATEXT('DOT not found near CLOSEPARENTHESIS'), $lexer->token['value']); - } - //add warning - //Address is valid within the message but cannot be used unmodified for the envelope - return new ValidEmail(); - } - - public function getWarnings(): array - { - return []; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser/CommentStrategy/LocalComment.php b/core/vendor/egulias/email-validator/src/Parser/CommentStrategy/LocalComment.php deleted file mode 100644 index 73bc7b2bc3..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/CommentStrategy/LocalComment.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Parser\CommentStrategy; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Warning\CFWSNearAt; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\ExpectingATEXT; - -class LocalComment implements CommentStrategy -{ - /** - * @var array - */ - private $warnings = []; - - public function exitCondition(EmailLexer $lexer, int $openedParenthesis) : bool - { - return !$lexer->isNextToken(EmailLexer::S_AT); - } - - public function endOfLoopValidations(EmailLexer $lexer) : Result - { - if (!$lexer->isNextToken(EmailLexer::S_AT)) { - return new InvalidEmail(new ExpectingATEXT('ATEX is not expected after closing comments'), $lexer->token['value']); - } - $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); - return new ValidEmail(); - } - - public function getWarnings(): array - { - return $this->warnings; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser/DomainLiteral.php b/core/vendor/egulias/email-validator/src/Parser/DomainLiteral.php deleted file mode 100644 index 54a6fab9e6..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/DomainLiteral.php +++ /dev/null @@ -1,212 +0,0 @@ -<?php -namespace Egulias\EmailValidator\Parser; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Warning\CFWSWithFWS; -use Egulias\EmailValidator\Warning\IPV6BadChar; -use Egulias\EmailValidator\Result\Reason\CRNoLF; -use Egulias\EmailValidator\Warning\IPV6ColonEnd; -use Egulias\EmailValidator\Warning\IPV6MaxGroups; -use Egulias\EmailValidator\Warning\ObsoleteDTEXT; -use Egulias\EmailValidator\Warning\AddressLiteral; -use Egulias\EmailValidator\Warning\IPV6ColonStart; -use Egulias\EmailValidator\Warning\IPV6Deprecated; -use Egulias\EmailValidator\Warning\IPV6GroupCount; -use Egulias\EmailValidator\Warning\IPV6DoubleColon; -use Egulias\EmailValidator\Result\Reason\ExpectingDTEXT; -use Egulias\EmailValidator\Result\Reason\UnusualElements; -use Egulias\EmailValidator\Warning\DomainLiteral as WarningDomainLiteral; - -class DomainLiteral extends PartParser -{ - public function parse() : Result - { - $this->addTagWarnings(); - - $IPv6TAG = false; - $addressLiteral = ''; - - do { - if ($this->lexer->token['type'] === EmailLexer::C_NUL) { - return new InvalidEmail(new ExpectingDTEXT(), $this->lexer->token['value']); - } - - $this->addObsoleteWarnings(); - - if ($this->lexer->isNextTokenAny(array(EmailLexer::S_OPENBRACKET, EmailLexer::S_OPENBRACKET))) { - return new InvalidEmail(new ExpectingDTEXT(), $this->lexer->token['value']); - } - - if ($this->lexer->isNextTokenAny( - array(EmailLexer::S_HTAB, EmailLexer::S_SP, $this->lexer->token['type'] === EmailLexer::CRLF) - )) { - $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); - $this->parseFWS(); - } - - if ($this->lexer->isNextToken(EmailLexer::S_CR)) { - return new InvalidEmail(new CRNoLF(), $this->lexer->token['value']); - } - - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH) { - return new InvalidEmail(new UnusualElements($this->lexer->token['value']), $this->lexer->token['value']); - } - if ($this->lexer->token['type'] === EmailLexer::S_IPV6TAG) { - $IPv6TAG = true; - } - - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEBRACKET) { - break; - } - - $addressLiteral .= $this->lexer->token['value']; - - } while ($this->lexer->moveNext()); - - - //Encapsulate - $addressLiteral = str_replace('[', '', $addressLiteral); - $isAddressLiteralIPv4 = $this->checkIPV4Tag($addressLiteral); - - if (!$isAddressLiteralIPv4) { - return new ValidEmail(); - } else { - $addressLiteral = $this->convertIPv4ToIPv6($addressLiteral); - } - - if (!$IPv6TAG) { - $this->warnings[WarningDomainLiteral::CODE] = new WarningDomainLiteral(); - return new ValidEmail(); - } - - $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); - - $this->checkIPV6Tag($addressLiteral); - - return new ValidEmail(); - } - - /** - * @param string $addressLiteral - * @param int $maxGroups - */ - public function checkIPV6Tag($addressLiteral, $maxGroups = 8) : void - { - $prev = $this->lexer->getPrevious(); - if ($prev['type'] === EmailLexer::S_COLON) { - $this->warnings[IPV6ColonEnd::CODE] = new IPV6ColonEnd(); - } - - $IPv6 = substr($addressLiteral, 5); - //Daniel Marschall's new IPv6 testing strategy - $matchesIP = explode(':', $IPv6); - $groupCount = count($matchesIP); - $colons = strpos($IPv6, '::'); - - if (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/', $matchesIP, PREG_GREP_INVERT)) !== 0) { - $this->warnings[IPV6BadChar::CODE] = new IPV6BadChar(); - } - - if ($colons === false) { - // We need exactly the right number of groups - if ($groupCount !== $maxGroups) { - $this->warnings[IPV6GroupCount::CODE] = new IPV6GroupCount(); - } - return; - } - - if ($colons !== strrpos($IPv6, '::')) { - $this->warnings[IPV6DoubleColon::CODE] = new IPV6DoubleColon(); - return; - } - - if ($colons === 0 || $colons === (strlen($IPv6) - 2)) { - // RFC 4291 allows :: at the start or end of an address - //with 7 other groups in addition - ++$maxGroups; - } - - if ($groupCount > $maxGroups) { - $this->warnings[IPV6MaxGroups::CODE] = new IPV6MaxGroups(); - } elseif ($groupCount === $maxGroups) { - $this->warnings[IPV6Deprecated::CODE] = new IPV6Deprecated(); - } - } - - public function convertIPv4ToIPv6(string $addressLiteralIPv4) : string - { - $matchesIP = array(); - $IPv4Match = preg_match( - '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/', - $addressLiteralIPv4, - $matchesIP); - - // Extract IPv4 part from the end of the address-literal (if there is one) - if ($IPv4Match > 0) { - $index = (int) strrpos($addressLiteralIPv4, $matchesIP[0]); - //There's a match but it is at the start - if ($index > 0) { - // Convert IPv4 part to IPv6 format for further testing - return substr($addressLiteralIPv4, 0, $index) . '0:0'; - } - } - - return $addressLiteralIPv4; - } - - /** - * @param string $addressLiteral - * - * @return bool - */ - protected function checkIPV4Tag($addressLiteral) : bool - { - $matchesIP = array(); - $IPv4Match = preg_match( - '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/', - $addressLiteral, - $matchesIP); - - // Extract IPv4 part from the end of the address-literal (if there is one) - - if ($IPv4Match > 0) { - $index = strrpos($addressLiteral, $matchesIP[0]); - //There's a match but it is at the start - if ($index === 0) { - $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); - return false; - } - } - - return true; - } - - private function addObsoleteWarnings() : void - { - if ($this->lexer->token['type'] === EmailLexer::INVALID || - $this->lexer->token['type'] === EmailLexer::C_DEL || - $this->lexer->token['type'] === EmailLexer::S_LF || - $this->lexer->token['type'] === EmailLexer::S_BACKSLASH - ) { - $this->warnings[ObsoleteDTEXT::CODE] = new ObsoleteDTEXT(); - } - } - - private function addTagWarnings() : void - { - if ($this->lexer->isNextToken(EmailLexer::S_COLON)) { - $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); - } - if ($this->lexer->isNextToken(EmailLexer::S_IPV6TAG)) { - $lexer = clone $this->lexer; - $lexer->moveNext(); - if ($lexer->isNextToken(EmailLexer::S_DOUBLECOLON)) { - $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); - } - } - } - -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser/DomainPart.php b/core/vendor/egulias/email-validator/src/Parser/DomainPart.php index 4ca54f2d9e..4dadba8af7 100644 --- a/core/vendor/egulias/email-validator/src/Parser/DomainPart.php +++ b/core/vendor/egulias/email-validator/src/Parser/DomainPart.php @@ -3,28 +3,38 @@ namespace Egulias\EmailValidator\Parser; use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Warning\TLD; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\DotAtEnd; -use Egulias\EmailValidator\Result\Reason\DotAtStart; +use Egulias\EmailValidator\Exception\CharNotAllowed; +use Egulias\EmailValidator\Exception\CommaInDomain; +use Egulias\EmailValidator\Exception\ConsecutiveAt; +use Egulias\EmailValidator\Exception\CRLFAtTheEnd; +use Egulias\EmailValidator\Exception\CRNoLF; +use Egulias\EmailValidator\Exception\DomainHyphened; +use Egulias\EmailValidator\Exception\DotAtEnd; +use Egulias\EmailValidator\Exception\DotAtStart; +use Egulias\EmailValidator\Exception\ExpectingATEXT; +use Egulias\EmailValidator\Exception\ExpectingDomainLiteralClose; +use Egulias\EmailValidator\Exception\ExpectingDTEXT; +use Egulias\EmailValidator\Exception\NoDomainPart; +use Egulias\EmailValidator\Exception\UnopenedComment; +use Egulias\EmailValidator\Warning\AddressLiteral; +use Egulias\EmailValidator\Warning\CFWSWithFWS; use Egulias\EmailValidator\Warning\DeprecatedComment; -use Egulias\EmailValidator\Result\Reason\CRLFAtTheEnd; -use Egulias\EmailValidator\Result\Reason\LabelTooLong; -use Egulias\EmailValidator\Result\Reason\NoDomainPart; -use Egulias\EmailValidator\Result\Reason\ConsecutiveAt; -use Egulias\EmailValidator\Result\Reason\DomainTooLong; -use Egulias\EmailValidator\Result\Reason\CharNotAllowed; -use Egulias\EmailValidator\Result\Reason\DomainHyphened; -use Egulias\EmailValidator\Result\Reason\ExpectingATEXT; -use Egulias\EmailValidator\Parser\CommentStrategy\DomainComment; -use Egulias\EmailValidator\Result\Reason\ExpectingDomainLiteralClose; -use Egulias\EmailValidator\Parser\DomainLiteral as DomainLiteralParser; - -class DomainPart extends PartParser +use Egulias\EmailValidator\Warning\DomainLiteral; +use Egulias\EmailValidator\Warning\DomainTooLong; +use Egulias\EmailValidator\Warning\IPV6BadChar; +use Egulias\EmailValidator\Warning\IPV6ColonEnd; +use Egulias\EmailValidator\Warning\IPV6ColonStart; +use Egulias\EmailValidator\Warning\IPV6Deprecated; +use Egulias\EmailValidator\Warning\IPV6DoubleColon; +use Egulias\EmailValidator\Warning\IPV6GroupCount; +use Egulias\EmailValidator\Warning\IPV6MaxGroups; +use Egulias\EmailValidator\Warning\LabelTooLong; +use Egulias\EmailValidator\Warning\ObsoleteDTEXT; +use Egulias\EmailValidator\Warning\TLD; + +class DomainPart extends Parser { - const DOMAIN_MAX_LENGTH = 253; + const DOMAIN_MAX_LENGTH = 254; const LABEL_MAX_LENGTH = 63; /** @@ -32,281 +42,402 @@ class DomainPart extends PartParser */ protected $domainPart = ''; - /** - * @var string - */ - protected $label = ''; - - public function parse() : Result + public function parse($domainPart) { - $this->lexer->clearRecorded(); - $this->lexer->startRecording(); - $this->lexer->moveNext(); - $domainChecks = $this->performDomainStartChecks(); - if ($domainChecks->isInvalid()) { - return $domainChecks; - } - - if ($this->lexer->token['type'] === EmailLexer::S_AT) { - return new InvalidEmail(new ConsecutiveAt(), $this->lexer->token['value']); - } - - $result = $this->doParseDomainPart(); - if ($result->isInvalid()) { - return $result; - } - - $end = $this->checkEndOfDomain(); - if ($end->isInvalid()) { - return $end; - } - - $this->lexer->stopRecording(); - $this->domainPart = $this->lexer->getAccumulatedValues(); - - $length = strlen($this->domainPart); - if ($length > self::DOMAIN_MAX_LENGTH) { - return new InvalidEmail(new DomainTooLong(), $this->lexer->token['value']); - } + $this->performDomainStartChecks(); - return new ValidEmail(); - } + $domain = $this->doParseDomainPart(); - private function checkEndOfDomain() : Result - { $prev = $this->lexer->getPrevious(); + $length = strlen($domain); + if ($prev['type'] === EmailLexer::S_DOT) { - return new InvalidEmail(new DotAtEnd(), $this->lexer->token['value']); + throw new DotAtEnd(); } if ($prev['type'] === EmailLexer::S_HYPHEN) { - return new InvalidEmail(new DomainHyphened('Hypen found at the end of the domain'), $prev['value']); + throw new DomainHyphened(); } - - if ($this->lexer->token['type'] === EmailLexer::S_SP) { - return new InvalidEmail(new CRLFAtTheEnd(), $prev['value']); + if ($length > self::DOMAIN_MAX_LENGTH) { + $this->warnings[DomainTooLong::CODE] = new DomainTooLong(); } - return new ValidEmail(); - + if ($prev['type'] === EmailLexer::S_CR) { + throw new CRLFAtTheEnd(); + } + $this->domainPart = $domain; } - private function performDomainStartChecks() : Result + private function performDomainStartChecks() { - $invalidTokens = $this->checkInvalidTokensAfterAT(); - if ($invalidTokens->isInvalid()) { - return $invalidTokens; - } - - $missingDomain = $this->checkEmptyDomain(); - if ($missingDomain->isInvalid()) { - return $missingDomain; - } + $this->checkInvalidTokensAfterAT(); + $this->checkEmptyDomain(); if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { $this->warnings[DeprecatedComment::CODE] = new DeprecatedComment(); + $this->parseDomainComments(); } - return new ValidEmail(); } - private function checkEmptyDomain() : Result + private function checkEmptyDomain() { $thereIsNoDomain = $this->lexer->token['type'] === EmailLexer::S_EMPTY || ($this->lexer->token['type'] === EmailLexer::S_SP && !$this->lexer->isNextToken(EmailLexer::GENERIC)); if ($thereIsNoDomain) { - return new InvalidEmail(new NoDomainPart(), $this->lexer->token['value']); + throw new NoDomainPart(); } - - return new ValidEmail(); } - private function checkInvalidTokensAfterAT() : Result + private function checkInvalidTokensAfterAT() { if ($this->lexer->token['type'] === EmailLexer::S_DOT) { - return new InvalidEmail(new DotAtStart(), $this->lexer->token['value']); + throw new DotAtStart(); } if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) { - return new InvalidEmail(new DomainHyphened('After AT'), $this->lexer->token['value']); + throw new DomainHyphened(); } - return new ValidEmail(); } - protected function parseComments(): Result + /** + * @return string + */ + public function getDomainPart() { - $commentParser = new Comment($this->lexer, new DomainComment()); - $result = $commentParser->parse(); - $this->warnings = array_merge($this->warnings, $commentParser->getWarnings()); + return $this->domainPart; + } - return $result; + /** + * @param string $addressLiteral + * @param int $maxGroups + */ + public function checkIPV6Tag($addressLiteral, $maxGroups = 8) + { + $prev = $this->lexer->getPrevious(); + if ($prev['type'] === EmailLexer::S_COLON) { + $this->warnings[IPV6ColonEnd::CODE] = new IPV6ColonEnd(); + } + + $IPv6 = substr($addressLiteral, 5); + //Daniel Marschall's new IPv6 testing strategy + $matchesIP = explode(':', $IPv6); + $groupCount = count($matchesIP); + $colons = strpos($IPv6, '::'); + + if (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/', $matchesIP, PREG_GREP_INVERT)) !== 0) { + $this->warnings[IPV6BadChar::CODE] = new IPV6BadChar(); + } + + if ($colons === false) { + // We need exactly the right number of groups + if ($groupCount !== $maxGroups) { + $this->warnings[IPV6GroupCount::CODE] = new IPV6GroupCount(); + } + return; + } + + if ($colons !== strrpos($IPv6, '::')) { + $this->warnings[IPV6DoubleColon::CODE] = new IPV6DoubleColon(); + return; + } + + if ($colons === 0 || $colons === (strlen($IPv6) - 2)) { + // RFC 4291 allows :: at the start or end of an address + //with 7 other groups in addition + ++$maxGroups; + } + + if ($groupCount > $maxGroups) { + $this->warnings[IPV6MaxGroups::CODE] = new IPV6MaxGroups(); + } elseif ($groupCount === $maxGroups) { + $this->warnings[IPV6Deprecated::CODE] = new IPV6Deprecated(); + } } - protected function doParseDomainPart() : Result + /** + * @return string + */ + protected function doParseDomainPart() { - $tldMissing = true; - $hasComments = false; $domain = ''; + $label = ''; + $openedParenthesis = 0; do { $prev = $this->lexer->getPrevious(); - $notAllowedChars = $this->checkNotAllowedChars($this->lexer->token); - if ($notAllowedChars->isInvalid()) { - return $notAllowedChars; - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS || - $this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS ) { - $hasComments = true; - $commentsResult = $this->parseComments(); + $this->checkNotAllowedChars($this->lexer->token); - //Invalid comment parsing - if($commentsResult->isInvalid()) { - return $commentsResult; + if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { + $this->parseComments(); + $openedParenthesis += $this->getOpenedParenthesis(); + $this->lexer->moveNext(); + $tmpPrev = $this->lexer->getPrevious(); + if ($tmpPrev['type'] === EmailLexer::S_CLOSEPARENTHESIS) { + $openedParenthesis--; } } - - $dotsResult = $this->checkConsecutiveDots(); - if ($dotsResult->isInvalid()) { - return $dotsResult; + if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { + if ($openedParenthesis === 0) { + throw new UnopenedComment(); + } else { + $openedParenthesis--; + } } - if ($this->lexer->token['type'] === EmailLexer::S_OPENBRACKET) { - $literalResult = $this->parseDomainLiteral(); + $this->checkConsecutiveDots(); + $this->checkDomainPartExceptions($prev); - $this->addTLDWarnings($tldMissing); - return $literalResult; + if ($this->hasBrackets()) { + $this->parseDomainLiteral(); } - $labelCheck = $this->checkLabelLength(); - if ($labelCheck->isInvalid()) { - return $labelCheck; - } - - $FwsResult = $this->parseFWS(); - if($FwsResult->isInvalid()) { - return $FwsResult; + if ($this->lexer->token['type'] === EmailLexer::S_DOT) { + $this->checkLabelLength($label); + $label = ''; + } else { + $label .= $this->lexer->token['value']; } - $domain .= $this->lexer->token['value']; - - if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::GENERIC)) { - $tldMissing = false; + if ($this->isFWS()) { + $this->parseFWS(); } - $exceptionsResult = $this->checkDomainPartExceptions($prev, $hasComments); - if ($exceptionsResult->isInvalid()) { - return $exceptionsResult; - } + $domain .= $this->lexer->token['value']; $this->lexer->moveNext(); - + if ($this->lexer->token['type'] === EmailLexer::S_SP) { + throw new CharNotAllowed(); + } } while (null !== $this->lexer->token['type']); - $labelCheck = $this->checkLabelLength(true); - if ($labelCheck->isInvalid()) { - return $labelCheck; - } - $this->addTLDWarnings($tldMissing); + $this->checkLabelLength($label); - $this->domainPart = $domain; - return new ValidEmail(); + return $domain; } - private function checkNotAllowedChars(array $token) : Result + private function checkNotAllowedChars(array $token) { $notAllowed = [EmailLexer::S_BACKSLASH => true, EmailLexer::S_SLASH=> true]; if (isset($notAllowed[$token['type']])) { - return new InvalidEmail(new CharNotAllowed(), $token['value']); + throw new CharNotAllowed(); } - return new ValidEmail(); } /** - * @return Result + * @return string|false */ - protected function parseDomainLiteral() : Result + protected function parseDomainLiteral() { - try { - $this->lexer->find(EmailLexer::S_CLOSEBRACKET); - } catch (\RuntimeException $e) { - return new InvalidEmail(new ExpectingDomainLiteralClose(), $this->lexer->token['value']); + if ($this->lexer->isNextToken(EmailLexer::S_COLON)) { + $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); + } + if ($this->lexer->isNextToken(EmailLexer::S_IPV6TAG)) { + $lexer = clone $this->lexer; + $lexer->moveNext(); + if ($lexer->isNextToken(EmailLexer::S_DOUBLECOLON)) { + $this->warnings[IPV6ColonStart::CODE] = new IPV6ColonStart(); + } } - $domainLiteralParser = new DomainLiteralParser($this->lexer); - $result = $domainLiteralParser->parse(); - $this->warnings = array_merge($this->warnings, $domainLiteralParser->getWarnings()); - return $result; + return $this->doParseDomainLiteral(); } - protected function checkDomainPartExceptions(array $prev, bool $hasComments) : Result + /** + * @return string|false + */ + protected function doParseDomainLiteral() { - if ($this->lexer->token['type'] === EmailLexer::S_OPENBRACKET && $prev['type'] !== EmailLexer::S_AT) { - return new InvalidEmail(new ExpectingATEXT('OPENBRACKET not after AT'), $this->lexer->token['value']); + $IPv6TAG = false; + $addressLiteral = ''; + do { + if ($this->lexer->token['type'] === EmailLexer::C_NUL) { + throw new ExpectingDTEXT(); + } + + if ($this->lexer->token['type'] === EmailLexer::INVALID || + $this->lexer->token['type'] === EmailLexer::C_DEL || + $this->lexer->token['type'] === EmailLexer::S_LF + ) { + $this->warnings[ObsoleteDTEXT::CODE] = new ObsoleteDTEXT(); + } + + if ($this->lexer->isNextTokenAny(array(EmailLexer::S_OPENQBRACKET, EmailLexer::S_OPENBRACKET))) { + throw new ExpectingDTEXT(); + } + + if ($this->lexer->isNextTokenAny( + array(EmailLexer::S_HTAB, EmailLexer::S_SP, $this->lexer->token['type'] === EmailLexer::CRLF) + )) { + $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); + $this->parseFWS(); + } + + if ($this->lexer->isNextToken(EmailLexer::S_CR)) { + throw new CRNoLF(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH) { + $this->warnings[ObsoleteDTEXT::CODE] = new ObsoleteDTEXT(); + $addressLiteral .= $this->lexer->token['value']; + $this->lexer->moveNext(); + $this->validateQuotedPair(); + } + if ($this->lexer->token['type'] === EmailLexer::S_IPV6TAG) { + $IPv6TAG = true; + } + if ($this->lexer->token['type'] === EmailLexer::S_CLOSEQBRACKET) { + break; + } + + $addressLiteral .= $this->lexer->token['value']; + + } while ($this->lexer->moveNext()); + + $addressLiteral = str_replace('[', '', $addressLiteral); + $addressLiteral = $this->checkIPV4Tag($addressLiteral); + + if (false === $addressLiteral) { + return $addressLiteral; } - if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - return new InvalidEmail(new DomainHyphened('Hypen found near DOT'), $this->lexer->token['value']); + if (!$IPv6TAG) { + $this->warnings[DomainLiteral::CODE] = new DomainLiteral(); + return $addressLiteral; } - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH - && $this->lexer->isNextToken(EmailLexer::GENERIC)) { - return new InvalidEmail(new ExpectingATEXT('Escaping following "ATOM"'), $this->lexer->token['value']); + $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); + + $this->checkIPV6Tag($addressLiteral); + + return $addressLiteral; + } + + /** + * @param string $addressLiteral + * + * @return string|false + */ + protected function checkIPV4Tag($addressLiteral) + { + $matchesIP = array(); + + // Extract IPv4 part from the end of the address-literal (if there is one) + if (preg_match( + '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/', + $addressLiteral, + $matchesIP + ) > 0 + ) { + $index = strrpos($addressLiteral, $matchesIP[0]); + if ($index === 0) { + $this->warnings[AddressLiteral::CODE] = new AddressLiteral(); + return false; + } + // Convert IPv4 part to IPv6 format for further testing + $addressLiteral = substr($addressLiteral, 0, (int) $index) . '0:0'; } - return $this->validateTokens($hasComments); + return $addressLiteral; } - protected function validateTokens(bool $hasComments) : Result + protected function checkDomainPartExceptions(array $prev) { - $validDomainTokens = array( - EmailLexer::GENERIC => true, - EmailLexer::S_HYPHEN => true, - EmailLexer::S_DOT => true, + $invalidDomainTokens = array( + EmailLexer::S_DQUOTE => true, + EmailLexer::S_SQUOTE => true, + EmailLexer::S_BACKTICK => true, + EmailLexer::S_SEMICOLON => true, + EmailLexer::S_GREATERTHAN => true, + EmailLexer::S_LOWERTHAN => true, ); - if ($hasComments) { - $validDomainTokens[EmailLexer::S_OPENPARENTHESIS] = true; - $validDomainTokens[EmailLexer::S_CLOSEPARENTHESIS] = true; + if (isset($invalidDomainTokens[$this->lexer->token['type']])) { + throw new ExpectingATEXT(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_COMMA) { + throw new CommaInDomain(); } - if (!isset($validDomainTokens[$this->lexer->token['type']])) { - return new InvalidEmail(new ExpectingATEXT('Invalid token in domain: ' . $this->lexer->token['value']), $this->lexer->token['value']); + if ($this->lexer->token['type'] === EmailLexer::S_AT) { + throw new ConsecutiveAt(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_OPENQBRACKET && $prev['type'] !== EmailLexer::S_AT) { + throw new ExpectingATEXT(); } - return new ValidEmail(); + if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) { + throw new DomainHyphened(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH + && $this->lexer->isNextToken(EmailLexer::GENERIC)) { + throw new ExpectingATEXT(); + } } - private function checkLabelLength(bool $isEndOfDomain = false) : Result + /** + * @return bool + */ + protected function hasBrackets() { - if ($this->lexer->token['type'] === EmailLexer::S_DOT || $isEndOfDomain) { - if ($this->isLabelTooLong($this->label)) { - return new InvalidEmail(new LabelTooLong(), $this->lexer->token['value']); - } - $this->label = ''; + if ($this->lexer->token['type'] !== EmailLexer::S_OPENBRACKET) { + return false; } - $this->label .= $this->lexer->token['value']; - return new ValidEmail(); + + try { + $this->lexer->find(EmailLexer::S_CLOSEBRACKET); + } catch (\RuntimeException $e) { + throw new ExpectingDomainLiteralClose(); + } + + return true; } + /** + * @param string $label + */ + protected function checkLabelLength($label) + { + if ($this->isLabelTooLong($label)) { + $this->warnings[LabelTooLong::CODE] = new LabelTooLong(); + } + } - private function isLabelTooLong(string $label) : bool + /** + * @param string $label + * @return bool + */ + private function isLabelTooLong($label) { if (preg_match('/[^\x00-\x7F]/', $label)) { - idn_to_ascii(utf8_decode($label), IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46, $idnaInfo); + idn_to_ascii($label, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46, $idnaInfo); + return (bool) ($idnaInfo['errors'] & IDNA_ERROR_LABEL_TOO_LONG); } + return strlen($label) > self::LABEL_MAX_LENGTH; } - private function addTLDWarnings(bool $isTLDMissing) : void + protected function parseDomainComments() { - if ($isTLDMissing) { - $this->warnings[TLD::CODE] = new TLD(); + $this->isUnclosedComment(); + while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { + $this->warnEscaping(); + $this->lexer->moveNext(); + } + + $this->lexer->moveNext(); + if ($this->lexer->isNextToken(EmailLexer::S_DOT)) { + throw new ExpectingATEXT(); } } - public function domainPart() : string + protected function addTLDWarnings() { - return $this->domainPart; + if ($this->warnings[DomainLiteral::CODE]) { + $this->warnings[TLD::CODE] = new TLD(); + } } -} \ No newline at end of file +} diff --git a/core/vendor/egulias/email-validator/src/Parser/DoubleQuote.php b/core/vendor/egulias/email-validator/src/Parser/DoubleQuote.php deleted file mode 100644 index 19c098e858..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/DoubleQuote.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -namespace Egulias\EmailValidator\Parser; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Parser\Parser; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Warning\CFWSWithFWS; -use Egulias\EmailValidator\Warning\QuotedString; -use Egulias\EmailValidator\Result\Reason\ExpectingATEXT; -use Egulias\EmailValidator\Result\Reason\UnclosedQuotedString; -use Egulias\EmailValidator\Result\Result; - -class DoubleQuote extends PartParser -{ - public function parse() : Result - { - - $validQuotedString = $this->checkDQUOTE(); - if($validQuotedString->isInvalid()) return $validQuotedString; - - $special = array( - EmailLexer::S_CR => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_LF => true - ); - - $invalid = array( - EmailLexer::C_NUL => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_CR => true, - EmailLexer::S_LF => true - ); - $setSpecialsWarning = true; - - $this->lexer->moveNext(); - - while ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE && null !== $this->lexer->token['type']) { - if (isset($special[$this->lexer->token['type']]) && $setSpecialsWarning) { - $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); - $setSpecialsWarning = false; - } - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH && $this->lexer->isNextToken(EmailLexer::S_DQUOTE)) { - $this->lexer->moveNext(); - } - - $this->lexer->moveNext(); - - if (!$this->escaped() && isset($invalid[$this->lexer->token['type']])) { - return new InvalidEmail(new ExpectingATEXT("Expecting ATEXT between DQUOTE"), $this->lexer->token['value']); - } - } - - $prev = $this->lexer->getPrevious(); - - if ($prev['type'] === EmailLexer::S_BACKSLASH) { - $validQuotedString = $this->checkDQUOTE(); - if($validQuotedString->isInvalid()) return $validQuotedString; - } - - if (!$this->lexer->isNextToken(EmailLexer::S_AT) && $prev['type'] !== EmailLexer::S_BACKSLASH) { - return new InvalidEmail(new ExpectingATEXT("Expecting ATEXT between DQUOTE"), $this->lexer->token['value']); - } - - return new ValidEmail(); - } - - protected function checkDQUOTE() : Result - { - $previous = $this->lexer->getPrevious(); - - if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] === EmailLexer::GENERIC) { - $description = 'https://tools.ietf.org/html/rfc5322#section-3.2.4 - quoted string should be a unit'; - return new InvalidEmail(new ExpectingATEXT($description), $this->lexer->token['value']); - } - - try { - $this->lexer->find(EmailLexer::S_DQUOTE); - } catch (\Exception $e) { - return new InvalidEmail(new UnclosedQuotedString(), $this->lexer->token['value']); - } - $this->warnings[QuotedString::CODE] = new QuotedString($previous['value'], $this->lexer->token['value']); - - return new ValidEmail(); - } - -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser/FoldingWhiteSpace.php b/core/vendor/egulias/email-validator/src/Parser/FoldingWhiteSpace.php deleted file mode 100644 index d32231e7b3..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/FoldingWhiteSpace.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -namespace Egulias\EmailValidator\Parser; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Warning\CFWSNearAt; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Warning\CFWSWithFWS; -use Egulias\EmailValidator\Result\Reason\CRNoLF; -use Egulias\EmailValidator\Result\Reason\AtextAfterCFWS; -use Egulias\EmailValidator\Result\Reason\CRLFAtTheEnd; -use Egulias\EmailValidator\Result\Reason\CRLFX2; -use Egulias\EmailValidator\Result\Reason\ExpectingCTEXT; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Result\ValidEmail; - -class FoldingWhiteSpace extends PartParser -{ - public function parse() : Result - { - if (!$this->isFWS()) { - return new ValidEmail(); - } - - $previous = $this->lexer->getPrevious(); - - $resultCRLF = $this->checkCRLFInFWS(); - if ($resultCRLF->isInvalid()) { - return $resultCRLF; - } - - if ($this->lexer->token['type'] === EmailLexer::S_CR) { - return new InvalidEmail(new CRNoLF(), $this->lexer->token['value']); - } - - if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] !== EmailLexer::S_AT) { - return new InvalidEmail(new AtextAfterCFWS(), $this->lexer->token['value']); - } - - if ($this->lexer->token['type'] === EmailLexer::S_LF || $this->lexer->token['type'] === EmailLexer::C_NUL) { - return new InvalidEmail(new ExpectingCTEXT(), $this->lexer->token['value']); - } - - if ($this->lexer->isNextToken(EmailLexer::S_AT) || $previous['type'] === EmailLexer::S_AT) { - $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); - } else { - $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); - } - - return new ValidEmail(); - } - - protected function checkCRLFInFWS() : Result - { - if ($this->lexer->token['type'] !== EmailLexer::CRLF) { - return new ValidEmail(); - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { - return new InvalidEmail(new CRLFX2(), $this->lexer->token['value']); - } - - //this has no coverage. Condition is repeated from above one - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { - return new InvalidEmail(new CRLFAtTheEnd(), $this->lexer->token['value']); - } - - return new ValidEmail(); - } - - protected function isFWS() : bool - { - if ($this->escaped()) { - return false; - } - - return $this->lexer->token['type'] === EmailLexer::S_SP || - $this->lexer->token['type'] === EmailLexer::S_HTAB || - $this->lexer->token['type'] === EmailLexer::S_CR || - $this->lexer->token['type'] === EmailLexer::S_LF || - $this->lexer->token['type'] === EmailLexer::CRLF; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser/IDLeftPart.php b/core/vendor/egulias/email-validator/src/Parser/IDLeftPart.php deleted file mode 100644 index abb4982b72..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/IDLeftPart.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Parser; - -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Parser\LocalPart; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\CommentsInIDRight; - -class IDLeftPart extends LocalPart -{ - protected function parseComments(): Result - { - return new InvalidEmail(new CommentsInIDRight(), $this->lexer->token['value']); - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser/IDRightPart.php b/core/vendor/egulias/email-validator/src/Parser/IDRightPart.php deleted file mode 100644 index bcf80dd0f2..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/IDRightPart.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Parser; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\ExpectingATEXT; - -class IDRightPart extends DomainPart -{ - protected function validateTokens(bool $hasComments) : Result - { - $invalidDomainTokens = array( - EmailLexer::S_DQUOTE => true, - EmailLexer::S_SQUOTE => true, - EmailLexer::S_BACKTICK => true, - EmailLexer::S_SEMICOLON => true, - EmailLexer::S_GREATERTHAN => true, - EmailLexer::S_LOWERTHAN => true, - ); - - if (isset($invalidDomainTokens[$this->lexer->token['type']])) { - return new InvalidEmail(new ExpectingATEXT('Invalid token in domain: ' . $this->lexer->token['value']), $this->lexer->token['value']); - } - return new ValidEmail(); - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Parser/LocalPart.php b/core/vendor/egulias/email-validator/src/Parser/LocalPart.php index d505c6183e..3c21f34ac0 100644 --- a/core/vendor/egulias/email-validator/src/Parser/LocalPart.php +++ b/core/vendor/egulias/email-validator/src/Parser/LocalPart.php @@ -2,163 +2,144 @@ namespace Egulias\EmailValidator\Parser; +use Egulias\EmailValidator\Exception\DotAtEnd; +use Egulias\EmailValidator\Exception\DotAtStart; use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Result\ValidEmail; -use Egulias\EmailValidator\Result\InvalidEmail; +use Egulias\EmailValidator\Exception\ExpectingAT; +use Egulias\EmailValidator\Exception\ExpectingATEXT; +use Egulias\EmailValidator\Exception\UnclosedQuotedString; +use Egulias\EmailValidator\Exception\UnopenedComment; +use Egulias\EmailValidator\Warning\CFWSWithFWS; use Egulias\EmailValidator\Warning\LocalTooLong; -use Egulias\EmailValidator\Result\Reason\DotAtEnd; -use Egulias\EmailValidator\Result\Reason\DotAtStart; -use Egulias\EmailValidator\Result\Reason\ConsecutiveDot; -use Egulias\EmailValidator\Result\Reason\ExpectingATEXT; -use Egulias\EmailValidator\Parser\CommentStrategy\LocalComment; -class LocalPart extends PartParser +class LocalPart extends Parser { - /** - * @var string - */ - private $localPart = ''; - - - public function parse() : Result + public function parse($localPart) { - $this->lexer->startRecording(); + $parseDQuote = true; + $closingQuote = false; + $openedParenthesis = 0; + $totalLength = 0; while ($this->lexer->token['type'] !== EmailLexer::S_AT && null !== $this->lexer->token['type']) { - if ($this->hasDotAtStart()) { - return new InvalidEmail(new DotAtStart(), $this->lexer->token['value']); + if ($this->lexer->token['type'] === EmailLexer::S_DOT && null === $this->lexer->getPrevious()['type']) { + throw new DotAtStart(); } - if ($this->lexer->token['type'] === EmailLexer::S_DQUOTE) { - $dquoteParsingResult = $this->parseDoubleQuote(); - - //Invalid double quote parsing - if($dquoteParsingResult->isInvalid()) { - return $dquoteParsingResult; - } + $closingQuote = $this->checkDQUOTE($closingQuote); + if ($closingQuote && $parseDQuote) { + $parseDQuote = $this->parseDoubleQuote(); } - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS || - $this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS ) { - $commentsResult = $this->parseComments(); + if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { + $this->parseComments(); + $openedParenthesis += $this->getOpenedParenthesis(); + } - //Invalid comment parsing - if($commentsResult->isInvalid()) { - return $commentsResult; + if ($this->lexer->token['type'] === EmailLexer::S_CLOSEPARENTHESIS) { + if ($openedParenthesis === 0) { + throw new UnopenedComment(); } - } - if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - return new InvalidEmail(new ConsecutiveDot(), $this->lexer->token['value']); + $openedParenthesis--; } + $this->checkConsecutiveDots(); + if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_AT) ) { - return new InvalidEmail(new DotAtEnd(), $this->lexer->token['value']); + throw new DotAtEnd(); } - $resultEscaping = $this->validateEscaping(); - if ($resultEscaping->isInvalid()) { - return $resultEscaping; - } - - $resultToken = $this->validateTokens(false); - if ($resultToken->isInvalid()) { - return $resultToken; - } + $this->warnEscaping(); + $this->isInvalidToken($this->lexer->token, $closingQuote); - $resultFWS = $this->parseLocalFWS(); - if($resultFWS->isInvalid()) { - return $resultFWS; + if ($this->isFWS()) { + $this->parseFWS(); } + $totalLength += strlen($this->lexer->token['value']); $this->lexer->moveNext(); } - $this->lexer->stopRecording(); - $this->localPart = rtrim($this->lexer->getAccumulatedValues(), '@'); - if (strlen($this->localPart) > LocalTooLong::LOCAL_PART_LENGTH) { + if ($totalLength > LocalTooLong::LOCAL_PART_LENGTH) { $this->warnings[LocalTooLong::CODE] = new LocalTooLong(); } - - return new ValidEmail(); } - protected function validateTokens(bool $hasComments) : Result + /** + * @return bool + */ + protected function parseDoubleQuote() { - $invalidTokens = array( - EmailLexer::S_COMMA => EmailLexer::S_COMMA, - EmailLexer::S_CLOSEBRACKET => EmailLexer::S_CLOSEBRACKET, - EmailLexer::S_OPENBRACKET => EmailLexer::S_OPENBRACKET, - EmailLexer::S_GREATERTHAN => EmailLexer::S_GREATERTHAN, - EmailLexer::S_LOWERTHAN => EmailLexer::S_LOWERTHAN, - EmailLexer::S_COLON => EmailLexer::S_COLON, - EmailLexer::S_SEMICOLON => EmailLexer::S_SEMICOLON, - EmailLexer::INVALID => EmailLexer::INVALID + $parseAgain = true; + $special = array( + EmailLexer::S_CR => true, + EmailLexer::S_HTAB => true, + EmailLexer::S_LF => true ); - if (isset($invalidTokens[$this->lexer->token['type']])) { - return new InvalidEmail(new ExpectingATEXT('Invalid token found'), $this->lexer->token['value']); - } - return new ValidEmail(); - } - public function localPart() : string - { - return $this->localPart; - } + $invalid = array( + EmailLexer::C_NUL => true, + EmailLexer::S_HTAB => true, + EmailLexer::S_CR => true, + EmailLexer::S_LF => true + ); + $setSpecialsWarning = true; - private function parseLocalFWS() : Result - { - $foldingWS = new FoldingWhiteSpace($this->lexer); - $resultFWS = $foldingWS->parse(); - if ($resultFWS->isValid()) { - $this->warnings = array_merge($this->warnings, $foldingWS->getWarnings()); - } - return $resultFWS; - } + $this->lexer->moveNext(); - private function hasDotAtStart() : bool - { - return $this->lexer->token['type'] === EmailLexer::S_DOT && null === $this->lexer->getPrevious()['type']; - } - - private function parseDoubleQuote() : Result - { - $dquoteParser = new DoubleQuote($this->lexer); - $parseAgain = $dquoteParser->parse(); - $this->warnings = array_merge($this->warnings, $dquoteParser->getWarnings()); + while ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE && null !== $this->lexer->token['type']) { + $parseAgain = false; + if (isset($special[$this->lexer->token['type']]) && $setSpecialsWarning) { + $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); + $setSpecialsWarning = false; + } + if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH && $this->lexer->isNextToken(EmailLexer::S_DQUOTE)) { + $this->lexer->moveNext(); + } - return $parseAgain; - } + $this->lexer->moveNext(); - protected function parseComments(): Result - { - $commentParser = new Comment($this->lexer, new LocalComment()); - $result = $commentParser->parse(); - $this->warnings = array_merge($this->warnings, $commentParser->getWarnings()); - if($result->isInvalid()) { - return $result; + if (!$this->escaped() && isset($invalid[$this->lexer->token['type']])) { + throw new ExpectingATEXT(); + } } - return $result; - } - private function validateEscaping() : Result - { - //Backslash found - if ($this->lexer->token['type'] !== EmailLexer::S_BACKSLASH) { - return new ValidEmail(); - } + $prev = $this->lexer->getPrevious(); - if ($this->lexer->isNextToken(EmailLexer::GENERIC)) { - return new InvalidEmail(new ExpectingATEXT('Found ATOM after escaping'), $this->lexer->token['value']); + if ($prev['type'] === EmailLexer::S_BACKSLASH) { + if (!$this->checkDQUOTE(false)) { + throw new UnclosedQuotedString(); + } } - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::C_DEL))) { - return new ValidEmail(); + if (!$this->lexer->isNextToken(EmailLexer::S_AT) && $prev['type'] !== EmailLexer::S_BACKSLASH) { + throw new ExpectingAT(); } - return new ValidEmail(); + return $parseAgain; + } + + /** + * @param bool $closingQuote + */ + protected function isInvalidToken(array $token, $closingQuote) + { + $forbidden = array( + EmailLexer::S_COMMA, + EmailLexer::S_CLOSEBRACKET, + EmailLexer::S_OPENBRACKET, + EmailLexer::S_GREATERTHAN, + EmailLexer::S_LOWERTHAN, + EmailLexer::S_COLON, + EmailLexer::S_SEMICOLON, + EmailLexer::INVALID + ); + + if (in_array($token['type'], $forbidden) && !$closingQuote) { + throw new ExpectingATEXT(); + } } -} \ No newline at end of file +} diff --git a/core/vendor/egulias/email-validator/src/Parser/Parser.php b/core/vendor/egulias/email-validator/src/Parser/Parser.php new file mode 100644 index 0000000000..ccdc93889a --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Parser/Parser.php @@ -0,0 +1,249 @@ +<?php + +namespace Egulias\EmailValidator\Parser; + +use Egulias\EmailValidator\EmailLexer; +use Egulias\EmailValidator\Exception\AtextAfterCFWS; +use Egulias\EmailValidator\Exception\ConsecutiveDot; +use Egulias\EmailValidator\Exception\CRLFAtTheEnd; +use Egulias\EmailValidator\Exception\CRLFX2; +use Egulias\EmailValidator\Exception\CRNoLF; +use Egulias\EmailValidator\Exception\ExpectingQPair; +use Egulias\EmailValidator\Exception\ExpectingATEXT; +use Egulias\EmailValidator\Exception\ExpectingCTEXT; +use Egulias\EmailValidator\Exception\UnclosedComment; +use Egulias\EmailValidator\Exception\UnclosedQuotedString; +use Egulias\EmailValidator\Warning\CFWSNearAt; +use Egulias\EmailValidator\Warning\CFWSWithFWS; +use Egulias\EmailValidator\Warning\Comment; +use Egulias\EmailValidator\Warning\QuotedPart; +use Egulias\EmailValidator\Warning\QuotedString; + +abstract class Parser +{ + /** + * @var array + */ + protected $warnings = []; + + /** + * @var EmailLexer + */ + protected $lexer; + + /** + * @var int + */ + protected $openedParenthesis = 0; + + public function __construct(EmailLexer $lexer) + { + $this->lexer = $lexer; + } + + /** + * @return \Egulias\EmailValidator\Warning\Warning[] + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * @param string $str + */ + abstract public function parse($str); + + /** @return int */ + public function getOpenedParenthesis() + { + return $this->openedParenthesis; + } + + /** + * validateQuotedPair + */ + protected function validateQuotedPair() + { + if (!($this->lexer->token['type'] === EmailLexer::INVALID + || $this->lexer->token['type'] === EmailLexer::C_DEL)) { + throw new ExpectingQPair(); + } + + $this->warnings[QuotedPart::CODE] = + new QuotedPart($this->lexer->getPrevious()['type'], $this->lexer->token['type']); + } + + protected function parseComments() + { + $this->openedParenthesis = 1; + $this->isUnclosedComment(); + $this->warnings[Comment::CODE] = new Comment(); + while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { + if ($this->lexer->isNextToken(EmailLexer::S_OPENPARENTHESIS)) { + $this->openedParenthesis++; + } + $this->warnEscaping(); + $this->lexer->moveNext(); + } + + $this->lexer->moveNext(); + if ($this->lexer->isNextTokenAny(array(EmailLexer::GENERIC, EmailLexer::S_EMPTY))) { + throw new ExpectingATEXT(); + } + + if ($this->lexer->isNextToken(EmailLexer::S_AT)) { + $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); + } + } + + /** + * @return bool + */ + protected function isUnclosedComment() + { + try { + $this->lexer->find(EmailLexer::S_CLOSEPARENTHESIS); + return true; + } catch (\RuntimeException $e) { + throw new UnclosedComment(); + } + } + + protected function parseFWS() + { + $previous = $this->lexer->getPrevious(); + + $this->checkCRLFInFWS(); + + if ($this->lexer->token['type'] === EmailLexer::S_CR) { + throw new CRNoLF(); + } + + if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] !== EmailLexer::S_AT) { + throw new AtextAfterCFWS(); + } + + if ($this->lexer->token['type'] === EmailLexer::S_LF || $this->lexer->token['type'] === EmailLexer::C_NUL) { + throw new ExpectingCTEXT(); + } + + if ($this->lexer->isNextToken(EmailLexer::S_AT) || $previous['type'] === EmailLexer::S_AT) { + $this->warnings[CFWSNearAt::CODE] = new CFWSNearAt(); + } else { + $this->warnings[CFWSWithFWS::CODE] = new CFWSWithFWS(); + } + } + + protected function checkConsecutiveDots() + { + if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { + throw new ConsecutiveDot(); + } + } + + /** + * @return bool + */ + protected function isFWS() + { + if ($this->escaped()) { + return false; + } + + if ($this->lexer->token['type'] === EmailLexer::S_SP || + $this->lexer->token['type'] === EmailLexer::S_HTAB || + $this->lexer->token['type'] === EmailLexer::S_CR || + $this->lexer->token['type'] === EmailLexer::S_LF || + $this->lexer->token['type'] === EmailLexer::CRLF + ) { + return true; + } + + return false; + } + + /** + * @return bool + */ + protected function escaped() + { + $previous = $this->lexer->getPrevious(); + + if ($previous && $previous['type'] === EmailLexer::S_BACKSLASH + && + $this->lexer->token['type'] !== EmailLexer::GENERIC + ) { + return true; + } + + return false; + } + + /** + * @return bool + */ + protected function warnEscaping() + { + if ($this->lexer->token['type'] !== EmailLexer::S_BACKSLASH) { + return false; + } + + if ($this->lexer->isNextToken(EmailLexer::GENERIC)) { + throw new ExpectingATEXT(); + } + + if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::C_DEL))) { + return false; + } + + $this->warnings[QuotedPart::CODE] = + new QuotedPart($this->lexer->getPrevious()['type'], $this->lexer->token['type']); + return true; + + } + + /** + * @param bool $hasClosingQuote + * + * @return bool + */ + protected function checkDQUOTE($hasClosingQuote) + { + if ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE) { + return $hasClosingQuote; + } + if ($hasClosingQuote) { + return $hasClosingQuote; + } + $previous = $this->lexer->getPrevious(); + if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] === EmailLexer::GENERIC) { + throw new ExpectingATEXT(); + } + + try { + $this->lexer->find(EmailLexer::S_DQUOTE); + $hasClosingQuote = true; + } catch (\Exception $e) { + throw new UnclosedQuotedString(); + } + $this->warnings[QuotedString::CODE] = new QuotedString($previous['value'], $this->lexer->token['value']); + + return $hasClosingQuote; + } + + protected function checkCRLFInFWS() + { + if ($this->lexer->token['type'] !== EmailLexer::CRLF) { + return; + } + + if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { + throw new CRLFX2(); + } + + if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { + throw new CRLFAtTheEnd(); + } + } +} diff --git a/core/vendor/egulias/email-validator/src/Parser/PartParser.php b/core/vendor/egulias/email-validator/src/Parser/PartParser.php deleted file mode 100644 index fd65fc5602..0000000000 --- a/core/vendor/egulias/email-validator/src/Parser/PartParser.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Parser; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\ConsecutiveDot; -use Egulias\EmailValidator\Result\Result; -use Egulias\EmailValidator\Result\ValidEmail; - -abstract class PartParser -{ - /** - * @var array - */ - protected $warnings = []; - - /** - * @var EmailLexer - */ - protected $lexer; - - public function __construct(EmailLexer $lexer) - { - $this->lexer = $lexer; - } - - abstract public function parse() : Result; - - /** - * @return \Egulias\EmailValidator\Warning\Warning[] - */ - public function getWarnings() - { - return $this->warnings; - } - - protected function parseFWS() : Result - { - $foldingWS = new FoldingWhiteSpace($this->lexer); - $resultFWS = $foldingWS->parse(); - $this->warnings = array_merge($this->warnings, $foldingWS->getWarnings()); - return $resultFWS; - } - - protected function checkConsecutiveDots() : Result - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - return new InvalidEmail(new ConsecutiveDot(), $this->lexer->token['value']); - } - - return new ValidEmail(); - } - - protected function escaped() : bool - { - $previous = $this->lexer->getPrevious(); - - return $previous && $previous['type'] === EmailLexer::S_BACKSLASH - && - $this->lexer->token['type'] !== EmailLexer::GENERIC; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/InvalidEmail.php b/core/vendor/egulias/email-validator/src/Result/InvalidEmail.php deleted file mode 100644 index 3d85e154ae..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/InvalidEmail.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result; - -use Egulias\EmailValidator\Result\Reason\Reason; - -class InvalidEmail implements Result -{ - private $token; - /** - * @var Reason - */ - protected $reason; - - public function __construct(Reason $reason, string $token) - { - $this->token = $token; - $this->reason = $reason; - } - - public function isValid(): bool - { - return false; - } - - public function isInvalid(): bool - { - return true; - } - - public function description(): string - { - return $this->reason->description() . " in char " . $this->token; - } - - public function code(): int - { - return $this->reason->code(); - } - - public function reason() : Reason - { - return $this->reason; - } - -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/MultipleErrors.php b/core/vendor/egulias/email-validator/src/Result/MultipleErrors.php deleted file mode 100644 index 5fa85afc9e..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/MultipleErrors.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result; - -use Egulias\EmailValidator\Result\Reason\EmptyReason; -use Egulias\EmailValidator\Result\Reason\Reason; - -/** - * @psalm-suppress PropertyNotSetInConstructor - */ -class MultipleErrors extends InvalidEmail -{ - /** - * @var Reason[] - */ - private $reasons = []; - - public function __construct() - { - } - - public function addReason(Reason $reason) : void - { - $this->reasons[$reason->code()] = $reason; - } - - /** - * @return Reason[] - */ - public function getReasons() : array - { - return $this->reasons; - } - - public function reason() : Reason - { - return 0 !== count($this->reasons) - ? current($this->reasons) - : new EmptyReason(); - } - - public function description() : string - { - $description = ''; - foreach($this->reasons as $reason) { - $description .= $reason->description() . PHP_EOL; - } - - return $description; - } - - public function code() : int - { - return 0; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/AtextAfterCFWS.php b/core/vendor/egulias/email-validator/src/Result/Reason/AtextAfterCFWS.php deleted file mode 100644 index 76015a2d9e..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/AtextAfterCFWS.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class AtextAfterCFWS implements Reason -{ - public function code() : int - { - return 133; - } - - public function description() : string - { - return 'ATEXT found after CFWS'; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/CRLFAtTheEnd.php b/core/vendor/egulias/email-validator/src/Result/Reason/CRLFAtTheEnd.php deleted file mode 100644 index a0b66e71f6..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/CRLFAtTheEnd.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class CRLFAtTheEnd implements Reason -{ - const CODE = 149; - const REASON = "CRLF at the end"; - - public function code() : int - { - return 149; - } - - public function description() : string - { - return 'CRLF at the end'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/CRLFX2.php b/core/vendor/egulias/email-validator/src/Result/Reason/CRLFX2.php deleted file mode 100644 index 6123564909..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/CRLFX2.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class CRLFX2 implements Reason -{ - public function code() : int - { - return 148; - } - - public function description() : string - { - return 'CR LF tokens found twice'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/CRNoLF.php b/core/vendor/egulias/email-validator/src/Result/Reason/CRNoLF.php deleted file mode 100644 index e315ff0c96..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/CRNoLF.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class CRNoLF implements Reason -{ - public function code() : int - { - return 150; - } - - public function description() : string - { - return 'Missing LF after CR'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/CharNotAllowed.php b/core/vendor/egulias/email-validator/src/Result/Reason/CharNotAllowed.php deleted file mode 100644 index 45999b3629..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/CharNotAllowed.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class CharNotAllowed implements Reason -{ - public function code() : int - { - return 1; - } - - public function description() : string - { - return "Character not allowed"; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/CommaInDomain.php b/core/vendor/egulias/email-validator/src/Result/Reason/CommaInDomain.php deleted file mode 100644 index 93d3b56159..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/CommaInDomain.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class CommaInDomain implements Reason -{ - public function code() : int - { - return 200; - } - - public function description() : string - { - return "Comma ',' is not allowed in domain part"; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/CommentsInIDRight.php b/core/vendor/egulias/email-validator/src/Result/Reason/CommentsInIDRight.php deleted file mode 100644 index 43a7cf7b32..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/CommentsInIDRight.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class CommentsInIDRight implements Reason -{ - public function code() : int - { - return 400; - } - - public function description() : string - { - return 'Comments are not allowed in IDRight for message-id'; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/ConsecutiveAt.php b/core/vendor/egulias/email-validator/src/Result/Reason/ConsecutiveAt.php deleted file mode 100644 index 5128dc9e06..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/ConsecutiveAt.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class ConsecutiveAt implements Reason -{ - public function code() : int - { - return 128; - } - - public function description() : string - { - return '@ found after another @'; - } - -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/ConsecutiveDot.php b/core/vendor/egulias/email-validator/src/Result/Reason/ConsecutiveDot.php deleted file mode 100644 index e7b6565785..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/ConsecutiveDot.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class ConsecutiveDot implements Reason -{ - public function code() : int - { - return 132; - } - - public function description() : string - { - return 'Concecutive DOT found'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/DetailedReason.php b/core/vendor/egulias/email-validator/src/Result/Reason/DetailedReason.php deleted file mode 100644 index 1751987339..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/DetailedReason.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -abstract class DetailedReason implements Reason -{ - protected $detailedDescription; - - public function __construct(string $details) - { - $this->detailedDescription = $details; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/DomainAcceptsNoMail.php b/core/vendor/egulias/email-validator/src/Result/Reason/DomainAcceptsNoMail.php deleted file mode 100644 index 55f44bbafd..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/DomainAcceptsNoMail.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class DomainAcceptsNoMail implements Reason -{ - public function code() : int - { - return 154; - } - - public function description() : string - { - return 'Domain accepts no mail (Null MX, RFC7505)'; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/DomainHyphened.php b/core/vendor/egulias/email-validator/src/Result/Reason/DomainHyphened.php deleted file mode 100644 index 2944eb8ee2..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/DomainHyphened.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class DomainHyphened extends DetailedReason -{ - public function code() : int - { - return 144; - } - - public function description() : string - { - return 'S_HYPHEN found in domain'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/DomainTooLong.php b/core/vendor/egulias/email-validator/src/Result/Reason/DomainTooLong.php deleted file mode 100644 index fa17213236..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/DomainTooLong.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class DomainTooLong implements Reason -{ - public function code() : int - { - return 244; - } - - public function description() : string - { - return 'Domain is longer than 253 characters'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/DotAtEnd.php b/core/vendor/egulias/email-validator/src/Result/Reason/DotAtEnd.php deleted file mode 100644 index 6dfe605525..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/DotAtEnd.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class DotAtEnd implements Reason -{ - public function code() : int - { - return 142; - } - - public function description() : string - { - return 'Dot at the end'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/DotAtStart.php b/core/vendor/egulias/email-validator/src/Result/Reason/DotAtStart.php deleted file mode 100644 index b564f1b5fe..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/DotAtStart.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class DotAtStart implements Reason -{ - public function code() : int - { - return 141; - } - - public function description() : string - { - return "Starts with a DOT"; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/EmptyReason.php b/core/vendor/egulias/email-validator/src/Result/Reason/EmptyReason.php deleted file mode 100644 index 3016e6f71b..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/EmptyReason.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class EmptyReason implements Reason -{ - public function code() : int - { - return 0; - } - - public function description() : string - { - return 'Empty reason'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/ExceptionFound.php b/core/vendor/egulias/email-validator/src/Result/Reason/ExceptionFound.php deleted file mode 100644 index 8b1135d06d..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/ExceptionFound.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class ExceptionFound implements Reason -{ - /** - * @var \Exception - */ - private $exception; - - public function __construct(\Exception $exception) - { - $this->exception = $exception; - - } - public function code() : int - { - return 999; - } - - public function description() : string - { - return $this->exception->getMessage(); - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingATEXT.php b/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingATEXT.php deleted file mode 100644 index 07ea8d2383..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingATEXT.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class ExpectingATEXT extends DetailedReason -{ - public function code() : int - { - return 137; - } - - public function description() : string - { - return "Expecting ATEXT (Printable US-ASCII). Extended: " . $this->detailedDescription; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingCTEXT.php b/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingCTEXT.php deleted file mode 100644 index 64f5f7c3e8..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingCTEXT.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class ExpectingCTEXT implements Reason -{ - public function code() : int - { - return 139; - } - - public function description() : string - { - return 'Expecting CTEXT'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingDTEXT.php b/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingDTEXT.php deleted file mode 100644 index e47c251bff..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingDTEXT.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class ExpectingDTEXT implements Reason -{ - public function code() : int - { - return 129; - } - - public function description() : string - { - return 'Expecting DTEXT'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingDomainLiteralClose.php b/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingDomainLiteralClose.php deleted file mode 100644 index 7deffcaffe..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/ExpectingDomainLiteralClose.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class ExpectingDomainLiteralClose implements Reason -{ - public function code() : int - { - return 137; - } - - public function description() : string - { - return "Closing bracket ']' for domain literal not found"; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/LabelTooLong.php b/core/vendor/egulias/email-validator/src/Result/Reason/LabelTooLong.php deleted file mode 100644 index e181ef923b..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/LabelTooLong.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class LabelTooLong implements Reason -{ - public function code() : int - { - return 245; - } - - public function description() : string - { - return 'Domain "label" is longer than 63 characters'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/LocalOrReservedDomain.php b/core/vendor/egulias/email-validator/src/Result/Reason/LocalOrReservedDomain.php deleted file mode 100644 index bc7c5d5a3d..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/LocalOrReservedDomain.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class LocalOrReservedDomain implements Reason -{ - public function code() : int - { - return 153; - } - - public function description() : string - { - return 'Local, mDNS or reserved domain (RFC2606, RFC6762)'; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/NoDNSRecord.php b/core/vendor/egulias/email-validator/src/Result/Reason/NoDNSRecord.php deleted file mode 100644 index e217d02c95..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/NoDNSRecord.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class NoDNSRecord implements Reason -{ - public function code() : int - { - return 5; - } - - public function description() : string - { - return 'No MX or A DSN record was found for this email'; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/NoDomainPart.php b/core/vendor/egulias/email-validator/src/Result/Reason/NoDomainPart.php deleted file mode 100644 index bbbb04bea4..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/NoDomainPart.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class NoDomainPart implements Reason -{ - public function code() : int - { - return 131; - } - - public function description() : string - { - return 'No domain part found'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/NoLocalPart.php b/core/vendor/egulias/email-validator/src/Result/Reason/NoLocalPart.php deleted file mode 100644 index 984c061945..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/NoLocalPart.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class NoLocalPart implements Reason -{ - public function code() : int - { - return 130; - } - - public function description() : string - { - return "No local part"; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/RFCWarnings.php b/core/vendor/egulias/email-validator/src/Result/Reason/RFCWarnings.php deleted file mode 100644 index e6ff29a344..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/RFCWarnings.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class RFCWarnings implements Reason -{ - public function code() : int - { - return 997; - } - - public function description() : string - { - return 'Warnings found after validating'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/Reason.php b/core/vendor/egulias/email-validator/src/Result/Reason/Reason.php deleted file mode 100644 index e6810b9365..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/Reason.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -interface Reason -{ - /** - * Code for user land to act upon; - */ - public function code() : int; - - /** - * Short description of the result, human readable. - */ - public function description() : string; -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/SpoofEmail.php b/core/vendor/egulias/email-validator/src/Result/Reason/SpoofEmail.php deleted file mode 100644 index da669cc834..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/SpoofEmail.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class SpoofEmail implements Reason -{ - public function code() : int - { - return 298; - } - - public function description() : string - { - return 'The email contains mixed UTF8 chars that makes it suspicious'; - } - -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/UnOpenedComment.php b/core/vendor/egulias/email-validator/src/Result/Reason/UnOpenedComment.php deleted file mode 100644 index cc7915ca36..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/UnOpenedComment.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class UnOpenedComment implements Reason -{ - public function code() : int - { - return 152; - } - - public function description(): string - { - return 'Missing openning comment parentheses - https://tools.ietf.org/html/rfc5322#section-3.2.2'; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/UnableToGetDNSRecord.php b/core/vendor/egulias/email-validator/src/Result/Reason/UnableToGetDNSRecord.php deleted file mode 100644 index f178b1a041..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/UnableToGetDNSRecord.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -/** - * Used on SERVFAIL, TIMEOUT or other runtime and network errors - */ -class UnableToGetDNSRecord extends NoDNSRecord -{ - public function code() : int - { - return 3; - } - - public function description() : string - { - return 'Unable to get DNS records for the host'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/UnclosedComment.php b/core/vendor/egulias/email-validator/src/Result/Reason/UnclosedComment.php deleted file mode 100644 index 4ac41a0b83..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/UnclosedComment.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class UnclosedComment implements Reason -{ - public function code() : int - { - return 146; - } - - public function description(): string - { - return 'No closing comment token found'; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/UnclosedQuotedString.php b/core/vendor/egulias/email-validator/src/Result/Reason/UnclosedQuotedString.php deleted file mode 100644 index f42c422586..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/UnclosedQuotedString.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class UnclosedQuotedString implements Reason -{ - public function code() : int - { - return 145; - } - - public function description() : string - { - return "Unclosed quoted string"; - } -} diff --git a/core/vendor/egulias/email-validator/src/Result/Reason/UnusualElements.php b/core/vendor/egulias/email-validator/src/Result/Reason/UnusualElements.php deleted file mode 100644 index 03873dc09e..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Reason/UnusualElements.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result\Reason; - -class UnusualElements implements Reason -{ - /** - * @var string $element - */ - private $element = ''; - - public function __construct(string $element) - { - $this->element = $element; - } - - public function code() : int - { - return 201; - } - - public function description() : string - { - return 'Unusual element found, wourld render invalid in majority of cases. Element found: ' . $this->element; - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/Result.php b/core/vendor/egulias/email-validator/src/Result/Result.php deleted file mode 100644 index 1e16bccacc..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/Result.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result; - -interface Result -{ - /** - * Is validation result valid? - */ - public function isValid() : bool; - - /** - * Is validation result invalid? - * Usually the inverse of isValid() - */ - public function isInvalid() : bool; - - /** - * Short description of the result, human readable. - */ - public function description() : string; - - /** - * Code for user land to act upon. - */ - public function code() : int; -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/SpoofEmail.php b/core/vendor/egulias/email-validator/src/Result/SpoofEmail.php deleted file mode 100644 index 9f010de114..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/SpoofEmail.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -namespace Egulias\EmailValidator\Result; - -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\SpoofEmail as ReasonSpoofEmail; - -class SpoofEmail extends InvalidEmail -{ - public function __construct() - { - $this->reason = new ReasonSpoofEmail(); - parent::__construct($this->reason, ''); - } -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Result/ValidEmail.php b/core/vendor/egulias/email-validator/src/Result/ValidEmail.php deleted file mode 100644 index 4f3693a924..0000000000 --- a/core/vendor/egulias/email-validator/src/Result/ValidEmail.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Result; - -class ValidEmail implements Result -{ - public function isValid(): bool - { - return true; - } - - public function isInvalid(): bool - { - return false; - } - - public function description(): string - { - return "Valid email"; - } - - public function code(): int - { - return 0; - } - -} \ No newline at end of file diff --git a/core/vendor/egulias/email-validator/src/Validation/DNSCheckValidation.php b/core/vendor/egulias/email-validator/src/Validation/DNSCheckValidation.php index a935727840..491082a590 100644 --- a/core/vendor/egulias/email-validator/src/Validation/DNSCheckValidation.php +++ b/core/vendor/egulias/email-validator/src/Validation/DNSCheckValidation.php @@ -3,20 +3,14 @@ namespace Egulias\EmailValidator\Validation; use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\DomainAcceptsNoMail; -use Egulias\EmailValidator\Result\Reason\LocalOrReservedDomain; -use Egulias\EmailValidator\Result\Reason\NoDNSRecord as ReasonNoDNSRecord; -use Egulias\EmailValidator\Result\Reason\UnableToGetDNSRecord; +use Egulias\EmailValidator\Exception\InvalidEmail; +use Egulias\EmailValidator\Exception\LocalOrReservedDomain; +use Egulias\EmailValidator\Exception\DomainAcceptsNoMail; use Egulias\EmailValidator\Warning\NoDNSMXRecord; +use Egulias\EmailValidator\Exception\NoDNSRecord; class DNSCheckValidation implements EmailValidation { - /** - * @var int - */ - protected const DNS_RECORD_TYPES_TO_CHECK = DNS_MX + DNS_A + DNS_AAAA; - /** * @var array */ @@ -40,7 +34,7 @@ public function __construct() } } - public function isValid(string $email, EmailLexer $emailLexer) : bool + public function isValid($email, EmailLexer $emailLexer) { // use the input to check DNS if we cannot extract something similar to a domain $host = $email; @@ -79,19 +73,19 @@ public function isValid(string $email, EmailLexer $emailLexer) : bool // Exclude reserved top level DNS names if ($isLocalDomain || $isReservedTopLevel) { - $this->error = new InvalidEmail(new LocalOrReservedDomain(), $host); + $this->error = new LocalOrReservedDomain(); return false; } return $this->checkDns($host); } - public function getError() : ?InvalidEmail + public function getError() { return $this->error; } - public function getWarnings() : array + public function getWarnings() { return $this->warnings; } @@ -118,43 +112,31 @@ protected function checkDns($host) * * @return bool True on success. */ - private function validateDnsRecords($host) : bool + private function validateDnsRecords($host) { - // A workaround to fix https://bugs.php.net/bug.php?id=73149 - /** @psalm-suppress InvalidArgument */ - set_error_handler( - static function (int $errorLevel, string $errorMessage): ?bool { - throw new \RuntimeException("Unable to get DNS record for the host: $errorMessage"); - } - ); - - try { - // Get all MX, A and AAAA DNS records for host - $dnsRecords = dns_get_record($host, static::DNS_RECORD_TYPES_TO_CHECK); - } catch (\RuntimeException $exception) { - $this->error = new InvalidEmail(new UnableToGetDNSRecord(), ''); + // Get all MX, A and AAAA DNS records for host + // Using @ as workaround to fix https://bugs.php.net/bug.php?id=73149 + $dnsRecords = @dns_get_record($host, DNS_MX + DNS_A + DNS_AAAA); - return false; - } finally { - restore_error_handler(); - } // No MX, A or AAAA DNS records - if ($dnsRecords === [] || $dnsRecords === false) { - $this->error = new InvalidEmail(new ReasonNoDNSRecord(), ''); + if (empty($dnsRecords)) { + $this->error = new NoDNSRecord(); return false; } // For each DNS record foreach ($dnsRecords as $dnsRecord) { if (!$this->validateMXRecord($dnsRecord)) { - // No MX records (fallback to A or AAAA records) - if (empty($this->mxRecords)) { - $this->warnings[NoDNSMXRecord::CODE] = new NoDNSMXRecord(); - } return false; } } + + // No MX records (fallback to A or AAAA records) + if (empty($this->mxRecords)) { + $this->warnings[NoDNSMXRecord::CODE] = new NoDNSMXRecord(); + } + return true; } @@ -165,7 +147,7 @@ static function (int $errorLevel, string $errorMessage): ?bool { * * @return bool True if valid. */ - private function validateMxRecord($dnsRecord) : bool + private function validateMxRecord($dnsRecord) { if ($dnsRecord['type'] !== 'MX') { return true; @@ -173,7 +155,7 @@ private function validateMxRecord($dnsRecord) : bool // "Null MX" record indicates the domain accepts no mail (https://tools.ietf.org/html/rfc7505) if (empty($dnsRecord['target']) || $dnsRecord['target'] === '.') { - $this->error = new InvalidEmail(new DomainAcceptsNoMail(), ""); + $this->error = new DomainAcceptsNoMail(); return false; } @@ -181,4 +163,4 @@ private function validateMxRecord($dnsRecord) : bool return true; } -} \ No newline at end of file +} diff --git a/core/vendor/egulias/email-validator/src/Validation/EmailValidation.php b/core/vendor/egulias/email-validator/src/Validation/EmailValidation.php index 1bcc0a70bf..d5a015be57 100644 --- a/core/vendor/egulias/email-validator/src/Validation/EmailValidation.php +++ b/core/vendor/egulias/email-validator/src/Validation/EmailValidation.php @@ -3,7 +3,7 @@ namespace Egulias\EmailValidator\Validation; use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\InvalidEmail; +use Egulias\EmailValidator\Exception\InvalidEmail; use Egulias\EmailValidator\Warning\Warning; interface EmailValidation @@ -16,19 +16,19 @@ interface EmailValidation * * @return bool */ - public function isValid(string $email, EmailLexer $emailLexer) : bool; + public function isValid($email, EmailLexer $emailLexer); /** * Returns the validation error. * * @return InvalidEmail|null */ - public function getError() : ?InvalidEmail; + public function getError(); /** * Returns the validation warnings. * * @return Warning[] */ - public function getWarnings() : array; + public function getWarnings(); } diff --git a/core/vendor/egulias/email-validator/src/Validation/Error/RFCWarnings.php b/core/vendor/egulias/email-validator/src/Validation/Error/RFCWarnings.php new file mode 100644 index 0000000000..7f2256d60f --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Validation/Error/RFCWarnings.php @@ -0,0 +1,11 @@ +<?php + +namespace Egulias\EmailValidator\Validation\Error; + +use Egulias\EmailValidator\Exception\InvalidEmail; + +class RFCWarnings extends InvalidEmail +{ + const CODE = 997; + const REASON = 'Warnings were found.'; +} diff --git a/core/vendor/egulias/email-validator/src/Validation/Error/SpoofEmail.php b/core/vendor/egulias/email-validator/src/Validation/Error/SpoofEmail.php new file mode 100644 index 0000000000..8c92cb5aec --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Validation/Error/SpoofEmail.php @@ -0,0 +1,11 @@ +<?php + +namespace Egulias\EmailValidator\Validation\Error; + +use Egulias\EmailValidator\Exception\InvalidEmail; + +class SpoofEmail extends InvalidEmail +{ + const CODE = 998; + const REASON = "The email contains mixed UTF8 chars that makes it suspicious"; +} diff --git a/core/vendor/egulias/email-validator/src/Validation/MessageIDValidation.php b/core/vendor/egulias/email-validator/src/Validation/MessageIDValidation.php deleted file mode 100644 index 0e020433d0..0000000000 --- a/core/vendor/egulias/email-validator/src/Validation/MessageIDValidation.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Egulias\EmailValidator\Validation; - -use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\MessageIDParser; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\ExceptionFound; - -class MessageIDValidation implements EmailValidation -{ - - /** - * @var array - */ - private $warnings = []; - - /** - * @var ?InvalidEmail - */ - private $error; - - public function isValid(string $email, EmailLexer $emailLexer): bool - { - $parser = new MessageIDParser($emailLexer); - try { - $result = $parser->parse($email); - $this->warnings = $parser->getWarnings(); - if ($result->isInvalid()) { - /** @psalm-suppress PropertyTypeCoercion */ - $this->error = $result; - return false; - } - } catch (\Exception $invalid) { - $this->error = new InvalidEmail(new ExceptionFound($invalid), ''); - return false; - } - - return true; - } - - public function getWarnings(): array - { - return $this->warnings; - } - - public function getError(): ?InvalidEmail - { - return $this->error; - } -} diff --git a/core/vendor/egulias/email-validator/src/Validation/MultipleErrors.php b/core/vendor/egulias/email-validator/src/Validation/MultipleErrors.php new file mode 100644 index 0000000000..3be5973266 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Validation/MultipleErrors.php @@ -0,0 +1,32 @@ +<?php + +namespace Egulias\EmailValidator\Validation; + +use Egulias\EmailValidator\Exception\InvalidEmail; + +class MultipleErrors extends InvalidEmail +{ + const CODE = 999; + const REASON = "Accumulated errors for multiple validations"; + /** + * @var InvalidEmail[] + */ + private $errors = []; + + /** + * @param InvalidEmail[] $errors + */ + public function __construct(array $errors) + { + $this->errors = $errors; + parent::__construct(); + } + + /** + * @return InvalidEmail[] + */ + public function getErrors() + { + return $this->errors; + } +} diff --git a/core/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php b/core/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php index 6debf22fdd..feb224023d 100644 --- a/core/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php +++ b/core/vendor/egulias/email-validator/src/Validation/MultipleValidationWithAnd.php @@ -3,15 +3,13 @@ namespace Egulias\EmailValidator\Validation; use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\InvalidEmail; use Egulias\EmailValidator\Validation\Exception\EmptyValidationList; -use Egulias\EmailValidator\Result\MultipleErrors; class MultipleValidationWithAnd implements EmailValidation { /** - * If one of validations fails, the remaining validations will be skept. - * This means MultipleErrors will only contain a single error, the first found. + * If one of validations gets failure skips all succeeding validation. + * This means MultipleErrors will only contain a single error which first found. */ const STOP_ON_ERROR = 0; @@ -58,51 +56,60 @@ public function __construct(array $validations, $mode = self::ALLOW_ALL_ERRORS) /** * {@inheritdoc} */ - public function isValid(string $email, EmailLexer $emailLexer) : bool + public function isValid($email, EmailLexer $emailLexer) { $result = true; + $errors = []; foreach ($this->validations as $validation) { $emailLexer->reset(); $validationResult = $validation->isValid($email, $emailLexer); $result = $result && $validationResult; $this->warnings = array_merge($this->warnings, $validation->getWarnings()); - if (!$validationResult) { - $this->processError($validation); - } + $errors = $this->addNewError($validation->getError(), $errors); if ($this->shouldStop($result)) { break; } } + if (!empty($errors)) { + $this->error = new MultipleErrors($errors); + } + return $result; } - private function initErrorStorage() : void + /** + * @param \Egulias\EmailValidator\Exception\InvalidEmail|null $possibleError + * @param \Egulias\EmailValidator\Exception\InvalidEmail[] $errors + * + * @return \Egulias\EmailValidator\Exception\InvalidEmail[] + */ + private function addNewError($possibleError, array $errors) { - if (null === $this->error) { - $this->error = new MultipleErrors(); + if (null !== $possibleError) { + $errors[] = $possibleError; } - } - private function processError(EmailValidation $validation) : void - { - if (null !== $validation->getError()) { - $this->initErrorStorage(); - /** @psalm-suppress PossiblyNullReference */ - $this->error->addReason($validation->getError()->reason()); - } + return $errors; } - private function shouldStop(bool $result) : bool + /** + * @param bool $result + * + * @return bool + */ + private function shouldStop($result) { return !$result && $this->mode === self::STOP_ON_ERROR; } /** * Returns the validation errors. + * + * @return MultipleErrors|null */ - public function getError() : ?InvalidEmail + public function getError() { return $this->error; } @@ -110,7 +117,7 @@ public function getError() : ?InvalidEmail /** * {@inheritdoc} */ - public function getWarnings() : array + public function getWarnings() { return $this->warnings; } diff --git a/core/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php b/core/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php index 06885ed71a..6b31e5440e 100644 --- a/core/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php +++ b/core/vendor/egulias/email-validator/src/Validation/NoRFCWarningsValidation.php @@ -3,8 +3,8 @@ namespace Egulias\EmailValidator\Validation; use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\RFCWarnings; +use Egulias\EmailValidator\Exception\InvalidEmail; +use Egulias\EmailValidator\Validation\Error\RFCWarnings; class NoRFCWarningsValidation extends RFCValidation { @@ -16,7 +16,7 @@ class NoRFCWarningsValidation extends RFCValidation /** * {@inheritdoc} */ - public function isValid(string $email, EmailLexer $emailLexer) : bool + public function isValid($email, EmailLexer $emailLexer) { if (!parent::isValid($email, $emailLexer)) { return false; @@ -26,7 +26,7 @@ public function isValid(string $email, EmailLexer $emailLexer) : bool return true; } - $this->error = new InvalidEmail(new RFCWarnings(), ''); + $this->error = new RFCWarnings(); return false; } @@ -34,7 +34,7 @@ public function isValid(string $email, EmailLexer $emailLexer) : bool /** * {@inheritdoc} */ - public function getError() : ?InvalidEmail + public function getError() { return $this->error ?: parent::getError(); } diff --git a/core/vendor/egulias/email-validator/src/Validation/RFCValidation.php b/core/vendor/egulias/email-validator/src/Validation/RFCValidation.php index e2c27baccf..8781e0b62d 100644 --- a/core/vendor/egulias/email-validator/src/Validation/RFCValidation.php +++ b/core/vendor/egulias/email-validator/src/Validation/RFCValidation.php @@ -4,8 +4,7 @@ use Egulias\EmailValidator\EmailLexer; use Egulias\EmailValidator\EmailParser; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Result\Reason\ExceptionFound; +use Egulias\EmailValidator\Exception\InvalidEmail; class RFCValidation implements EmailValidation { @@ -20,35 +19,30 @@ class RFCValidation implements EmailValidation private $warnings = []; /** - * @var ?InvalidEmail + * @var InvalidEmail|null */ private $error; - public function isValid(string $email, EmailLexer $emailLexer) : bool + public function isValid($email, EmailLexer $emailLexer) { $this->parser = new EmailParser($emailLexer); try { - $result = $this->parser->parse($email); - $this->warnings = $this->parser->getWarnings(); - if ($result->isInvalid()) { - /** @psalm-suppress PropertyTypeCoercion */ - $this->error = $result; - return false; - } - } catch (\Exception $invalid) { - $this->error = new InvalidEmail(new ExceptionFound($invalid), ''); + $this->parser->parse((string)$email); + } catch (InvalidEmail $invalid) { + $this->error = $invalid; return false; } + $this->warnings = $this->parser->getWarnings(); return true; } - public function getError() : ?InvalidEmail + public function getError() { return $this->error; } - public function getWarnings() : array + public function getWarnings() { return $this->warnings; } diff --git a/core/vendor/egulias/email-validator/src/Validation/Extra/SpoofCheckValidation.php b/core/vendor/egulias/email-validator/src/Validation/SpoofCheckValidation.php similarity index 66% rename from core/vendor/egulias/email-validator/src/Validation/Extra/SpoofCheckValidation.php rename to core/vendor/egulias/email-validator/src/Validation/SpoofCheckValidation.php index 4972dbceff..e10bfabd92 100644 --- a/core/vendor/egulias/email-validator/src/Validation/Extra/SpoofCheckValidation.php +++ b/core/vendor/egulias/email-validator/src/Validation/SpoofCheckValidation.php @@ -1,12 +1,11 @@ <?php -namespace Egulias\EmailValidator\Validation\Extra; +namespace Egulias\EmailValidator\Validation; -use \Spoofchecker; use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\SpoofEmail; -use Egulias\EmailValidator\Result\InvalidEmail; -use Egulias\EmailValidator\Validation\EmailValidation; +use Egulias\EmailValidator\Exception\InvalidEmail; +use Egulias\EmailValidator\Validation\Error\SpoofEmail; +use \Spoofchecker; class SpoofCheckValidation implements EmailValidation { @@ -25,7 +24,7 @@ public function __construct() /** * @psalm-suppress InvalidArgument */ - public function isValid(string $email, EmailLexer $emailLexer) : bool + public function isValid($email, EmailLexer $emailLexer) { $checker = new Spoofchecker(); $checker->setChecks(Spoofchecker::SINGLE_SCRIPT); @@ -38,14 +37,14 @@ public function isValid(string $email, EmailLexer $emailLexer) : bool } /** - * @return InvalidEmail + * @return InvalidEmail|null */ - public function getError() : ?InvalidEmail + public function getError() { return $this->error; } - public function getWarnings() : array + public function getWarnings() { return []; } diff --git a/core/vendor/egulias/email-validator/src/Warning/DomainTooLong.php b/core/vendor/egulias/email-validator/src/Warning/DomainTooLong.php new file mode 100644 index 0000000000..61ff17a767 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Warning/DomainTooLong.php @@ -0,0 +1,14 @@ +<?php + +namespace Egulias\EmailValidator\Warning; + +class DomainTooLong extends Warning +{ + const CODE = 255; + + public function __construct() + { + $this->message = 'Domain is too long, exceeds 255 chars'; + $this->rfcNumber = 5322; + } +} diff --git a/core/vendor/egulias/email-validator/src/Warning/LabelTooLong.php b/core/vendor/egulias/email-validator/src/Warning/LabelTooLong.php new file mode 100644 index 0000000000..daf07f4083 --- /dev/null +++ b/core/vendor/egulias/email-validator/src/Warning/LabelTooLong.php @@ -0,0 +1,14 @@ +<?php + +namespace Egulias\EmailValidator\Warning; + +class LabelTooLong extends Warning +{ + const CODE = 63; + + public function __construct() + { + $this->message = 'Label too long'; + $this->rfcNumber = 5322; + } +} diff --git a/core/vendor/egulias/email-validator/src/Warning/Warning.php b/core/vendor/egulias/email-validator/src/Warning/Warning.php index bce7e7a5ae..a2ee7b0de1 100644 --- a/core/vendor/egulias/email-validator/src/Warning/Warning.php +++ b/core/vendor/egulias/email-validator/src/Warning/Warning.php @@ -29,7 +29,7 @@ public function message() */ public function code() { - return self::CODE; + return static::CODE; } /** diff --git a/core/vendor/illuminate/bus/Batch.php b/core/vendor/illuminate/bus/Batch.php index 5a712eec4c..db8779d3ac 100644 --- a/core/vendor/illuminate/bus/Batch.php +++ b/core/vendor/illuminate/bus/Batch.php @@ -462,7 +462,8 @@ public function toArray() * * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->toArray(); } diff --git a/core/vendor/illuminate/bus/PendingBatch.php b/core/vendor/illuminate/bus/PendingBatch.php index e5b59c6fd5..77cb7fa88b 100644 --- a/core/vendor/illuminate/bus/PendingBatch.php +++ b/core/vendor/illuminate/bus/PendingBatch.php @@ -6,9 +6,9 @@ use Illuminate\Bus\Events\BatchDispatched; use Illuminate\Contracts\Container\Container; use Illuminate\Contracts\Events\Dispatcher as EventDispatcher; +use Illuminate\Queue\SerializableClosureFactory; use Illuminate\Support\Arr; use Illuminate\Support\Collection; -use Laravel\SerializableClosure\SerializableClosure; use Throwable; class PendingBatch @@ -78,7 +78,7 @@ public function add($jobs) public function then($callback) { $this->options['then'][] = $callback instanceof Closure - ? new SerializableClosure($callback) + ? SerializableClosureFactory::make($callback) : $callback; return $this; @@ -103,7 +103,7 @@ public function thenCallbacks() public function catch($callback) { $this->options['catch'][] = $callback instanceof Closure - ? new SerializableClosure($callback) + ? SerializableClosureFactory::make($callback) : $callback; return $this; @@ -128,7 +128,7 @@ public function catchCallbacks() public function finally($callback) { $this->options['finally'][] = $callback instanceof Closure - ? new SerializableClosure($callback) + ? SerializableClosureFactory::make($callback) : $callback; return $this; diff --git a/core/vendor/illuminate/bus/UniqueLock.php b/core/vendor/illuminate/bus/UniqueLock.php index d1bd774cfe..a937b18696 100644 --- a/core/vendor/illuminate/bus/UniqueLock.php +++ b/core/vendor/illuminate/bus/UniqueLock.php @@ -36,17 +36,13 @@ public function acquire($job) ? $job->uniqueId() : ($job->uniqueId ?? ''); - $uniqueFor = method_exists($job, 'uniqueFor') - ? $job->uniqueFor() - : ($job->uniqueFor ?? 0); - $cache = method_exists($job, 'uniqueVia') ? $job->uniqueVia() : $this->cache; return (bool) $cache->lock( $key = 'laravel_unique_job:'.get_class($job).$uniqueId, - $uniqueFor + $job->uniqueFor ?? 0 )->get(); } } diff --git a/core/vendor/illuminate/bus/composer.json b/core/vendor/illuminate/bus/composer.json index 44e795a4d6..12713a61c3 100644 --- a/core/vendor/illuminate/bus/composer.json +++ b/core/vendor/illuminate/bus/composer.json @@ -14,11 +14,11 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/pipeline": "^9.0", - "illuminate/support": "^9.0" + "php": "^7.3|^8.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/pipeline": "^8.0", + "illuminate/support": "^8.0" }, "autoload": { "psr-4": { @@ -27,7 +27,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { diff --git a/core/vendor/illuminate/cache/CacheManager.php b/core/vendor/illuminate/cache/CacheManager.php index fbd7011289..145b3e6172 100755 --- a/core/vendor/illuminate/cache/CacheManager.php +++ b/core/vendor/illuminate/cache/CacheManager.php @@ -254,7 +254,7 @@ protected function createDynamodbDriver(array $config) /** * Create new DynamoDb Client instance. * - * @return \Aws\DynamoDb\DynamoDbClient + * @return DynamoDbClient */ protected function newDynamodbClient(array $config) { @@ -328,7 +328,7 @@ protected function getPrefix(array $config) * Get the cache connection configuration. * * @param string $name - * @return array|null + * @return array */ protected function getConfig($name) { diff --git a/core/vendor/illuminate/cache/Console/CacheTableCommand.php b/core/vendor/illuminate/cache/Console/CacheTableCommand.php index 56bf2dd1c3..a8c78c9e08 100644 --- a/core/vendor/illuminate/cache/Console/CacheTableCommand.php +++ b/core/vendor/illuminate/cache/Console/CacheTableCommand.php @@ -15,15 +15,6 @@ class CacheTableCommand extends Command */ protected $name = 'cache:table'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'cache:table'; - /** * The console command description. * diff --git a/core/vendor/illuminate/cache/Console/ClearCommand.php b/core/vendor/illuminate/cache/Console/ClearCommand.php index 260116eeec..8a37b8b29c 100755 --- a/core/vendor/illuminate/cache/Console/ClearCommand.php +++ b/core/vendor/illuminate/cache/Console/ClearCommand.php @@ -17,15 +17,6 @@ class ClearCommand extends Command */ protected $name = 'cache:clear'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'cache:clear'; - /** * The console command description. * diff --git a/core/vendor/illuminate/cache/Console/ForgetCommand.php b/core/vendor/illuminate/cache/Console/ForgetCommand.php index 22677837e4..eb0c066688 100755 --- a/core/vendor/illuminate/cache/Console/ForgetCommand.php +++ b/core/vendor/illuminate/cache/Console/ForgetCommand.php @@ -14,15 +14,6 @@ class ForgetCommand extends Command */ protected $signature = 'cache:forget {key : The key to remove} {store? : The store to remove the key from}'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'cache:forget'; - /** * The console command description. * diff --git a/core/vendor/illuminate/cache/Console/stubs/cache.stub b/core/vendor/illuminate/cache/Console/stubs/cache.stub index eee35e9436..88cd44590c 100644 --- a/core/vendor/illuminate/cache/Console/stubs/cache.stub +++ b/core/vendor/illuminate/cache/Console/stubs/cache.stub @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +class CreateCacheTable extends Migration { /** * Run the migrations. @@ -36,4 +36,4 @@ return new class extends Migration Schema::dropIfExists('cache'); Schema::dropIfExists('cache_locks'); } -}; +} diff --git a/core/vendor/illuminate/cache/DatabaseStore.php b/core/vendor/illuminate/cache/DatabaseStore.php index b43761b1e3..32d7a9fc06 100755 --- a/core/vendor/illuminate/cache/DatabaseStore.php +++ b/core/vendor/illuminate/cache/DatabaseStore.php @@ -371,7 +371,7 @@ protected function serialize($value) { $result = serialize($value); - if ($this->connection instanceof PostgresConnection && str_contains($result, "\0")) { + if ($this->connection instanceof PostgresConnection && Str::contains($result, "\0")) { $result = base64_encode($result); } diff --git a/core/vendor/illuminate/cache/DynamoDbStore.php b/core/vendor/illuminate/cache/DynamoDbStore.php index 30e175ac0e..aa28a789fa 100644 --- a/core/vendor/illuminate/cache/DynamoDbStore.php +++ b/core/vendor/illuminate/cache/DynamoDbStore.php @@ -211,7 +211,7 @@ public function put($key, $value, $seconds) } /** - * Store multiple items in the cache for a given number of seconds. + * Store multiple items in the cache for a given number of $seconds. * * @param array $values * @param int $seconds @@ -284,7 +284,7 @@ public function add($key, $value, $seconds) return true; } catch (DynamoDbException $e) { - if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) { + if (Str::contains($e->getMessage(), 'ConditionalCheckFailed')) { return false; } @@ -329,7 +329,7 @@ public function increment($key, $value = 1) return (int) $response['Attributes'][$this->valueAttribute]['N']; } catch (DynamoDbException $e) { - if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) { + if (Str::contains($e->getMessage(), 'ConditionalCheckFailed')) { return false; } @@ -374,7 +374,7 @@ public function decrement($key, $value = 1) return (int) $response['Attributes'][$this->valueAttribute]['N']; } catch (DynamoDbException $e) { - if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) { + if (Str::contains($e->getMessage(), 'ConditionalCheckFailed')) { return false; } @@ -529,7 +529,7 @@ public function setPrefix($prefix) /** * Get the DynamoDb Client instance. * - * @return \Aws\DynamoDb\DynamoDbClient + * @return DynamoDbClient */ public function getClient() { diff --git a/core/vendor/illuminate/cache/Repository.php b/core/vendor/illuminate/cache/Repository.php index 6d6d91a168..cf2fda09eb 100755 --- a/core/vendor/illuminate/cache/Repository.php +++ b/core/vendor/illuminate/cache/Repository.php @@ -65,7 +65,7 @@ public function __construct(Store $store) * @param string $key * @return bool */ - public function has($key): bool + public function has($key) { return ! is_null($this->get($key)); } @@ -84,11 +84,11 @@ public function missing($key) /** * Retrieve an item from the cache by key. * - * @param array|string $key + * @param string $key * @param mixed $default * @return mixed */ - public function get($key, $default = null): mixed + public function get($key, $default = null) { if (is_array($key)) { return $this->many($key); @@ -134,7 +134,7 @@ public function many(array $keys) * * @return iterable */ - public function getMultiple($keys, $default = null): iterable + public function getMultiple($keys, $default = null) { $defaults = []; @@ -189,7 +189,7 @@ public function pull($key, $default = null) /** * Store an item in the cache. * - * @param array|string $key + * @param string $key * @param mixed $value * @param \DateTimeInterface|\DateInterval|int|null $ttl * @return bool @@ -224,7 +224,7 @@ public function put($key, $value, $ttl = null) * * @return bool */ - public function set($key, $value, $ttl = null): bool + public function set($key, $value, $ttl = null) { return $this->put($key, $value, $ttl); } @@ -283,7 +283,7 @@ protected function putManyForever(array $values) * * @return bool */ - public function setMultiple($values, $ttl = null): bool + public function setMultiple($values, $ttl = null) { return $this->putMany(is_array($values) ? $values : iterator_to_array($values), $ttl); } @@ -448,7 +448,7 @@ public function forget($key) * * @return bool */ - public function delete($key): bool + public function delete($key) { return $this->forget($key); } @@ -458,7 +458,7 @@ public function delete($key): bool * * @return bool */ - public function deleteMultiple($keys): bool + public function deleteMultiple($keys) { $result = true; @@ -476,7 +476,7 @@ public function deleteMultiple($keys): bool * * @return bool */ - public function clear(): bool + public function clear() { return $this->store->flush(); } @@ -583,7 +583,9 @@ public function getStore() */ protected function event($event) { - $this->events?->dispatch($event); + if (isset($this->events)) { + $this->events->dispatch($event); + } } /** @@ -613,7 +615,8 @@ public function setEventDispatcher(Dispatcher $events) * @param string $key * @return bool */ - public function offsetExists($key): bool + #[\ReturnTypeWillChange] + public function offsetExists($key) { return $this->has($key); } @@ -624,7 +627,8 @@ public function offsetExists($key): bool * @param string $key * @return mixed */ - public function offsetGet($key): mixed + #[\ReturnTypeWillChange] + public function offsetGet($key) { return $this->get($key); } @@ -636,7 +640,8 @@ public function offsetGet($key): mixed * @param mixed $value * @return void */ - public function offsetSet($key, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) { $this->put($key, $value, $this->default); } @@ -647,7 +652,8 @@ public function offsetSet($key, $value): void * @param string $key * @return void */ - public function offsetUnset($key): void + #[\ReturnTypeWillChange] + public function offsetUnset($key) { $this->forget($key); } diff --git a/core/vendor/illuminate/cache/composer.json b/core/vendor/illuminate/cache/composer.json index 92dd4fb03f..69f553fa63 100755 --- a/core/vendor/illuminate/cache/composer.json +++ b/core/vendor/illuminate/cache/composer.json @@ -14,14 +14,14 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0" + "php": "^7.3|^8.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0" }, "provide": { - "psr/simple-cache-implementation": "1.0|2.0|3.0" + "psr/simple-cache-implementation": "1.0" }, "autoload": { "psr-4": { @@ -30,15 +30,15 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { "ext-memcached": "Required to use the memcache cache driver.", - "illuminate/database": "Required to use the database cache driver (^9.0).", - "illuminate/filesystem": "Required to use the file cache driver (^9.0).", - "illuminate/redis": "Required to use the redis cache driver (^9.0).", - "symfony/cache": "Required to use PSR-6 cache bridge (^6.0)." + "illuminate/database": "Required to use the database cache driver (^8.0).", + "illuminate/filesystem": "Required to use the file cache driver (^8.0).", + "illuminate/redis": "Required to use the redis cache driver (^8.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.4)." }, "config": { "sort-packages": true diff --git a/core/vendor/illuminate/collections/Arr.php b/core/vendor/illuminate/collections/Arr.php index 76ae64be9d..8267315e70 100644 --- a/core/vendor/illuminate/collections/Arr.php +++ b/core/vendor/illuminate/collections/Arr.php @@ -314,7 +314,7 @@ public static function get($array, $key, $default = null) return $array[$key]; } - if (! str_contains($key, '.')) { + if (strpos($key, '.') === false) { return $array[$key] ?? value($default); } diff --git a/core/vendor/illuminate/collections/Collection.php b/core/vendor/illuminate/collections/Collection.php index 3fda5a3567..02d8f8925e 100644 --- a/core/vendor/illuminate/collections/Collection.php +++ b/core/vendor/illuminate/collections/Collection.php @@ -8,33 +8,22 @@ use Illuminate\Support\Traits\EnumeratesValues; use Illuminate\Support\Traits\Macroable; use stdClass; -use Traversable; - -/** - * @template TKey of array-key - * @template TValue - * - * @implements \ArrayAccess<TKey, TValue> - * @implements \Illuminate\Support\Enumerable<TKey, TValue> - */ + class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerable { - /** - * @use \Illuminate\Support\Traits\EnumeratesValues<TKey, TValue> - */ use EnumeratesValues, Macroable; /** * The items contained in the collection. * - * @var array<TKey, TValue> + * @var array */ protected $items = []; /** * Create a new collection. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>|null $items + * @param mixed $items * @return void */ public function __construct($items = []) @@ -47,7 +36,7 @@ public function __construct($items = []) * * @param int $from * @param int $to - * @return static<int, int> + * @return static */ public static function range($from, $to) { @@ -57,7 +46,7 @@ public static function range($from, $to) /** * Get all of the items in the collection. * - * @return array<TKey, TValue> + * @return array */ public function all() { @@ -67,7 +56,7 @@ public function all() /** * Get a lazy collection for the items in this collection. * - * @return \Illuminate\Support\LazyCollection<TKey, TValue> + * @return \Illuminate\Support\LazyCollection */ public function lazy() { @@ -77,8 +66,8 @@ public function lazy() /** * Get the average value of a given key. * - * @param (callable(TValue): float|int)|string|null $callback - * @return float|int|null + * @param callable|string|null $callback + * @return mixed */ public function avg($callback = null) { @@ -98,8 +87,8 @@ public function avg($callback = null) /** * Get the median of a given key. * - * @param string|array<array-key, string>|null $key - * @return float|int|null + * @param string|array|null $key + * @return mixed */ public function median($key = null) { @@ -128,8 +117,8 @@ public function median($key = null) /** * Get the mode of a given key. * - * @param string|array<array-key, string>|null $key - * @return array<int, float|int>|null + * @param string|array|null $key + * @return array|null */ public function mode($key = null) { @@ -157,7 +146,7 @@ public function mode($key = null) /** * Collapse the collection of items into a single array. * - * @return static<int, mixed> + * @return static */ public function collapse() { @@ -167,7 +156,7 @@ public function collapse() /** * Determine if an item exists in the collection. * - * @param (callable(TValue): bool)|TValue|string $key + * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool @@ -203,11 +192,8 @@ public function doesntContain($key, $operator = null, $value = null) /** * Cross join with the given lists, returning all possible permutations. * - * @template TCrossJoinKey - * @template TCrossJoinValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TCrossJoinKey, TCrossJoinValue>|iterable<TCrossJoinKey, TCrossJoinValue> ...$lists - * @return static<int, array<int, TValue|TCrossJoinValue>> + * @param mixed ...$lists + * @return static */ public function crossJoin(...$lists) { @@ -219,7 +205,7 @@ public function crossJoin(...$lists) /** * Get the items in the collection that are not present in the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items + * @param mixed $items * @return static */ public function diff($items) @@ -230,8 +216,8 @@ public function diff($items) /** * Get the items in the collection that are not present in the given items, using the callback. * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items - * @param callable(TValue): int $callback + * @param mixed $items + * @param callable $callback * @return static */ public function diffUsing($items, callable $callback) @@ -242,7 +228,7 @@ public function diffUsing($items, callable $callback) /** * Get the items in the collection whose keys and values are not present in the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function diffAssoc($items) @@ -253,8 +239,8 @@ public function diffAssoc($items) /** * Get the items in the collection whose keys and values are not present in the given items, using the callback. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items - * @param callable(TKey): int $callback + * @param mixed $items + * @param callable $callback * @return static */ public function diffAssocUsing($items, callable $callback) @@ -265,7 +251,7 @@ public function diffAssocUsing($items, callable $callback) /** * Get the items in the collection whose keys are not present in the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function diffKeys($items) @@ -276,8 +262,8 @@ public function diffKeys($items) /** * Get the items in the collection whose keys are not present in the given items, using the callback. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items - * @param callable(TKey): int $callback + * @param mixed $items + * @param callable $callback * @return static */ public function diffKeysUsing($items, callable $callback) @@ -288,7 +274,7 @@ public function diffKeysUsing($items, callable $callback) /** * Retrieve duplicate items from the collection. * - * @param (callable(TValue): bool)|string|null $callback + * @param callable|string|null $callback * @param bool $strict * @return static */ @@ -316,7 +302,7 @@ public function duplicates($callback = null, $strict = false) /** * Retrieve duplicate items from the collection using strict comparison. * - * @param (callable(TValue): bool)|string|null $callback + * @param callable|string|null $callback * @return static */ public function duplicatesStrict($callback = null) @@ -328,7 +314,7 @@ public function duplicatesStrict($callback = null) * Get the comparison function to detect duplicates. * * @param bool $strict - * @return callable(TValue, TValue): bool + * @return \Closure */ protected function duplicateComparator($strict) { @@ -346,7 +332,7 @@ protected function duplicateComparator($strict) /** * Get all items except for those with the specified keys. * - * @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys + * @param \Illuminate\Support\Collection|mixed $keys * @return static */ public function except($keys) @@ -363,7 +349,7 @@ public function except($keys) /** * Run a filter over each of the items. * - * @param (callable(TValue, TKey): bool)|null $callback + * @param callable|null $callback * @return static */ public function filter(callable $callback = null) @@ -378,11 +364,9 @@ public function filter(callable $callback = null) /** * Get the first item from the collection passing the given truth test. * - * @template TFirstDefault - * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TFirstDefault|(\Closure(): TFirstDefault) $default - * @return TValue|TFirstDefault + * @param callable|null $callback + * @param mixed $default + * @return mixed */ public function first(callable $callback = null, $default = null) { @@ -393,7 +377,7 @@ public function first(callable $callback = null, $default = null) * Get a flattened array of the items in the collection. * * @param int $depth - * @return static<int, mixed> + * @return static */ public function flatten($depth = INF) { @@ -403,7 +387,7 @@ public function flatten($depth = INF) /** * Flip the items in the collection. * - * @return static<TValue, TKey> + * @return static */ public function flip() { @@ -413,7 +397,7 @@ public function flip() /** * Remove an item from the collection by key. * - * @param TKey|array<array-key, TKey> $keys + * @param string|int|array $keys * @return $this */ public function forget($keys) @@ -428,11 +412,9 @@ public function forget($keys) /** * Get an item from the collection by key. * - * @template TGetDefault - * - * @param TKey $key - * @param TGetDefault|(\Closure(): TGetDefault) $default - * @return TValue|TGetDefault + * @param mixed $key + * @param mixed $default + * @return mixed */ public function get($key, $default = null) { @@ -464,9 +446,9 @@ public function getOrPut($key, $value) /** * Group an associative array by a field or using a callback. * - * @param (callable(TValue, TKey): array-key)|array|string $groupBy + * @param array|callable|string $groupBy * @param bool $preserveKeys - * @return static<array-key, static<array-key, TValue>> + * @return static */ public function groupBy($groupBy, $preserveKeys = false) { @@ -510,8 +492,8 @@ public function groupBy($groupBy, $preserveKeys = false) /** * Key an associative array by a field or using a callback. * - * @param (callable(TValue, TKey): array-key)|array|string $keyBy - * @return static<array-key, TValue> + * @param callable|string $keyBy + * @return static */ public function keyBy($keyBy) { @@ -535,7 +517,7 @@ public function keyBy($keyBy) /** * Determine if an item exists in the collection by key. * - * @param TKey|array<array-key, TKey> $key + * @param mixed $key * @return bool */ public function has($key) @@ -595,7 +577,7 @@ public function implode($value, $glue = null) /** * Intersect the collection with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function intersect($items) @@ -606,7 +588,7 @@ public function intersect($items) /** * Intersect the collection with the given items by key. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function intersectByKeys($items) @@ -669,7 +651,7 @@ public function join($glue, $finalGlue = '') /** * Get the keys of the collection items. * - * @return static<int, TKey> + * @return static */ public function keys() { @@ -679,11 +661,9 @@ public function keys() /** * Get the last item from the collection. * - * @template TLastDefault - * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TLastDefault|(\Closure(): TLastDefault) $default - * @return TValue|TLastDefault + * @param callable|null $callback + * @param mixed $default + * @return mixed */ public function last(callable $callback = null, $default = null) { @@ -693,9 +673,9 @@ public function last(callable $callback = null, $default = null) /** * Get the values of a given key. * - * @param string|array<array-key, string> $value + * @param string|array|int|null $value * @param string|null $key - * @return static<int, mixed> + * @return static */ public function pluck($value, $key = null) { @@ -705,10 +685,8 @@ public function pluck($value, $key = null) /** * Run a map over each of the items. * - * @template TMapValue - * - * @param callable(TValue, TKey): TMapValue $callback - * @return static<TKey, TMapValue> + * @param callable $callback + * @return static */ public function map(callable $callback) { @@ -724,11 +702,8 @@ public function map(callable $callback) * * The callback should return an associative array with a single key/value pair. * - * @template TMapToDictionaryKey of array-key - * @template TMapToDictionaryValue - * - * @param callable(TValue, TKey): array<TMapToDictionaryKey, TMapToDictionaryValue> $callback - * @return static<TMapToDictionaryKey, array<int, TMapToDictionaryValue>> + * @param callable $callback + * @return static */ public function mapToDictionary(callable $callback) { @@ -756,11 +731,8 @@ public function mapToDictionary(callable $callback) * * The callback should return an associative array with a single key/value pair. * - * @template TMapWithKeysKey of array-key - * @template TMapWithKeysValue - * - * @param callable(TValue, TKey): array<TMapWithKeysKey, TMapWithKeysValue> $callback - * @return static<TMapWithKeysKey, TMapWithKeysValue> + * @param callable $callback + * @return static */ public function mapWithKeys(callable $callback) { @@ -780,7 +752,7 @@ public function mapWithKeys(callable $callback) /** * Merge the collection with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function merge($items) @@ -791,10 +763,8 @@ public function merge($items) /** * Recursively merge the collection with the given items. * - * @template TMergeRecursiveValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TMergeRecursiveValue>|iterable<TKey, TMergeRecursiveValue> $items - * @return static<TKey, TValue|TMergeRecursiveValue> + * @param mixed $items + * @return static */ public function mergeRecursive($items) { @@ -804,10 +774,8 @@ public function mergeRecursive($items) /** * Create a collection by using this collection for keys and another for its values. * - * @template TCombineValue - * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values - * @return static<TKey, TCombineValue> + * @param mixed $values + * @return static */ public function combine($values) { @@ -817,7 +785,7 @@ public function combine($values) /** * Union the collection with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function union($items) @@ -852,7 +820,7 @@ public function nth($step, $offset = 0) /** * Get the items with the specified keys. * - * @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys + * @param mixed $keys * @return static */ public function only($keys) @@ -874,7 +842,7 @@ public function only($keys) * Get and remove the last N items from the collection. * * @param int $count - * @return static<int, TValue>|TValue|null + * @return mixed */ public function pop($count = 1) { @@ -900,8 +868,8 @@ public function pop($count = 1) /** * Push an item onto the beginning of the collection. * - * @param TValue $value - * @param TKey $key + * @param mixed $value + * @param mixed $key * @return $this */ public function prepend($value, $key = null) @@ -914,7 +882,7 @@ public function prepend($value, $key = null) /** * Push one or more items onto the end of the collection. * - * @param TValue ...$values + * @param mixed $values * @return $this */ public function push(...$values) @@ -929,7 +897,7 @@ public function push(...$values) /** * Push all of the given items onto the collection. * - * @param iterable<array-key, TValue> $source + * @param iterable $source * @return static */ public function concat($source) @@ -946,11 +914,9 @@ public function concat($source) /** * Get and remove an item from the collection. * - * @template TPullDefault - * - * @param TKey $key - * @param TPullDefault|(\Closure(): TPullDefault) $default - * @return TValue|TPullDefault + * @param mixed $key + * @param mixed $default + * @return mixed */ public function pull($key, $default = null) { @@ -960,8 +926,8 @@ public function pull($key, $default = null) /** * Put an item in the collection by key. * - * @param TKey $key - * @param TValue $value + * @param mixed $key + * @param mixed $value * @return $this */ public function put($key, $value) @@ -975,7 +941,7 @@ public function put($key, $value) * Get one or a specified number of items randomly from the collection. * * @param int|null $number - * @return static<int, TValue>|TValue + * @return static|mixed * * @throws \InvalidArgumentException */ @@ -991,7 +957,7 @@ public function random($number = null) /** * Replace the collection items with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function replace($items) @@ -1002,7 +968,7 @@ public function replace($items) /** * Recursively replace the collection items with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function replaceRecursive($items) @@ -1023,9 +989,9 @@ public function reverse() /** * Search the collection for a given value and return the corresponding key if successful. * - * @param TValue|(callable(TValue,TKey): bool) $value + * @param mixed $value * @param bool $strict - * @return TKey|bool + * @return mixed */ public function search($value, $strict = false) { @@ -1046,7 +1012,7 @@ public function search($value, $strict = false) * Get and remove the first N items from the collection. * * @param int $count - * @return static<int, TValue>|TValue|null + * @return mixed */ public function shift($count = 1) { @@ -1085,7 +1051,7 @@ public function shuffle($seed = null) * * @param int $size * @param int $step - * @return static<int, static> + * @return static */ public function sliding($size = 2, $step = 1) { @@ -1110,7 +1076,7 @@ public function skip($count) /** * Skip items in the collection until the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function skipUntil($value) @@ -1121,7 +1087,7 @@ public function skipUntil($value) /** * Skip items in the collection while the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function skipWhile($value) @@ -1145,7 +1111,7 @@ public function slice($offset, $length = null) * Split a collection into a certain number of groups. * * @param int $numberOfGroups - * @return static<int, static> + * @return static */ public function split($numberOfGroups) { @@ -1182,7 +1148,7 @@ public function split($numberOfGroups) * Split a collection into a certain number of groups, and fill the first groups completely. * * @param int $numberOfGroups - * @return static<int, static> + * @return static */ public function splitIn($numberOfGroups) { @@ -1192,10 +1158,10 @@ public function splitIn($numberOfGroups) /** * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. * - * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $key * @param mixed $operator * @param mixed $value - * @return TValue + * @return mixed * * @throws \Illuminate\Support\ItemNotFoundException * @throws \Illuminate\Support\MultipleItemsFoundException @@ -1206,7 +1172,7 @@ public function sole($key = null, $operator = null, $value = null) ? $this->operatorForWhere(...func_get_args()) : $key; - $items = $this->unless($filter == null)->filter($filter); + $items = $this->when($filter)->filter($filter); if ($items->isEmpty()) { throw new ItemNotFoundException; @@ -1222,10 +1188,10 @@ public function sole($key = null, $operator = null, $value = null) /** * Get the first item in the collection but throw an exception if no matching items exist. * - * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $key * @param mixed $operator * @param mixed $value - * @return TValue + * @return mixed * * @throws \Illuminate\Support\ItemNotFoundException */ @@ -1250,7 +1216,7 @@ public function firstOrFail($key = null, $operator = null, $value = null) * Chunk the collection into chunks of the given size. * * @param int $size - * @return static<int, static> + * @return static */ public function chunk($size) { @@ -1270,8 +1236,8 @@ public function chunk($size) /** * Chunk the collection into chunks with a callback. * - * @param callable(TValue, TKey, static<int, TValue>): bool $callback - * @return static<int, static<int, TValue>> + * @param callable $callback + * @return static */ public function chunkWhile(callable $callback) { @@ -1283,7 +1249,7 @@ public function chunkWhile(callable $callback) /** * Sort through each item with a callback. * - * @param (callable(TValue, TValue): bool)|null|int $callback + * @param callable|int|null $callback * @return static */ public function sort($callback = null) @@ -1315,7 +1281,7 @@ public function sortDesc($options = SORT_REGULAR) /** * Sort the collection using the given callback. * - * @param array<array-key, (callable(TValue, TKey): mixed)|array<array-key, string>|(callable(TValue, TKey): mixed)|string $callback + * @param callable|array|string $callback * @param int $options * @param bool $descending * @return static @@ -1353,7 +1319,7 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false) /** * Sort the collection using multiple comparisons. * - * @param array<array-key, (callable(TValue, TKey): mixed)|array<array-key, string> $comparisons + * @param array $comparisons * @return static */ protected function sortByMany(array $comparisons = []) @@ -1397,7 +1363,7 @@ protected function sortByMany(array $comparisons = []) /** * Sort the collection in descending order using the given callback. * - * @param array<array-key, (callable(TValue, TKey): mixed)|array<array-key, string>|(callable(TValue, TKey): mixed)|string $callback + * @param callable|string $callback * @param int $options * @return static */ @@ -1453,7 +1419,7 @@ public function sortKeysUsing(callable $callback) * * @param int $offset * @param int|null $length - * @param array<array-key, TValue> $replacement + * @param mixed $replacement * @return static */ public function splice($offset, $length = null, $replacement = []) @@ -1483,7 +1449,7 @@ public function take($limit) /** * Take items in the collection until the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function takeUntil($value) @@ -1494,7 +1460,7 @@ public function takeUntil($value) /** * Take items in the collection while the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function takeWhile($value) @@ -1505,7 +1471,7 @@ public function takeWhile($value) /** * Transform each item in the collection using a callback. * - * @param callable(TValue, TKey): TValue $callback + * @param callable $callback * @return $this */ public function transform(callable $callback) @@ -1528,7 +1494,7 @@ public function undot() /** * Return only unique items from the collection array. * - * @param (callable(TValue, TKey): mixed)|string|null $key + * @param string|callable|null $key * @param bool $strict * @return static */ @@ -1554,7 +1520,7 @@ public function unique($key = null, $strict = false) /** * Reset the keys on the underlying array. * - * @return static<int, TValue> + * @return static */ public function values() { @@ -1567,10 +1533,8 @@ public function values() * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]); * => [[1, 4], [2, 5], [3, 6]] * - * @template TZipValue - * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TZipValue>|iterable<array-key, TZipValue> ...$items - * @return static<int, static<int, TValue|TZipValue>> + * @param mixed ...$items + * @return static */ public function zip($items) { @@ -1588,11 +1552,9 @@ public function zip($items) /** * Pad collection to the specified length with a value. * - * @template TPadValue - * * @param int $size - * @param TPadValue $value - * @return static<int, TValue|TPadValue> + * @param mixed $value + * @return static */ public function pad($size, $value) { @@ -1602,9 +1564,10 @@ public function pad($size, $value) /** * Get an iterator for the items. * - * @return \ArrayIterator<TKey, TValue> + * @return \ArrayIterator */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { return new ArrayIterator($this->items); } @@ -1614,7 +1577,8 @@ public function getIterator(): Traversable * * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return count($this->items); } @@ -1622,8 +1586,8 @@ public function count(): int /** * Count the number of items in the collection by a field or using a callback. * - * @param (callable(TValue, TKey): mixed)|string|null $countBy - * @return static<array-key, int> + * @param callable|string $countBy + * @return static */ public function countBy($countBy = null) { @@ -1633,7 +1597,7 @@ public function countBy($countBy = null) /** * Add an item to the collection. * - * @param TValue $item + * @param mixed $item * @return $this */ public function add($item) @@ -1646,7 +1610,7 @@ public function add($item) /** * Get a base Support collection instance from this collection. * - * @return \Illuminate\Support\Collection<TKey, TValue> + * @return \Illuminate\Support\Collection */ public function toBase() { @@ -1656,10 +1620,11 @@ public function toBase() /** * Determine if an item exists at an offset. * - * @param TKey $key + * @param mixed $key * @return bool */ - public function offsetExists($key): bool + #[\ReturnTypeWillChange] + public function offsetExists($key) { return isset($this->items[$key]); } @@ -1667,10 +1632,11 @@ public function offsetExists($key): bool /** * Get an item at a given offset. * - * @param TKey $key - * @return TValue + * @param mixed $key + * @return mixed */ - public function offsetGet($key): mixed + #[\ReturnTypeWillChange] + public function offsetGet($key) { return $this->items[$key]; } @@ -1678,11 +1644,12 @@ public function offsetGet($key): mixed /** * Set the item at a given offset. * - * @param TKey|null $key - * @param TValue $value + * @param mixed $key + * @param mixed $value * @return void */ - public function offsetSet($key, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) { if (is_null($key)) { $this->items[] = $value; @@ -1694,10 +1661,11 @@ public function offsetSet($key, $value): void /** * Unset the item at a given offset. * - * @param TKey $key + * @param mixed $key * @return void */ - public function offsetUnset($key): void + #[\ReturnTypeWillChange] + public function offsetUnset($key) { unset($this->items[$key]); } diff --git a/core/vendor/illuminate/collections/Enumerable.php b/core/vendor/illuminate/collections/Enumerable.php index c0ba789c87..261a0c856b 100644 --- a/core/vendor/illuminate/collections/Enumerable.php +++ b/core/vendor/illuminate/collections/Enumerable.php @@ -2,31 +2,19 @@ namespace Illuminate\Support; -use CachingIterator; use Countable; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Support\Jsonable; use IteratorAggregate; use JsonSerializable; -use Traversable; - -/** - * @template TKey of array-key - * @template TValue - * - * @extends \Illuminate\Contracts\Support\Arrayable<TKey, TValue> - * @extends \IteratorAggregate<TKey, TValue> - */ + interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable { /** * Create a new collection instance if the value isn't one already. * - * @template TMakeKey of array-key - * @template TMakeValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TMakeKey, TMakeValue>|iterable<TMakeKey, TMakeValue>|null $items - * @return static<TMakeKey, TMakeValue> + * @param mixed $items + * @return static */ public static function make($items = []); @@ -51,22 +39,16 @@ public static function range($from, $to); /** * Wrap the given value in a collection if applicable. * - * @template TWrapKey of array-key - * @template TWrapValue - * - * @param iterable<TWrapKey, TWrapValue> $value - * @return static<TWrapKey, TWrapValue> + * @param mixed $value + * @return static */ public static function wrap($value); /** * Get the underlying items from the given collection if applicable. * - * @template TUnwrapKey of array-key - * @template TUnwrapValue - * - * @param array<TUnwrapKey, TUnwrapValue>|static<TUnwrapKey, TUnwrapValue> $value - * @return array<TUnwrapKey, TUnwrapValue> + * @param array|static $value + * @return array */ public static function unwrap($value); @@ -87,38 +69,38 @@ public function all(); /** * Alias for the "avg" method. * - * @param (callable(TValue): float|int)|string|null $callback - * @return float|int|null + * @param callable|string|null $callback + * @return mixed */ public function average($callback = null); /** * Get the median of a given key. * - * @param string|array<array-key, string>|null $key - * @return float|int|null + * @param string|array|null $key + * @return mixed */ public function median($key = null); /** * Get the mode of a given key. * - * @param string|array<array-key, string>|null $key - * @return array<int, float|int>|null + * @param string|array|null $key + * @return array|null */ public function mode($key = null); /** * Collapse the items into a single enumerable. * - * @return static<int, mixed> + * @return static */ public function collapse(); /** * Alias for the "contains" method. * - * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool @@ -128,8 +110,8 @@ public function some($key, $operator = null, $value = null); /** * Determine if an item exists, using strict comparison. * - * @param (callable(TValue): bool)|TValue|array-key $key - * @param TValue|null $value + * @param mixed $key + * @param mixed $value * @return bool */ public function containsStrict($key, $value = null); @@ -137,39 +119,26 @@ public function containsStrict($key, $value = null); /** * Get the average value of a given key. * - * @param (callable(TValue): float|int)|string|null $callback - * @return float|int|null + * @param callable|string|null $callback + * @return mixed */ public function avg($callback = null); /** * Determine if an item exists in the enumerable. * - * @param (callable(TValue, TKey): bool)|TValue|string $key - * @param mixed $operator - * @param mixed $value - * @return bool - */ - public function contains($key, $operator = null, $value = null); - - /** - * Determine if an item is not contained in the collection. - * * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool */ - public function doesntContain($key, $operator = null, $value = null); + public function contains($key, $operator = null, $value = null); /** * Cross join with the given lists, returning all possible permutations. * - * @template TCrossJoinKey - * @template TCrossJoinValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TCrossJoinKey, TCrossJoinValue>|iterable<TCrossJoinKey, TCrossJoinValue> ...$lists - * @return static<int, array<int, TValue|TCrossJoinValue>> + * @param mixed ...$lists + * @return static */ public function crossJoin(...$lists); @@ -177,7 +146,7 @@ public function crossJoin(...$lists); * Dump the collection and end the script. * * @param mixed ...$args - * @return never + * @return void */ public function dd(...$args); @@ -191,7 +160,7 @@ public function dump(); /** * Get the items that are not present in the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items + * @param mixed $items * @return static */ public function diff($items); @@ -199,8 +168,8 @@ public function diff($items); /** * Get the items that are not present in the given items, using the callback. * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items - * @param callable(TValue): int $callback + * @param mixed $items + * @param callable $callback * @return static */ public function diffUsing($items, callable $callback); @@ -208,7 +177,7 @@ public function diffUsing($items, callable $callback); /** * Get the items whose keys and values are not present in the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function diffAssoc($items); @@ -216,8 +185,8 @@ public function diffAssoc($items); /** * Get the items whose keys and values are not present in the given items, using the callback. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items - * @param callable(TKey): int $callback + * @param mixed $items + * @param callable $callback * @return static */ public function diffAssocUsing($items, callable $callback); @@ -225,7 +194,7 @@ public function diffAssocUsing($items, callable $callback); /** * Get the items whose keys are not present in the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function diffKeys($items); @@ -233,8 +202,8 @@ public function diffKeys($items); /** * Get the items whose keys are not present in the given items, using the callback. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items - * @param callable(TKey): int $callback + * @param mixed $items + * @param callable $callback * @return static */ public function diffKeysUsing($items, callable $callback); @@ -242,7 +211,7 @@ public function diffKeysUsing($items, callable $callback); /** * Retrieve duplicate items. * - * @param (callable(TValue): bool)|string|null $callback + * @param callable|string|null $callback * @param bool $strict * @return static */ @@ -251,7 +220,7 @@ public function duplicates($callback = null, $strict = false); /** * Retrieve duplicate items using strict comparison. * - * @param (callable(TValue): bool)|string|null $callback + * @param callable|string|null $callback * @return static */ public function duplicatesStrict($callback = null); @@ -259,7 +228,7 @@ public function duplicatesStrict($callback = null); /** * Execute a callback over each item. * - * @param callable(TValue, TKey): mixed $callback + * @param callable $callback * @return $this */ public function each(callable $callback); @@ -275,7 +244,7 @@ public function eachSpread(callable $callback); /** * Determine if all items pass the given truth test. * - * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param string|callable $key * @param mixed $operator * @param mixed $value * @return bool @@ -285,7 +254,7 @@ public function every($key, $operator = null, $value = null); /** * Get all items except for those with the specified keys. * - * @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys + * @param mixed $keys * @return static */ public function except($keys); @@ -293,76 +262,64 @@ public function except($keys); /** * Run a filter over each of the items. * - * @param (callable(TValue): bool)|null $callback + * @param callable|null $callback * @return static */ public function filter(callable $callback = null); /** - * Apply the callback if the given "value" is (or resolves to) truthy. - * - * @template TWhenReturnType as null + * Apply the callback if the value is truthy. * * @param bool $value - * @param (callable($this): TWhenReturnType)|null $callback - * @param (callable($this): TWhenReturnType)|null $default - * @return $this|TWhenReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ - public function when($value, callable $callback = null, callable $default = null); + public function when($value, callable $callback, callable $default = null); /** * Apply the callback if the collection is empty. * - * @template TWhenEmptyReturnType - * - * @param (callable($this): TWhenEmptyReturnType) $callback - * @param (callable($this): TWhenEmptyReturnType)|null $default - * @return $this|TWhenEmptyReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ public function whenEmpty(callable $callback, callable $default = null); /** * Apply the callback if the collection is not empty. * - * @template TWhenNotEmptyReturnType - * - * @param callable($this): TWhenNotEmptyReturnType $callback - * @param (callable($this): TWhenNotEmptyReturnType)|null $default - * @return $this|TWhenNotEmptyReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ public function whenNotEmpty(callable $callback, callable $default = null); /** - * Apply the callback if the given "value" is (or resolves to) truthy. - * - * @template TUnlessReturnType + * Apply the callback if the value is falsy. * * @param bool $value - * @param (callable($this): TUnlessReturnType) $callback - * @param (callable($this): TUnlessReturnType)|null $default - * @return $this|TUnlessReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ public function unless($value, callable $callback, callable $default = null); /** * Apply the callback unless the collection is empty. * - * @template TUnlessEmptyReturnType - * - * @param callable($this): TUnlessEmptyReturnType $callback - * @param (callable($this): TUnlessEmptyReturnType)|null $default - * @return $this|TUnlessEmptyReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ public function unlessEmpty(callable $callback, callable $default = null); /** * Apply the callback unless the collection is not empty. * - * @template TUnlessNotEmptyReturnType - * - * @param callable($this): TUnlessNotEmptyReturnType $callback - * @param (callable($this): TUnlessNotEmptyReturnType)|null $default - * @return $this|TUnlessNotEmptyReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ public function unlessNotEmpty(callable $callback, callable $default = null); @@ -405,7 +362,7 @@ public function whereStrict($key, $value); * Filter items by the given key value pair. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param mixed $values * @param bool $strict * @return static */ @@ -415,7 +372,7 @@ public function whereIn($key, $values, $strict = false); * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param mixed $values * @return static */ public function whereInStrict($key, $values); @@ -424,7 +381,7 @@ public function whereInStrict($key, $values); * Filter items such that the value of the given key is between the given values. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param array $values * @return static */ public function whereBetween($key, $values); @@ -433,7 +390,7 @@ public function whereBetween($key, $values); * Filter items such that the value of the given key is not between the given values. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param array $values * @return static */ public function whereNotBetween($key, $values); @@ -442,7 +399,7 @@ public function whereNotBetween($key, $values); * Filter items by the given key value pair. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param mixed $values * @param bool $strict * @return static */ @@ -452,7 +409,7 @@ public function whereNotIn($key, $values, $strict = false); * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param mixed $values * @return static */ public function whereNotInStrict($key, $values); @@ -460,7 +417,7 @@ public function whereNotInStrict($key, $values); /** * Filter the items, removing any items that don't match the given type(s). * - * @param class-string|array<array-key, class-string> $type + * @param string|string[] $type * @return static */ public function whereInstanceOf($type); @@ -468,11 +425,9 @@ public function whereInstanceOf($type); /** * Get the first item from the enumerable passing the given truth test. * - * @template TFirstDefault - * - * @param (callable(TValue,TKey): bool)|null $callback - * @param TFirstDefault|(\Closure(): TFirstDefault) $default - * @return TValue|TFirstDefault + * @param callable|null $callback + * @param mixed $default + * @return mixed */ public function first(callable $callback = null, $default = null); @@ -482,7 +437,7 @@ public function first(callable $callback = null, $default = null); * @param string $key * @param mixed $operator * @param mixed $value - * @return TValue|null + * @return mixed */ public function firstWhere($key, $operator = null, $value = null); @@ -497,53 +452,43 @@ public function flatten($depth = INF); /** * Flip the values with their keys. * - * @return static<TValue, TKey> + * @return static */ public function flip(); /** * Get an item from the collection by key. * - * @template TGetDefault - * - * @param TKey $key - * @param TGetDefault|(\Closure(): TGetDefault) $default - * @return TValue|TGetDefault + * @param mixed $key + * @param mixed $default + * @return mixed */ public function get($key, $default = null); /** * Group an associative array by a field or using a callback. * - * @param (callable(TValue, TKey): array-key)|array|string $groupBy + * @param array|callable|string $groupBy * @param bool $preserveKeys - * @return static<array-key, static<array-key, TValue>> + * @return static */ public function groupBy($groupBy, $preserveKeys = false); /** * Key an associative array by a field or using a callback. * - * @param (callable(TValue, TKey): array-key)|array|string $keyBy - * @return static<array-key, TValue> + * @param callable|string $keyBy + * @return static */ public function keyBy($keyBy); /** * Determine if an item exists in the collection by key. * - * @param TKey|array<array-key, TKey> $key - * @return bool - */ - public function has($key); - - /** - * Determine if any of the keys exist in the collection. - * * @param mixed $key * @return bool */ - public function hasAny($key); + public function has($key); /** * Concatenate values of a given key as a string. @@ -557,7 +502,7 @@ public function implode($value, $glue = null); /** * Intersect the collection with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function intersect($items); @@ -565,7 +510,7 @@ public function intersect($items); /** * Intersect the collection with the given items by key. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function intersectByKeys($items); @@ -584,13 +529,6 @@ public function isEmpty(); */ public function isNotEmpty(); - /** - * Determine if the collection contains a single item. - * - * @return bool - */ - public function containsOneItem(); - /** * Join all items from the collection using a string. The final items can use a separate glue string. * @@ -603,28 +541,24 @@ public function join($glue, $finalGlue = ''); /** * Get the keys of the collection items. * - * @return static<int, TKey> + * @return static */ public function keys(); /** * Get the last item from the collection. * - * @template TLastDefault - * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TLastDefault|(\Closure(): TLastDefault) $default - * @return TValue|TLastDefault + * @param callable|null $callback + * @param mixed $default + * @return mixed */ public function last(callable $callback = null, $default = null); /** * Run a map over each of the items. * - * @template TMapValue - * - * @param callable(TValue, TKey): TMapValue $callback - * @return static<TKey, TMapValue> + * @param callable $callback + * @return static */ public function map(callable $callback); @@ -641,11 +575,8 @@ public function mapSpread(callable $callback); * * The callback should return an associative array with a single key/value pair. * - * @template TMapToDictionaryKey of array-key - * @template TMapToDictionaryValue - * - * @param callable(TValue, TKey): array<TMapToDictionaryKey, TMapToDictionaryValue> $callback - * @return static<TMapToDictionaryKey, array<int, TMapToDictionaryValue>> + * @param callable $callback + * @return static */ public function mapToDictionary(callable $callback); @@ -654,11 +585,8 @@ public function mapToDictionary(callable $callback); * * The callback should return an associative array with a single key/value pair. * - * @template TMapToGroupsKey of array-key - * @template TMapToGroupsValue - * - * @param callable(TValue, TKey): array<TMapToGroupsKey, TMapToGroupsValue> $callback - * @return static<TMapToGroupsKey, static<int, TMapToGroupsValue>> + * @param callable $callback + * @return static */ public function mapToGroups(callable $callback); @@ -667,36 +595,31 @@ public function mapToGroups(callable $callback); * * The callback should return an associative array with a single key/value pair. * - * @template TMapWithKeysKey of array-key - * @template TMapWithKeysValue - * - * @param callable(TValue, TKey): array<TMapWithKeysKey, TMapWithKeysValue> $callback - * @return static<TMapWithKeysKey, TMapWithKeysValue> + * @param callable $callback + * @return static */ public function mapWithKeys(callable $callback); /** * Map a collection and flatten the result by a single level. * - * @param callable(TValue, TKey): mixed $callback - * @return static<int, mixed> + * @param callable $callback + * @return static */ public function flatMap(callable $callback); /** * Map the values into a new class. * - * @template TMapIntoValue - * - * @param class-string<TMapIntoValue> $class - * @return static<TKey, TMapIntoValue> + * @param string $class + * @return static */ public function mapInto($class); /** * Merge the collection with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function merge($items); @@ -704,27 +627,23 @@ public function merge($items); /** * Recursively merge the collection with the given items. * - * @template TMergeRecursiveValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TMergeRecursiveValue>|iterable<TKey, TMergeRecursiveValue> $items - * @return static<TKey, TValue|TMergeRecursiveValue> + * @param mixed $items + * @return static */ public function mergeRecursive($items); /** * Create a collection by using this collection for keys and another for its values. * - * @template TCombineValue - * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values - * @return static<TKey, TCombineValue> + * @param mixed $values + * @return static */ public function combine($values); /** * Union the collection with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function union($items); @@ -732,16 +651,16 @@ public function union($items); /** * Get the min value of a given key. * - * @param (callable(TValue):mixed)|string|null $callback - * @return TValue + * @param callable|string|null $callback + * @return mixed */ public function min($callback = null); /** * Get the max value of a given key. * - * @param (callable(TValue):mixed)|string|null $callback - * @return TValue + * @param callable|string|null $callback + * @return mixed */ public function max($callback = null); @@ -757,7 +676,7 @@ public function nth($step, $offset = 0); /** * Get the items with the specified keys. * - * @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys + * @param mixed $keys * @return static */ public function only($keys); @@ -774,17 +693,17 @@ public function forPage($page, $perPage); /** * Partition the collection into two arrays using the given callback or key. * - * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param callable|string $key * @param mixed $operator * @param mixed $value - * @return static<int<0, 1>, static<TKey, TValue>> + * @return static */ public function partition($key, $operator = null, $value = null); /** * Push all of the given items onto the collection. * - * @param iterable<array-key, TValue> $source + * @param iterable $source * @return static */ public function concat($source); @@ -793,7 +712,7 @@ public function concat($source); * Get one or a specified number of items randomly from the collection. * * @param int|null $number - * @return static<int, TValue>|TValue + * @return static|mixed * * @throws \InvalidArgumentException */ @@ -802,30 +721,16 @@ public function random($number = null); /** * Reduce the collection to a single value. * - * @template TReduceInitial - * @template TReduceReturnType - * - * @param callable(TReduceInitial|TReduceReturnType, TValue): TReduceReturnType $callback - * @param TReduceInitial $initial - * @return TReduceReturnType - */ - public function reduce(callable $callback, $initial = null); - - /** - * Reduce the collection to multiple aggregate values. - * * @param callable $callback - * @param mixed ...$initial - * @return array - * - * @throws \UnexpectedValueException + * @param mixed $initial + * @return mixed */ - public function reduceSpread(callable $callback, ...$initial); + public function reduce(callable $callback, $initial = null); /** * Replace the collection items with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function replace($items); @@ -833,7 +738,7 @@ public function replace($items); /** * Recursively replace the collection items with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function replaceRecursive($items); @@ -848,9 +753,9 @@ public function reverse(); /** * Search the collection for a given value and return the corresponding key if successful. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @param bool $strict - * @return TKey|bool + * @return mixed */ public function search($value, $strict = false); @@ -862,15 +767,6 @@ public function search($value, $strict = false); */ public function shuffle($seed = null); - /** - * Create chunks representing a "sliding window" view of the items in the collection. - * - * @param int $size - * @param int $step - * @return static<int, static> - */ - public function sliding($size = 2, $step = 1); - /** * Skip the first {$count} items. * @@ -882,7 +778,7 @@ public function skip($count); /** * Skip items in the collection until the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function skipUntil($value); @@ -890,7 +786,7 @@ public function skipUntil($value); /** * Skip items in the collection while the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function skipWhile($value); @@ -908,63 +804,30 @@ public function slice($offset, $length = null); * Split a collection into a certain number of groups. * * @param int $numberOfGroups - * @return static<int, static> + * @return static */ public function split($numberOfGroups); - /** - * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. - * - * @param (callable(TValue, TKey): bool)|string $key - * @param mixed $operator - * @param mixed $value - * @return TValue - * - * @throws \Illuminate\Support\ItemNotFoundException - * @throws \Illuminate\Support\MultipleItemsFoundException - */ - public function sole($key = null, $operator = null, $value = null); - - /** - * Get the first item in the collection but throw an exception if no matching items exist. - * - * @param (callable(TValue, TKey): bool)|string $key - * @param mixed $operator - * @param mixed $value - * @return TValue - * - * @throws \Illuminate\Support\ItemNotFoundException - */ - public function firstOrFail($key = null, $operator = null, $value = null); - /** * Chunk the collection into chunks of the given size. * * @param int $size - * @return static<int, static> + * @return static */ public function chunk($size); /** * Chunk the collection into chunks with a callback. * - * @param callable(TValue, TKey, static<int, TValue>): bool $callback - * @return static<int, static<int, TValue>> + * @param callable $callback + * @return static */ public function chunkWhile(callable $callback); - /** - * Split a collection into a certain number of groups, and fill the first groups completely. - * - * @param int $numberOfGroups - * @return static<int, static> - */ - public function splitIn($numberOfGroups); - /** * Sort through each item with a callback. * - * @param (callable(TValue, TValue): bool)|null|int $callback + * @param callable|null|int $callback * @return static */ public function sort($callback = null); @@ -980,7 +843,7 @@ public function sortDesc($options = SORT_REGULAR); /** * Sort the collection using the given callback. * - * @param array<array-key, (callable(TValue, TKey): mixed)|array<array-key, string>|(callable(TValue, TKey): mixed)|string $callback + * @param callable|string $callback * @param int $options * @param bool $descending * @return static @@ -990,7 +853,7 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false); /** * Sort the collection in descending order using the given callback. * - * @param array<array-key, (callable(TValue, TKey): mixed)|array<array-key, string>|(callable(TValue, TKey): mixed)|string $callback + * @param callable|string $callback * @param int $options * @return static */ @@ -1013,18 +876,10 @@ public function sortKeys($options = SORT_REGULAR, $descending = false); */ public function sortKeysDesc($options = SORT_REGULAR); - /** - * Sort the collection keys using a callback. - * - * @param callable $callback - * @return static - */ - public function sortKeysUsing(callable $callback); - /** * Get the sum of the given values. * - * @param (callable(TValue): mixed)|string|null $callback + * @param callable|string|null $callback * @return mixed */ public function sum($callback = null); @@ -1040,7 +895,7 @@ public function take($limit); /** * Take items in the collection until the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function takeUntil($value); @@ -1048,7 +903,7 @@ public function takeUntil($value); /** * Take items in the collection while the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function takeWhile($value); @@ -1056,7 +911,7 @@ public function takeWhile($value); /** * Pass the collection to the given callback and then return it. * - * @param callable(TValue): mixed $callback + * @param callable $callback * @return $this */ public function tap(callable $callback); @@ -1064,57 +919,32 @@ public function tap(callable $callback); /** * Pass the enumerable to the given callback and return the result. * - * @template TPipeReturnType - * - * @param callable($this): TPipeReturnType $callback - * @return TPipeReturnType - */ - public function pipe(callable $callback); - - /** - * Pass the collection into a new class. - * - * @param string-class $class - * @return mixed - */ - public function pipeInto($class); - - /** - * Pass the collection through a series of callable pipes and return the result. - * - * @param array<callable> $pipes + * @param callable $callback * @return mixed */ - public function pipeThrough($pipes); + public function pipe(callable $callback); /** * Get the values of a given key. * - * @param string|array<array-key, string> $value + * @param string|array $value * @param string|null $key - * @return static<int, mixed> + * @return static */ public function pluck($value, $key = null); /** * Create a collection of all elements that do not pass a given truth test. * - * @param (callable(TValue, TKey): bool)|bool $callback + * @param callable|mixed $callback * @return static */ public function reject($callback = true); - /** - * Convert a flatten "dot" notation array into an expanded array. - * - * @return static - */ - public function undot(); - /** * Return only unique items from the collection array. * - * @param (callable(TValue, TKey): mixed)|string|null $key + * @param string|callable|null $key * @param bool $strict * @return static */ @@ -1123,7 +953,7 @@ public function unique($key = null, $strict = false); /** * Return only unique items from the collection array using strict comparison. * - * @param (callable(TValue, TKey): mixed)|string|null $key + * @param string|callable|null $key * @return static */ public function uniqueStrict($key = null); @@ -1131,40 +961,24 @@ public function uniqueStrict($key = null); /** * Reset the keys on the underlying array. * - * @return static<int, TValue> + * @return static */ public function values(); /** * Pad collection to the specified length with a value. * - * @template TPadValue - * * @param int $size - * @param TPadValue $value - * @return static<int, TValue|TPadValue> + * @param mixed $value + * @return static */ public function pad($size, $value); /** - * Get the values iterator. - * - * @return \Traversable<TKey, TValue> - */ - public function getIterator(): Traversable; - - /** - * Count the number of items in the collection. + * Count the number of items in the collection using a given truth test. * - * @return int - */ - public function count(): int; - - /** - * Count the number of items in the collection by a field or using a callback. - * - * @param (callable(TValue, TKey): mixed)|string|null $countBy - * @return static<array-key, int> + * @param callable|null $callback + * @return static */ public function countBy($callback = null); @@ -1174,50 +988,18 @@ public function countBy($callback = null); * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]); * => [[1, 4], [2, 5], [3, 6]] * - * @template TZipValue - * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TZipValue>|iterable<array-key, TZipValue> ...$items - * @return static<int, static<int, TValue|TZipValue>> + * @param mixed ...$items + * @return static */ public function zip($items); /** * Collect the values into a collection. * - * @return \Illuminate\Support\Collection<TKey, TValue> + * @return \Illuminate\Support\Collection */ public function collect(); - /** - * Get the collection of items as a plain array. - * - * @return array<TKey, mixed> - */ - public function toArray(); - - /** - * Convert the object into something JSON serializable. - * - * @return array<TKey, mixed> - */ - public function jsonSerialize(): array; - - /** - * Get the collection of items as JSON. - * - * @param int $options - * @return string - */ - public function toJson($options = 0); - - /** - * Get a CachingIterator instance. - * - * @param int $flags - * @return \CachingIterator - */ - public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING); - /** * Convert the collection to its string representation. * @@ -1225,14 +1007,6 @@ public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING); */ public function __toString(); - /** - * Indicate that the model's string representation should be escaped when __toString is invoked. - * - * @param bool $escape - * @return $this - */ - public function escapeWhenCastingToString($escape = true); - /** * Add a method to the list of proxied methods. * diff --git a/core/vendor/illuminate/conditionable/HigherOrderWhenProxy.php b/core/vendor/illuminate/collections/HigherOrderWhenProxy.php similarity index 54% rename from core/vendor/illuminate/conditionable/HigherOrderWhenProxy.php rename to core/vendor/illuminate/collections/HigherOrderWhenProxy.php index 173a783967..6653c03a65 100644 --- a/core/vendor/illuminate/conditionable/HigherOrderWhenProxy.php +++ b/core/vendor/illuminate/collections/HigherOrderWhenProxy.php @@ -2,14 +2,17 @@ namespace Illuminate\Support; +/** + * @mixin \Illuminate\Support\Enumerable + */ class HigherOrderWhenProxy { /** - * The target being conditionally operated on. + * The collection being operated on. * - * @var mixed + * @var \Illuminate\Support\Enumerable */ - protected $target; + protected $collection; /** * The condition for proxying. @@ -21,18 +24,18 @@ class HigherOrderWhenProxy /** * Create a new proxy instance. * - * @param mixed $target + * @param \Illuminate\Support\Enumerable $collection * @param bool $condition * @return void */ - public function __construct($target, $condition) + public function __construct(Enumerable $collection, $condition) { - $this->target = $target; $this->condition = $condition; + $this->collection = $collection; } /** - * Proxy accessing an attribute onto the target. + * Proxy accessing an attribute onto the collection. * * @param string $key * @return mixed @@ -40,12 +43,12 @@ public function __construct($target, $condition) public function __get($key) { return $this->condition - ? $this->target->{$key} - : $this->target; + ? $this->collection->{$key} + : $this->collection; } /** - * Proxy a method call on the target. + * Proxy a method call onto the collection. * * @param string $method * @param array $parameters @@ -54,7 +57,7 @@ public function __get($key) public function __call($method, $parameters) { return $this->condition - ? $this->target->{$method}(...$parameters) - : $this->target; + ? $this->collection->{$method}(...$parameters) + : $this->collection; } } diff --git a/core/vendor/illuminate/collections/LazyCollection.php b/core/vendor/illuminate/collections/LazyCollection.php index 3fb672a5bb..957a1923e6 100644 --- a/core/vendor/illuminate/collections/LazyCollection.php +++ b/core/vendor/illuminate/collections/LazyCollection.php @@ -5,39 +5,27 @@ use ArrayIterator; use Closure; use DateTimeInterface; -use Generator; use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString; use Illuminate\Support\Traits\EnumeratesValues; use Illuminate\Support\Traits\Macroable; -use InvalidArgumentException; use IteratorAggregate; use stdClass; -use Traversable; - -/** - * @template TKey of array-key - * @template TValue - * - * @implements \Illuminate\Support\Enumerable<TKey, TValue> - */ + class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable { - /** - * @use \Illuminate\Support\Traits\EnumeratesValues<TKey, TValue> - */ use EnumeratesValues, Macroable; /** * The source from which to generate items. * - * @var (Closure(): \Generator<TKey, TValue, mixed, void>)|static|array<TKey, TValue> + * @var callable|static */ public $source; /** * Create a new lazy collection instance. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>|(Closure(): \Generator<TKey, TValue, mixed, void>)|self<TKey, TValue>|array<TKey, TValue>|null $source + * @param mixed $source * @return void */ public function __construct($source = null) @@ -46,35 +34,17 @@ public function __construct($source = null) $this->source = $source; } elseif (is_null($source)) { $this->source = static::empty(); - } elseif ($source instanceof Generator) { - throw new InvalidArgumentException( - 'Generators should not be passed directly to LazyCollection. Instead, pass a generator function.' - ); } else { $this->source = $this->getArrayableItems($source); } } - /** - * Create a new collection instance if the value isn't one already. - * - * @template TMakeKey of array-key - * @template TMakeValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TMakeKey, TMakeValue>|iterable<TMakeKey, TMakeValue>|(Closure(): \Generator<TMakeKey, TMakeValue, mixed, void>)|self<TMakeKey, TMakeValue>|array<TMakeKey, TMakeValue>|null $items - * @return static<TMakeKey, TMakeValue> - */ - public static function make($items = []) - { - return new static($items); - } - /** * Create a collection with the given range. * * @param int $from * @param int $to - * @return static<int, int> + * @return static */ public static function range($from, $to) { @@ -94,7 +64,7 @@ public static function range($from, $to) /** * Get all items in the enumerable. * - * @return array<TKey, TValue> + * @return array */ public function all() { @@ -156,8 +126,8 @@ public function remember() /** * Get the average value of a given key. * - * @param (callable(TValue): float|int)|string|null $callback - * @return float|int|null + * @param callable|string|null $callback + * @return mixed */ public function avg($callback = null) { @@ -167,8 +137,8 @@ public function avg($callback = null) /** * Get the median of a given key. * - * @param string|array<array-key, string>|null $key - * @return float|int|null + * @param string|array|null $key + * @return mixed */ public function median($key = null) { @@ -178,8 +148,8 @@ public function median($key = null) /** * Get the mode of a given key. * - * @param string|array<string>|null $key - * @return array<int, float|int>|null + * @param string|array|null $key + * @return array|null */ public function mode($key = null) { @@ -189,7 +159,7 @@ public function mode($key = null) /** * Collapse the collection of items into a single array. * - * @return static<int, mixed> + * @return static */ public function collapse() { @@ -207,7 +177,7 @@ public function collapse() /** * Determine if an item exists in the enumerable. * - * @param (callable(TValue): bool)|TValue|string $key + * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool @@ -217,7 +187,6 @@ public function contains($key, $operator = null, $value = null) if (func_num_args() === 1 && $this->useAsCallable($key)) { $placeholder = new stdClass; - /** @var callable $key */ return $this->first($key, $placeholder) !== $placeholder; } @@ -252,11 +221,8 @@ public function doesntContain($key, $operator = null, $value = null) /** * Cross join the given iterables, returning all possible permutations. * - * @template TCrossJoinKey - * @template TCrossJoinValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TCrossJoinKey, TCrossJoinValue>|iterable<TCrossJoinKey, TCrossJoinValue> ...$arrays - * @return static<int, array<int, TValue|TCrossJoinValue>> + * @param array ...$arrays + * @return static */ public function crossJoin(...$arrays) { @@ -266,8 +232,8 @@ public function crossJoin(...$arrays) /** * Count the number of items in the collection by a field or using a callback. * - * @param (callable(TValue, TKey): mixed)|string|null $countBy - * @return static<array-key, int> + * @param callable|string $countBy + * @return static */ public function countBy($countBy = null) { @@ -295,7 +261,7 @@ public function countBy($countBy = null) /** * Get the items that are not present in the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items + * @param mixed $items * @return static */ public function diff($items) @@ -306,8 +272,8 @@ public function diff($items) /** * Get the items that are not present in the given items, using the callback. * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items - * @param callable(TValue): int $callback + * @param mixed $items + * @param callable $callback * @return static */ public function diffUsing($items, callable $callback) @@ -318,7 +284,7 @@ public function diffUsing($items, callable $callback) /** * Get the items whose keys and values are not present in the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function diffAssoc($items) @@ -329,8 +295,8 @@ public function diffAssoc($items) /** * Get the items whose keys and values are not present in the given items, using the callback. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items - * @param callable(TKey): int $callback + * @param mixed $items + * @param callable $callback * @return static */ public function diffAssocUsing($items, callable $callback) @@ -341,7 +307,7 @@ public function diffAssocUsing($items, callable $callback) /** * Get the items whose keys are not present in the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function diffKeys($items) @@ -352,8 +318,8 @@ public function diffKeys($items) /** * Get the items whose keys are not present in the given items, using the callback. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items - * @param callable(TKey): int $callback + * @param mixed $items + * @param callable $callback * @return static */ public function diffKeysUsing($items, callable $callback) @@ -364,7 +330,7 @@ public function diffKeysUsing($items, callable $callback) /** * Retrieve duplicate items. * - * @param (callable(TValue): bool)|string|null $callback + * @param callable|string|null $callback * @param bool $strict * @return static */ @@ -376,7 +342,7 @@ public function duplicates($callback = null, $strict = false) /** * Retrieve duplicate items using strict comparison. * - * @param (callable(TValue): bool)|string|null $callback + * @param callable|string|null $callback * @return static */ public function duplicatesStrict($callback = null) @@ -387,7 +353,7 @@ public function duplicatesStrict($callback = null) /** * Get all items except for those with the specified keys. * - * @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys + * @param mixed $keys * @return static */ public function except($keys) @@ -398,7 +364,7 @@ public function except($keys) /** * Run a filter over each of the items. * - * @param (callable(TValue): bool)|null $callback + * @param callable|null $callback * @return static */ public function filter(callable $callback = null) @@ -421,11 +387,9 @@ public function filter(callable $callback = null) /** * Get the first item from the enumerable passing the given truth test. * - * @template TFirstDefault - * - * @param (callable(TValue): bool)|null $callback - * @param TFirstDefault|(\Closure(): TFirstDefault) $default - * @return TValue|TFirstDefault + * @param callable|null $callback + * @param mixed $default + * @return mixed */ public function first(callable $callback = null, $default = null) { @@ -452,7 +416,7 @@ public function first(callable $callback = null, $default = null) * Get a flattened list of the items in the collection. * * @param int $depth - * @return static<int, mixed> + * @return static */ public function flatten($depth = INF) { @@ -474,7 +438,7 @@ public function flatten($depth = INF) /** * Flip the items in the collection. * - * @return static<TValue, TKey> + * @return static */ public function flip() { @@ -488,11 +452,9 @@ public function flip() /** * Get an item by key. * - * @template TGetDefault - * - * @param TKey|null $key - * @param TGetDefault|(\Closure(): TGetDefault) $default - * @return TValue|TGetDefault + * @param mixed $key + * @param mixed $default + * @return mixed */ public function get($key, $default = null) { @@ -512,9 +474,9 @@ public function get($key, $default = null) /** * Group an associative array by a field or using a callback. * - * @param (callable(TValue, TKey): array-key)|array|string $groupBy + * @param array|callable|string $groupBy * @param bool $preserveKeys - * @return static<array-key, static<array-key, TValue>> + * @return static */ public function groupBy($groupBy, $preserveKeys = false) { @@ -524,8 +486,8 @@ public function groupBy($groupBy, $preserveKeys = false) /** * Key an associative array by a field or using a callback. * - * @param (callable(TValue, TKey): array-key)|array|string $keyBy - * @return static<array-key, TValue> + * @param callable|string $keyBy + * @return static */ public function keyBy($keyBy) { @@ -598,7 +560,7 @@ public function implode($value, $glue = null) /** * Intersect the collection with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function intersect($items) @@ -609,7 +571,7 @@ public function intersect($items) /** * Intersect the collection with the given items by key. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function intersectByKeys($items) @@ -652,7 +614,7 @@ public function join($glue, $finalGlue = '') /** * Get the keys of the collection items. * - * @return static<int, TKey> + * @return static */ public function keys() { @@ -666,11 +628,9 @@ public function keys() /** * Get the last item from the collection. * - * @template TLastDefault - * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TLastDefault|(\Closure(): TLastDefault) $default - * @return TValue|TLastDefault + * @param callable|null $callback + * @param mixed $default + * @return mixed */ public function last(callable $callback = null, $default = null) { @@ -688,9 +648,9 @@ public function last(callable $callback = null, $default = null) /** * Get the values of a given key. * - * @param string|array<array-key, string> $value + * @param string|array $value * @param string|null $key - * @return static<int, mixed> + * @return static */ public function pluck($value, $key = null) { @@ -718,10 +678,8 @@ public function pluck($value, $key = null) /** * Run a map over each of the items. * - * @template TMapValue - * - * @param callable(TValue, TKey): TMapValue $callback - * @return static<TKey, TMapValue> + * @param callable $callback + * @return static */ public function map(callable $callback) { @@ -737,11 +695,8 @@ public function map(callable $callback) * * The callback should return an associative array with a single key/value pair. * - * @template TMapToDictionaryKey of array-key - * @template TMapToDictionaryValue - * - * @param callable(TValue, TKey): array<TMapToDictionaryKey, TMapToDictionaryValue> $callback - * @return static<TMapToDictionaryKey, array<int, TMapToDictionaryValue>> + * @param callable $callback + * @return static */ public function mapToDictionary(callable $callback) { @@ -753,11 +708,8 @@ public function mapToDictionary(callable $callback) * * The callback should return an associative array with a single key/value pair. * - * @template TMapWithKeysKey of array-key - * @template TMapWithKeysValue - * - * @param callable(TValue, TKey): array<TMapWithKeysKey, TMapWithKeysValue> $callback - * @return static<TMapWithKeysKey, TMapWithKeysValue> + * @param callable $callback + * @return static */ public function mapWithKeys(callable $callback) { @@ -771,7 +723,7 @@ public function mapWithKeys(callable $callback) /** * Merge the collection with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function merge($items) @@ -782,10 +734,8 @@ public function merge($items) /** * Recursively merge the collection with the given items. * - * @template TMergeRecursiveValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TMergeRecursiveValue>|iterable<TKey, TMergeRecursiveValue> $items - * @return static<TKey, TValue|TMergeRecursiveValue> + * @param mixed $items + * @return static */ public function mergeRecursive($items) { @@ -795,10 +745,8 @@ public function mergeRecursive($items) /** * Create a collection by using this collection for keys and another for its values. * - * @template TCombineValue - * - * @param \IteratorAggregate<array-key, TCombineValue>|array<array-key, TCombineValue>|(callable(): \Generator<array-key, TCombineValue>) $values - * @return static<TKey, TCombineValue> + * @param mixed $values + * @return static */ public function combine($values) { @@ -828,7 +776,7 @@ public function combine($values) /** * Union the collection with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function union($items) @@ -861,7 +809,7 @@ public function nth($step, $offset = 0) /** * Get the items with the specified keys. * - * @param \Illuminate\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys + * @param mixed $keys * @return static */ public function only($keys) @@ -896,7 +844,7 @@ public function only($keys) /** * Push all of the given items onto the collection. * - * @param iterable<array-key, TValue> $source + * @param iterable $source * @return static */ public function concat($source) @@ -911,7 +859,7 @@ public function concat($source) * Get one or a specified number of items randomly from the collection. * * @param int|null $number - * @return static<int, TValue>|TValue + * @return static|mixed * * @throws \InvalidArgumentException */ @@ -925,7 +873,7 @@ public function random($number = null) /** * Replace the collection items with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function replace($items) @@ -952,7 +900,7 @@ public function replace($items) /** * Recursively replace the collection items with the given items. * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items + * @param mixed $items * @return static */ public function replaceRecursive($items) @@ -973,13 +921,12 @@ public function reverse() /** * Search the collection for a given value and return the corresponding key if successful. * - * @param TValue|(callable(TValue,TKey): bool) $value + * @param mixed $value * @param bool $strict - * @return TKey|bool + * @return mixed */ public function search($value, $strict = false) { - /** @var (callable(TValue,TKey): bool) $predicate */ $predicate = $this->useAsCallable($value) ? $value : function ($item) use ($value, $strict) { @@ -1011,7 +958,7 @@ public function shuffle($seed = null) * * @param int $size * @param int $step - * @return static<int, static> + * @return static */ public function sliding($size = 2, $step = 1) { @@ -1071,7 +1018,7 @@ public function skip($count) /** * Skip items in the collection until the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function skipUntil($value) @@ -1084,7 +1031,7 @@ public function skipUntil($value) /** * Skip items in the collection while the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function skipWhile($value) @@ -1128,7 +1075,7 @@ public function slice($offset, $length = null) * Split a collection into a certain number of groups. * * @param int $numberOfGroups - * @return static<int, static> + * @return static */ public function split($numberOfGroups) { @@ -1138,10 +1085,10 @@ public function split($numberOfGroups) /** * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. * - * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $key * @param mixed $operator * @param mixed $value - * @return TValue + * @return mixed * * @throws \Illuminate\Support\ItemNotFoundException * @throws \Illuminate\Support\MultipleItemsFoundException @@ -1153,7 +1100,7 @@ public function sole($key = null, $operator = null, $value = null) : $key; return $this - ->unless($filter == null) + ->when($filter) ->filter($filter) ->take(2) ->collect() @@ -1163,10 +1110,10 @@ public function sole($key = null, $operator = null, $value = null) /** * Get the first item in the collection but throw an exception if no matching items exist. * - * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $key * @param mixed $operator * @param mixed $value - * @return TValue + * @return mixed * * @throws \Illuminate\Support\ItemNotFoundException */ @@ -1177,7 +1124,7 @@ public function firstOrFail($key = null, $operator = null, $value = null) : $key; return $this - ->unless($filter == null) + ->when($filter) ->filter($filter) ->take(1) ->collect() @@ -1188,7 +1135,7 @@ public function firstOrFail($key = null, $operator = null, $value = null) * Chunk the collection into chunks of the given size. * * @param int $size - * @return static<int, static> + * @return static */ public function chunk($size) { @@ -1227,7 +1174,7 @@ public function chunk($size) * Split a collection into a certain number of groups, and fill the first groups completely. * * @param int $numberOfGroups - * @return static<int, static> + * @return static */ public function splitIn($numberOfGroups) { @@ -1237,8 +1184,8 @@ public function splitIn($numberOfGroups) /** * Chunk the collection into chunks with a callback. * - * @param callable(TValue, TKey, Collection<TKey, TValue>): bool $callback - * @return static<int, static<int, TValue>> + * @param callable $callback + * @return static */ public function chunkWhile(callable $callback) { @@ -1274,7 +1221,7 @@ public function chunkWhile(callable $callback) /** * Sort through each item with a callback. * - * @param (callable(TValue, TValue): bool)|null|int $callback + * @param callable|null|int $callback * @return static */ public function sort($callback = null) @@ -1296,7 +1243,7 @@ public function sortDesc($options = SORT_REGULAR) /** * Sort the collection using the given callback. * - * @param array<array-key, (callable(TValue, TKey): mixed)|array<array-key, string>|(callable(TValue, TKey): mixed)|string $callback + * @param callable|string $callback * @param int $options * @param bool $descending * @return static @@ -1309,7 +1256,7 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false) /** * Sort the collection in descending order using the given callback. * - * @param array<array-key, (callable(TValue, TKey): mixed)|array<array-key, string>|(callable(TValue, TKey): mixed)|string $callback + * @param callable|string $callback * @param int $options * @return static */ @@ -1384,12 +1331,11 @@ public function take($limit) /** * Take items in the collection until the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function takeUntil($value) { - /** @var callable(TValue, TKey): bool $callback */ $callback = $this->useAsCallable($value) ? $value : $this->equality($value); return new static(function () use ($callback) { @@ -1421,12 +1367,11 @@ public function takeUntilTimeout(DateTimeInterface $timeout) /** * Take items in the collection while the given condition is met. * - * @param TValue|callable(TValue,TKey): bool $value + * @param mixed $value * @return static */ public function takeWhile($value) { - /** @var callable(TValue, TKey): bool $callback */ $callback = $this->useAsCallable($value) ? $value : $this->equality($value); return $this->takeUntil(function ($item, $key) use ($callback) { @@ -1437,7 +1382,7 @@ public function takeWhile($value) /** * Pass each item in the collection to the given callback, lazily. * - * @param callable(TValue, TKey): mixed $callback + * @param callable $callback * @return static */ public function tapEach(callable $callback) @@ -1464,7 +1409,7 @@ public function undot() /** * Return only unique items from the collection array. * - * @param (callable(TValue, TKey): mixed)|string|null $key + * @param string|callable|null $key * @param bool $strict * @return static */ @@ -1488,7 +1433,7 @@ public function unique($key = null, $strict = false) /** * Reset the keys on the underlying array. * - * @return static<int, TValue> + * @return static */ public function values() { @@ -1505,10 +1450,8 @@ public function values() * e.g. new LazyCollection([1, 2, 3])->zip([4, 5, 6]); * => [[1, 4], [2, 5], [3, 6]] * - * @template TZipValue - * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TZipValue>|iterable<array-key, TZipValue> ...$items - * @return static<int, static<int, TValue|TZipValue>> + * @param mixed ...$items + * @return static */ public function zip($items) { @@ -1530,11 +1473,9 @@ public function zip($items) /** * Pad collection to the specified length with a value. * - * @template TPadValue - * * @param int $size - * @param TPadValue $value - * @return static<int, TValue|TPadValue> + * @param mixed $value + * @return static */ public function pad($size, $value) { @@ -1560,9 +1501,10 @@ public function pad($size, $value) /** * Get the values iterator. * - * @return \Traversable<TKey, TValue> + * @return \Traversable */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { return $this->makeIterator($this->source); } @@ -1572,7 +1514,8 @@ public function getIterator(): Traversable * * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { if (is_array($this->source)) { return count($this->source); @@ -1584,11 +1527,8 @@ public function count(): int /** * Make an iterator from the given source. * - * @template TIteratorKey of array-key - * @template TIteratorValue - * - * @param \IteratorAggregate<TIteratorKey, TIteratorValue>|array<TIteratorKey, TIteratorValue>|(callable(): \Generator<TIteratorKey, TIteratorValue>) $source - * @return \Traversable<TIteratorKey, TIteratorValue> + * @param mixed $source + * @return \Traversable */ protected function makeIterator($source) { @@ -1606,9 +1546,9 @@ protected function makeIterator($source) /** * Explode the "value" and "key" arguments passed to "pluck". * - * @param string|string[] $value - * @param string|string[]|null $key - * @return array{string[],string[]|null} + * @param string|array $value + * @param string|array|null $key + * @return array */ protected function explodePluckParameters($value, $key) { @@ -1623,7 +1563,7 @@ protected function explodePluckParameters($value, $key) * Pass this lazy collection through a method on the collection class. * * @param string $method - * @param array<mixed> $params + * @param array $params * @return static */ protected function passthru($method, array $params) diff --git a/core/vendor/illuminate/collections/Traits/EnumeratesValues.php b/core/vendor/illuminate/collections/Traits/EnumeratesValues.php index 4dd07ea9de..d732f8b572 100644 --- a/core/vendor/illuminate/collections/Traits/EnumeratesValues.php +++ b/core/vendor/illuminate/collections/Traits/EnumeratesValues.php @@ -11,18 +11,17 @@ use Illuminate\Support\Collection; use Illuminate\Support\Enumerable; use Illuminate\Support\HigherOrderCollectionProxy; +use Illuminate\Support\HigherOrderWhenProxy; use JsonSerializable; use Symfony\Component\VarDumper\VarDumper; use Traversable; use UnexpectedValueException; /** - * @template TKey of array-key - * @template TValue - * * @property-read HigherOrderCollectionProxy $average * @property-read HigherOrderCollectionProxy $avg * @property-read HigherOrderCollectionProxy $contains + * @property-read HigherOrderCollectionProxy $doesntContain * @property-read HigherOrderCollectionProxy $each * @property-read HigherOrderCollectionProxy $every * @property-read HigherOrderCollectionProxy $filter @@ -35,23 +34,19 @@ * @property-read HigherOrderCollectionProxy $min * @property-read HigherOrderCollectionProxy $partition * @property-read HigherOrderCollectionProxy $reject - * @property-read HigherOrderCollectionProxy $skipUntil - * @property-read HigherOrderCollectionProxy $skipWhile * @property-read HigherOrderCollectionProxy $some * @property-read HigherOrderCollectionProxy $sortBy * @property-read HigherOrderCollectionProxy $sortByDesc + * @property-read HigherOrderCollectionProxy $skipUntil + * @property-read HigherOrderCollectionProxy $skipWhile * @property-read HigherOrderCollectionProxy $sum * @property-read HigherOrderCollectionProxy $takeUntil * @property-read HigherOrderCollectionProxy $takeWhile * @property-read HigherOrderCollectionProxy $unique - * @property-read HigherOrderCollectionProxy $unless * @property-read HigherOrderCollectionProxy $until - * @property-read HigherOrderCollectionProxy $when */ trait EnumeratesValues { - use Conditionable; - /** * Indicates that the object's string representation should be escaped when __toString is invoked. * @@ -62,12 +57,13 @@ trait EnumeratesValues /** * The methods that can be proxied. * - * @var array<int, string> + * @var string[] */ protected static $proxies = [ 'average', 'avg', 'contains', + 'doesntContain', 'each', 'every', 'filter', @@ -89,19 +85,14 @@ trait EnumeratesValues 'takeUntil', 'takeWhile', 'unique', - 'unless', 'until', - 'when', ]; /** * Create a new collection instance if the value isn't one already. * - * @template TMakeKey of array-key - * @template TMakeValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TMakeKey, TMakeValue>|iterable<TMakeKey, TMakeValue>|null $items - * @return static<TMakeKey, TMakeValue> + * @param mixed $items + * @return static */ public static function make($items = []) { @@ -111,11 +102,8 @@ public static function make($items = []) /** * Wrap the given value in a collection if applicable. * - * @template TWrapKey of array-key - * @template TWrapValue - * - * @param iterable<TWrapKey, TWrapValue> $value - * @return static<TWrapKey, TWrapValue> + * @param mixed $value + * @return static */ public static function wrap($value) { @@ -127,11 +115,8 @@ public static function wrap($value) /** * Get the underlying items from the given collection if applicable. * - * @template TUnwrapKey of array-key - * @template TUnwrapValue - * - * @param array<TUnwrapKey, TUnwrapValue>|static<TUnwrapKey, TUnwrapValue> $value - * @return array<TUnwrapKey, TUnwrapValue> + * @param array|static $value + * @return array */ public static function unwrap($value) { @@ -151,11 +136,9 @@ public static function empty() /** * Create a new collection by invoking the callback a given amount of times. * - * @template TTimesValue - * * @param int $number - * @param (callable(int): TTimesValue)|null $callback - * @return static<int, TTimesValue> + * @param callable|null $callback + * @return static */ public static function times($number, callable $callback = null) { @@ -164,15 +147,15 @@ public static function times($number, callable $callback = null) } return static::range(1, $number) - ->unless($callback == null) + ->when($callback) ->map($callback); } /** * Alias for the "avg" method. * - * @param (callable(TValue): float|int)|string|null $callback - * @return float|int|null + * @param callable|string|null $callback + * @return mixed */ public function average($callback = null) { @@ -182,7 +165,7 @@ public function average($callback = null) /** * Alias for the "contains" method. * - * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool @@ -195,8 +178,8 @@ public function some($key, $operator = null, $value = null) /** * Determine if an item exists, using strict comparison. * - * @param (callable(TValue): bool)|TValue|array-key $key - * @param TValue|null $value + * @param mixed $key + * @param mixed $value * @return bool */ public function containsStrict($key, $value = null) @@ -224,7 +207,7 @@ public function containsStrict($key, $value = null) * Dump the items and end the script. * * @param mixed ...$args - * @return never + * @return void */ public function dd(...$args) { @@ -252,7 +235,7 @@ public function dump() /** * Execute a callback over each item. * - * @param callable(TValue, TKey): mixed $callback + * @param callable $callback * @return $this */ public function each(callable $callback) @@ -269,7 +252,7 @@ public function each(callable $callback) /** * Execute a callback over each nested chunk of items. * - * @param callable(...mixed): mixed $callback + * @param callable $callback * @return static */ public function eachSpread(callable $callback) @@ -284,7 +267,7 @@ public function eachSpread(callable $callback) /** * Determine if all items pass the given truth test. * - * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param string|callable $key * @param mixed $operator * @param mixed $value * @return bool @@ -312,7 +295,7 @@ public function every($key, $operator = null, $value = null) * @param string $key * @param mixed $operator * @param mixed $value - * @return TValue|null + * @return mixed */ public function firstWhere($key, $operator = null, $value = null) { @@ -332,10 +315,8 @@ public function isNotEmpty() /** * Run a map over each nested chunk of items. * - * @template TMapSpreadValue - * - * @param callable(mixed): TMapSpreadValue $callback - * @return static<TKey, TMapSpreadValue> + * @param callable $callback + * @return static */ public function mapSpread(callable $callback) { @@ -351,11 +332,8 @@ public function mapSpread(callable $callback) * * The callback should return an associative array with a single key/value pair. * - * @template TMapToGroupsKey of array-key - * @template TMapToGroupsValue - * - * @param callable(TValue, TKey): array<TMapToGroupsKey, TMapToGroupsValue> $callback - * @return static<TMapToGroupsKey, static<int, TMapToGroupsValue>> + * @param callable $callback + * @return static */ public function mapToGroups(callable $callback) { @@ -367,8 +345,8 @@ public function mapToGroups(callable $callback) /** * Map a collection and flatten the result by a single level. * - * @param callable(TValue, TKey): mixed $callback - * @return static<int, mixed> + * @param callable $callback + * @return static */ public function flatMap(callable $callback) { @@ -378,10 +356,8 @@ public function flatMap(callable $callback) /** * Map the values into a new class. * - * @template TMapIntoValue - * - * @param class-string<TMapIntoValue> $class - * @return static<TKey, TMapIntoValue> + * @param string $class + * @return static */ public function mapInto($class) { @@ -393,8 +369,8 @@ public function mapInto($class) /** * Get the min value of a given key. * - * @param (callable(TValue):mixed)|string|null $callback - * @return TValue + * @param callable|string|null $callback + * @return mixed */ public function min($callback = null) { @@ -412,8 +388,8 @@ public function min($callback = null) /** * Get the max value of a given key. * - * @param (callable(TValue):mixed)|string|null $callback - * @return TValue + * @param callable|string|null $callback + * @return mixed */ public function max($callback = null) { @@ -445,10 +421,10 @@ public function forPage($page, $perPage) /** * Partition the collection into two arrays using the given callback or key. * - * @param (callable(TValue, TKey): bool)|TValue|string $key - * @param TValue|string|null $operator - * @param TValue|null $value - * @return static<int<0, 1>, static<TKey, TValue>> + * @param callable|string $key + * @param mixed $operator + * @param mixed $value + * @return static */ public function partition($key, $operator = null, $value = null) { @@ -473,7 +449,7 @@ public function partition($key, $operator = null, $value = null) /** * Get the sum of the given values. * - * @param (callable(TValue): mixed)|string|null $callback + * @param callable|string|null $callback * @return mixed */ public function sum($callback = null) @@ -488,13 +464,34 @@ public function sum($callback = null) } /** - * Apply the callback if the collection is empty. + * Apply the callback if the value is truthy. * - * @template TWhenEmptyReturnType + * @param bool|mixed $value + * @param callable|null $callback + * @param callable|null $default + * @return static|mixed + */ + public function when($value, callable $callback = null, callable $default = null) + { + if (! $callback) { + return new HigherOrderWhenProxy($this, $value); + } + + if ($value) { + return $callback($this, $value); + } elseif ($default) { + return $default($this, $value); + } + + return $this; + } + + /** + * Apply the callback if the collection is empty. * - * @param (callable($this): TWhenEmptyReturnType) $callback - * @param (callable($this): TWhenEmptyReturnType)|null $default - * @return $this|TWhenEmptyReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ public function whenEmpty(callable $callback, callable $default = null) { @@ -504,11 +501,9 @@ public function whenEmpty(callable $callback, callable $default = null) /** * Apply the callback if the collection is not empty. * - * @template TWhenNotEmptyReturnType - * - * @param callable($this): TWhenNotEmptyReturnType $callback - * @param (callable($this): TWhenNotEmptyReturnType)|null $default - * @return $this|TWhenNotEmptyReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ public function whenNotEmpty(callable $callback, callable $default = null) { @@ -516,13 +511,24 @@ public function whenNotEmpty(callable $callback, callable $default = null) } /** - * Apply the callback unless the collection is empty. + * Apply the callback if the value is falsy. * - * @template TUnlessEmptyReturnType + * @param bool $value + * @param callable $callback + * @param callable|null $default + * @return static|mixed + */ + public function unless($value, callable $callback, callable $default = null) + { + return $this->when(! $value, $callback, $default); + } + + /** + * Apply the callback unless the collection is empty. * - * @param callable($this): TUnlessEmptyReturnType $callback - * @param (callable($this): TUnlessEmptyReturnType)|null $default - * @return $this|TUnlessEmptyReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ public function unlessEmpty(callable $callback, callable $default = null) { @@ -532,11 +538,9 @@ public function unlessEmpty(callable $callback, callable $default = null) /** * Apply the callback unless the collection is not empty. * - * @template TUnlessNotEmptyReturnType - * - * @param callable($this): TUnlessNotEmptyReturnType $callback - * @param (callable($this): TUnlessNotEmptyReturnType)|null $default - * @return $this|TUnlessNotEmptyReturnType + * @param callable $callback + * @param callable|null $default + * @return static|mixed */ public function unlessNotEmpty(callable $callback, callable $default = null) { @@ -594,7 +598,7 @@ public function whereStrict($key, $value) * Filter items by the given key value pair. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param mixed $values * @param bool $strict * @return static */ @@ -611,7 +615,7 @@ public function whereIn($key, $values, $strict = false) * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param mixed $values * @return static */ public function whereInStrict($key, $values) @@ -623,7 +627,7 @@ public function whereInStrict($key, $values) * Filter items such that the value of the given key is between the given values. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param array $values * @return static */ public function whereBetween($key, $values) @@ -635,7 +639,7 @@ public function whereBetween($key, $values) * Filter items such that the value of the given key is not between the given values. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param array $values * @return static */ public function whereNotBetween($key, $values) @@ -649,7 +653,7 @@ public function whereNotBetween($key, $values) * Filter items by the given key value pair. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param mixed $values * @param bool $strict * @return static */ @@ -666,7 +670,7 @@ public function whereNotIn($key, $values, $strict = false) * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param mixed $values * @return static */ public function whereNotInStrict($key, $values) @@ -677,7 +681,7 @@ public function whereNotInStrict($key, $values) /** * Filter the items, removing any items that don't match the given type(s). * - * @param class-string|array<array-key, class-string> $type + * @param string|string[] $type * @return static */ public function whereInstanceOf($type) @@ -700,10 +704,8 @@ public function whereInstanceOf($type) /** * Pass the collection to the given callback and return the result. * - * @template TPipeReturnType - * - * @param callable($this): TPipeReturnType $callback - * @return TPipeReturnType + * @param callable $callback + * @return mixed */ public function pipe(callable $callback) { @@ -713,7 +715,7 @@ public function pipe(callable $callback) /** * Pass the collection into a new class. * - * @param string-class $class + * @param string $class * @return mixed */ public function pipeInto($class) @@ -724,28 +726,38 @@ public function pipeInto($class) /** * Pass the collection through a series of callable pipes and return the result. * - * @param array<callable> $callbacks + * @param array<callable> $pipes * @return mixed */ - public function pipeThrough($callbacks) + public function pipeThrough($pipes) { - return Collection::make($callbacks)->reduce( - function ($carry, $callback) { - return $callback($carry); + return static::make($pipes)->reduce( + function ($carry, $pipe) { + return $pipe($carry); }, $this, ); } /** - * Reduce the collection to a single value. + * Pass the collection to the given callback and then return it. * - * @template TReduceInitial - * @template TReduceReturnType + * @param callable $callback + * @return $this + */ + public function tap(callable $callback) + { + $callback(clone $this); + + return $this; + } + + /** + * Reduce the collection to a single value. * - * @param callable(TReduceInitial|TReduceReturnType, TValue): TReduceReturnType $callback - * @param TReduceInitial $initial - * @return TReduceReturnType + * @param callable $callback + * @param mixed $initial + * @return mixed */ public function reduce(callable $callback, $initial = null) { @@ -758,6 +770,22 @@ public function reduce(callable $callback, $initial = null) return $result; } + /** + * Reduce the collection to multiple aggregate values. + * + * @param callable $callback + * @param mixed ...$initial + * @return array + * + * @deprecated Use "reduceSpread" instead + * + * @throws \UnexpectedValueException + */ + public function reduceMany(callable $callback, ...$initial) + { + return $this->reduceSpread($callback, ...$initial); + } + /** * Reduce the collection to multiple aggregate values. * @@ -785,10 +813,22 @@ class_basename(static::class), gettype($result) return $result; } + /** + * Reduce an associative collection to a single value. + * + * @param callable $callback + * @param mixed $initial + * @return mixed + */ + public function reduceWithKeys(callable $callback, $initial = null) + { + return $this->reduce($callback, $initial); + } + /** * Create a collection of all elements that do not pass a given truth test. * - * @param (callable(TValue, TKey): bool)|bool $callback + * @param callable|mixed $callback * @return static */ public function reject($callback = true) @@ -802,45 +842,10 @@ public function reject($callback = true) }); } - /** - * Pass the collection to the given callback and then return it. - * - * @param callable($this): mixed $callback - * @return $this - */ - public function tap(callable $callback) - { - $callback($this); - - return $this; - } - - /** - * Return only unique items from the collection array. - * - * @param (callable(TValue, TKey): mixed)|string|null $key - * @param bool $strict - * @return static - */ - public function unique($key = null, $strict = false) - { - $callback = $this->valueRetriever($key); - - $exists = []; - - return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) { - if (in_array($id = $callback($item, $key), $exists, $strict)) { - return true; - } - - $exists[] = $id; - }); - } - /** * Return only unique items from the collection array using strict comparison. * - * @param (callable(TValue, TKey): mixed)|string|null $key + * @param string|callable|null $key * @return static */ public function uniqueStrict($key = null) @@ -851,7 +856,7 @@ public function uniqueStrict($key = null) /** * Collect the values into a collection. * - * @return \Illuminate\Support\Collection<TKey, TValue> + * @return \Illuminate\Support\Collection */ public function collect() { @@ -861,7 +866,7 @@ public function collect() /** * Get the collection of items as a plain array. * - * @return array<TKey, mixed> + * @return array */ public function toArray() { @@ -873,9 +878,10 @@ public function toArray() /** * Convert the object into something JSON serializable. * - * @return array<TKey, mixed> + * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return array_map(function ($value) { if ($value instanceof JsonSerializable) { @@ -969,7 +975,7 @@ public function __get($key) * Results array of items from Collection or Arrayable. * * @param mixed $items - * @return array<TKey, TValue> + * @return array */ protected function getArrayableItems($items) { @@ -1071,7 +1077,7 @@ protected function valueRetriever($value) * Make a function to check an item's equality. * * @param mixed $value - * @return \Closure(mixed): bool + * @return \Closure */ protected function equality($value) { @@ -1096,7 +1102,7 @@ protected function negate(Closure $callback) /** * Make a function that returns what's passed to it. * - * @return \Closure(TValue): TValue + * @return \Closure */ protected function identity() { diff --git a/core/vendor/illuminate/collections/composer.json b/core/vendor/illuminate/collections/composer.json index cc9aad3429..ecc4537266 100644 --- a/core/vendor/illuminate/collections/composer.json +++ b/core/vendor/illuminate/collections/composer.json @@ -14,10 +14,9 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0" + "php": "^7.3|^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0" }, "autoload": { "psr-4": { @@ -29,11 +28,11 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^6.0)." + "symfony/var-dumper": "Required to use the dump method (^5.4)." }, "config": { "sort-packages": true diff --git a/core/vendor/illuminate/collections/helpers.php b/core/vendor/illuminate/collections/helpers.php index 45fc6d4051..67669e5ce1 100644 --- a/core/vendor/illuminate/collections/helpers.php +++ b/core/vendor/illuminate/collections/helpers.php @@ -7,11 +7,8 @@ /** * Create a collection from the given value. * - * @template TKey of array-key - * @template TValue - * - * @param \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>|null $value - * @return \Illuminate\Support\Collection<TKey, TValue> + * @param mixed $value + * @return \Illuminate\Support\Collection */ function collect($value = null) { @@ -61,7 +58,7 @@ function data_get($target, $key, $default = null) if ($segment === '*') { if ($target instanceof Collection) { $target = $target->all(); - } elseif (! is_iterable($target)) { + } elseif (! is_array($target)) { return value($default); } diff --git a/core/vendor/illuminate/conditionable/Traits/Conditionable.php b/core/vendor/illuminate/conditionable/Traits/Conditionable.php deleted file mode 100644 index e0d58b9660..0000000000 --- a/core/vendor/illuminate/conditionable/Traits/Conditionable.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -namespace Illuminate\Support\Traits; - -use Closure; -use Illuminate\Support\HigherOrderWhenProxy; - -trait Conditionable -{ - /** - * Apply the callback if the given "value" is (or resolves to) truthy. - * - * @template TWhenReturnType - * - * @param bool $value - * @param (callable($this): TWhenReturnType)|null $callback - * @param (callable($this): TWhenReturnType)|null $default - * @return $this|TWhenReturnType - */ - public function when($value, callable $callback = null, callable $default = null) - { - $value = $value instanceof Closure ? $value($this) : $value; - - if (! $callback) { - return new HigherOrderWhenProxy($this, $value); - } - - if ($value) { - return $callback($this, $value) ?? $this; - } elseif ($default) { - return $default($this, $value) ?? $this; - } - - return $this; - } - - /** - * Apply the callback if the given "value" is (or resolves to) falsy. - * - * @template TUnlessReturnType - * - * @param bool $value - * @param (callable($this): TUnlessReturnType) $callback - * @param (callable($this): TUnlessReturnType)|null $default - * @return $this|TUnlessReturnType - */ - public function unless($value, callable $callback = null, callable $default = null) - { - $value = $value instanceof Closure ? $value($this) : $value; - - if (! $callback) { - return new HigherOrderWhenProxy($this, ! $value); - } - - if (! $value) { - return $callback($this, $value) ?? $this; - } elseif ($default) { - return $default($this, $value) ?? $this; - } - - return $this; - } -} diff --git a/core/vendor/illuminate/conditionable/composer.json b/core/vendor/illuminate/conditionable/composer.json deleted file mode 100644 index a423aad17b..0000000000 --- a/core/vendor/illuminate/conditionable/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "illuminate/conditionable", - "description": "The Illuminate Conditionable package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": "^8.0.2" - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/core/vendor/illuminate/config/Repository.php b/core/vendor/illuminate/config/Repository.php index 4a28b2ff37..1719e90a90 100644 --- a/core/vendor/illuminate/config/Repository.php +++ b/core/vendor/illuminate/config/Repository.php @@ -138,7 +138,8 @@ public function all() * @param string $key * @return bool */ - public function offsetExists($key): bool + #[\ReturnTypeWillChange] + public function offsetExists($key) { return $this->has($key); } @@ -149,7 +150,8 @@ public function offsetExists($key): bool * @param string $key * @return mixed */ - public function offsetGet($key): mixed + #[\ReturnTypeWillChange] + public function offsetGet($key) { return $this->get($key); } @@ -161,7 +163,8 @@ public function offsetGet($key): mixed * @param mixed $value * @return void */ - public function offsetSet($key, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) { $this->set($key, $value); } @@ -172,7 +175,8 @@ public function offsetSet($key, $value): void * @param string $key * @return void */ - public function offsetUnset($key): void + #[\ReturnTypeWillChange] + public function offsetUnset($key) { $this->set($key, null); } diff --git a/core/vendor/illuminate/config/composer.json b/core/vendor/illuminate/config/composer.json index bc2e8e5c96..9d577bb46f 100755 --- a/core/vendor/illuminate/config/composer.json +++ b/core/vendor/illuminate/config/composer.json @@ -14,9 +14,9 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0" + "php": "^7.3|^8.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/console/Application.php b/core/vendor/illuminate/console/Application.php index 3c7f5c9bf9..88c65c7081 100755 --- a/core/vendor/illuminate/console/Application.php +++ b/core/vendor/illuminate/console/Application.php @@ -15,7 +15,6 @@ use Symfony\Component\Console\Exception\CommandNotFoundException; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\StringInput; @@ -32,13 +31,6 @@ class Application extends SymfonyApplication implements ApplicationContract */ protected $laravel; - /** - * The event dispatcher instance. - * - * @var \Illuminate\Contracts\Events\Dispatcher - */ - protected $events; - /** * The output from the previous command. * @@ -54,11 +46,11 @@ class Application extends SymfonyApplication implements ApplicationContract protected static $bootstrappers = []; /** - * A map of command names to classes. + * The Event Dispatcher. * - * @var array + * @var \Illuminate\Contracts\Events\Dispatcher */ - protected $commandMap = []; + protected $events; /** * Create a new Artisan console application. @@ -87,7 +79,7 @@ public function __construct(Container $laravel, Dispatcher $events, $version) * * @return int */ - public function run(InputInterface $input = null, OutputInterface $output = null): int + public function run(InputInterface $input = null, OutputInterface $output = null) { $commandName = $this->getCommandName( $input = $input ?: new ArgvInput @@ -263,16 +255,10 @@ protected function addToParent(SymfonyCommand $command) * Add a command, resolving through the application. * * @param string $command - * @return \Symfony\Component\Console\Command\Command|null + * @return \Symfony\Component\Console\Command\Command */ public function resolve($command) { - if (is_subclass_of($command, SymfonyCommand::class) && ($commandName = $command::getDefaultName())) { - $this->commandMap[$commandName] = $command; - - return null; - } - return $this->add($this->laravel->make($command)); } @@ -293,18 +279,6 @@ public function resolveCommands($commands) return $this; } - /** - * Set the container command loader for lazy resolution. - * - * @return $this - */ - public function setContainerCommandLoader() - { - $this->setCommandLoader(new ContainerCommandLoader($this->laravel, $this->commandMap)); - - return $this; - } - /** * Get the default input definition for the application. * @@ -312,7 +286,7 @@ public function setContainerCommandLoader() * * @return \Symfony\Component\Console\Input\InputDefinition */ - protected function getDefaultInputDefinition(): InputDefinition + protected function getDefaultInputDefinition() { return tap(parent::getDefaultInputDefinition(), function ($definition) { $definition->addOption($this->getEnvironmentOption()); diff --git a/core/vendor/illuminate/console/Command.php b/core/vendor/illuminate/console/Command.php index 6d9ae8c893..5c8c179f03 100755 --- a/core/vendor/illuminate/console/Command.php +++ b/core/vendor/illuminate/console/Command.php @@ -111,7 +111,7 @@ protected function configureUsingFluentDefinition() * @param \Symfony\Component\Console\Output\OutputInterface $output * @return int */ - public function run(InputInterface $input, OutputInterface $output): int + public function run(InputInterface $input, OutputInterface $output) { $this->output = $this->laravel->make( OutputStyle::class, ['input' => $input, 'output' => $output] @@ -166,15 +166,17 @@ protected function resolveCommand($command) * * @return bool */ - public function isHidden(): bool + public function isHidden() { return $this->hidden; } /** * {@inheritdoc} + * + * @return static */ - public function setHidden(bool $hidden = true): static + public function setHidden(bool $hidden) { parent::setHidden($this->hidden = $hidden); diff --git a/core/vendor/illuminate/console/ContainerCommandLoader.php b/core/vendor/illuminate/console/ContainerCommandLoader.php deleted file mode 100644 index f770f6c710..0000000000 --- a/core/vendor/illuminate/console/ContainerCommandLoader.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Illuminate\Console; - -use Psr\Container\ContainerInterface; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -class ContainerCommandLoader implements CommandLoaderInterface -{ - /** - * The container instance. - * - * @var \Psr\Container\ContainerInterface - */ - protected $container; - - /** - * A map of command names to classes. - * - * @var array - */ - protected $commandMap; - - /** - * Create a new command loader instance. - * - * @param \Psr\Container\ContainerInterface $container - * @param array $commandMap - * @return void - */ - public function __construct(ContainerInterface $container, array $commandMap) - { - $this->container = $container; - $this->commandMap = $commandMap; - } - - /** - * Resolve a command from the container. - * - * @param string $name - * @return \Symfony\Component\Console\Command\Command - * - * @throws \Symfony\Component\Console\Exception\CommandNotFoundException - */ - public function get(string $name): Command - { - if (! $this->has($name)) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->container->get($this->commandMap[$name]); - } - - /** - * Determines if a command exists. - * - * @param string $name - * @return bool - */ - public function has(string $name): bool - { - return $name && isset($this->commandMap[$name]); - } - - /** - * Get the command names. - * - * @return string[] - */ - public function getNames(): array - { - return array_keys($this->commandMap); - } -} diff --git a/core/vendor/illuminate/console/OutputStyle.php b/core/vendor/illuminate/console/OutputStyle.php index 78083a9aba..1e7c153145 100644 --- a/core/vendor/illuminate/console/OutputStyle.php +++ b/core/vendor/illuminate/console/OutputStyle.php @@ -34,7 +34,7 @@ public function __construct(InputInterface $input, OutputInterface $output) * * @return bool */ - public function isQuiet(): bool + public function isQuiet() { return $this->output->isQuiet(); } @@ -44,7 +44,7 @@ public function isQuiet(): bool * * @return bool */ - public function isVerbose(): bool + public function isVerbose() { return $this->output->isVerbose(); } @@ -54,7 +54,7 @@ public function isVerbose(): bool * * @return bool */ - public function isVeryVerbose(): bool + public function isVeryVerbose() { return $this->output->isVeryVerbose(); } @@ -64,7 +64,7 @@ public function isVeryVerbose(): bool * * @return bool */ - public function isDebug(): bool + public function isDebug() { return $this->output->isDebug(); } diff --git a/core/vendor/illuminate/console/Parser.php b/core/vendor/illuminate/console/Parser.php index 552400d764..00dca1cd6a 100644 --- a/core/vendor/illuminate/console/Parser.php +++ b/core/vendor/illuminate/console/Parser.php @@ -2,6 +2,7 @@ namespace Illuminate\Console; +use Illuminate\Support\Str; use InvalidArgumentException; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; @@ -20,8 +21,10 @@ public static function parse($expression) { $name = static::name($expression); - if (preg_match_all('/\{\s*(.*?)\s*\}/', $expression, $matches) && count($matches[1])) { - return array_merge([$name], static::parameters($matches[1])); + if (preg_match_all('/\{\s*(.*?)\s*\}/', $expression, $matches)) { + if (count($matches[1])) { + return array_merge([$name], static::parameters($matches[1])); + } } return [$name, [], []]; @@ -78,11 +81,11 @@ protected static function parseArgument($token) [$token, $description] = static::extractDescription($token); switch (true) { - case str_ends_with($token, '?*'): + case Str::endsWith($token, '?*'): return new InputArgument(trim($token, '?*'), InputArgument::IS_ARRAY, $description); - case str_ends_with($token, '*'): + case Str::endsWith($token, '*'): return new InputArgument(trim($token, '*'), InputArgument::IS_ARRAY | InputArgument::REQUIRED, $description); - case str_ends_with($token, '?'): + case Str::endsWith($token, '?'): return new InputArgument(trim($token, '?'), InputArgument::OPTIONAL, $description); case preg_match('/(.+)\=\*(.+)/', $token, $matches): return new InputArgument($matches[1], InputArgument::IS_ARRAY, $description, preg_split('/,\s?/', $matches[2])); @@ -113,9 +116,9 @@ protected static function parseOption($token) } switch (true) { - case str_ends_with($token, '='): + case Str::endsWith($token, '='): return new InputOption(trim($token, '='), $shortcut, InputOption::VALUE_OPTIONAL, $description); - case str_ends_with($token, '=*'): + case Str::endsWith($token, '=*'): return new InputOption(trim($token, '=*'), $shortcut, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, $description); case preg_match('/(.+)\=\*(.+)/', $token, $matches): return new InputOption($matches[1], $shortcut, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, $description, preg_split('/,\s?/', $matches[2])); diff --git a/core/vendor/illuminate/console/Scheduling/CallbackEvent.php b/core/vendor/illuminate/console/Scheduling/CallbackEvent.php index e91600ac3a..dde5d7dea5 100644 --- a/core/vendor/illuminate/console/Scheduling/CallbackEvent.php +++ b/core/vendor/illuminate/console/Scheduling/CallbackEvent.php @@ -6,7 +6,6 @@ use Illuminate\Support\Reflector; use InvalidArgumentException; use LogicException; -use RuntimeException; use Throwable; class CallbackEvent extends Event @@ -25,25 +24,11 @@ class CallbackEvent extends Event */ protected $parameters; - /** - * The result of the callback's execution. - * - * @var mixed - */ - protected $result; - - /** - * The exception that was thrown when calling the callback, if any. - * - * @var \Throwable|null - */ - protected $exception; - /** * Create a new event instance. * * @param \Illuminate\Console\Scheduling\EventMutex $mutex - * @param string|callable $callback + * @param string $callback * @param array $parameters * @param \DateTimeZone|string|null $timezone * @return void @@ -65,64 +50,58 @@ public function __construct(EventMutex $mutex, $callback, array $parameters = [] } /** - * Run the callback event. + * Run the given event. * * @param \Illuminate\Contracts\Container\Container $container * @return mixed * - * @throws \Throwable + * @throws \Exception */ public function run(Container $container) { - parent::run($container); - - if ($this->exception) { - throw $this->exception; + if ($this->description && $this->withoutOverlapping && + ! $this->mutex->create($this)) { + return; } - return $this->result; - } + $pid = getmypid(); - /** - * Determine if the event should skip because another process is overlapping. - * - * @return bool - */ - public function shouldSkipDueToOverlapping() - { - return $this->description && parent::shouldSkipDueToOverlapping(); - } + register_shutdown_function(function () use ($pid) { + if ($pid === getmypid()) { + $this->removeMutex(); + } + }); - /** - * Indicate that the callback should run in the background. - * - * @return void - * - * @throws \RuntimeException - */ - public function runInBackground() - { - throw new RuntimeException('Scheduled closures can not be run in the background.'); + parent::callBeforeCallbacks($container); + + try { + $response = is_object($this->callback) + ? $container->call([$this->callback, '__invoke'], $this->parameters) + : $container->call($this->callback, $this->parameters); + + $this->exitCode = $response === false ? 1 : 0; + } catch (Throwable $e) { + $this->exitCode = 1; + + throw $e; + } finally { + $this->removeMutex(); + + parent::callAfterCallbacks($container); + } + + return $response; } /** - * Run the callback. + * Clear the mutex for the event. * - * @param \Illuminate\Contracts\Container\Container $container - * @return int + * @return void */ - protected function execute($container) + protected function removeMutex() { - try { - $this->result = is_object($this->callback) - ? $container->call([$this->callback, '__invoke'], $this->parameters) - : $container->call($this->callback, $this->parameters); - - return $this->result === false ? 1 : 0; - } catch (Throwable $e) { - $this->exception = $e; - - return 1; + if ($this->description && $this->withoutOverlapping) { + $this->mutex->forget($this); } } @@ -142,7 +121,13 @@ public function withoutOverlapping($expiresAt = 1440) ); } - return parent::withoutOverlapping($expiresAt); + $this->withoutOverlapping = true; + + $this->expiresAt = $expiresAt; + + return $this->skip(function () { + return $this->mutex->exists($this); + }); } /** @@ -160,21 +145,9 @@ public function onOneServer() ); } - return parent::onOneServer(); - } + $this->onOneServer = true; - /** - * Get the summary of the event for display. - * - * @return string - */ - public function getSummaryForDisplay() - { - if (is_string($this->description)) { - return $this->description; - } - - return is_string($this->callback) ? $this->callback : 'Callback'; + return $this; } /** @@ -188,14 +161,16 @@ public function mutexName() } /** - * Clear the mutex for the event. + * Get the summary of the event for display. * - * @return void + * @return string */ - protected function removeMutex() + public function getSummaryForDisplay() { - if ($this->description) { - parent::removeMutex(); + if (is_string($this->description)) { + return $this->description; } + + return is_string($this->callback) ? $this->callback : 'Callback'; } } diff --git a/core/vendor/illuminate/console/Scheduling/Event.php b/core/vendor/illuminate/console/Scheduling/Event.php index 2df0417ae0..4de88f163d 100644 --- a/core/vendor/illuminate/console/Scheduling/Event.php +++ b/core/vendor/illuminate/console/Scheduling/Event.php @@ -188,81 +188,66 @@ public function getDefaultOutput() * * @param \Illuminate\Contracts\Container\Container $container * @return void - * - * @throws \Throwable */ public function run(Container $container) { - if ($this->shouldSkipDueToOverlapping()) { + if ($this->withoutOverlapping && + ! $this->mutex->create($this)) { return; } - $exitCode = $this->start($container); - - if (! $this->runInBackground) { - $this->finish($container, $exitCode); - } + $this->runInBackground + ? $this->runCommandInBackground($container) + : $this->runCommandInForeground($container); } /** - * Determine if the event should skip because another process is overlapping. + * Get the mutex name for the scheduled command. * - * @return bool + * @return string */ - public function shouldSkipDueToOverlapping() + public function mutexName() { - return $this->withoutOverlapping && ! $this->mutex->create($this); + return 'framework'.DIRECTORY_SEPARATOR.'schedule-'.sha1($this->expression.$this->command); } /** - * Run the command process. + * Run the command in the foreground. * * @param \Illuminate\Contracts\Container\Container $container - * @return int - * - * @throws \Throwable + * @return void */ - protected function start($container) + protected function runCommandInForeground(Container $container) { try { $this->callBeforeCallbacks($container); - return $this->execute($container); - } catch (Throwable $exception) { - $this->removeMutex(); + $this->exitCode = Process::fromShellCommandline( + $this->buildCommand(), base_path(), null, null, null + )->run(); - throw $exception; + $this->callAfterCallbacks($container); + } finally { + $this->removeMutex(); } } /** - * Run the command process. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return int - */ - protected function execute($container) - { - return Process::fromShellCommandline( - $this->buildCommand(), base_path(), null, null, null - )->run(); - } - - /** - * Mark the command process as finished and run callbacks/cleanup. + * Run the command in the background. * * @param \Illuminate\Contracts\Container\Container $container - * @param int $exitCode * @return void */ - public function finish(Container $container, $exitCode) + protected function runCommandInBackground(Container $container) { - $this->exitCode = (int) $exitCode; - try { - $this->callAfterCallbacks($container); - } finally { + $this->callBeforeCallbacks($container); + + Process::fromShellCommandline($this->buildCommand(), base_path(), null, null, null)->run(); + } catch (Throwable $exception) { $this->removeMutex(); + + throw $exception; } } @@ -292,6 +277,24 @@ public function callAfterCallbacks(Container $container) } } + /** + * Call all of the "after" callbacks for the event. + * + * @param \Illuminate\Contracts\Container\Container $container + * @param int $exitCode + * @return void + */ + public function callAfterCallbacksWithExitCode(Container $container, $exitCode) + { + $this->exitCode = (int) $exitCode; + + try { + $this->callAfterCallbacks($container); + } finally { + $this->removeMutex(); + } + } + /** * Build the command string. * @@ -928,16 +931,6 @@ public function preventOverlapsUsing(EventMutex $mutex) return $this; } - /** - * Get the mutex name for the scheduled command. - * - * @return string - */ - public function mutexName() - { - return 'framework'.DIRECTORY_SEPARATOR.'schedule-'.sha1($this->expression.$this->command); - } - /** * Delete the mutex for the event. * diff --git a/core/vendor/illuminate/console/Scheduling/ManagesFrequencies.php b/core/vendor/illuminate/console/Scheduling/ManagesFrequencies.php index 307631200f..9226cec270 100644 --- a/core/vendor/illuminate/console/Scheduling/ManagesFrequencies.php +++ b/core/vendor/illuminate/console/Scheduling/ManagesFrequencies.php @@ -60,9 +60,9 @@ private function inTimeInterval($startTime, $endTime) if ($endTime->lessThan($startTime)) { if ($startTime->greaterThan($now)) { - $startTime = $startTime->subDay(1); + $startTime->subDay(1); } else { - $endTime = $endTime->addDay(1); + $endTime->addDay(1); } } diff --git a/core/vendor/illuminate/console/Scheduling/Schedule.php b/core/vendor/illuminate/console/Scheduling/Schedule.php index 9be43c93bd..ee5412b7b4 100644 --- a/core/vendor/illuminate/console/Scheduling/Schedule.php +++ b/core/vendor/illuminate/console/Scheduling/Schedule.php @@ -14,6 +14,7 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\CallQueuedClosure; use Illuminate\Support\ProcessUtils; +use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; use RuntimeException; @@ -271,11 +272,11 @@ public function compileArrayInput($key, $value) return ProcessUtils::escapeArgument($value); }); - if (str_starts_with($key, '--')) { + if (Str::startsWith($key, '--')) { $value = $value->map(function ($value) use ($key) { return "{$key}={$value}"; }); - } elseif (str_starts_with($key, '-')) { + } elseif (Str::startsWith($key, '-')) { $value = $value->map(function ($value) use ($key) { return "{$key} {$value}"; }); diff --git a/core/vendor/illuminate/console/Scheduling/ScheduleFinishCommand.php b/core/vendor/illuminate/console/Scheduling/ScheduleFinishCommand.php index 03a5020dd6..4857d695ca 100644 --- a/core/vendor/illuminate/console/Scheduling/ScheduleFinishCommand.php +++ b/core/vendor/illuminate/console/Scheduling/ScheduleFinishCommand.php @@ -15,15 +15,6 @@ class ScheduleFinishCommand extends Command */ protected $signature = 'schedule:finish {id} {code=0}'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'schedule:finish'; - /** * The console command description. * @@ -49,7 +40,7 @@ public function handle(Schedule $schedule) collect($schedule->events())->filter(function ($value) { return $value->mutexName() == $this->argument('id'); })->each(function ($event) { - $event->finish($this->laravel, $this->argument('code')); + $event->callafterCallbacksWithExitCode($this->laravel, $this->argument('code')); $this->laravel->make(Dispatcher::class)->dispatch(new ScheduledBackgroundTaskFinished($event)); }); diff --git a/core/vendor/illuminate/console/Scheduling/ScheduleRunCommand.php b/core/vendor/illuminate/console/Scheduling/ScheduleRunCommand.php index 08e7f20de6..4193408fc0 100644 --- a/core/vendor/illuminate/console/Scheduling/ScheduleRunCommand.php +++ b/core/vendor/illuminate/console/Scheduling/ScheduleRunCommand.php @@ -21,15 +21,6 @@ class ScheduleRunCommand extends Command */ protected $name = 'schedule:run'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'schedule:run'; - /** * The console command description. * diff --git a/core/vendor/illuminate/console/Scheduling/ScheduleTestCommand.php b/core/vendor/illuminate/console/Scheduling/ScheduleTestCommand.php index f9bee078d5..281886439f 100644 --- a/core/vendor/illuminate/console/Scheduling/ScheduleTestCommand.php +++ b/core/vendor/illuminate/console/Scheduling/ScheduleTestCommand.php @@ -13,15 +13,6 @@ class ScheduleTestCommand extends Command */ protected $name = 'schedule:test'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'schedule:test'; - /** * The console command description. * diff --git a/core/vendor/illuminate/console/Scheduling/ScheduleWorkCommand.php b/core/vendor/illuminate/console/Scheduling/ScheduleWorkCommand.php index ea4a61ae90..f30a2f0c90 100644 --- a/core/vendor/illuminate/console/Scheduling/ScheduleWorkCommand.php +++ b/core/vendor/illuminate/console/Scheduling/ScheduleWorkCommand.php @@ -15,15 +15,6 @@ class ScheduleWorkCommand extends Command */ protected $name = 'schedule:work'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'schedule:work'; - /** * The console command description. * diff --git a/core/vendor/illuminate/console/composer.json b/core/vendor/illuminate/console/composer.json index 5a768863bc..ba5366e3b7 100755 --- a/core/vendor/illuminate/console/composer.json +++ b/core/vendor/illuminate/console/composer.json @@ -14,13 +14,13 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "symfony/console": "^6.0", - "symfony/process": "^6.0" + "php": "^7.3|^8.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "symfony/console": "^5.4", + "symfony/process": "^5.4" }, "autoload": { "psr-4": { @@ -29,16 +29,16 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { - "dragonmantank/cron-expression": "Required to use scheduler (^3.1).", - "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^7.2).", - "illuminate/bus": "Required to use the scheduled job dispatcher (^9.0).", - "illuminate/container": "Required to use the scheduler (^9.0).", - "illuminate/filesystem": "Required to use the generator command (^9.0).", - "illuminate/queue": "Required to use closures for scheduled jobs (^9.0)." + "dragonmantank/cron-expression": "Required to use scheduler (^3.0.2).", + "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^6.5.5|^7.0.1).", + "illuminate/bus": "Required to use the scheduled job dispatcher (^8.0).", + "illuminate/container": "Required to use the scheduler (^8.0).", + "illuminate/filesystem": "Required to use the generator command (^8.0).", + "illuminate/queue": "Required to use closures for scheduled jobs (^8.0)." }, "config": { "sort-packages": true diff --git a/core/vendor/illuminate/container/BoundMethod.php b/core/vendor/illuminate/container/BoundMethod.php index 0bac7faef1..5c96c973e0 100644 --- a/core/vendor/illuminate/container/BoundMethod.php +++ b/core/vendor/illuminate/container/BoundMethod.php @@ -137,7 +137,7 @@ protected static function getMethodDependencies($container, $callback, array $pa */ protected static function getCallReflector($callback) { - if (is_string($callback) && str_contains($callback, '::')) { + if (is_string($callback) && strpos($callback, '::') !== false) { $callback = explode('::', $callback); } elseif (is_object($callback) && ! $callback instanceof Closure) { $callback = [$callback, '__invoke']; @@ -171,14 +171,16 @@ protected static function addDependencyForCallParameter($container, $parameter, $dependencies[] = $parameters[$className]; unset($parameters[$className]); - } elseif ($parameter->isVariadic()) { - $variadicDependencies = $container->make($className); - - $dependencies = array_merge($dependencies, is_array($variadicDependencies) - ? $variadicDependencies - : [$variadicDependencies]); } else { - $dependencies[] = $container->make($className); + if ($parameter->isVariadic()) { + $variadicDependencies = $container->make($className); + + $dependencies = array_merge($dependencies, is_array($variadicDependencies) + ? $variadicDependencies + : [$variadicDependencies]); + } else { + $dependencies[] = $container->make($className); + } } } elseif ($parameter->isDefaultValueAvailable()) { $dependencies[] = $parameter->getDefaultValue(); @@ -197,6 +199,6 @@ protected static function addDependencyForCallParameter($container, $parameter, */ protected static function isCallableWithAtSign($callback) { - return is_string($callback) && str_contains($callback, '@'); + return is_string($callback) && strpos($callback, '@') !== false; } } diff --git a/core/vendor/illuminate/container/Container.php b/core/vendor/illuminate/container/Container.php index 37ae6e0be0..e6cd346fed 100755 --- a/core/vendor/illuminate/container/Container.php +++ b/core/vendor/illuminate/container/Container.php @@ -191,7 +191,7 @@ public function bound($abstract) * * @return bool */ - public function has(string $id): bool + public function has($id) { return $this->bound($id); } @@ -609,7 +609,7 @@ protected function rebound($abstract) $instance = $this->make($abstract); foreach ($this->getReboundCallbacks($abstract) as $callback) { - $callback($this, $instance); + call_user_func($callback, $this, $instance); } } @@ -699,7 +699,7 @@ public function make($abstract, array $parameters = []) * * @return mixed */ - public function get(string $id) + public function get($id) { try { return $this->resolve($id); @@ -1001,7 +1001,7 @@ protected function getLastParameterOverride() protected function resolvePrimitive(ReflectionParameter $parameter) { if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->getName()))) { - return Util::unwrapIfClosure($concrete, $this); + return $concrete instanceof Closure ? $concrete($this) : $concrete; } if ($parameter->isDefaultValueAvailable()) { @@ -1401,7 +1401,8 @@ public static function setInstance(ContainerContract $container = null) * @param string $key * @return bool */ - public function offsetExists($key): bool + #[\ReturnTypeWillChange] + public function offsetExists($key) { return $this->bound($key); } @@ -1412,7 +1413,8 @@ public function offsetExists($key): bool * @param string $key * @return mixed */ - public function offsetGet($key): mixed + #[\ReturnTypeWillChange] + public function offsetGet($key) { return $this->make($key); } @@ -1424,7 +1426,8 @@ public function offsetGet($key): mixed * @param mixed $value * @return void */ - public function offsetSet($key, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) { $this->bind($key, $value instanceof Closure ? $value : function () use ($value) { return $value; @@ -1437,7 +1440,8 @@ public function offsetSet($key, $value): void * @param string $key * @return void */ - public function offsetUnset($key): void + #[\ReturnTypeWillChange] + public function offsetUnset($key) { unset($this->bindings[$key], $this->instances[$key], $this->resolved[$key]); } diff --git a/core/vendor/illuminate/container/RewindableGenerator.php b/core/vendor/illuminate/container/RewindableGenerator.php index 14c0bd0178..4ee7bb20c6 100644 --- a/core/vendor/illuminate/container/RewindableGenerator.php +++ b/core/vendor/illuminate/container/RewindableGenerator.php @@ -4,7 +4,6 @@ use Countable; use IteratorAggregate; -use Traversable; class RewindableGenerator implements Countable, IteratorAggregate { @@ -38,9 +37,10 @@ public function __construct(callable $generator, $count) /** * Get an iterator from the generator. * - * @return \Traversable + * @return mixed */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { return ($this->generator)(); } @@ -50,7 +50,8 @@ public function getIterator(): Traversable * * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { if (is_callable($count = $this->count)) { $this->count = $count(); diff --git a/core/vendor/illuminate/container/Util.php b/core/vendor/illuminate/container/Util.php index 8d5023b4a5..8f7e9171d6 100644 --- a/core/vendor/illuminate/container/Util.php +++ b/core/vendor/illuminate/container/Util.php @@ -33,12 +33,11 @@ public static function arrayWrap($value) * From global value() helper in Illuminate\Support. * * @param mixed $value - * @param mixed ...$args * @return mixed */ - public static function unwrapIfClosure($value, ...$args) + public static function unwrapIfClosure($value) { - return $value instanceof Closure ? $value(...$args) : $value; + return $value instanceof Closure ? $value() : $value; } /** diff --git a/core/vendor/illuminate/container/composer.json b/core/vendor/illuminate/container/composer.json index 8944b5bc5d..cf93160996 100755 --- a/core/vendor/illuminate/container/composer.json +++ b/core/vendor/illuminate/container/composer.json @@ -14,12 +14,12 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/contracts": "^9.0", - "psr/container": "^1.1.1|^2.0.1" + "php": "^7.3|^8.0", + "illuminate/contracts": "^8.0", + "psr/container": "^1.0" }, "provide": { - "psr/container-implementation": "1.1|2.0" + "psr/container-implementation": "1.0" }, "autoload": { "psr-4": { @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/contracts/Auth/Guard.php b/core/vendor/illuminate/contracts/Auth/Guard.php index 2796f1ae6a..2a27fb5f50 100644 --- a/core/vendor/illuminate/contracts/Auth/Guard.php +++ b/core/vendor/illuminate/contracts/Auth/Guard.php @@ -40,13 +40,6 @@ public function id(); */ public function validate(array $credentials = []); - /** - * Determine if the guard has a user instance. - * - * @return bool - */ - public function hasUser(); - /** * Set the current user. * diff --git a/core/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php b/core/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php index 683a90308b..47b1c08968 100644 --- a/core/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php +++ b/core/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php @@ -8,7 +8,7 @@ interface PasswordBrokerFactory * Get a password broker instance by name. * * @param string|null $name - * @return \Illuminate\Contracts\Auth\PasswordBroker + * @return mixed */ public function broker($name = null); } diff --git a/core/vendor/illuminate/contracts/Broadcasting/Broadcaster.php b/core/vendor/illuminate/contracts/Broadcasting/Broadcaster.php index 2d317d0a69..1034e44068 100644 --- a/core/vendor/illuminate/contracts/Broadcasting/Broadcaster.php +++ b/core/vendor/illuminate/contracts/Broadcasting/Broadcaster.php @@ -28,8 +28,6 @@ public function validAuthenticationResponse($request, $result); * @param string $event * @param array $payload * @return void - * - * @throws \Illuminate\Broadcasting\BroadcastException */ public function broadcast(array $channels, $event, array $payload = []); } diff --git a/core/vendor/illuminate/contracts/Container/Container.php b/core/vendor/illuminate/contracts/Container/Container.php index 7d7f2c96a0..1b8bb64079 100644 --- a/core/vendor/illuminate/contracts/Container/Container.php +++ b/core/vendor/illuminate/contracts/Container/Container.php @@ -81,24 +81,6 @@ public function singleton($abstract, $concrete = null); */ public function singletonIf($abstract, $concrete = null); - /** - * Register a scoped binding in the container. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @return void - */ - public function scoped($abstract, $concrete = null); - - /** - * Register a scoped binding if it hasn't already been registered. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @return void - */ - public function scopedIf($abstract, $concrete = null); - /** * "Extend" an abstract type in the container. * @@ -181,15 +163,6 @@ public function call($callback, array $parameters = [], $defaultMethod = null); */ public function resolved($abstract); - /** - * Register a new before resolving callback. - * - * @param \Closure|string $abstract - * @param \Closure|null $callback - * @return void - */ - public function beforeResolving($abstract, Closure $callback = null); - /** * Register a new resolving callback. * diff --git a/core/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php b/core/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php index 1fc7fc1593..149e7b28c9 100644 --- a/core/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php +++ b/core/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php @@ -27,13 +27,4 @@ public function give($implementation); * @return void */ public function giveTagged($tag); - - /** - * Specify the configuration item to bind as a primitive. - * - * @param string $key - * @param ?string $default - * @return void - */ - public function giveConfig($key, $default = null); } diff --git a/core/vendor/illuminate/contracts/Database/Eloquent/Builder.php b/core/vendor/illuminate/contracts/Database/Eloquent/Builder.php deleted file mode 100644 index 6fdf405c99..0000000000 --- a/core/vendor/illuminate/contracts/Database/Eloquent/Builder.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Database\Eloquent; - -use Illuminate\Contracts\Database\Query\Builder as BaseContract; - -/** - * This interface is intentionally empty and exists to improve IDE support. - * - * @mixin \Illuminate\Database\Eloquent\Builder - */ -interface Builder extends BaseContract -{ -} diff --git a/core/vendor/illuminate/contracts/Database/Query/Builder.php b/core/vendor/illuminate/contracts/Database/Query/Builder.php deleted file mode 100644 index e116ebf419..0000000000 --- a/core/vendor/illuminate/contracts/Database/Query/Builder.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Database\Query; - -/** - * This interface is intentionally empty and exists to improve IDE support. - * - * @mixin \Illuminate\Database\Query\Builder - */ -interface Builder -{ -} diff --git a/core/vendor/illuminate/contracts/Debug/ExceptionHandler.php b/core/vendor/illuminate/contracts/Debug/ExceptionHandler.php index 3b6594a2ba..54381a179a 100644 --- a/core/vendor/illuminate/contracts/Debug/ExceptionHandler.php +++ b/core/vendor/illuminate/contracts/Debug/ExceptionHandler.php @@ -41,8 +41,6 @@ public function render($request, Throwable $e); * @param \Symfony\Component\Console\Output\OutputInterface $output * @param \Throwable $e * @return void - * - * @internal This method is not meant to be used or overwritten outside the framework. */ public function renderForConsole($output, Throwable $e); } diff --git a/core/vendor/illuminate/contracts/Encryption/Encrypter.php b/core/vendor/illuminate/contracts/Encryption/Encrypter.php index 5ac1102ebc..4747b68ad0 100644 --- a/core/vendor/illuminate/contracts/Encryption/Encrypter.php +++ b/core/vendor/illuminate/contracts/Encryption/Encrypter.php @@ -25,11 +25,4 @@ public function encrypt($value, $serialize = true); * @throws \Illuminate\Contracts\Encryption\DecryptException */ public function decrypt($payload, $unserialize = true); - - /** - * Get the encryption key that the encrypter is currently using. - * - * @return string - */ - public function getKey(); } diff --git a/core/vendor/illuminate/contracts/Filesystem/FileExistsException.php b/core/vendor/illuminate/contracts/Filesystem/FileExistsException.php new file mode 100644 index 0000000000..9027892faa --- /dev/null +++ b/core/vendor/illuminate/contracts/Filesystem/FileExistsException.php @@ -0,0 +1,10 @@ +<?php + +namespace Illuminate\Contracts\Filesystem; + +use Exception; + +class FileExistsException extends Exception +{ + // +} diff --git a/core/vendor/illuminate/contracts/Filesystem/Filesystem.php b/core/vendor/illuminate/contracts/Filesystem/Filesystem.php index 6d2fd57873..e8b0dd4e61 100644 --- a/core/vendor/illuminate/contracts/Filesystem/Filesystem.php +++ b/core/vendor/illuminate/contracts/Filesystem/Filesystem.php @@ -30,7 +30,9 @@ public function exists($path); * Get the contents of a file. * * @param string $path - * @return string|null + * @return string + * + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function get($path); @@ -39,6 +41,8 @@ public function get($path); * * @param string $path * @return resource|null The path resource or null on failure. + * + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function readStream($path); @@ -59,6 +63,9 @@ public function put($path, $contents, $options = []); * @param resource $resource * @param array $options * @return bool + * + * @throws \InvalidArgumentException If $resource is not a file handle. + * @throws \Illuminate\Contracts\Filesystem\FileExistsException */ public function writeStream($path, $resource, array $options = []); diff --git a/core/vendor/illuminate/contracts/Foundation/Application.php b/core/vendor/illuminate/contracts/Foundation/Application.php index b46c6de4d8..74af47c751 100644 --- a/core/vendor/illuminate/contracts/Foundation/Application.php +++ b/core/vendor/illuminate/contracts/Foundation/Application.php @@ -56,10 +56,9 @@ public function resourcePath($path = ''); /** * Get the path to the storage directory. * - * @param string $path * @return string */ - public function storagePath($path = ''); + public function storagePath(); /** * Get or check the current application environment. @@ -83,13 +82,6 @@ public function runningInConsole(); */ public function runningUnitTests(); - /** - * Get an instance of the maintenance mode manager implementation. - * - * @return \Illuminate\Contracts\Foundation\MaintenanceMode - */ - public function maintenanceMode(); - /** * Determine if the application is currently down for maintenance. * @@ -214,14 +206,6 @@ public function setLocale($locale); */ public function shouldSkipMiddleware(); - /** - * Register a terminating callback with the application. - * - * @param callable|string $callback - * @return \Illuminate\Contracts\Foundation\Application - */ - public function terminating($callback); - /** * Terminate the application. * diff --git a/core/vendor/illuminate/contracts/Foundation/ExceptionRenderer.php b/core/vendor/illuminate/contracts/Foundation/ExceptionRenderer.php deleted file mode 100644 index 24f4e4be09..0000000000 --- a/core/vendor/illuminate/contracts/Foundation/ExceptionRenderer.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Foundation; - -interface ExceptionRenderer -{ - /** - * Renders the given exception as HTML. - * - * @param \Throwable $throwable - * @return string - */ - public function render($throwable); -} diff --git a/core/vendor/illuminate/contracts/Foundation/MaintenanceMode.php b/core/vendor/illuminate/contracts/Foundation/MaintenanceMode.php deleted file mode 100644 index 4c948f702d..0000000000 --- a/core/vendor/illuminate/contracts/Foundation/MaintenanceMode.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Foundation; - -interface MaintenanceMode -{ - /** - * Take the application down for maintenance. - * - * @param array $payload - * @return void - */ - public function activate(array $payload): void; - - /** - * Take the application out of maintenance. - * - * @return void - */ - public function deactivate(): void; - - /** - * Determine if the application is currently down for maintenance. - * - * @return bool - */ - public function active(): bool; - - /** - * Get the data array which was provided when the application was placed into maintenance. - * - * @return array - */ - public function data(): array; -} diff --git a/core/vendor/illuminate/contracts/Mail/Mailer.php b/core/vendor/illuminate/contracts/Mail/Mailer.php index 38f9e3b56c..255b6789da 100644 --- a/core/vendor/illuminate/contracts/Mail/Mailer.php +++ b/core/vendor/illuminate/contracts/Mail/Mailer.php @@ -38,4 +38,11 @@ public function raw($text, $callback); * @return void */ public function send($view, array $data = [], $callback = null); + + /** + * Get the array of failed recipients. + * + * @return array + */ + public function failures(); } diff --git a/core/vendor/illuminate/contracts/Queue/QueueableCollection.php b/core/vendor/illuminate/contracts/Queue/QueueableCollection.php index 750d10d4b0..7f1ea19c54 100644 --- a/core/vendor/illuminate/contracts/Queue/QueueableCollection.php +++ b/core/vendor/illuminate/contracts/Queue/QueueableCollection.php @@ -14,14 +14,14 @@ public function getQueueableClass(); /** * Get the identifiers for all of the entities. * - * @return array<int, mixed> + * @return array */ public function getQueueableIds(); /** * Get the relationships of the entities being queued. * - * @return array<int, string> + * @return array */ public function getQueueableRelations(); diff --git a/core/vendor/illuminate/contracts/Routing/UrlGenerator.php b/core/vendor/illuminate/contracts/Routing/UrlGenerator.php index cca221cc72..e576dda19e 100644 --- a/core/vendor/illuminate/contracts/Routing/UrlGenerator.php +++ b/core/vendor/illuminate/contracts/Routing/UrlGenerator.php @@ -69,13 +69,6 @@ public function route($name, $parameters = [], $absolute = true); */ public function action($action, $parameters = [], $absolute = true); - /** - * Get the root controller namespace. - * - * @return string - */ - public function getRootControllerNamespace(); - /** * Set the root controller namespace. * diff --git a/core/vendor/illuminate/contracts/Support/Arrayable.php b/core/vendor/illuminate/contracts/Support/Arrayable.php index 3194bd1163..5ad93b70bd 100755 --- a/core/vendor/illuminate/contracts/Support/Arrayable.php +++ b/core/vendor/illuminate/contracts/Support/Arrayable.php @@ -2,16 +2,12 @@ namespace Illuminate\Contracts\Support; -/** - * @template TKey of array-key - * @template TValue - */ interface Arrayable { /** * Get the instance as an array. * - * @return array<TKey, TValue> + * @return array */ public function toArray(); } diff --git a/core/vendor/illuminate/contracts/composer.json b/core/vendor/illuminate/contracts/composer.json index 9296ba9e5a..c9b46671f3 100644 --- a/core/vendor/illuminate/contracts/composer.json +++ b/core/vendor/illuminate/contracts/composer.json @@ -14,9 +14,9 @@ } ], "require": { - "php": "^8.0.2", - "psr/container": "^1.1.1|^2.0.1", - "psr/simple-cache": "^1.0|^2.0|^3.0" + "php": "^7.3|^8.0", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/database/Concerns/BuildsQueries.php b/core/vendor/illuminate/database/Concerns/BuildsQueries.php index 9f56e80fd4..0ce31d6d1f 100644 --- a/core/vendor/illuminate/database/Concerns/BuildsQueries.php +++ b/core/vendor/illuminate/database/Concerns/BuildsQueries.php @@ -457,12 +457,10 @@ protected function cursorPaginator($items, $perPage, $cursor, $options) * Pass the query to a given callback. * * @param callable $callback - * @return $this + * @return $this|mixed */ public function tap($callback) { - $callback($this); - - return $this; + return $this->when(true, $callback); } } diff --git a/core/vendor/illuminate/database/Concerns/ManagesTransactions.php b/core/vendor/illuminate/database/Concerns/ManagesTransactions.php index 3b1875fb0f..fac70295de 100644 --- a/core/vendor/illuminate/database/Concerns/ManagesTransactions.php +++ b/core/vendor/illuminate/database/Concerns/ManagesTransactions.php @@ -48,7 +48,7 @@ public function transaction(Closure $callback, $attempts = 1) $this->transactions = max(0, $this->transactions - 1); if ($this->transactions == 0) { - $this->transactionsManager?->commit($this->getName()); + optional($this->transactionsManager)->commit($this->getName()); } } catch (Throwable $e) { $this->handleCommitTransactionException( @@ -83,7 +83,7 @@ protected function handleTransactionException(Throwable $e, $currentAttempt, $ma $this->transactions > 1) { $this->transactions--; - $this->transactionsManager?->rollback( + optional($this->transactionsManager)->rollback( $this->getName(), $this->transactions ); @@ -116,7 +116,7 @@ public function beginTransaction() $this->transactions++; - $this->transactionsManager?->begin( + optional($this->transactionsManager)->begin( $this->getName(), $this->transactions ); @@ -194,7 +194,7 @@ public function commit() $this->transactions = max(0, $this->transactions - 1); if ($this->transactions == 0) { - $this->transactionsManager?->commit($this->getName()); + optional($this->transactionsManager)->commit($this->getName()); } $this->fireConnectionEvent('committed'); @@ -258,7 +258,7 @@ public function rollBack($toLevel = null) $this->transactions = $toLevel; - $this->transactionsManager?->rollback( + optional($this->transactionsManager)->rollback( $this->getName(), $this->transactions ); @@ -297,7 +297,7 @@ protected function handleRollBackException(Throwable $e) if ($this->causedByLostConnection($e)) { $this->transactions = 0; - $this->transactionsManager?->rollback( + optional($this->transactionsManager)->rollback( $this->getName(), $this->transactions ); } diff --git a/core/vendor/illuminate/database/Connection.php b/core/vendor/illuminate/database/Connection.php index ee96baf3bd..df1a020265 100755 --- a/core/vendor/illuminate/database/Connection.php +++ b/core/vendor/illuminate/database/Connection.php @@ -865,12 +865,14 @@ protected function fireConnectionEvent($event) return; } - return $this->events->dispatch(match ($event) { - 'beganTransaction' => new TransactionBeginning($this), - 'committed' => new TransactionCommitted($this), - 'rollingBack' => new TransactionRolledBack($this), - default => null, - }); + switch ($event) { + case 'beganTransaction': + return $this->events->dispatch(new TransactionBeginning($this)); + case 'committed': + return $this->events->dispatch(new TransactionCommitted($this)); + case 'rollingBack': + return $this->events->dispatch(new TransactionRolledBack($this)); + } } /** @@ -1009,7 +1011,7 @@ public function getDoctrineConnection() $this->doctrineConnection = new DoctrineConnection(array_filter([ 'pdo' => $this->getPdo(), 'dbname' => $this->getDatabaseName(), - 'driver' => $driver->getName(), + 'driver' => method_exists($driver, 'getName') ? $driver->getName() : null, 'serverVersion' => $this->getConfig('server_version'), ]), $driver); diff --git a/core/vendor/illuminate/database/Connectors/ConnectionFactory.php b/core/vendor/illuminate/database/Connectors/ConnectionFactory.php index e057470dfd..ad46505503 100755 --- a/core/vendor/illuminate/database/Connectors/ConnectionFactory.php +++ b/core/vendor/illuminate/database/Connectors/ConnectionFactory.php @@ -241,13 +241,18 @@ public function createConnector(array $config) return $this->container->make($key); } - return match ($config['driver']) { - 'mysql' => new MySqlConnector, - 'pgsql' => new PostgresConnector, - 'sqlite' => new SQLiteConnector, - 'sqlsrv' => new SqlServerConnector, - default => throw new InvalidArgumentException("Unsupported driver [{$config['driver']}]."), - }; + switch ($config['driver']) { + case 'mysql': + return new MySqlConnector; + case 'pgsql': + return new PostgresConnector; + case 'sqlite': + return new SQLiteConnector; + case 'sqlsrv': + return new SqlServerConnector; + } + + throw new InvalidArgumentException("Unsupported driver [{$config['driver']}]."); } /** @@ -268,12 +273,17 @@ protected function createConnection($driver, $connection, $database, $prefix = ' return $resolver($connection, $database, $prefix, $config); } - return match ($driver) { - 'mysql' => new MySqlConnection($connection, $database, $prefix, $config), - 'pgsql' => new PostgresConnection($connection, $database, $prefix, $config), - 'sqlite' => new SQLiteConnection($connection, $database, $prefix, $config), - 'sqlsrv' => new SqlServerConnection($connection, $database, $prefix, $config), - default => throw new InvalidArgumentException("Unsupported driver [{$driver}]."), - }; + switch ($driver) { + case 'mysql': + return new MySqlConnection($connection, $database, $prefix, $config); + case 'pgsql': + return new PostgresConnection($connection, $database, $prefix, $config); + case 'sqlite': + return new SQLiteConnection($connection, $database, $prefix, $config); + case 'sqlsrv': + return new SqlServerConnection($connection, $database, $prefix, $config); + } + + throw new InvalidArgumentException("Unsupported driver [{$driver}]."); } } diff --git a/core/vendor/illuminate/database/Connectors/PostgresConnector.php b/core/vendor/illuminate/database/Connectors/PostgresConnector.php index 9bc63269e5..a507d9ac3c 100755 --- a/core/vendor/illuminate/database/Connectors/PostgresConnector.php +++ b/core/vendor/illuminate/database/Connectors/PostgresConnector.php @@ -42,7 +42,7 @@ public function connect(array $config) // database. Setting this DB timezone is an optional configuration item. $this->configureTimezone($connection, $config); - $this->configureSearchPath($connection, $config); + $this->configureSchema($connection, $config); // Postgres allows an application_name to be set by the user and this name is // used to when monitoring the application with pg_stat_activity. So we'll @@ -101,59 +101,38 @@ protected function configureTimezone($connection, array $config) } /** - * Set the "search_path" on the database connection. + * Set the schema on the connection. * * @param \PDO $connection * @param array $config * @return void */ - protected function configureSearchPath($connection, $config) + protected function configureSchema($connection, $config) { - if (isset($config['search_path']) || isset($config['schema'])) { - $searchPath = $this->quoteSearchPath( - $this->parseSearchPath($config['search_path'] ?? $config['schema']) - ); + if (isset($config['schema'])) { + $schema = $this->formatSchema($config['schema']); - $connection->prepare("set search_path to {$searchPath}")->execute(); + $connection->prepare("set search_path to {$schema}")->execute(); } } /** - * Parse the "search_path" configuration value into an array. + * Format the schema for the DSN. * - * @param string|array $searchPath - * @return array + * @param array|string $schema + * @return string */ - protected function parseSearchPath($searchPath) + protected function formatSchema($schema) { - if (is_string($searchPath)) { - preg_match_all('/[a-zA-z0-9$]{1,}/i', $searchPath, $matches); - - $searchPath = $matches[0]; + if (is_array($schema)) { + return '"'.implode('", "', $schema).'"'; } - $searchPath = $searchPath ?? []; - - array_walk($searchPath, function (&$schema) { - $schema = trim($schema, '\'"'); - }); - - return $searchPath; - } - - /** - * Format the search path for the DSN. - * - * @param array|string $searchPath - * @return string - */ - protected function quoteSearchPath($searchPath) - { - return count($searchPath) === 1 ? '"'.$searchPath[0].'"' : '"'.implode('", "', $searchPath).'"'; + return '"'.$schema.'"'; } /** - * Set the application name on the connection. + * Set the schema on the connection. * * @param \PDO $connection * @param array $config diff --git a/core/vendor/illuminate/database/Console/DumpCommand.php b/core/vendor/illuminate/database/Console/DumpCommand.php index bf0568f751..fe73fb2af0 100644 --- a/core/vendor/illuminate/database/Console/DumpCommand.php +++ b/core/vendor/illuminate/database/Console/DumpCommand.php @@ -22,15 +22,6 @@ class DumpCommand extends Command {--path= : The path where the schema dump file should be stored} {--prune : Delete all existing migration files}'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'schema:dump'; - /** * The console command description. * diff --git a/core/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php b/core/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php index 0b3039ab21..6233fe29f0 100644 --- a/core/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php +++ b/core/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php @@ -15,15 +15,6 @@ class FactoryMakeCommand extends GeneratorCommand */ protected $name = 'make:factory'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'make:factory'; - /** * The console command description. * @@ -121,7 +112,7 @@ protected function getPath($name) */ protected function guessModelName($name) { - if (str_ends_with($name, 'Factory')) { + if (Str::endsWith($name, 'Factory')) { $name = substr($name, 0, -7); } diff --git a/core/vendor/illuminate/database/Console/Factories/stubs/factory.stub b/core/vendor/illuminate/database/Console/Factories/stubs/factory.stub index 5649e3f708..3e00f3659d 100644 --- a/core/vendor/illuminate/database/Console/Factories/stubs/factory.stub +++ b/core/vendor/illuminate/database/Console/Factories/stubs/factory.stub @@ -4,9 +4,6 @@ namespace {{ factoryNamespace }}; use Illuminate\Database\Eloquent\Factories\Factory; -/** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\{{ namespacedModel }}> - */ class {{ factory }}Factory extends Factory { /** diff --git a/core/vendor/illuminate/database/Console/Seeds/SeedCommand.php b/core/vendor/illuminate/database/Console/Seeds/SeedCommand.php index 1d0b96e235..058e545c23 100644 --- a/core/vendor/illuminate/database/Console/Seeds/SeedCommand.php +++ b/core/vendor/illuminate/database/Console/Seeds/SeedCommand.php @@ -20,15 +20,6 @@ class SeedCommand extends Command */ protected $name = 'db:seed'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'db:seed'; - /** * The console command description. * @@ -93,7 +84,7 @@ protected function getSeeder() { $class = $this->input->getArgument('class') ?? $this->input->getOption('class'); - if (! str_contains($class, '\\')) { + if (strpos($class, '\\') === false) { $class = 'Database\\Seeders\\'.$class; } diff --git a/core/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php b/core/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php index 716f18729d..aef7a77e6b 100644 --- a/core/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php +++ b/core/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php @@ -13,15 +13,6 @@ class SeederMakeCommand extends GeneratorCommand */ protected $name = 'make:seeder'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'make:seeder'; - /** * The console command description. * diff --git a/core/vendor/illuminate/database/Console/Seeds/WithoutModelEvents.php b/core/vendor/illuminate/database/Console/Seeds/WithoutModelEvents.php deleted file mode 100644 index acd9ec3f20..0000000000 --- a/core/vendor/illuminate/database/Console/Seeds/WithoutModelEvents.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Seeds; - -use Illuminate\Database\Eloquent\Model; - -trait WithoutModelEvents -{ - /** - * Prevent model events from being dispatched by the given callback. - * - * @param callable $callback - * @return callable - */ - public function withoutModelEvents(callable $callback) - { - return fn () => Model::withoutEvents($callback); - } -} diff --git a/core/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub b/core/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub index 29e4af4ea2..5662969c70 100644 --- a/core/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub +++ b/core/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub @@ -2,7 +2,6 @@ namespace Database\Seeders; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; class {{ class }} extends Seeder diff --git a/core/vendor/illuminate/database/Console/WipeCommand.php b/core/vendor/illuminate/database/Console/WipeCommand.php index 2a7c1e5adb..30825ed7c5 100644 --- a/core/vendor/illuminate/database/Console/WipeCommand.php +++ b/core/vendor/illuminate/database/Console/WipeCommand.php @@ -17,15 +17,6 @@ class WipeCommand extends Command */ protected $name = 'db:wipe'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'db:wipe'; - /** * The console command description. * diff --git a/core/vendor/illuminate/database/DBAL/TimestampType.php b/core/vendor/illuminate/database/DBAL/TimestampType.php index 4fa9851535..1557f124eb 100644 --- a/core/vendor/illuminate/database/DBAL/TimestampType.php +++ b/core/vendor/illuminate/database/DBAL/TimestampType.php @@ -2,29 +2,42 @@ namespace Illuminate\Database\DBAL; -use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\PhpDateTimeMappingType; use Doctrine\DBAL\Types\Type; +use RuntimeException; class TimestampType extends Type implements PhpDateTimeMappingType { /** * {@inheritdoc} + * + * @return string */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { - return match ($name = $platform->getName()) { - 'mysql', - 'mysql2' => $this->getMySqlPlatformSQLDeclaration($fieldDeclaration), - 'postgresql', - 'pgsql', - 'postgres' => $this->getPostgresPlatformSQLDeclaration($fieldDeclaration), - 'mssql' => $this->getSqlServerPlatformSQLDeclaration($fieldDeclaration), - 'sqlite', - 'sqlite3' => $this->getSQLitePlatformSQLDeclaration($fieldDeclaration), - default => throw new DBALException('Invalid platform: '.$name), - }; + $name = $platform->getName(); + + switch ($name) { + case 'mysql': + case 'mysql2': + return $this->getMySqlPlatformSQLDeclaration($fieldDeclaration); + + case 'postgresql': + case 'pgsql': + case 'postgres': + return $this->getPostgresPlatformSQLDeclaration($fieldDeclaration); + + case 'mssql': + return $this->getSqlServerPlatformSQLDeclaration($fieldDeclaration); + + case 'sqlite': + case 'sqlite3': + return $this->getSQLitePlatformSQLDeclaration($fieldDeclaration); + + default: + throw new RuntimeException('Invalid platform: '.$name); + } } /** @@ -87,6 +100,8 @@ protected function getSQLitePlatformSQLDeclaration(array $fieldDeclaration) /** * {@inheritdoc} + * + * @return string */ public function getName() { diff --git a/core/vendor/illuminate/database/DatabaseServiceProvider.php b/core/vendor/illuminate/database/DatabaseServiceProvider.php index 9a2f47d1b7..4b6521b701 100755 --- a/core/vendor/illuminate/database/DatabaseServiceProvider.php +++ b/core/vendor/illuminate/database/DatabaseServiceProvider.php @@ -70,10 +70,6 @@ protected function registerConnectionServices() return $app['db']->connection(); }); - $this->app->bind('db.schema', function ($app) { - return $app['db']->connection()->getSchemaBuilder(); - }); - $this->app->singleton('db.transactions', function ($app) { return new DatabaseTransactionsManager; }); diff --git a/core/vendor/illuminate/database/DatabaseTransactionRecord.php b/core/vendor/illuminate/database/DatabaseTransactionRecord.php index 4736ee9224..3259552dcf 100755 --- a/core/vendor/illuminate/database/DatabaseTransactionRecord.php +++ b/core/vendor/illuminate/database/DatabaseTransactionRecord.php @@ -57,7 +57,7 @@ public function addCallback($callback) public function executeCallbacks() { foreach ($this->callbacks as $callback) { - $callback(); + call_user_func($callback); } } diff --git a/core/vendor/illuminate/database/DatabaseTransactionsManager.php b/core/vendor/illuminate/database/DatabaseTransactionsManager.php index 8c36504230..add2f7c1a6 100755 --- a/core/vendor/illuminate/database/DatabaseTransactionsManager.php +++ b/core/vendor/illuminate/database/DatabaseTransactionsManager.php @@ -81,7 +81,7 @@ public function addCallback($callback) return $current->addCallback($callback); } - $callback(); + call_user_func($callback); } /** diff --git a/core/vendor/illuminate/database/Eloquent/Builder.php b/core/vendor/illuminate/database/Eloquent/Builder.php index 134c160025..c98e76cf7c 100755 --- a/core/vendor/illuminate/database/Eloquent/Builder.php +++ b/core/vendor/illuminate/database/Eloquent/Builder.php @@ -5,10 +5,8 @@ use BadMethodCallException; use Closure; use Exception; -use Illuminate\Contracts\Database\Eloquent\Builder as BuilderContract; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Database\Concerns\BuildsQueries; -use Illuminate\Database\Eloquent\Concerns\QueriesRelationships; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder; @@ -25,10 +23,11 @@ * * @mixin \Illuminate\Database\Query\Builder */ -class Builder implements BuilderContract +class Builder { - use BuildsQueries, ForwardsCalls, QueriesRelationships { - BuildsQueries::sole as baseSole; + use Concerns\QueriesRelationships, ForwardsCalls; + use BuildsQueries { + sole as baseSole; } /** @@ -435,22 +434,16 @@ public function findOrFail($id, $columns = ['*']) $id = $id instanceof Arrayable ? $id->toArray() : $id; if (is_array($id)) { - if (count($result) !== count(array_unique($id))) { - throw (new ModelNotFoundException)->setModel( - get_class($this->model), array_diff($id, $result->modelKeys()) - ); + if (count($result) === count(array_unique($id))) { + return $result; } - + } elseif (! is_null($result)) { return $result; } - if (is_null($result)) { - throw (new ModelNotFoundException)->setModel( - get_class($this->model), $id - ); - } - - return $result; + throw (new ModelNotFoundException)->setModel( + get_class($this->model), $id + ); } /** @@ -645,7 +638,7 @@ public function eagerLoadRelations(array $models) // For nested eager loads we'll skip loading them here and they will be set as an // eager load on the query to retrieve the relation so that they will be eager // loaded on that query, because that is where they get hydrated as models. - if (! str_contains($name, '.')) { + if (strpos($name, '.') === false) { $models = $this->eagerLoadRelation($models, $name, $constraints); } } @@ -743,7 +736,7 @@ protected function relationsNestedUnder($relation) */ protected function isNestedUnder($relation, $name) { - return str_contains($name, '.') && str_starts_with($name, $relation.'.'); + return Str::contains($name, '.') && Str::startsWith($name, $relation.'.'); } /** @@ -1368,7 +1361,7 @@ protected function parseWithRelations(array $relations) if (is_numeric($name)) { $name = $constraints; - [$name, $constraints] = str_contains($name, ':') + [$name, $constraints] = Str::contains($name, ':') ? $this->createSelectWithConstraint($name) : [$name, static function () { // @@ -1396,7 +1389,7 @@ protected function createSelectWithConstraint($name) { return [explode(':', $name)[0], static function ($query) use ($name) { $query->select(array_map(static function ($column) use ($query) { - if (str_contains($column, '.')) { + if (Str::contains($column, '.')) { return $column; } diff --git a/core/vendor/illuminate/database/Eloquent/Casts/ArrayObject.php b/core/vendor/illuminate/database/Eloquent/Casts/ArrayObject.php index 2da92c3346..6f1713c946 100644 --- a/core/vendor/illuminate/database/Eloquent/Casts/ArrayObject.php +++ b/core/vendor/illuminate/database/Eloquent/Casts/ArrayObject.php @@ -33,7 +33,8 @@ public function toArray() * * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->getArrayCopy(); } diff --git a/core/vendor/illuminate/database/Eloquent/Collection.php b/core/vendor/illuminate/database/Eloquent/Collection.php index 5810087337..ff9b2747fe 100755 --- a/core/vendor/illuminate/database/Eloquent/Collection.php +++ b/core/vendor/illuminate/database/Eloquent/Collection.php @@ -7,24 +7,17 @@ use Illuminate\Contracts\Support\Arrayable; use Illuminate\Support\Arr; use Illuminate\Support\Collection as BaseCollection; +use Illuminate\Support\Str; use LogicException; -/** - * @template TKey of array-key - * @template TModel of \Illuminate\Database\Eloquent\Model - * - * @extends \Illuminate\Support\Collection<TKey, TModel> - */ class Collection extends BaseCollection implements QueueableCollection { /** * Find a model in the collection by key. * - * @template TFindDefault - * * @param mixed $key - * @param TFindDefault $default - * @return static<TKey|TModel>|TModel|TFindDefault + * @param mixed $default + * @return \Illuminate\Database\Eloquent\Model|static|null */ public function find($key, $default = null) { @@ -52,7 +45,7 @@ public function find($key, $default = null) /** * Load a set of relationships onto the collection. * - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string>|string $relations + * @param array|string $relations * @return $this */ public function load($relations) @@ -73,9 +66,9 @@ public function load($relations) /** * Load a set of aggregations over relationship's column onto the collection. * - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string>|string $relations + * @param array|string $relations * @param string $column - * @param string|null $function + * @param string $function * @return $this */ public function loadAggregate($relations, $column, $function = null) @@ -108,7 +101,7 @@ public function loadAggregate($relations, $column, $function = null) /** * Load a set of relationship counts onto the collection. * - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string>|string $relations + * @param array|string $relations * @return $this */ public function loadCount($relations) @@ -119,7 +112,7 @@ public function loadCount($relations) /** * Load a set of relationship's max column values onto the collection. * - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string>|string $relations + * @param array|string $relations * @param string $column * @return $this */ @@ -131,7 +124,7 @@ public function loadMax($relations, $column) /** * Load a set of relationship's min column values onto the collection. * - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string>|string $relations + * @param array|string $relations * @param string $column * @return $this */ @@ -143,7 +136,7 @@ public function loadMin($relations, $column) /** * Load a set of relationship's column summations onto the collection. * - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string>|string $relations + * @param array|string $relations * @param string $column * @return $this */ @@ -155,7 +148,7 @@ public function loadSum($relations, $column) /** * Load a set of relationship's average column values onto the collection. * - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string>|string $relations + * @param array|string $relations * @param string $column * @return $this */ @@ -167,7 +160,7 @@ public function loadAvg($relations, $column) /** * Load a set of related existences onto the collection. * - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string>|string $relations + * @param array|string $relations * @return $this */ public function loadExists($relations) @@ -178,7 +171,7 @@ public function loadExists($relations) /** * Load a set of relationships onto the collection if they are not already eager loaded. * - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string>|string $relations + * @param array|string $relations * @return $this */ public function loadMissing($relations) @@ -194,7 +187,7 @@ public function loadMissing($relations) $segments = explode('.', explode(':', $key)[0]); - if (str_contains($key, ':')) { + if (Str::contains($key, ':')) { $segments[count($segments) - 1] .= ':'.explode(':', $key)[1]; } @@ -252,7 +245,7 @@ protected function loadMissingRelation(self $models, array $path) * Load a set of relationships onto the mixed relationship collection. * * @param string $relation - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string> $relations + * @param array $relations * @return $this */ public function loadMorph($relation, $relations) @@ -273,7 +266,7 @@ public function loadMorph($relation, $relations) * Load a set of relationship counts onto the mixed relationship collection. * * @param string $relation - * @param array<array-key, (callable(\Illuminate\Database\Eloquent\Builder): mixed)|string> $relations + * @param array $relations * @return $this */ public function loadMorphCount($relation, $relations) @@ -293,7 +286,7 @@ public function loadMorphCount($relation, $relations) /** * Determine if a key exists in the collection. * - * @param (callable(TModel, TKey): bool)|TModel|string $key + * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool @@ -318,7 +311,7 @@ public function contains($key, $operator = null, $value = null) /** * Get the array of primary keys. * - * @return array<int, array-key> + * @return array */ public function modelKeys() { @@ -330,7 +323,7 @@ public function modelKeys() /** * Merge the collection with the given items. * - * @param iterable<array-key, TModel> $items + * @param \ArrayAccess|array $items * @return static */ public function merge($items) @@ -347,10 +340,8 @@ public function merge($items) /** * Run a map over each of the items. * - * @template TMapValue - * - * @param callable(TModel, TKey): TMapValue $callback - * @return \Illuminate\Support\Collection<TKey, TMapValue>|static<TKey, TMapValue> + * @param callable $callback + * @return \Illuminate\Support\Collection|static */ public function map(callable $callback) { @@ -366,11 +357,8 @@ public function map(callable $callback) * * The callback should return an associative array with a single key / value pair. * - * @template TMapWithKeysKey of array-key - * @template TMapWithKeysValue - * - * @param callable(TModel, TKey): array<TMapWithKeysKey, TMapWithKeysValue> $callback - * @return \Illuminate\Support\Collection<TMapWithKeysKey, TMapWithKeysValue>|static<TMapWithKeysKey, TMapWithKeysValue> + * @param callable $callback + * @return \Illuminate\Support\Collection|static */ public function mapWithKeys(callable $callback) { @@ -384,7 +372,7 @@ public function mapWithKeys(callable $callback) /** * Reload a fresh model instance from the database for all the entities. * - * @param array<array-key, string>|string $with + * @param array|string $with * @return static */ public function fresh($with = []) @@ -412,7 +400,7 @@ public function fresh($with = []) /** * Diff the collection with the given items. * - * @param iterable<array-key, TModel> $items + * @param \ArrayAccess|array $items * @return static */ public function diff($items) @@ -433,7 +421,7 @@ public function diff($items) /** * Intersect the collection with the given items. * - * @param iterable<array-key, TModel> $items + * @param \ArrayAccess|array $items * @return static */ public function intersect($items) @@ -458,9 +446,9 @@ public function intersect($items) /** * Return only unique items from the collection. * - * @param (callable(TModel, TKey): mixed)|string|null $key + * @param string|callable|null $key * @param bool $strict - * @return static<int, TModel> + * @return static */ public function unique($key = null, $strict = false) { @@ -474,8 +462,8 @@ public function unique($key = null, $strict = false) /** * Returns only the models from the collection with the specified keys. * - * @param array<array-key, mixed>|null $keys - * @return static<int, TModel> + * @param mixed $keys + * @return static */ public function only($keys) { @@ -491,8 +479,8 @@ public function only($keys) /** * Returns all models in the collection except the models with specified keys. * - * @param array<array-key, mixed>|null $keys - * @return static<int, TModel> + * @param mixed $keys + * @return static */ public function except($keys) { @@ -504,7 +492,7 @@ public function except($keys) /** * Make the given, typically visible, attributes hidden across the entire collection. * - * @param array<array-key, string>|string $attributes + * @param array|string $attributes * @return $this */ public function makeHidden($attributes) @@ -515,7 +503,7 @@ public function makeHidden($attributes) /** * Make the given, typically hidden, attributes visible across the entire collection. * - * @param array<array-key, string>|string $attributes + * @param array|string $attributes * @return $this */ public function makeVisible($attributes) @@ -526,7 +514,7 @@ public function makeVisible($attributes) /** * Append an attribute across the entire collection. * - * @param array<array-key, string>|string $attributes + * @param array|string $attributes * @return $this */ public function append($attributes) @@ -537,8 +525,8 @@ public function append($attributes) /** * Get a dictionary keyed by primary keys. * - * @param iterable<array-key, TModel>|null $items - * @return array<array-key, TModel> + * @param \ArrayAccess|array|null $items + * @return array */ public function getDictionary($items = null) { @@ -560,9 +548,9 @@ public function getDictionary($items = null) /** * Get an array with the values of a given key. * - * @param string|array<array-key, string> $value + * @param string|array $value * @param string|null $key - * @return \Illuminate\Support\Collection<int, mixed> + * @return \Illuminate\Support\Collection */ public function pluck($value, $key = null) { @@ -572,7 +560,7 @@ public function pluck($value, $key = null) /** * Get the keys of the collection items. * - * @return \Illuminate\Support\Collection<int, TKey> + * @return \Illuminate\Support\Collection */ public function keys() { @@ -582,10 +570,8 @@ public function keys() /** * Zip the collection together with one or more arrays. * - * @template TZipValue - * - * @param \Illuminate\Contracts\Support\Arrayable<array-key, TZipValue>|iterable<array-key, TZipValue> ...$items - * @return \Illuminate\Support\Collection<int, \Illuminate\Support\Collection<int, TModel|TZipValue>> + * @param mixed ...$items + * @return \Illuminate\Support\Collection */ public function zip($items) { @@ -595,7 +581,7 @@ public function zip($items) /** * Collapse the collection of items into a single array. * - * @return \Illuminate\Support\Collection<int, mixed> + * @return \Illuminate\Support\Collection */ public function collapse() { @@ -606,7 +592,7 @@ public function collapse() * Get a flattened array of the items in the collection. * * @param int $depth - * @return \Illuminate\Support\Collection<int, mixed> + * @return \Illuminate\Support\Collection */ public function flatten($depth = INF) { @@ -616,7 +602,7 @@ public function flatten($depth = INF) /** * Flip the items in the collection. * - * @return \Illuminate\Support\Collection<TModel, TKey> + * @return \Illuminate\Support\Collection */ public function flip() { @@ -626,11 +612,9 @@ public function flip() /** * Pad collection to the specified length with a value. * - * @template TPadValue - * * @param int $size - * @param TPadValue $value - * @return \Illuminate\Support\Collection<int, TModel|TPadValue> + * @param mixed $value + * @return \Illuminate\Support\Collection */ public function pad($size, $value) { @@ -641,7 +625,7 @@ public function pad($size, $value) * Get the comparison function to detect duplicates. * * @param bool $strict - * @return callable(TValue, TValue): bool + * @return \Closure */ protected function duplicateComparator($strict) { @@ -677,7 +661,7 @@ public function getQueueableClass() /** * Get the identifiers for all of the entities. * - * @return array<int, mixed> + * @return array */ public function getQueueableIds() { @@ -693,7 +677,7 @@ public function getQueueableIds() /** * Get the relationships of the entities being queued. * - * @return array<int, string> + * @return array */ public function getQueueableRelations() { diff --git a/core/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php b/core/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php index b2e6651b2e..3e85fb955e 100644 --- a/core/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php +++ b/core/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php @@ -2,6 +2,8 @@ namespace Illuminate\Database\Eloquent\Concerns; +use Illuminate\Support\Str; + trait GuardsAttributes { /** @@ -185,8 +187,8 @@ public function isFillable($key) } return empty($this->getFillable()) && - ! str_contains($key, '.') && - ! str_starts_with($key, '_'); + strpos($key, '.') === false && + ! Str::startsWith($key, '_'); } /** diff --git a/core/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php b/core/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php index d0a2922464..1cdf24375b 100644 --- a/core/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php +++ b/core/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php @@ -4,7 +4,6 @@ use Carbon\CarbonImmutable; use Carbon\CarbonInterface; -use DateTimeImmutable; use DateTimeInterface; use Illuminate\Contracts\Database\Eloquent\Castable; use Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes; @@ -864,8 +863,8 @@ protected function serializeClassCastableAttribute($key, $value) */ protected function isCustomDateTimeCast($cast) { - return str_starts_with($cast, 'date:') || - str_starts_with($cast, 'datetime:'); + return strncmp($cast, 'date:', 5) === 0 || + strncmp($cast, 'datetime:', 9) === 0; } /** @@ -888,7 +887,7 @@ protected function isImmutableCustomDateTimeCast($cast) */ protected function isDecimalCast($cast) { - return str_starts_with($cast, 'decimal:'); + return strncmp($cast, 'decimal:', 8) === 0; } /** @@ -935,7 +934,7 @@ public function setAttribute($key, $value) // If this attribute contains a JSON ->, we'll set the proper value in the // attribute's underlying array. This takes care of properly nesting an // attribute in the array's value in the case of deeply nested items. - if (str_contains($key, '->')) { + if (Str::contains($key, '->')) { return $this->fillJsonAttribute($key, $value); } @@ -1015,7 +1014,7 @@ protected function setAttributeMarkedMutatedAttributeValue($key, $value) $this->attributes = array_merge( $this->attributes, $this->normalizeCastClassResponse( - $key, $callback($value, $this->attributes) + $key, call_user_func($callback, $value, $this->attributes) ) ); @@ -1071,12 +1070,22 @@ protected function setClassCastableAttribute($key, $value) { $caster = $this->resolveCasterClass($key); - $this->attributes = array_merge( - $this->attributes, - $this->normalizeCastClassResponse($key, $caster->set( - $this, $key, $value, $this->attributes - )) - ); + if (is_null($value)) { + $this->attributes = array_merge($this->attributes, array_map( + function () { + }, + $this->normalizeCastClassResponse($key, $caster->set( + $this, $key, $this->{$key}, $this->attributes + )) + )); + } else { + $this->attributes = array_merge( + $this->attributes, + $this->normalizeCastClassResponse($key, $caster->set( + $this, $key, $value, $this->attributes + )) + ); + } if ($caster instanceof CastsInboundAttributes || ! is_object($value)) { unset($this->classCastCache[$key]); @@ -1224,12 +1233,16 @@ public static function encryptUsing($encrypter) */ public function fromFloat($value) { - return match ((string) $value) { - 'Infinity' => INF, - '-Infinity' => -INF, - 'NaN' => NAN, - default => (float) $value, - }; + switch ((string) $value) { + case 'Infinity': + return INF; + case '-Infinity': + return -INF; + case 'NaN': + return NAN; + default: + return (float) $value; + } } /** @@ -1350,7 +1363,7 @@ protected function asTimestamp($value) */ protected function serializeDate(DateTimeInterface $date) { - return $date instanceof DateTimeImmutable ? + return $date instanceof \DateTimeImmutable ? CarbonImmutable::instance($date)->toJSON() : Carbon::instance($date)->toJSON(); } @@ -1563,7 +1576,7 @@ protected function resolveCasterClass($key) $arguments = []; - if (is_string($castType) && str_contains($castType, ':')) { + if (is_string($castType) && strpos($castType, ':') !== false) { $segments = explode(':', $castType, 2); $castType = $segments[0]; @@ -1589,7 +1602,7 @@ protected function resolveCasterClass($key) */ protected function parseCasterClass($class) { - return ! str_contains($class, ':') + return strpos($class, ':') === false ? $class : explode(':', $class, 2)[0]; } @@ -1645,7 +1658,7 @@ protected function mergeAttributesFromAttributeCasts() $this->attributes = array_merge( $this->attributes, $this->normalizeCastClassResponse( - $key, $callback($value, $this->attributes) + $key, call_user_func($callback, $value, $this->attributes) ) ); } diff --git a/core/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php b/core/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php index 72afb17889..1742679c5a 100644 --- a/core/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php +++ b/core/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php @@ -13,14 +13,14 @@ trait HasGlobalScopes * Register a new global scope on the model. * * @param \Illuminate\Database\Eloquent\Scope|\Closure|string $scope - * @param \Illuminate\Database\Eloquent\Scope|\Closure|null $implementation + * @param \Closure|null $implementation * @return mixed * * @throws \InvalidArgumentException */ - public static function addGlobalScope($scope, $implementation = null) + public static function addGlobalScope($scope, Closure $implementation = null) { - if (is_string($scope) && ($implementation instanceof Closure || $implementation instanceof Scope)) { + if (is_string($scope) && ! is_null($implementation)) { return static::$globalScopes[static::class][$scope] = $implementation; } elseif ($scope instanceof Closure) { return static::$globalScopes[static::class][spl_object_hash($scope)] = $scope; diff --git a/core/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php b/core/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php index add911ae86..13ebd31744 100644 --- a/core/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php +++ b/core/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php @@ -16,17 +16,10 @@ trait HasTimestamps /** * Update the model's update timestamp. * - * @param string|null $attribute * @return bool */ - public function touch($attribute = null) + public function touch() { - if ($attribute) { - $this->$attribute = $this->freshTimestamp(); - - return $this->save(); - } - if (! $this->usesTimestamps()) { return false; } diff --git a/core/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php b/core/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php index 31b8b982ff..065d48a8d0 100644 --- a/core/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php +++ b/core/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php @@ -2,6 +2,8 @@ namespace Illuminate\Database\Eloquent\Concerns; +use Closure; + trait HidesAttributes { /** @@ -86,7 +88,7 @@ public function makeVisible($attributes) /** * Make the given, typically hidden, attributes visible if the given truth test passes. * - * @param bool|\Closure $condition + * @param bool|Closure $condition * @param array|string|null $attributes * @return $this */ @@ -113,7 +115,7 @@ public function makeHidden($attributes) /** * Make the given, typically visible, attributes hidden if the given truth test passes. * - * @param bool|\Closure $condition + * @param bool|Closure $condition * @param array|string|null $attributes * @return $this */ diff --git a/core/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php b/core/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php index 2cb68ff97a..c16af1fa00 100644 --- a/core/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php +++ b/core/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php @@ -30,7 +30,7 @@ trait QueriesRelationships public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null) { if (is_string($relation)) { - if (str_contains($relation, '.')) { + if (strpos($relation, '.') !== false) { return $this->hasNested($relation, $operator, $count, $boolean, $callback); } @@ -462,11 +462,11 @@ public function orWhereMorphedTo($relation, $model) * Add a "belongs to" relationship where clause to the query. * * @param \Illuminate\Database\Eloquent\Model $related - * @param string|null $relationshipName + * @param string $relationship * @param string $boolean * @return $this * - * @throws \Illuminate\Database\Eloquent\RelationNotFoundException + * @throws \RuntimeException */ public function whereBelongsTo($related, $relationshipName = null, $boolean = 'and') { @@ -498,7 +498,7 @@ public function whereBelongsTo($related, $relationshipName = null, $boolean = 'a * Add an "BelongsTo" relationship with an "or where" clause to the query. * * @param \Illuminate\Database\Eloquent\Model $related - * @param string|null $relationshipName + * @param string $relationship * @return $this * * @throws \RuntimeException diff --git a/core/vendor/illuminate/database/Eloquent/Factories/Factory.php b/core/vendor/illuminate/database/Eloquent/Factories/Factory.php index 8ac9642253..56826e765a 100644 --- a/core/vendor/illuminate/database/Eloquent/Factories/Factory.php +++ b/core/vendor/illuminate/database/Eloquent/Factories/Factory.php @@ -15,9 +15,6 @@ use Illuminate\Support\Traits\Macroable; use Throwable; -/** - * @template TModel of \Illuminate\Database\Eloquent\Model - */ abstract class Factory { use Conditionable, ForwardsCalls, Macroable { @@ -27,7 +24,7 @@ abstract class Factory /** * The name of the factory's corresponding model. * - * @var class-string<\Illuminate\Database\Eloquent\Model|TModel> + * @var string|null */ protected $model; @@ -141,14 +138,14 @@ public function __construct($count = null, /** * Define the model's default state. * - * @return array<string, mixed> + * @return array */ abstract public function definition(); /** * Get a new factory instance for the given attributes. * - * @param (callable(array<string, mixed>): array<string, mixed>)|array<string, mixed> $attributes + * @param callable|array $attributes * @return static */ public static function new($attributes = []) @@ -180,9 +177,9 @@ public function configure() /** * Get the raw attributes generated by the factory. * - * @param (callable(array<string, mixed>): array<string, mixed>)|array<string, mixed> $attributes + * @param array $attributes * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return array<int|string, mixed> + * @return array */ public function raw($attributes = [], ?Model $parent = null) { @@ -198,8 +195,8 @@ public function raw($attributes = [], ?Model $parent = null) /** * Create a single model and persist it to the database. * - * @param (callable(array<string, mixed>): array<string, mixed>)|array<string, mixed> $attributes - * @return \Illuminate\Database\Eloquent\Model|TModel + * @param array $attributes + * @return \Illuminate\Database\Eloquent\Model */ public function createOne($attributes = []) { @@ -209,8 +206,8 @@ public function createOne($attributes = []) /** * Create a single model and persist it to the database. * - * @param (callable(array<string, mixed>): array<string, mixed>)|array<string, mixed> $attributes - * @return \Illuminate\Database\Eloquent\Model|TModel + * @param array $attributes + * @return \Illuminate\Database\Eloquent\Model */ public function createOneQuietly($attributes = []) { @@ -220,8 +217,8 @@ public function createOneQuietly($attributes = []) /** * Create a collection of models and persist them to the database. * - * @param iterable<int, array<string, mixed>> $records - * @return \Illuminate\Database\Eloquent\Collection<int, \Illuminate\Database\Eloquent\Model|TModel> + * @param iterable $records + * @return \Illuminate\Database\Eloquent\Collection */ public function createMany(iterable $records) { @@ -235,8 +232,8 @@ public function createMany(iterable $records) /** * Create a collection of models and persist them to the database. * - * @param iterable<int, array<string, mixed>> $records - * @return \Illuminate\Database\Eloquent\Collection<int, \Illuminate\Database\Eloquent\Model|TModel> + * @param iterable $records + * @return \Illuminate\Database\Eloquent\Collection */ public function createManyQuietly(iterable $records) { @@ -248,9 +245,9 @@ public function createManyQuietly(iterable $records) /** * Create a collection of models and persist them to the database. * - * @param (callable(array<string, mixed>): array<string, mixed>)|array<string, mixed> $attributes + * @param array $attributes * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Illuminate\Database\Eloquent\Collection<int, \Illuminate\Database\Eloquent\Model|TModel>|\Illuminate\Database\Eloquent\Model|TModel + * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model */ public function create($attributes = [], ?Model $parent = null) { @@ -276,9 +273,9 @@ public function create($attributes = [], ?Model $parent = null) /** * Create a collection of models and persist them to the database. * - * @param array<string, mixed> $attributes + * @param array $attributes * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Illuminate\Database\Eloquent\Collection<int, \Illuminate\Database\Eloquent\Model|TModel>|\Illuminate\Database\Eloquent\Model|TModel + * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model */ public function createQuietly($attributes = [], ?Model $parent = null) { @@ -290,9 +287,9 @@ public function createQuietly($attributes = [], ?Model $parent = null) /** * Create a callback that persists a model in the database when invoked. * - * @param array<string, mixed> $attributes + * @param array $attributes * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Closure(): (\Illuminate\Database\Eloquent\Collection<int, \Illuminate\Database\Eloquent\Model|TModel>|\Illuminate\Database\Eloquent\Model|TModel) + * @return \Closure */ public function lazy(array $attributes = [], ?Model $parent = null) { @@ -338,8 +335,8 @@ protected function createChildren(Model $model) /** * Make a single instance of the model. * - * @param (callable(array<string, mixed>): array<string, mixed>)|array<string, mixed> $attributes - * @return \Illuminate\Database\Eloquent\Model|TModel + * @param callable|array $attributes + * @return \Illuminate\Database\Eloquent\Model */ public function makeOne($attributes = []) { @@ -349,9 +346,9 @@ public function makeOne($attributes = []) /** * Create a collection of models. * - * @param (callable(array<string, mixed>): array<string, mixed>)|array<string, mixed> $attributes + * @param array $attributes * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Illuminate\Database\Eloquent\Collection<int, \Illuminate\Database\Eloquent\Model|TModel>|\Illuminate\Database\Eloquent\Model|TModel + * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model */ public function make($attributes = [], ?Model $parent = null) { @@ -469,7 +466,7 @@ protected function expandAttributes(array $definition) /** * Add a new state transformation to the model definition. * - * @param (callable(array<string, mixed>): array<string, mixed>)|array<string, mixed> $state + * @param callable|array $state * @return static */ public function state($state) @@ -538,7 +535,7 @@ protected function guessRelationship(string $related) * Define an attached relationship for the model. * * @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model $factory - * @param (callable(): array<string, mixed>)|array<string, mixed> $pivot + * @param callable|array $pivot * @param string|null $relationship * @return static */ @@ -577,7 +574,7 @@ public function for($factory, $relationship = null) /** * Add a new "after making" callback to the model definition. * - * @param \Closure(\Illuminate\Database\Eloquent\Model|TModel): mixed $callback + * @param \Closure $callback * @return static */ public function afterMaking(Closure $callback) @@ -588,7 +585,7 @@ public function afterMaking(Closure $callback) /** * Add a new "after creating" callback to the model definition. * - * @param \Closure(\Illuminate\Database\Eloquent\Model|TModel): mixed $callback + * @param \Closure $callback * @return static */ public function afterCreating(Closure $callback) @@ -671,8 +668,8 @@ protected function newInstance(array $arguments = []) /** * Get a new model instance. * - * @param array<string, mixed> $attributes - * @return \Illuminate\Database\Eloquent\Model|TModel + * @param array $attributes + * @return \Illuminate\Database\Eloquent\Model */ public function newModel(array $attributes = []) { @@ -684,7 +681,7 @@ public function newModel(array $attributes = []) /** * Get the name of the model that is generated by the factory. * - * @return class-string<\Illuminate\Database\Eloquent\Model|TModel> + * @return string */ public function modelName() { @@ -708,7 +705,7 @@ public function modelName() /** * Specify the callback that should be invoked to guess model names based on factory names. * - * @param callable(): class-string<\Illuminate\Database\Eloquent\Model|TModel> $callback + * @param callable $callback * @return void */ public static function guessModelNamesUsing(callable $callback) @@ -730,8 +727,8 @@ public static function useNamespace(string $namespace) /** * Get a new factory instance for the given model name. * - * @param class-string<\Illuminate\Database\Eloquent\Model> $modelName - * @return \Illuminate\Database\Eloquent\Factories\Factory + * @param string $modelName + * @return static */ public static function factoryForModel(string $modelName) { @@ -743,7 +740,7 @@ public static function factoryForModel(string $modelName) /** * Specify the callback that should be invoked to guess factory names based on dynamic relationship names. * - * @param callable(): class-string<\Illuminate\Database\Eloquent\Model|TModel> $callback + * @param callable $callback * @return void */ public static function guessFactoryNamesUsing(callable $callback) @@ -764,8 +761,8 @@ protected function withFaker() /** * Get the factory name for the given model name. * - * @param class-string<\Illuminate\Database\Eloquent\Model> $modelName - * @return class-string<\Illuminate\Database\Eloquent\Factories\Factory> + * @param string $modelName + * @return string */ public static function resolveFactoryName(string $modelName) { @@ -825,9 +822,9 @@ public function __call($method, $parameters) $factory = static::factoryForModel($relatedModel); } - if (str_starts_with($method, 'for')) { + if (Str::startsWith($method, 'for')) { return $this->for($factory->state($parameters[0] ?? []), $relationship); - } elseif (str_starts_with($method, 'has')) { + } elseif (Str::startsWith($method, 'has')) { return $this->has( $factory ->count(is_numeric($parameters[0] ?? null) ? $parameters[0] : 1) diff --git a/core/vendor/illuminate/database/Eloquent/Factories/HasFactory.php b/core/vendor/illuminate/database/Eloquent/Factories/HasFactory.php index f10281d141..7d2be22054 100644 --- a/core/vendor/illuminate/database/Eloquent/Factories/HasFactory.php +++ b/core/vendor/illuminate/database/Eloquent/Factories/HasFactory.php @@ -7,23 +7,22 @@ trait HasFactory /** * Get a new factory instance for the model. * - * @param callable|array|int|null $count - * @param callable|array $state - * @return \Illuminate\Database\Eloquent\Factories\Factory<static> + * @param mixed $parameters + * @return \Illuminate\Database\Eloquent\Factories\Factory */ - public static function factory($count = null, $state = []) + public static function factory(...$parameters) { $factory = static::newFactory() ?: Factory::factoryForModel(get_called_class()); return $factory - ->count(is_numeric($count) ? $count : null) - ->state(is_callable($count) || is_array($count) ? $count : $state); + ->count(is_numeric($parameters[0] ?? null) ? $parameters[0] : null) + ->state(is_array($parameters[0] ?? null) ? $parameters[0] : ($parameters[1] ?? [])); } /** * Create a new factory instance for the model. * - * @return \Illuminate\Database\Eloquent\Factories\Factory<static> + * @return \Illuminate\Database\Eloquent\Factories\Factory */ protected static function newFactory() { diff --git a/core/vendor/illuminate/database/Eloquent/Model.php b/core/vendor/illuminate/database/Eloquent/Model.php index 8e888c4cf2..676a08ddd1 100644 --- a/core/vendor/illuminate/database/Eloquent/Model.php +++ b/core/vendor/illuminate/database/Eloquent/Model.php @@ -461,7 +461,7 @@ public function forceFill(array $attributes) */ public function qualifyColumn($column) { - if (str_contains($column, '.')) { + if (Str::contains($column, '.')) { return $column; } @@ -560,7 +560,7 @@ public static function onWriteConnection() * Get all of the models from the database. * * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Collection<int, static> + * @return \Illuminate\Database\Eloquent\Collection|static[] */ public static function all($columns = ['*']) { @@ -1509,7 +1509,8 @@ public function toJson($options = 0) * * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->toArray(); } @@ -1527,7 +1528,6 @@ public function fresh($with = []) } return $this->setKeysForSelectQuery($this->newQueryWithoutScopes()) - ->useWritePdo() ->with(is_string($with) ? func_get_args() : $with) ->first(); } @@ -1544,10 +1544,7 @@ public function refresh() } $this->setRawAttributes( - $this->setKeysForSelectQuery($this->newQueryWithoutScopes()) - ->useWritePdo() - ->firstOrFail() - ->attributes + $this->setKeysForSelectQuery($this->newQueryWithoutScopes())->firstOrFail()->attributes ); $this->load(collect($this->relations)->reject(function ($relation) { @@ -1948,7 +1945,7 @@ protected function resolveChildRouteBindingQuery($childType, $value, $field) /** * Retrieve the model for a bound value. * - * @param \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Relations\Relation $query + * @param \Illuminate\Database\Eloquent\Model|Illuminate\Database\Eloquent\Relations\Relation $query * @param mixed $value * @param string|null $field * @return \Illuminate\Database\Eloquent\Relations\Relation @@ -2050,7 +2047,8 @@ public function __set($key, $value) * @param mixed $offset * @return bool */ - public function offsetExists($offset): bool + #[\ReturnTypeWillChange] + public function offsetExists($offset) { return ! is_null($this->getAttribute($offset)); } @@ -2061,7 +2059,8 @@ public function offsetExists($offset): bool * @param mixed $offset * @return mixed */ - public function offsetGet($offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($offset) { return $this->getAttribute($offset); } @@ -2073,7 +2072,8 @@ public function offsetGet($offset): mixed * @param mixed $value * @return void */ - public function offsetSet($offset, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) { $this->setAttribute($offset, $value); } @@ -2084,7 +2084,8 @@ public function offsetSet($offset, $value): void * @param mixed $offset * @return void */ - public function offsetUnset($offset): void + #[\ReturnTypeWillChange] + public function offsetUnset($offset) { unset($this->attributes[$offset], $this->relations[$offset]); } diff --git a/core/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php b/core/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php index ee443c4815..4cadd74072 100755 --- a/core/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php @@ -164,7 +164,7 @@ public function __construct(Builder $query, Model $parent, $table, $foreignPivot */ protected function resolveTableName($table) { - if (! str_contains($table, '\\') || ! class_exists($table)) { + if (! Str::contains($table, '\\') || ! class_exists($table)) { return $table; } @@ -595,13 +595,12 @@ public function findOrNew($id, $columns = ['*']) * Get the first related model record matching the attributes or instantiate it. * * @param array $attributes - * @param array $values * @return \Illuminate\Database\Eloquent\Model */ - public function firstOrNew(array $attributes = [], array $values = []) + public function firstOrNew(array $attributes) { - if (is_null($instance = $this->related->where($attributes)->first())) { - $instance = $this->related->newInstance(array_merge($attributes, $values)); + if (is_null($instance = $this->where($attributes)->first())) { + $instance = $this->related->newInstance($attributes); } return $instance; @@ -611,15 +610,14 @@ public function firstOrNew(array $attributes = [], array $values = []) * Get the first related record matching the attributes or create it. * * @param array $attributes - * @param array $values * @param array $joining * @param bool $touch * @return \Illuminate\Database\Eloquent\Model */ - public function firstOrCreate(array $attributes = [], array $values = [], array $joining = [], $touch = true) + public function firstOrCreate(array $attributes, array $joining = [], $touch = true) { - if (is_null($instance = $this->related->where($attributes)->first())) { - $instance = $this->create(array_merge($attributes, $values), $joining, $touch); + if (is_null($instance = $this->where($attributes)->first())) { + $instance = $this->create($attributes, $joining, $touch); } return $instance; @@ -636,8 +634,8 @@ public function firstOrCreate(array $attributes = [], array $values = [], array */ public function updateOrCreate(array $attributes, array $values = [], array $joining = [], $touch = true) { - if (is_null($instance = $this->related->where($attributes)->first())) { - return $this->create(array_merge($attributes, $values), $joining, $touch); + if (is_null($instance = $this->where($attributes)->first())) { + return $this->create($values, $joining, $touch); } $instance->fill($values); @@ -1059,7 +1057,7 @@ protected function migratePivotAttributes(Model $model) // To get the pivots attributes we will just take any of the attributes which // begin with "pivot_" and add those to this arrays, as well as unsetting // them from the parent's models since they exist in a different table. - if (str_starts_with($key, 'pivot_')) { + if (strpos($key, 'pivot_') === 0) { $values[substr($key, 6)] = $value; unset($model->$key); @@ -1155,21 +1153,6 @@ public function save(Model $model, array $pivotAttributes = [], $touch = true) return $model; } - /** - * Save a new model without raising any events and attach it to the parent model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param array $pivotAttributes - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function saveQuietly(Model $model, array $pivotAttributes = [], $touch = true) - { - return Model::withoutEvents(function () use ($model, $pivotAttributes, $touch) { - return $this->save($model, $pivotAttributes, $touch); - }); - } - /** * Save an array of new models and attach them to the parent model. * @@ -1445,7 +1428,7 @@ public function getPivotColumns() */ public function qualifyPivotColumn($column) { - return str_contains($column, '.') + return Str::contains($column, '.') ? $column : $this->table.'.'.$column; } diff --git a/core/vendor/illuminate/database/Eloquent/Relations/Concerns/AsPivot.php b/core/vendor/illuminate/database/Eloquent/Relations/Concerns/AsPivot.php index e6f9f23015..af9defb746 100644 --- a/core/vendor/illuminate/database/Eloquent/Relations/Concerns/AsPivot.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/Concerns/AsPivot.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Eloquent\Relations\Concerns; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; @@ -76,9 +77,7 @@ public static function fromRawAttributes(Model $parent, $attributes, $table, $ex $instance->timestamps = $instance->hasTimestampAttributes($attributes); - $instance->setRawAttributes( - array_merge($instance->getRawOriginal(), $attributes), $exists - ); + $instance->setRawAttributes($attributes, $exists); return $instance; } @@ -279,7 +278,7 @@ public function newQueryForRestoration($ids) return $this->newQueryForCollectionRestoration($ids); } - if (! str_contains($ids, ':')) { + if (! Str::contains($ids, ':')) { return parent::newQueryForRestoration($ids); } @@ -300,7 +299,7 @@ protected function newQueryForCollectionRestoration(array $ids) { $ids = array_values($ids); - if (! str_contains($ids[0], ':')) { + if (! Str::contains($ids[0], ':')) { return parent::newQueryForRestoration($ids); } diff --git a/core/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php b/core/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php index 25b9a5834b..6f6b1b7f1f 100644 --- a/core/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Arr; +use Illuminate\Support\Str; use InvalidArgumentException; trait CanBeOneOfMany @@ -51,7 +52,7 @@ abstract public function getOneOfManySubQuerySelectColumns(); /** * Add join query constraints for one of many relationships. * - * @param \Illuminate\Database\Query\JoinClause $join + * @param \Illuminate\Database\Eloquent\JoinClause $join * @return void */ abstract public function addOneOfManyJoinSubQueryConstraints(JoinClause $join); @@ -60,7 +61,7 @@ abstract public function addOneOfManyJoinSubQueryConstraints(JoinClause $join); * Indicate that the relation is a single result of a larger one-to-many relationship. * * @param string|array|null $column - * @param string|\Closure|null $aggregate + * @param string|Closure|null $aggregate * @param string|null $relation * @return $this * @@ -136,6 +137,7 @@ public function ofMany($column = 'id', $aggregate = 'MAX', $relation = null) * Indicate that the relation is the latest single result of a larger one-to-many relationship. * * @param string|array|null $column + * @param string|Closure|null $aggregate * @param string|null $relation * @return $this */ @@ -150,6 +152,7 @@ public function latestOfMany($column = 'id', $relation = null) * Indicate that the relation is the oldest single result of a larger one-to-many relationship. * * @param string|array|null $column + * @param string|Closure|null $aggregate * @param string|null $relation * @return $this */ @@ -224,7 +227,7 @@ protected function addOneOfManyJoinSubQuery(Builder $parent, Builder $subQuery, /** * Merge the relationship query joins to the given query builder. * - * @param \Illuminate\Database\Eloquent\Builder $query + * @param \Illuminate\Database\Eloquent\Builder $builder * @return void */ protected function mergeOneOfManyJoinsTo(Builder $query) @@ -275,7 +278,7 @@ public function qualifySubSelectColumn($column) */ protected function qualifyRelatedColumn($column) { - return str_contains($column, '.') ? $column : $this->query->getModel()->getTable().'.'.$column; + return Str::contains($column, '.') ? $column : $this->query->getModel()->getTable().'.'.$column; } /** diff --git a/core/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php b/core/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php index 342a562813..7a1cbfaedb 100644 --- a/core/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php @@ -207,7 +207,7 @@ public function updateExistingPivot($id, array $attributes, $touch = true) return $this->updateExistingPivotUsingCustomClass($id, $attributes, $touch); } - if ($this->hasPivotColumn($this->updatedAt())) { + if (in_array($this->updatedAt(), $this->pivotColumns)) { $attributes = $this->addTimestampsToAttachment($attributes, true); } @@ -669,11 +669,18 @@ protected function castAttributes($attributes) */ protected function getTypeSwapValue($type, $value) { - return match (strtolower($type)) { - 'int', 'integer' => (int) $value, - 'real', 'float', 'double' => (float) $value, - 'string' => (string) $value, - default => $value, - }; + switch (strtolower($type)) { + case 'int': + case 'integer': + return (int) $value; + case 'real': + case 'float': + case 'double': + return (float) $value; + case 'string': + return (string) $value; + default: + return $value; + } } } diff --git a/core/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php b/core/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php index 7af84b7b90..2074816798 100644 --- a/core/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php @@ -2,7 +2,6 @@ namespace Illuminate\Database\Eloquent\Relations; -use Closure; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; @@ -302,28 +301,6 @@ public function firstOrFail($columns = ['*']) throw (new ModelNotFoundException)->setModel(get_class($this->related)); } - /** - * Execute the query and get the first result or call a callback. - * - * @param \Closure|array $columns - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Model|static|mixed - */ - public function firstOr($columns = ['*'], Closure $callback = null) - { - if ($columns instanceof Closure) { - $callback = $columns; - - $columns = ['*']; - } - - if (! is_null($model = $this->first($columns))) { - return $model; - } - - return $callback(); - } - /** * Find a related model by its primary key. * diff --git a/core/vendor/illuminate/database/Eloquent/Relations/HasOne.php b/core/vendor/illuminate/database/Eloquent/Relations/HasOne.php index ed85f1e910..15c735c328 100755 --- a/core/vendor/illuminate/database/Eloquent/Relations/HasOne.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/HasOne.php @@ -103,7 +103,7 @@ public function getOneOfManySubQuerySelectColumns() /** * Add join query constraints for one of many relationships. * - * @param \Illuminate\Database\Query\JoinClause $join + * @param \Illuminate\Database\Eloquent\JoinClause $join * @return void */ public function addOneOfManyJoinSubQueryConstraints(JoinClause $join) diff --git a/core/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php b/core/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php index 4de065152d..1c7ff591cd 100755 --- a/core/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php @@ -267,19 +267,6 @@ public function save(Model $model) return $model->save() ? $model : false; } - /** - * Attach a model instance without raising any events to the parent model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Database\Eloquent\Model|false - */ - public function saveQuietly(Model $model) - { - return Model::withoutEvents(function () use ($model) { - return $this->save($model); - }); - } - /** * Attach a collection of models to the parent instance. * diff --git a/core/vendor/illuminate/database/Eloquent/Relations/MorphOne.php b/core/vendor/illuminate/database/Eloquent/Relations/MorphOne.php index fc8f4dc8ca..ff526842ec 100755 --- a/core/vendor/illuminate/database/Eloquent/Relations/MorphOne.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/MorphOne.php @@ -101,7 +101,7 @@ public function getOneOfManySubQuerySelectColumns() /** * Add join query constraints for one of many relationships. * - * @param \Illuminate\Database\Query\JoinClause $join + * @param \Illuminate\Database\Eloquent\JoinClause $join * @return void */ public function addOneOfManyJoinSubQueryConstraints(JoinClause $join) diff --git a/core/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php b/core/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php index 5ca8b48bed..7fbe484aac 100644 --- a/core/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php @@ -2,6 +2,8 @@ namespace Illuminate\Database\Eloquent\Relations; +use Illuminate\Support\Str; + class MorphPivot extends Pivot { /** @@ -139,7 +141,7 @@ public function newQueryForRestoration($ids) return $this->newQueryForCollectionRestoration($ids); } - if (! str_contains($ids, ':')) { + if (! Str::contains($ids, ':')) { return parent::newQueryForRestoration($ids); } @@ -161,7 +163,7 @@ protected function newQueryForCollectionRestoration(array $ids) { $ids = array_values($ids); - if (! str_contains($ids[0], ':')) { + if (! Str::contains($ids[0], ':')) { return parent::newQueryForRestoration($ids); } diff --git a/core/vendor/illuminate/database/Eloquent/Relations/Relation.php b/core/vendor/illuminate/database/Eloquent/Relations/Relation.php index 90356abaf8..aa8ce5a07d 100755 --- a/core/vendor/illuminate/database/Eloquent/Relations/Relation.php +++ b/core/vendor/illuminate/database/Eloquent/Relations/Relation.php @@ -3,7 +3,6 @@ namespace Illuminate\Database\Eloquent\Relations; use Closure; -use Illuminate\Contracts\Database\Eloquent\Builder as BuilderContract; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; @@ -14,10 +13,13 @@ use Illuminate\Support\Traits\ForwardsCalls; use Illuminate\Support\Traits\Macroable; -abstract class Relation implements BuilderContract +/** + * @mixin \Illuminate\Database\Eloquent\Builder + */ +abstract class Relation { use ForwardsCalls, Macroable { - Macroable::__call as macroCall; + __call as macroCall; } /** @@ -299,21 +301,9 @@ public function getQuery() /** * Get the base query builder driving the Eloquent builder. * - * @deprecated Use toBase() instead - * * @return \Illuminate\Database\Query\Builder */ public function getBaseQuery() - { - return $this->toBase(); - } - - /** - * Get a base query builder instance. - * - * @return \Illuminate\Database\Query\Builder - */ - public function toBase() { return $this->query->getQuery(); } diff --git a/core/vendor/illuminate/database/Grammar.php b/core/vendor/illuminate/database/Grammar.php index 697f3253cc..52e3d63575 100755 --- a/core/vendor/illuminate/database/Grammar.php +++ b/core/vendor/illuminate/database/Grammar.php @@ -4,7 +4,6 @@ use Illuminate\Database\Query\Expression; use Illuminate\Support\Traits\Macroable; -use RuntimeException; abstract class Grammar { @@ -63,13 +62,6 @@ public function wrap($value, $prefixAlias = false) return $this->wrapAliasedValue($value, $prefixAlias); } - // If the given value is a JSON selector we will wrap it differently than a - // traditional value. We will need to split this path and wrap each part - // wrapped, etc. Otherwise, we will simply wrap the value as a string. - if ($this->isJsonSelector($value)) { - return $this->wrapJsonSelector($value); - } - return $this->wrapSegments(explode('.', $value)); } @@ -124,30 +116,6 @@ protected function wrapValue($value) return $value; } - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - * - * @throws \RuntimeException - */ - protected function wrapJsonSelector($value) - { - throw new RuntimeException('This database engine does not support JSON operations.'); - } - - /** - * Determine if the given string is a JSON selector. - * - * @param string $value - * @return bool - */ - protected function isJsonSelector($value) - { - return str_contains($value, '->'); - } - /** * Convert an array of column names into a delimited string. * diff --git a/core/vendor/illuminate/database/MigrationServiceProvider.php b/core/vendor/illuminate/database/MigrationServiceProvider.php index d61f442324..9ae7685773 100755 --- a/core/vendor/illuminate/database/MigrationServiceProvider.php +++ b/core/vendor/illuminate/database/MigrationServiceProvider.php @@ -25,14 +25,14 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv * @var array */ protected $commands = [ - 'Migrate' => MigrateCommand::class, - 'MigrateFresh' => FreshCommand::class, - 'MigrateInstall' => InstallCommand::class, - 'MigrateRefresh' => RefreshCommand::class, - 'MigrateReset' => ResetCommand::class, - 'MigrateRollback' => RollbackCommand::class, - 'MigrateStatus' => StatusCommand::class, - 'MigrateMake' => MigrateMakeCommand::class, + 'Migrate' => 'command.migrate', + 'MigrateFresh' => 'command.migrate.fresh', + 'MigrateInstall' => 'command.migrate.install', + 'MigrateRefresh' => 'command.migrate.refresh', + 'MigrateReset' => 'command.migrate.reset', + 'MigrateRollback' => 'command.migrate.rollback', + 'MigrateStatus' => 'command.migrate.status', + 'MigrateMake' => 'command.migrate.make', ]; /** @@ -116,7 +116,7 @@ protected function registerCommands(array $commands) */ protected function registerMigrateCommand() { - $this->app->singleton(MigrateCommand::class, function ($app) { + $this->app->singleton('command.migrate', function ($app) { return new MigrateCommand($app['migrator'], $app[Dispatcher::class]); }); } @@ -128,7 +128,9 @@ protected function registerMigrateCommand() */ protected function registerMigrateFreshCommand() { - $this->app->singleton(FreshCommand::class); + $this->app->singleton('command.migrate.fresh', function () { + return new FreshCommand; + }); } /** @@ -138,7 +140,7 @@ protected function registerMigrateFreshCommand() */ protected function registerMigrateInstallCommand() { - $this->app->singleton(InstallCommand::class, function ($app) { + $this->app->singleton('command.migrate.install', function ($app) { return new InstallCommand($app['migration.repository']); }); } @@ -150,7 +152,7 @@ protected function registerMigrateInstallCommand() */ protected function registerMigrateMakeCommand() { - $this->app->singleton(MigrateMakeCommand::class, function ($app) { + $this->app->singleton('command.migrate.make', function ($app) { // Once we have the migration creator registered, we will create the command // and inject the creator. The creator is responsible for the actual file // creation of the migrations, and may be extended by these developers. @@ -169,7 +171,9 @@ protected function registerMigrateMakeCommand() */ protected function registerMigrateRefreshCommand() { - $this->app->singleton(RefreshCommand::class); + $this->app->singleton('command.migrate.refresh', function () { + return new RefreshCommand; + }); } /** @@ -179,7 +183,7 @@ protected function registerMigrateRefreshCommand() */ protected function registerMigrateResetCommand() { - $this->app->singleton(ResetCommand::class, function ($app) { + $this->app->singleton('command.migrate.reset', function ($app) { return new ResetCommand($app['migrator']); }); } @@ -191,7 +195,7 @@ protected function registerMigrateResetCommand() */ protected function registerMigrateRollbackCommand() { - $this->app->singleton(RollbackCommand::class, function ($app) { + $this->app->singleton('command.migrate.rollback', function ($app) { return new RollbackCommand($app['migrator']); }); } @@ -203,7 +207,7 @@ protected function registerMigrateRollbackCommand() */ protected function registerMigrateStatusCommand() { - $this->app->singleton(StatusCommand::class, function ($app) { + $this->app->singleton('command.migrate.status', function ($app) { return new StatusCommand($app['migrator']); }); } diff --git a/core/vendor/illuminate/database/Migrations/MigrationCreator.php b/core/vendor/illuminate/database/Migrations/MigrationCreator.php index d8f1ce9d0b..a79039a7a2 100755 --- a/core/vendor/illuminate/database/Migrations/MigrationCreator.php +++ b/core/vendor/illuminate/database/Migrations/MigrationCreator.php @@ -68,13 +68,13 @@ public function create($name, $path, $table = null, $create = false) $this->files->ensureDirectoryExists(dirname($path)); $this->files->put( - $path, $this->populateStub($stub, $table) + $path, $this->populateStub($name, $stub, $table) ); // Next, we will fire any hooks that are supposed to fire after a migration is // created. Once that is done we'll be ready to return the full path to the // migration file so it can be used however it's needed by the developer. - $this->firePostCreateHooks($table, $path); + $this->firePostCreateHooks($table); return $path; } @@ -132,12 +132,18 @@ protected function getStub($table, $create) /** * Populate the place-holders in the migration stub. * + * @param string $name * @param string $stub * @param string|null $table * @return string */ - protected function populateStub($stub, $table) + protected function populateStub($name, $stub, $table) { + $stub = str_replace( + ['DummyClass', '{{ class }}', '{{class}}'], + $this->getClassName($name), $stub + ); + // Here we will replace the table place-holders with the table specified by // the developer, which is useful for quickly creating a tables creation // or update migration from the console instead of typing it manually. @@ -178,13 +184,12 @@ protected function getPath($name, $path) * Fire the registered post create hooks. * * @param string|null $table - * @param string $path * @return void */ - protected function firePostCreateHooks($table, $path) + protected function firePostCreateHooks($table) { foreach ($this->postCreate as $callback) { - $callback($table, $path); + $callback($table); } } diff --git a/core/vendor/illuminate/database/Migrations/Migrator.php b/core/vendor/illuminate/database/Migrations/Migrator.php index dbbaf80591..770ed87039 100755 --- a/core/vendor/illuminate/database/Migrations/Migrator.php +++ b/core/vendor/illuminate/database/Migrations/Migrator.php @@ -506,7 +506,7 @@ protected function getMigrationClass(string $migrationName): string public function getMigrationFiles($paths) { return Collection::make($paths)->flatMap(function ($path) { - return str_ends_with($path, '.php') ? [$path] : $this->files->glob($path.'/*_*.php'); + return Str::endsWith($path, '.php') ? [$path] : $this->files->glob($path.'/*_*.php'); })->filter()->values()->keyBy(function ($file) { return $this->getMigrationName($file); })->sortBy(function ($file, $key) { diff --git a/core/vendor/illuminate/database/Migrations/stubs/migration.create.stub b/core/vendor/illuminate/database/Migrations/stubs/migration.create.stub index 0e0ec22b85..f4a56a0774 100755 --- a/core/vendor/illuminate/database/Migrations/stubs/migration.create.stub +++ b/core/vendor/illuminate/database/Migrations/stubs/migration.create.stub @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +class {{ class }} extends Migration { /** * Run the migrations. @@ -28,4 +28,4 @@ return new class extends Migration { Schema::dropIfExists('{{ table }}'); } -}; +} diff --git a/core/vendor/illuminate/database/Migrations/stubs/migration.stub b/core/vendor/illuminate/database/Migrations/stubs/migration.stub index 41dd1c8e6a..fd0e437856 100755 --- a/core/vendor/illuminate/database/Migrations/stubs/migration.stub +++ b/core/vendor/illuminate/database/Migrations/stubs/migration.stub @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +class {{ class }} extends Migration { /** * Run the migrations. @@ -25,4 +25,4 @@ return new class extends Migration { // } -}; +} diff --git a/core/vendor/illuminate/database/Migrations/stubs/migration.update.stub b/core/vendor/illuminate/database/Migrations/stubs/migration.update.stub index d31a2c022b..f1a04ebe54 100755 --- a/core/vendor/illuminate/database/Migrations/stubs/migration.update.stub +++ b/core/vendor/illuminate/database/Migrations/stubs/migration.update.stub @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +class {{ class }} extends Migration { /** * Run the migrations. @@ -29,4 +29,4 @@ return new class extends Migration // }); } -}; +} diff --git a/core/vendor/illuminate/database/MySqlConnection.php b/core/vendor/illuminate/database/MySqlConnection.php index 54e3d473d5..9760358cf5 100755 --- a/core/vendor/illuminate/database/MySqlConnection.php +++ b/core/vendor/illuminate/database/MySqlConnection.php @@ -2,6 +2,8 @@ namespace Illuminate\Database; +use Doctrine\DBAL\Driver\PDOMySql\Driver as DoctrineDriver; +use Doctrine\DBAL\Version; use Illuminate\Database\PDO\MySqlDriver; use Illuminate\Database\Query\Grammars\MySqlGrammar as QueryGrammar; use Illuminate\Database\Query\Processors\MySqlProcessor; @@ -20,7 +22,7 @@ class MySqlConnection extends Connection */ public function isMaria() { - return str_contains($this->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), 'MariaDB'); + return strpos($this->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), 'MariaDB') !== false; } /** @@ -82,10 +84,10 @@ protected function getDefaultPostProcessor() /** * Get the Doctrine DBAL driver. * - * @return \Illuminate\Database\PDO\MySqlDriver + * @return \Doctrine\DBAL\Driver\PDOMySql\Driver|\Illuminate\Database\PDO\MySqlDriver */ protected function getDoctrineDriver() { - return new MySqlDriver; + return class_exists(Version::class) ? new DoctrineDriver : new MySqlDriver; } } diff --git a/core/vendor/illuminate/database/PDO/Concerns/ConnectsToDatabase.php b/core/vendor/illuminate/database/PDO/Concerns/ConnectsToDatabase.php index d2a8d6006d..84c3338013 100644 --- a/core/vendor/illuminate/database/PDO/Concerns/ConnectsToDatabase.php +++ b/core/vendor/illuminate/database/PDO/Concerns/ConnectsToDatabase.php @@ -11,15 +11,12 @@ trait ConnectsToDatabase /** * Create a new database connection. * - * @param mixed[] $params - * @param string|null $username - * @param string|null $password - * @param mixed[] $driverOptions + * @param array $params * @return \Illuminate\Database\PDO\Connection * * @throws \InvalidArgumentException */ - public function connect(array $params, $username = null, $password = null, array $driverOptions = []) + public function connect(array $params) { if (! isset($params['pdo']) || ! $params['pdo'] instanceof PDO) { throw new InvalidArgumentException('Laravel requires the "pdo" property to be set and be a PDO instance.'); diff --git a/core/vendor/illuminate/database/PDO/MySqlDriver.php b/core/vendor/illuminate/database/PDO/MySqlDriver.php index 54ac375361..5f68c6fab5 100644 --- a/core/vendor/illuminate/database/PDO/MySqlDriver.php +++ b/core/vendor/illuminate/database/PDO/MySqlDriver.php @@ -8,12 +8,4 @@ class MySqlDriver extends AbstractMySQLDriver { use ConnectsToDatabase; - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'pdo_mysql'; - } } diff --git a/core/vendor/illuminate/database/PDO/PostgresDriver.php b/core/vendor/illuminate/database/PDO/PostgresDriver.php index 0d9561107c..eb29c969de 100644 --- a/core/vendor/illuminate/database/PDO/PostgresDriver.php +++ b/core/vendor/illuminate/database/PDO/PostgresDriver.php @@ -8,12 +8,4 @@ class PostgresDriver extends AbstractPostgreSQLDriver { use ConnectsToDatabase; - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'pdo_pgsql'; - } } diff --git a/core/vendor/illuminate/database/PDO/SQLiteDriver.php b/core/vendor/illuminate/database/PDO/SQLiteDriver.php index f50da08e7d..2dac06db8b 100644 --- a/core/vendor/illuminate/database/PDO/SQLiteDriver.php +++ b/core/vendor/illuminate/database/PDO/SQLiteDriver.php @@ -8,12 +8,4 @@ class SQLiteDriver extends AbstractSQLiteDriver { use ConnectsToDatabase; - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'pdo_sqlite'; - } } diff --git a/core/vendor/illuminate/database/PDO/SqlServerConnection.php b/core/vendor/illuminate/database/PDO/SqlServerConnection.php index 0f09c3a94f..bbbb8b0b69 100644 --- a/core/vendor/illuminate/database/PDO/SqlServerConnection.php +++ b/core/vendor/illuminate/database/PDO/SqlServerConnection.php @@ -123,7 +123,7 @@ public function quote($value, $type = ParameterType::STRING) $val = $this->connection->quote($value, $type); // Fix for a driver version terminating all values with null byte... - if (\is_string($val) && str_contains($val, "\0")) { + if (\is_string($val) && \strpos($val, "\0") !== false) { $val = \substr($val, 0, -1); } diff --git a/core/vendor/illuminate/database/PDO/SqlServerDriver.php b/core/vendor/illuminate/database/PDO/SqlServerDriver.php index 1b0d9574e7..1373fc49f6 100644 --- a/core/vendor/illuminate/database/PDO/SqlServerDriver.php +++ b/core/vendor/illuminate/database/PDO/SqlServerDriver.php @@ -7,26 +7,12 @@ class SqlServerDriver extends AbstractSQLServerDriver { /** - * Create a new database connection. - * - * @param mixed[] $params - * @param string|null $username - * @param string|null $password - * @param mixed[] $driverOptions - * @return \Illuminate\Database\PDO\SqlServerConnection + * @return \Doctrine\DBAL\Driver\Connection */ - public function connect(array $params, $username = null, $password = null, array $driverOptions = []) + public function connect(array $params) { return new SqlServerConnection( new Connection($params['pdo']) ); } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'pdo_sqlsrv'; - } } diff --git a/core/vendor/illuminate/database/PostgresConnection.php b/core/vendor/illuminate/database/PostgresConnection.php index bc7beb5cd8..5d68d1d665 100755 --- a/core/vendor/illuminate/database/PostgresConnection.php +++ b/core/vendor/illuminate/database/PostgresConnection.php @@ -2,6 +2,8 @@ namespace Illuminate\Database; +use Doctrine\DBAL\Driver\PDOPgSql\Driver as DoctrineDriver; +use Doctrine\DBAL\Version; use Illuminate\Database\PDO\PostgresDriver; use Illuminate\Database\Query\Grammars\PostgresGrammar as QueryGrammar; use Illuminate\Database\Query\Processors\PostgresProcessor; @@ -98,10 +100,10 @@ protected function getDefaultPostProcessor() /** * Get the Doctrine DBAL driver. * - * @return \Illuminate\Database\PDO\PostgresDriver + * @return \Doctrine\DBAL\Driver\PDOPgSql\Driver|\Illuminate\Database\PDO\PostgresDriver */ protected function getDoctrineDriver() { - return new PostgresDriver; + return class_exists(Version::class) ? new DoctrineDriver : new PostgresDriver; } } diff --git a/core/vendor/illuminate/database/Query/Builder.php b/core/vendor/illuminate/database/Query/Builder.php index 4841827259..2d2d96ff76 100755 --- a/core/vendor/illuminate/database/Query/Builder.php +++ b/core/vendor/illuminate/database/Query/Builder.php @@ -3,10 +3,8 @@ namespace Illuminate\Database\Query; use BackedEnum; -use Carbon\CarbonPeriod; use Closure; use DateTimeInterface; -use Illuminate\Contracts\Database\Query\Builder as BuilderContract; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Database\Concerns\BuildsQueries; use Illuminate\Database\Concerns\ExplainsQueries; @@ -26,7 +24,7 @@ use LogicException; use RuntimeException; -class Builder implements BuilderContract +class Builder { use BuildsQueries, ExplainsQueries, ForwardsCalls, Macroable { __call as macroCall; @@ -239,7 +237,6 @@ public function select($columns = ['*']) { $this->columns = []; $this->bindings['select'] = []; - $columns = is_array($columns) ? $columns : func_get_args(); foreach ($columns as $as => $column) { @@ -376,7 +373,7 @@ protected function prependDatabaseNameIfCrossDatabaseQuery($query) $this->getConnection()->getDatabaseName()) { $databaseName = $query->getConnection()->getDatabaseName(); - if (! str_starts_with($query->from, $databaseName) && ! str_contains($query->from, '.')) { + if (strpos($query->from, $databaseName) !== 0 && strpos($query->from, '.') === false) { $query->from($databaseName.'.'.$query->from); } } @@ -412,6 +409,7 @@ public function addSelect($column) /** * Force the query to only return distinct results. * + * @param mixed ...$distinct * @return $this */ public function distinct() @@ -678,8 +676,6 @@ public function mergeWheres($wheres, $bindings) $this->bindings['where'] = array_values( array_merge($this->bindings['where'], (array) $bindings) ); - - return $this; } /** @@ -750,7 +746,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' // If the column is making a JSON reference we'll check to see if the value // is a boolean. If it is, we'll add the raw boolean string as an actual // value to the query to ensure this is properly handled by the query. - if (str_contains($column, '->') && is_bool($value)) { + if (Str::contains($column, '->') && is_bool($value)) { $value = new Expression($value ? 'true' : 'false'); if (is_string($column)) { @@ -1124,19 +1120,15 @@ public function whereNotNull($columns, $boolean = 'and') * Add a where between statement to the query. * * @param string|\Illuminate\Database\Query\Expression $column - * @param iterable $values + * @param array $values * @param string $boolean * @param bool $not * @return $this */ - public function whereBetween($column, iterable $values, $boolean = 'and', $not = false) + public function whereBetween($column, array $values, $boolean = 'and', $not = false) { $type = 'between'; - if ($values instanceof CarbonPeriod) { - $values = $values->toArray(); - } - $this->wheres[] = compact('type', 'column', 'values', 'boolean', 'not'); $this->addBinding(array_slice($this->cleanBindings(Arr::flatten($values)), 0, 2), 'where'); @@ -1166,10 +1158,10 @@ public function whereBetweenColumns($column, array $values, $boolean = 'and', $n * Add an or where between statement to the query. * * @param string $column - * @param iterable $values + * @param array $values * @return $this */ - public function orWhereBetween($column, iterable $values) + public function orWhereBetween($column, array $values) { return $this->whereBetween($column, $values, 'or'); } @@ -1190,11 +1182,11 @@ public function orWhereBetweenColumns($column, array $values) * Add a where not between statement to the query. * * @param string $column - * @param iterable $values + * @param array $values * @param string $boolean * @return $this */ - public function whereNotBetween($column, iterable $values, $boolean = 'and') + public function whereNotBetween($column, array $values, $boolean = 'and') { return $this->whereBetween($column, $values, $boolean, true); } @@ -1216,10 +1208,10 @@ public function whereNotBetweenColumns($column, array $values, $boolean = 'and') * Add an or where not between statement to the query. * * @param string $column - * @param iterable $values + * @param array $values * @return $this */ - public function orWhereNotBetween($column, iterable $values) + public function orWhereNotBetween($column, array $values) { return $this->whereNotBetween($column, $values, 'or'); } @@ -1250,7 +1242,7 @@ public function orWhereNotNull($column) /** * Add a "where date" statement to the query. * - * @param string $column + * @param \Illuminate\Database\Query\Expression|string $column * @param string $operator * @param \DateTimeInterface|string|null $value * @param string $boolean @@ -1490,7 +1482,7 @@ protected function addDateBasedWhere($type, $column, $operator, $value, $boolean */ public function whereNested(Closure $callback, $boolean = 'and') { - $callback($query = $this->forNestedWhere()); + call_user_func($callback, $query = $this->forNestedWhere()); return $this->addNestedWhereQuery($query, $boolean); } @@ -1541,7 +1533,7 @@ protected function whereSub($column, $operator, Closure $callback, $boolean) // Once we have the query instance we can simply execute it so it can add all // of the sub-select's conditions to itself, and then we can cache it off // in the array of where clauses for the "main" parent query instance. - $callback($query = $this->forSubQuery()); + call_user_func($callback, $query = $this->forSubQuery()); $this->wheres[] = compact( 'type', 'column', 'operator', 'query', 'boolean' @@ -1567,7 +1559,7 @@ public function whereExists(Closure $callback, $boolean = 'and', $not = false) // Similar to the sub-select clause, we will create a new query instance so // the developer may cleanly specify the entire exists query and we will // compile the whole thing in the grammar and insert it into the SQL. - $callback($query); + call_user_func($callback, $query); return $this->addWhereExistsQuery($query, $boolean, $not); } @@ -1899,7 +1891,7 @@ public function groupByRaw($sql, array $bindings = []) /** * Add a "having" clause to the query. * - * @param \Closure|string $column + * @param string $column * @param string|null $operator * @param string|null $value * @param string $boolean @@ -1916,10 +1908,6 @@ public function having($column, $operator = null, $value = null, $boolean = 'and $value, $operator, func_num_args() === 2 ); - if ($column instanceof Closure && is_null($operator)) { - return $this->havingNested($column, $boolean); - } - // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. @@ -1939,7 +1927,7 @@ public function having($column, $operator = null, $value = null, $boolean = 'and /** * Add an "or having" clause to the query. * - * @param \Closure|string $column + * @param string $column * @param string|null $operator * @param string|null $value * @return $this @@ -1953,93 +1941,6 @@ public function orHaving($column, $operator = null, $value = null) return $this->having($column, $operator, $value, 'or'); } - /** - * Add a nested having statement to the query. - * - * @param \Closure $callback - * @param string $boolean - * @return $this - */ - public function havingNested(Closure $callback, $boolean = 'and') - { - $callback($query = $this->forNestedWhere()); - - return $this->addNestedHavingQuery($query, $boolean); - } - - /** - * Add another query builder as a nested having to the query builder. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $boolean - * @return $this - */ - public function addNestedHavingQuery($query, $boolean = 'and') - { - if (count($query->havings)) { - $type = 'Nested'; - - $this->havings[] = compact('type', 'query', 'boolean'); - - $this->addBinding($query->getRawBindings()['having'], 'having'); - } - - return $this; - } - - /** - * Add a "having null" clause to the query. - * - * @param string|array $columns - * @param string $boolean - * @param bool $not - * @return $this - */ - public function havingNull($columns, $boolean = 'and', $not = false) - { - $type = $not ? 'NotNull' : 'Null'; - - foreach (Arr::wrap($columns) as $column) { - $this->havings[] = compact('type', 'column', 'boolean'); - } - - return $this; - } - - /** - * Add an "or having null" clause to the query. - * - * @param string $column - * @return $this - */ - public function orHavingNull($column) - { - return $this->havingNull($column, 'or'); - } - - /** - * Add a "having not null" clause to the query. - * - * @param string|array $columns - * @param string $boolean - * @return $this - */ - public function havingNotNull($columns, $boolean = 'and') - { - return $this->havingNull($columns, $boolean, true); - } - - /** - * Add an "or having not null" clause to the query. - * - * @param string $column - * @return $this - */ - public function orHavingNotNull($column) - { - return $this->havingNotNull($column, 'or'); - } - /** * Add a "having between " clause to the query. * @@ -2094,7 +1995,7 @@ public function orHavingRaw($sql, array $bindings = []) /** * Add an "order by" clause to the query. * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column * @param string $direction * @return $this * @@ -2127,7 +2028,7 @@ public function orderBy($column, $direction = 'asc') /** * Add a descending "order by" clause to the query. * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column * @return $this */ public function orderByDesc($column) @@ -2138,7 +2039,7 @@ public function orderByDesc($column) /** * Add an "order by" clause for a timestamp to the query. * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column * @return $this */ public function latest($column = 'created_at') @@ -2149,7 +2050,7 @@ public function latest($column = 'created_at') /** * Add an "order by" clause for a timestamp to the query. * - * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column + * @param \Closure|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column * @return $this */ public function oldest($column = 'created_at') @@ -2338,7 +2239,7 @@ protected function removeExistingOrdersFor($column) public function union($query, $all = false) { if ($query instanceof Closure) { - $query($query = $this->newQuery()); + call_user_func($query, $query = $this->newQuery()); } $this->unions[] = compact('query', 'all'); @@ -2726,7 +2627,7 @@ protected function stripTableForPluck($column) return $column; } - $separator = str_contains(strtolower($column), ' as ') ? ' as ' : '\.'; + $separator = strpos(strtolower($column), ' as ') !== false ? ' as ' : '\.'; return last(preg_split('~'.$separator.'~i', $column)); } @@ -2962,7 +2863,7 @@ public function numericAggregate($function, $columns = ['*']) // If the result doesn't contain a decimal place, we will assume it is an int then // cast it to one. When it does we will cast it to a float since it needs to be // cast to the expected data type for the developers out of pure convenience. - return ! str_contains((string) $result, '.') + return strpos((string) $result, '.') === false ? (int) $result : (float) $result; } @@ -3499,7 +3400,7 @@ public function getGrammar() } /** - * Use the "write" PDO connection when executing the query. + * Use the write pdo for query. * * @return $this */ @@ -3601,7 +3502,7 @@ public function __call($method, $parameters) return $this->macroCall($method, $parameters); } - if (str_starts_with($method, 'where')) { + if (Str::startsWith($method, 'where')) { return $this->dynamicWhere($method, $parameters); } diff --git a/core/vendor/illuminate/database/Query/Grammars/Grammar.php b/core/vendor/illuminate/database/Query/Grammars/Grammar.php index e3ee52a281..77472f088e 100755 --- a/core/vendor/illuminate/database/Query/Grammars/Grammar.php +++ b/core/vendor/illuminate/database/Query/Grammars/Grammar.php @@ -358,9 +358,9 @@ protected function whereBetween(Builder $query, $where) { $between = $where['not'] ? 'not between' : 'between'; - $min = $this->parameter(is_array($where['values']) ? reset($where['values']) : $where['values'][0]); + $min = $this->parameter(reset($where['values'])); - $max = $this->parameter(is_array($where['values']) ? end($where['values']) : $where['values'][1]); + $max = $this->parameter(end($where['values'])); return $this->wrap($where['column']).' '.$between.' '.$min.' and '.$max; } @@ -376,9 +376,9 @@ protected function whereBetweenColumns(Builder $query, $where) { $between = $where['not'] ? 'not between' : 'between'; - $min = $this->wrap(is_array($where['values']) ? reset($where['values']) : $where['values'][0]); + $min = $this->wrap(reset($where['values'])); - $max = $this->wrap(is_array($where['values']) ? end($where['values']) : $where['values'][1]); + $max = $this->wrap(end($where['values'])); return $this->wrap($where['column']).' '.$between.' '.$min.' and '.$max; } @@ -660,13 +660,14 @@ protected function compileGroups(Builder $query, $groups) * Compile the "having" portions of the query. * * @param \Illuminate\Database\Query\Builder $query + * @param array $havings * @return string */ - protected function compileHavings(Builder $query) + protected function compileHavings(Builder $query, $havings) { - return 'having '.$this->removeLeadingBoolean(collect($query->havings)->map(function ($having) { - return $having['boolean'].' '.$this->compileHaving($having); - })->implode(' ')); + $sql = implode(' ', array_map([$this, 'compileHaving'], $havings)); + + return 'having '.$this->removeLeadingBoolean($sql); } /** @@ -681,17 +682,9 @@ protected function compileHaving(array $having) // without doing any more processing on it. Otherwise, we will compile the // clause into SQL based on the components that make it up from builder. if ($having['type'] === 'Raw') { - return $having['sql']; + return $having['boolean'].' '.$having['sql']; } elseif ($having['type'] === 'between') { return $this->compileHavingBetween($having); - } elseif ($having['type'] === 'Null') { - return $this->compileHavingNull($having); - } elseif ($having['type'] === 'NotNull') { - return $this->compileHavingNotNull($having); - } elseif ($having['type'] === 'bit') { - return $this->compileHavingBit($having); - } elseif ($having['type'] === 'Nested') { - return $this->compileNestedHavings($having); } return $this->compileBasicHaving($having); @@ -709,7 +702,7 @@ protected function compileBasicHaving($having) $parameter = $this->parameter($having['value']); - return $column.' '.$having['operator'].' '.$parameter; + return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter; } /** @@ -728,59 +721,7 @@ protected function compileHavingBetween($having) $max = $this->parameter(last($having['values'])); - return $column.' '.$between.' '.$min.' and '.$max; - } - - /** - * Compile a having null clause. - * - * @param array $having - * @return string - */ - protected function compileHavingNull($having) - { - $column = $this->wrap($having['column']); - - return $column.' is null'; - } - - /** - * Compile a having not null clause. - * - * @param array $having - * @return string - */ - protected function compileHavingNotNull($having) - { - $column = $this->wrap($having['column']); - - return $column.' is not null'; - } - - /** - * Compile a having clause involving a bit operator. - * - * @param array $having - * @return string - */ - protected function compileHavingBit($having) - { - $column = $this->wrap($having['column']); - - $parameter = $this->parameter($having['value']); - - return '('.$column.' '.$having['operator'].' '.$parameter.') != 0'; - } - - /** - * Compile a nested having clause. - * - * @param array $having - * @return string - */ - protected function compileNestedHavings($having) - { - return '('.substr($this->compileHavings($having['query']), 7).')'; + return $having['boolean'].' '.$column.' '.$between.' '.$min.' and '.$max; } /** @@ -1218,6 +1159,49 @@ public function compileSavepointRollBack($name) return 'ROLLBACK TO SAVEPOINT '.$name; } + /** + * Wrap a value in keyword identifiers. + * + * @param \Illuminate\Database\Query\Expression|string $value + * @param bool $prefixAlias + * @return string + */ + public function wrap($value, $prefixAlias = false) + { + if ($this->isExpression($value)) { + return $this->getValue($value); + } + + // If the value being wrapped has a column alias we will need to separate out + // the pieces so we can wrap each of the segments of the expression on its + // own, and then join these both back together using the "as" connector. + if (stripos($value, ' as ') !== false) { + return $this->wrapAliasedValue($value, $prefixAlias); + } + + // If the given value is a JSON selector we will wrap it differently than a + // traditional value. We will need to split this path and wrap each part + // wrapped, etc. Otherwise, we will simply wrap the value as a string. + if ($this->isJsonSelector($value)) { + return $this->wrapJsonSelector($value); + } + + return $this->wrapSegments(explode('.', $value)); + } + + /** + * Wrap the given JSON selector. + * + * @param string $value + * @return string + * + * @throws \RuntimeException + */ + protected function wrapJsonSelector($value) + { + throw new RuntimeException('This database engine does not support JSON operations.'); + } + /** * Wrap the given JSON selector for boolean values. * @@ -1268,34 +1252,18 @@ protected function wrapJsonPath($value, $delimiter = '->') { $value = preg_replace("/([\\\\]+)?\\'/", "''", $value); - $jsonPath = collect(explode($delimiter, $value)) - ->map(function ($segment) { - return $this->wrapJsonPathSegment($segment); - }) - ->join('.'); - - return "'$".(str_starts_with($jsonPath, '[') ? '' : '.').$jsonPath."'"; + return '\'$."'.str_replace($delimiter, '"."', $value).'"\''; } /** - * Wrap the given JSON path segment. + * Determine if the given string is a JSON selector. * - * @param string $segment - * @return string + * @param string $value + * @return bool */ - protected function wrapJsonPathSegment($segment) + protected function isJsonSelector($value) { - if (preg_match('/(\[[^\]]+\])+$/', $segment, $parts)) { - $key = Str::beforeLast($segment, $parts[0]); - - if (! empty($key)) { - return '"'.$key.'"'.$parts[0]; - } - - return $parts[0]; - } - - return '"'.$segment.'"'; + return Str::contains($value, '->'); } /** diff --git a/core/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php b/core/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php index 7c4ef0751f..47f498e547 100755 --- a/core/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php +++ b/core/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php @@ -4,6 +4,7 @@ use Illuminate\Database\Query\Builder; use Illuminate\Support\Arr; +use Illuminate\Support\Str; class PostgresGrammar extends Grammar { @@ -21,16 +22,7 @@ class PostgresGrammar extends Grammar ]; /** - * The grammar specific bit operators. - * - * @var array - */ - protected $bitOperators = [ - '~', '&', '|', '#', '<<', '>>', '<<=', '>>=', - ]; - - /** - * Compile a basic where clause. + * {@inheritdoc} * * @param \Illuminate\Database\Query\Builder $query * @param array $where @@ -38,7 +30,7 @@ class PostgresGrammar extends Grammar */ protected function whereBasic(Builder $query, $where) { - if (str_contains(strtolower($where['operator']), 'like')) { + if (Str::contains(strtolower($where['operator']), 'like')) { return sprintf( '%s::text %s %s', $this->wrap($where['column']), @@ -211,7 +203,7 @@ protected function compileJsonLength($column, $operator, $value) { $column = str_replace('->>', '->', $this->wrap($column)); - return 'jsonb_array_length(('.$column.')::jsonb) '.$operator.' '.$value; + return 'json_array_length(('.$column.')::json) '.$operator.' '.$value; } /** diff --git a/core/vendor/illuminate/database/SQLiteConnection.php b/core/vendor/illuminate/database/SQLiteConnection.php index 59b5edb210..38116877c3 100755 --- a/core/vendor/illuminate/database/SQLiteConnection.php +++ b/core/vendor/illuminate/database/SQLiteConnection.php @@ -2,6 +2,8 @@ namespace Illuminate\Database; +use Doctrine\DBAL\Driver\PDOSqlite\Driver as DoctrineDriver; +use Doctrine\DBAL\Version; use Illuminate\Database\PDO\SQLiteDriver; use Illuminate\Database\Query\Grammars\SQLiteGrammar as QueryGrammar; use Illuminate\Database\Query\Processors\SQLiteProcessor; @@ -96,11 +98,11 @@ protected function getDefaultPostProcessor() /** * Get the Doctrine DBAL driver. * - * @return \Illuminate\Database\PDO\SQLiteDriver + * @return \Doctrine\DBAL\Driver\PDOSqlite\Driver|\Illuminate\Database\PDO\SQLiteDriver */ protected function getDoctrineDriver() { - return new SQLiteDriver; + return class_exists(Version::class) ? new DoctrineDriver : new SQLiteDriver; } /** diff --git a/core/vendor/illuminate/database/Schema/Blueprint.php b/core/vendor/illuminate/database/Schema/Blueprint.php index 7d1f0594cd..dfe53ee792 100755 --- a/core/vendor/illuminate/database/Schema/Blueprint.php +++ b/core/vendor/illuminate/database/Schema/Blueprint.php @@ -413,38 +413,6 @@ public function dropConstrainedForeignId($column) return $this->dropColumn($column); } - /** - * Indicate that the given foreign key should be dropped. - * - * @param \Illuminate\Database\Eloquent\Model|string $model - * @param string|null $column - * @return \Illuminate\Support\Fluent - */ - public function dropForeignIdFor($model, $column = null) - { - if (is_string($model)) { - $model = new $model; - } - - return $this->dropForeign([$column ?: $model->getForeignKey()]); - } - - /** - * Indicate that the given foreign key should be dropped. - * - * @param \Illuminate\Database\Eloquent\Model|string $model - * @param string|null $column - * @return \Illuminate\Support\Fluent - */ - public function dropConstrainedForeignIdFor($model, $column = null) - { - if (is_string($model)) { - $model = new $model; - } - - return $this->dropConstrainedForeignId($column ?: $model->getForeignKey()); - } - /** * Indicate that the given indexes should be renamed. * @@ -714,7 +682,7 @@ public function bigIncrements($column) */ public function char($column, $length = null) { - $length = ! is_null($length) ? $length : Builder::$defaultStringLength; + $length = $length ?: Builder::$defaultStringLength; return $this->addColumn('char', $column, compact('length')); } @@ -1248,7 +1216,7 @@ public function binary($column) * @param string $column * @return \Illuminate\Database\Schema\ColumnDefinition */ - public function uuid($column = 'uuid') + public function uuid($column) { return $this->addColumn('uuid', $column); } @@ -1273,7 +1241,7 @@ public function foreignUuid($column) * @param string $column * @return \Illuminate\Database\Schema\ColumnDefinition */ - public function ipAddress($column = 'ip_address') + public function ipAddress($column) { return $this->addColumn('ipAddress', $column); } @@ -1284,7 +1252,7 @@ public function ipAddress($column = 'ip_address') * @param string $column * @return \Illuminate\Database\Schema\ColumnDefinition */ - public function macAddress($column = 'mac_address') + public function macAddress($column) { return $this->addColumn('macAddress', $column); } diff --git a/core/vendor/illuminate/database/Schema/Builder.php b/core/vendor/illuminate/database/Schema/Builder.php index dd4290aa3f..40f78880b8 100755 --- a/core/vendor/illuminate/database/Schema/Builder.php +++ b/core/vendor/illuminate/database/Schema/Builder.php @@ -384,6 +384,19 @@ protected function createBlueprint($table, Closure $callback = null) return Container::getInstance()->make(Blueprint::class, compact('table', 'callback', 'prefix')); } + /** + * Register a custom Doctrine mapping type. + * + * @param string $class + * @param string $name + * @param string $type + * @return void + */ + public function registerCustomDoctrineType($class, $name, $type) + { + $this->connection->registerDoctrineType($class, $name, $type); + } + /** * Get the database connection instance. * diff --git a/core/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php b/core/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php index aa50bfff67..260935f8a7 100644 --- a/core/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php +++ b/core/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php @@ -145,14 +145,26 @@ protected static function getDoctrineColumnType($type) { $type = strtolower($type); - return Type::getType(match ($type) { - 'biginteger' => 'bigint', - 'smallinteger' => 'smallint', - 'mediumtext', 'longtext' => 'text', - 'binary' => 'blob', - 'uuid' => 'guid', - default => $type, - }); + switch ($type) { + case 'biginteger': + $type = 'bigint'; + break; + case 'smallinteger': + $type = 'smallint'; + break; + case 'mediumtext': + case 'longtext': + $type = 'text'; + break; + case 'binary': + $type = 'blob'; + break; + case 'uuid': + $type = 'guid'; + break; + } + + return Type::getType($type); } /** @@ -163,11 +175,14 @@ protected static function getDoctrineColumnType($type) */ protected static function calculateDoctrineTextLength($type) { - return match ($type) { - 'mediumText' => 65535 + 1, - 'longText' => 16777215 + 1, - default => 255 + 1, - }; + switch ($type) { + case 'mediumText': + return 65535 + 1; + case 'longText': + return 16777215 + 1; + default: + return 255 + 1; + } } /** @@ -204,13 +219,19 @@ protected static function doesntNeedCharacterOptions($type) */ protected static function mapFluentOptionToDoctrine($attribute) { - return match ($attribute) { - 'type', 'name' => null, - 'nullable' => 'notnull', - 'total' => 'precision', - 'places' => 'scale', - default => $attribute, - }; + switch ($attribute) { + case 'type': + case 'name': + return; + case 'nullable': + return 'notnull'; + case 'total': + return 'precision'; + case 'places': + return 'scale'; + default: + return $attribute; + } } /** diff --git a/core/vendor/illuminate/database/Schema/Grammars/Grammar.php b/core/vendor/illuminate/database/Schema/Grammars/Grammar.php index 7ed7eb22c7..7313576b4f 100755 --- a/core/vendor/illuminate/database/Schema/Grammars/Grammar.php +++ b/core/vendor/illuminate/database/Schema/Grammars/Grammar.php @@ -271,37 +271,6 @@ public function wrapTable($table) ); } - /** - * Split the given JSON selector into the field and the optional path and wrap them separately. - * - * @param string $column - * @return array - */ - protected function wrapJsonFieldAndPath($column) - { - $parts = explode('->', $column, 2); - - $field = $this->wrap($parts[0]); - - $path = count($parts) > 1 ? ', '.$this->wrapJsonPath($parts[1], '->') : ''; - - return [$field, $path]; - } - - /** - * Wrap the given JSON path. - * - * @param string $value - * @param string $delimiter - * @return string - */ - protected function wrapJsonPath($value, $delimiter = '->') - { - $value = preg_replace("/([\\\\]+)?\\'/", "''", $value); - - return '\'$."'.str_replace($delimiter, '"."', $value).'"\''; - } - /** * Wrap a value in keyword identifiers. * diff --git a/core/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php b/core/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php index 04280d5637..1f64cf31e1 100755 --- a/core/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php +++ b/core/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php @@ -959,16 +959,8 @@ protected function typeComputed(Fluent $column) */ protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) { - if (! is_null($virtualAs = $column->virtualAsJson)) { - if ($this->isJsonSelector($virtualAs)) { - $virtualAs = $this->wrapJsonSelector($virtualAs); - } - - return " as ({$virtualAs})"; - } - - if (! is_null($virtualAs = $column->virtualAs)) { - return " as ({$virtualAs})"; + if (! is_null($column->virtualAs)) { + return " as ({$column->virtualAs})"; } } @@ -981,16 +973,8 @@ protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) */ protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) { - if (! is_null($storedAs = $column->storedAsJson)) { - if ($this->isJsonSelector($storedAs)) { - $storedAs = $this->wrapJsonSelector($storedAs); - } - - return " as ({$storedAs}) stored"; - } - - if (! is_null($storedAs = $column->storedAs)) { - return " as ({$storedAs}) stored"; + if (! is_null($column->storedAs)) { + return " as ({$column->storedAs}) stored"; } } @@ -1045,10 +1029,7 @@ protected function modifyCollate(Blueprint $blueprint, Fluent $column) */ protected function modifyNullable(Blueprint $blueprint, Fluent $column) { - if (is_null($column->virtualAs) && - is_null($column->virtualAsJson) && - is_null($column->storedAs) && - is_null($column->storedAsJson)) { + if (is_null($column->virtualAs) && is_null($column->storedAs)) { return $column->nullable ? ' null' : ' not null'; } @@ -1169,17 +1150,4 @@ protected function wrapValue($value) return $value; } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($value); - - return 'json_unquote(json_extract('.$field.$path.'))'; - } } diff --git a/core/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php b/core/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php index 603eb24def..27490bc44f 100755 --- a/core/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php +++ b/core/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php @@ -72,7 +72,7 @@ public function compileDropDatabaseIfExists($name) */ public function compileTableExists() { - return "select * from information_schema.tables where table_catalog = ? and table_schema = ? and table_name = ? and table_type = 'BASE TABLE'"; + return "select * from information_schema.tables where table_schema = ? and table_name = ? and table_type = 'BASE TABLE'"; } /** @@ -82,7 +82,7 @@ public function compileTableExists() */ public function compileColumnListing() { - return 'select column_name from information_schema.columns where table_catalog = ? and table_schema = ? and table_name = ?'; + return 'select column_name from information_schema.columns where table_schema = ? and table_name = ?'; } /** @@ -300,23 +300,23 @@ public function compileDropAllTypes($types) /** * Compile the SQL needed to retrieve all table names. * - * @param string|array $searchPath + * @param string|array $schema * @return string */ - public function compileGetAllTables($searchPath) + public function compileGetAllTables($schema) { - return "select tablename from pg_catalog.pg_tables where schemaname in ('".implode("','", (array) $searchPath)."')"; + return "select tablename from pg_catalog.pg_tables where schemaname in ('".implode("','", (array) $schema)."')"; } /** * Compile the SQL needed to retrieve all view names. * - * @param string|array $searchPath + * @param string|array $schema * @return string */ - public function compileGetAllViews($searchPath) + public function compileGetAllViews($schema) { - return "select viewname from pg_catalog.pg_views where schemaname in ('".implode("','", (array) $searchPath)."')"; + return "select viewname from pg_catalog.pg_views where schemaname in ('".implode("','", (array) $schema)."')"; } /** diff --git a/core/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php b/core/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php index 4abdf65d85..e699ee68ba 100755 --- a/core/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php +++ b/core/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php @@ -858,16 +858,8 @@ protected function typeComputed(Fluent $column) */ protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) { - if (! is_null($virtualAs = $column->virtualAsJson)) { - if ($this->isJsonSelector($virtualAs)) { - $virtualAs = $this->wrapJsonSelector($virtualAs); - } - - return " as ({$virtualAs})"; - } - - if (! is_null($virtualAs = $column->virtualAs)) { - return " as ({$virtualAs})"; + if (! is_null($column->virtualAs)) { + return " as ({$column->virtualAs})"; } } @@ -880,15 +872,7 @@ protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) */ protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) { - if (! is_null($storedAs = $column->storedAsJson)) { - if ($this->isJsonSelector($storedAs)) { - $storedAs = $this->wrapJsonSelector($storedAs); - } - - return " as ({$storedAs}) stored"; - } - - if (! is_null($storedAs = $column->storedAs)) { + if (! is_null($column->storedAs)) { return " as ({$column->storedAs}) stored"; } } @@ -902,10 +886,7 @@ protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) */ protected function modifyNullable(Blueprint $blueprint, Fluent $column) { - if (is_null($column->virtualAs) && - is_null($column->virtualAsJson) && - is_null($column->storedAs) && - is_null($column->storedAsJson)) { + if (is_null($column->virtualAs) && is_null($column->storedAs)) { return $column->nullable ? '' : ' not null'; } @@ -923,7 +904,7 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column) */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) { - if (! is_null($column->default) && is_null($column->virtualAs) && is_null($column->virtualAsJson) && is_null($column->storedAs)) { + if (! is_null($column->default) && is_null($column->virtualAs) && is_null($column->storedAs)) { return ' default '.$this->getDefaultValue($column->default); } } @@ -941,17 +922,4 @@ protected function modifyIncrement(Blueprint $blueprint, Fluent $column) return ' primary key autoincrement'; } } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - [$field, $path] = $this->wrapJsonFieldAndPath($value); - - return 'json_extract('.$field.$path.')'; - } } diff --git a/core/vendor/illuminate/database/Schema/MySqlSchemaState.php b/core/vendor/illuminate/database/Schema/MySqlSchemaState.php index ab55a7bc4b..9bbec7a403 100644 --- a/core/vendor/illuminate/database/Schema/MySqlSchemaState.php +++ b/core/vendor/illuminate/database/Schema/MySqlSchemaState.php @@ -149,7 +149,7 @@ protected function executeDumpProcess(Process $process, $output, array $variable ), $output, $variables); } - if (str_contains($e->getMessage(), 'set-gtid-purged')) { + if (Str::contains($e->getMessage(), ['set-gtid-purged'])) { return $this->executeDumpProcess(Process::fromShellCommandLine( str_replace(' --set-gtid-purged=OFF', '', $process->getCommandLine()) ), $output, $variables); diff --git a/core/vendor/illuminate/database/Schema/PostgresBuilder.php b/core/vendor/illuminate/database/Schema/PostgresBuilder.php index 19b80c12db..ce1b5770ad 100755 --- a/core/vendor/illuminate/database/Schema/PostgresBuilder.php +++ b/core/vendor/illuminate/database/Schema/PostgresBuilder.php @@ -38,12 +38,12 @@ public function dropDatabaseIfExists($name) */ public function hasTable($table) { - [$database, $schema, $table] = $this->parseSchemaAndTable($table); + [$schema, $table] = $this->parseSchemaAndTable($table); $table = $this->connection->getTablePrefix().$table; return count($this->connection->select( - $this->grammar->compileTableExists(), [$database, $schema, $table] + $this->grammar->compileTableExists(), [$schema, $table] )) > 0; } @@ -133,11 +133,7 @@ public function dropAllTypes() public function getAllTables() { return $this->connection->select( - $this->grammar->compileGetAllTables( - $this->parseSearchPath( - $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema') - ) - ) + $this->grammar->compileGetAllTables((array) $this->connection->getConfig('schema')) ); } @@ -149,11 +145,7 @@ public function getAllTables() public function getAllViews() { return $this->connection->select( - $this->grammar->compileGetAllViews( - $this->parseSearchPath( - $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema') - ) - ) + $this->grammar->compileGetAllViews((array) $this->connection->getConfig('schema')) ); } @@ -177,80 +169,35 @@ public function getAllTypes() */ public function getColumnListing($table) { - [$database, $schema, $table] = $this->parseSchemaAndTable($table); + [$schema, $table] = $this->parseSchemaAndTable($table); $table = $this->connection->getTablePrefix().$table; $results = $this->connection->select( - $this->grammar->compileColumnListing(), [$database, $schema, $table] + $this->grammar->compileColumnListing(), [$schema, $table] ); return $this->connection->getPostProcessor()->processColumnListing($results); } /** - * Parse the database object reference and extract the database, schema, and table. + * Parse the table name and extract the schema and table. * - * @param string $reference + * @param string $table * @return array */ - protected function parseSchemaAndTable($reference) + protected function parseSchemaAndTable($table) { - $searchPath = $this->parseSearchPath( - $this->connection->getConfig('search_path') ?: 'public' - ); - - $parts = explode('.', $reference); - - $database = $this->connection->getConfig('database'); - - // If the reference contains a database name, we will use that instead of the - // default database name for the connection. This allows the database name - // to be specified in the query instead of at the full connection level. - if (count($parts) === 3) { - $database = $parts[0]; - array_shift($parts); - } - - // We will use the default schema unless the schema has been specified in the - // query. If the schema has been specified in the query then we can use it - // instead of a default schema configured in the connection search path. - $schema = $searchPath[0] === '$user' - ? $this->connection->getConfig('username') - : $searchPath[0]; - - if (count($parts) === 2) { - $schema = $parts[0]; - array_shift($parts); - } - - return [$database, $schema, $parts[0]]; - } + $table = explode('.', $table); - /** - * Parse the "search_path" value into an array. - * - * @param string|array $searchPath - * @return array - */ - protected function parseSearchPath($searchPath) - { - if (is_string($searchPath)) { - preg_match_all('/[a-zA-z0-9$]{1,}/i', $searchPath, $matches); + if (is_array($schema = $this->connection->getConfig('schema'))) { + if (in_array($table[0], $schema)) { + return [array_shift($table), implode('.', $table)]; + } - $searchPath = $matches[0]; + $schema = head($schema); } - $searchPath = $searchPath ?? []; - - array_walk($searchPath, function (&$schema) { - $schema = trim($schema, '\'"'); - - $schema = $schema === '$user' - ? $this->connection->getConfig('username') - : $schema; - }); - - return $searchPath; + return [$schema ?: 'public', implode('.', $table)]; } } diff --git a/core/vendor/illuminate/database/Schema/PostgresSchemaState.php b/core/vendor/illuminate/database/Schema/PostgresSchemaState.php index 884d3ec22c..3e2f5666e9 100644 --- a/core/vendor/illuminate/database/Schema/PostgresSchemaState.php +++ b/core/vendor/illuminate/database/Schema/PostgresSchemaState.php @@ -3,6 +3,7 @@ namespace Illuminate\Database\Schema; use Illuminate\Database\Connection; +use Illuminate\Support\Str; class PostgresSchemaState extends SchemaState { @@ -40,7 +41,7 @@ public function load($path) { $command = 'pg_restore --no-owner --no-acl --clean --if-exists --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --username="${:LARAVEL_LOAD_USER}" --dbname="${:LARAVEL_LOAD_DATABASE}" "${:LARAVEL_LOAD_PATH}"'; - if (str_ends_with($path, '.sql')) { + if (Str::endsWith($path, '.sql')) { $command = 'psql --file="${:LARAVEL_LOAD_PATH}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --username="${:LARAVEL_LOAD_USER}" --dbname="${:LARAVEL_LOAD_DATABASE}"'; } diff --git a/core/vendor/illuminate/database/Seeder.php b/core/vendor/illuminate/database/Seeder.php index 1a7a12e191..441fa27d6c 100755 --- a/core/vendor/illuminate/database/Seeder.php +++ b/core/vendor/illuminate/database/Seeder.php @@ -4,7 +4,6 @@ use Illuminate\Console\Command; use Illuminate\Container\Container; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Support\Arr; use InvalidArgumentException; @@ -24,13 +23,6 @@ abstract class Seeder */ protected $command; - /** - * Seeders that have been called at least one time. - * - * @var array - */ - protected static $called = []; - /** * Run the given seeder class. * @@ -61,8 +53,6 @@ public function call($class, $silent = false, array $parameters = []) if ($silent === false && isset($this->command)) { $this->command->getOutput()->writeln("<info>Seeded:</info> {$name} ({$runTime}ms)"); } - - static::$called[] = $class; } return $this; @@ -92,22 +82,6 @@ public function callSilent($class, array $parameters = []) $this->call($class, true, $parameters); } - /** - * Run the given seeder class once. - * - * @param array|string $class - * @param bool $silent - * @return void - */ - public function callOnce($class, $silent = false, array $parameters = []) - { - if (in_array($class, static::$called)) { - return; - } - - $this->call($class, $silent, $parameters); - } - /** * Resolve an instance of the given seeder class. * @@ -171,16 +145,8 @@ public function __invoke(array $parameters = []) throw new InvalidArgumentException('Method [run] missing from '.get_class($this)); } - $callback = fn () => isset($this->container) - ? $this->container->call([$this, 'run'], $parameters) - : $this->run(...$parameters); - - $uses = array_flip(class_uses_recursive(static::class)); - - if (isset($uses[WithoutModelEvents::class])) { - $callback = $this->withoutModelEvents($callback); - } - - return $callback(); + return isset($this->container) + ? $this->container->call([$this, 'run'], $parameters) + : $this->run(...$parameters); } } diff --git a/core/vendor/illuminate/database/SqlServerConnection.php b/core/vendor/illuminate/database/SqlServerConnection.php index ab8983d546..87628b99cc 100755 --- a/core/vendor/illuminate/database/SqlServerConnection.php +++ b/core/vendor/illuminate/database/SqlServerConnection.php @@ -3,6 +3,8 @@ namespace Illuminate\Database; use Closure; +use Doctrine\DBAL\Driver\PDOSqlsrv\Driver as DoctrineDriver; +use Doctrine\DBAL\Version; use Illuminate\Database\PDO\SqlServerDriver; use Illuminate\Database\Query\Grammars\SqlServerGrammar as QueryGrammar; use Illuminate\Database\Query\Processors\SqlServerProcessor; @@ -114,10 +116,10 @@ protected function getDefaultPostProcessor() /** * Get the Doctrine DBAL driver. * - * @return \Illuminate\Database\PDO\SqlServerDriver + * @return \Doctrine\DBAL\Driver\PDOSqlsrv\Driver|\Illuminate\Database\PDO\SqlServerDriver */ protected function getDoctrineDriver() { - return new SqlServerDriver; + return class_exists(Version::class) ? new DoctrineDriver : new SqlServerDriver; } } diff --git a/core/vendor/illuminate/database/composer.json b/core/vendor/illuminate/database/composer.json index df3d06cbac..12738d4aea 100644 --- a/core/vendor/illuminate/database/composer.json +++ b/core/vendor/illuminate/database/composer.json @@ -15,14 +15,14 @@ } ], "require": { - "php": "^8.0.2", + "php": "^7.3|^8.0", "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "symfony/console": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "symfony/console": "^5.4" }, "autoload": { "psr-4": { @@ -31,17 +31,17 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", - "illuminate/console": "Required to use the database commands (^9.0).", - "illuminate/events": "Required to use the observers with Eloquent (^9.0).", - "illuminate/filesystem": "Required to use the migrations (^9.0).", - "illuminate/pagination": "Required to paginate the result set (^9.0).", - "symfony/finder": "Required to use Eloquent model factories (^6.0)." + "illuminate/console": "Required to use the database commands (^8.0).", + "illuminate/events": "Required to use the observers with Eloquent (^8.0).", + "illuminate/filesystem": "Required to use the migrations (^8.0).", + "illuminate/pagination": "Required to paginate the result set (^8.0).", + "symfony/finder": "Required to use Eloquent model factories (^5.4)." }, "config": { "sort-packages": true diff --git a/core/vendor/illuminate/events/Dispatcher.php b/core/vendor/illuminate/events/Dispatcher.php index 6330030472..5972a83849 100755 --- a/core/vendor/illuminate/events/Dispatcher.php +++ b/core/vendor/illuminate/events/Dispatcher.php @@ -91,10 +91,10 @@ public function listen($events, $listener = null) } foreach ((array) $events as $event) { - if (str_contains($event, '*')) { + if (Str::contains($event, '*')) { $this->setupWildcardListen($event, $listener); } else { - $this->listeners[$event][] = $listener; + $this->listeners[$event][] = $this->makeListener($listener); } } } @@ -108,7 +108,7 @@ public function listen($events, $listener = null) */ protected function setupWildcardListen($event, $listener) { - $this->wildcards[$event][] = $listener; + $this->wildcards[$event][] = $this->makeListener($listener, true); $this->wildcardsCache = []; } @@ -328,8 +328,10 @@ protected function broadcastEvent($event) */ public function getListeners($eventName) { + $listeners = $this->listeners[$eventName] ?? []; + $listeners = array_merge( - $this->prepareListeners($eventName), + $listeners, $this->wildcardsCache[$eventName] ?? $this->getWildcardListeners($eventName) ); @@ -350,9 +352,7 @@ protected function getWildcardListeners($eventName) foreach ($this->wildcards as $key => $listeners) { if (Str::is($key, $eventName)) { - foreach ($listeners as $listener) { - $wildcards[] = $this->makeListener($listener, true); - } + $wildcards = array_merge($wildcards, $listeners); } } @@ -370,7 +370,7 @@ protected function addInterfaceListeners($eventName, array $listeners = []) { foreach (class_implements($eventName) as $interface) { if (isset($this->listeners[$interface])) { - foreach ($this->prepareListeners($interface) as $names) { + foreach ($this->listeners[$interface] as $names) { $listeners = array_merge($listeners, (array) $names); } } @@ -379,23 +379,6 @@ protected function addInterfaceListeners($eventName, array $listeners = []) return $listeners; } - /** - * Prepare the listeners for a given event. - * - * @param string $eventName - * @return \Closure[] - */ - protected function prepareListeners(string $eventName) - { - $listeners = []; - - foreach ($this->listeners[$eventName] ?? [] as $listener) { - $listeners[] = $this->makeListener($listener); - } - - return $listeners; - } - /** * Register an event listener with the dispatcher. * @@ -641,7 +624,7 @@ protected function propagateListenerOptions($listener, $job) */ public function forget($event) { - if (str_contains($event, '*')) { + if (Str::contains($event, '*')) { unset($this->wildcards[$event]); } else { unset($this->listeners[$event]); @@ -662,7 +645,7 @@ public function forget($event) public function forgetPushed() { foreach ($this->listeners as $key => $value) { - if (str_ends_with($key, '_pushed')) { + if (Str::endsWith($key, '_pushed')) { $this->forget($key); } } @@ -690,14 +673,4 @@ public function setQueueResolver(callable $resolver) return $this; } - - /** - * Gets the raw, unprepared listeners. - * - * @return array - */ - public function getRawListeners() - { - return $this->listeners; - } } diff --git a/core/vendor/illuminate/events/NullDispatcher.php b/core/vendor/illuminate/events/NullDispatcher.php index 3164fbb2a8..5c539d53a3 100644 --- a/core/vendor/illuminate/events/NullDispatcher.php +++ b/core/vendor/illuminate/events/NullDispatcher.php @@ -139,6 +139,6 @@ public function forgetPushed() */ public function __call($method, $parameters) { - return $this->forwardDecoratedCallTo($this->dispatcher, $method, $parameters); + return $this->forwardCallTo($this->dispatcher, $method, $parameters); } } diff --git a/core/vendor/illuminate/events/QueuedClosure.php b/core/vendor/illuminate/events/QueuedClosure.php index 9f6849884a..8259059844 100644 --- a/core/vendor/illuminate/events/QueuedClosure.php +++ b/core/vendor/illuminate/events/QueuedClosure.php @@ -3,7 +3,7 @@ namespace Illuminate\Events; use Closure; -use Laravel\SerializableClosure\SerializableClosure; +use Illuminate\Queue\SerializableClosureFactory; class QueuedClosure { @@ -114,10 +114,10 @@ public function resolve() { return function (...$arguments) { dispatch(new CallQueuedListener(InvokeQueuedClosure::class, 'handle', [ - 'closure' => new SerializableClosure($this->closure), + 'closure' => SerializableClosureFactory::make($this->closure), 'arguments' => $arguments, 'catch' => collect($this->catchCallbacks)->map(function ($callback) { - return new SerializableClosure($callback); + return SerializableClosureFactory::make($callback); })->all(), ]))->onConnection($this->connection)->onQueue($this->queue)->delay($this->delay); }; diff --git a/core/vendor/illuminate/events/composer.json b/core/vendor/illuminate/events/composer.json index d07421220c..b77ba2c896 100755 --- a/core/vendor/illuminate/events/composer.json +++ b/core/vendor/illuminate/events/composer.json @@ -14,13 +14,13 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/bus": "^9.0", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0" + "php": "^7.3|^8.0", + "illuminate/bus": "^8.0", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0" }, "autoload": { "psr-4": { @@ -32,7 +32,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/filesystem/AwsS3V3Adapter.php b/core/vendor/illuminate/filesystem/AwsS3V3Adapter.php deleted file mode 100644 index 95b893d2d9..0000000000 --- a/core/vendor/illuminate/filesystem/AwsS3V3Adapter.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -namespace Illuminate\Filesystem; - -use Aws\S3\S3Client; -use League\Flysystem\AwsS3V3\AwsS3V3Adapter as S3Adapter; -use League\Flysystem\FilesystemOperator; - -class AwsS3V3Adapter extends FilesystemAdapter -{ - /** - * The AWS S3 client. - * - * @var \Aws\S3\S3Client - */ - protected $client; - - /** - * Create a new AwsS3V3FilesystemAdapter instance. - * - * @param \League\Flysystem\FilesystemOperator $driver - * @param \League\Flysystem\AwsS3V3\AwsS3V3Adapter $adapter - * @param array $config - * @param \Aws\S3\S3Client $client - * @return void - */ - public function __construct(FilesystemOperator $driver, S3Adapter $adapter, array $config, S3Client $client) - { - parent::__construct($driver, $adapter, $config); - - $this->client = $client; - } - - /** - * Get the URL for the file at the given path. - * - * @param string $path - * @return string - * - * @throws \RuntimeException - */ - public function url($path) - { - // If an explicit base URL has been set on the disk configuration then we will use - // it as the base URL instead of the default path. This allows the developer to - // have full control over the base path for this filesystem's generated URLs. - if (isset($this->config['url'])) { - return $this->concatPathToUrl($this->config['url'], $this->prefixer->prefixPath($path)); - } - - return $this->client->getObjectUrl( - $this->config['bucket'], $this->prefixer->prefixPath($path) - ); - } - - /** - * Get a temporary URL for the file at the given path. - * - * @param string $path - * @param \DateTimeInterface $expiration - * @param array $options - * @return string - */ - public function temporaryUrl($path, $expiration, array $options = []) - { - $command = $this->client->getCommand('GetObject', array_merge([ - 'Bucket' => $this->config['bucket'], - 'Key' => $this->prefixer->prefixPath($path), - ], $options)); - - $uri = $this->client->createPresignedRequest( - $command, $expiration - )->getUri(); - - // If an explicit base URL has been set on the disk configuration then we will use - // it as the base URL instead of the default path. This allows the developer to - // have full control over the base path for this filesystem's generated URLs. - if (isset($this->config['temporary_url'])) { - $uri = $this->replaceBaseUrl($uri, $this->config['temporary_url']); - } - - return (string) $uri; - } -} diff --git a/core/vendor/illuminate/filesystem/Cache.php b/core/vendor/illuminate/filesystem/Cache.php new file mode 100644 index 0000000000..8ae2486dab --- /dev/null +++ b/core/vendor/illuminate/filesystem/Cache.php @@ -0,0 +1,71 @@ +<?php + +namespace Illuminate\Filesystem; + +use Illuminate\Contracts\Cache\Repository; +use League\Flysystem\Cached\Storage\AbstractCache; + +class Cache extends AbstractCache +{ + /** + * The cache repository implementation. + * + * @var \Illuminate\Contracts\Cache\Repository + */ + protected $repository; + + /** + * The cache key. + * + * @var string + */ + protected $key; + + /** + * The cache expiration time in seconds. + * + * @var int|null + */ + protected $expire; + + /** + * Create a new cache instance. + * + * @param \Illuminate\Contracts\Cache\Repository $repository + * @param string $key + * @param int|null $expire + * @return void + */ + public function __construct(Repository $repository, $key = 'flysystem', $expire = null) + { + $this->key = $key; + $this->expire = $expire; + $this->repository = $repository; + } + + /** + * Load the cache. + * + * @return void + */ + public function load() + { + $contents = $this->repository->get($this->key); + + if (! is_null($contents)) { + $this->setFromStorage($contents); + } + } + + /** + * Persist the cache. + * + * @return void + */ + public function save() + { + $contents = $this->getForStorage(); + + $this->repository->put($this->key, $contents, $this->expire); + } +} diff --git a/core/vendor/illuminate/filesystem/Filesystem.php b/core/vendor/illuminate/filesystem/Filesystem.php index 67a8682b05..8b98ae87ac 100644 --- a/core/vendor/illuminate/filesystem/Filesystem.php +++ b/core/vendor/illuminate/filesystem/Filesystem.php @@ -659,8 +659,10 @@ public function copyDirectory($directory, $destination, $options = null) // If the current items is just a regular file, we will just copy this to the new // location and keep looping. If for some reason the copy fails we'll bail out // and return false, so the developer is aware that the copy process failed. - elseif (! $this->copy($item->getPathname(), $target)) { - return false; + else { + if (! $this->copy($item->getPathname(), $target)) { + return false; + } } } diff --git a/core/vendor/illuminate/filesystem/FilesystemAdapter.php b/core/vendor/illuminate/filesystem/FilesystemAdapter.php index f48f661350..a9fd524740 100644 --- a/core/vendor/illuminate/filesystem/FilesystemAdapter.php +++ b/core/vendor/illuminate/filesystem/FilesystemAdapter.php @@ -4,36 +4,33 @@ use Closure; use Illuminate\Contracts\Filesystem\Cloud as CloudFilesystemContract; +use Illuminate\Contracts\Filesystem\FileExistsException as ContractFileExistsException; +use Illuminate\Contracts\Filesystem\FileNotFoundException as ContractFileNotFoundException; use Illuminate\Contracts\Filesystem\Filesystem as FilesystemContract; use Illuminate\Http\File; use Illuminate\Http\UploadedFile; use Illuminate\Support\Arr; +use Illuminate\Support\Collection; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; use InvalidArgumentException; -use League\Flysystem\FilesystemAdapter as FlysystemAdapter; -use League\Flysystem\FilesystemOperator; -use League\Flysystem\Ftp\FtpAdapter; -use League\Flysystem\Local\LocalFilesystemAdapter as LocalAdapter; -use League\Flysystem\PathPrefixer; -use League\Flysystem\PhpseclibV3\SftpAdapter; -use League\Flysystem\StorageAttributes; -use League\Flysystem\UnableToCopyFile; -use League\Flysystem\UnableToCreateDirectory; -use League\Flysystem\UnableToDeleteDirectory; -use League\Flysystem\UnableToDeleteFile; -use League\Flysystem\UnableToMoveFile; -use League\Flysystem\UnableToReadFile; -use League\Flysystem\UnableToSetVisibility; -use League\Flysystem\UnableToWriteFile; -use League\Flysystem\Visibility; +use League\Flysystem\Adapter\Ftp; +use League\Flysystem\Adapter\Local as LocalAdapter; +use League\Flysystem\AdapterInterface; +use League\Flysystem\AwsS3v3\AwsS3Adapter; +use League\Flysystem\Cached\CachedAdapter; +use League\Flysystem\FileExistsException; +use League\Flysystem\FileNotFoundException; +use League\Flysystem\FilesystemInterface; +use League\Flysystem\Sftp\SftpAdapter as Sftp; use PHPUnit\Framework\Assert as PHPUnit; use Psr\Http\Message\StreamInterface; +use Psr\Http\Message\UriInterface; use RuntimeException; use Symfony\Component\HttpFoundation\StreamedResponse; /** - * @mixin \League\Flysystem\FilesystemOperator + * @mixin \League\Flysystem\FilesystemInterface */ class FilesystemAdapter implements CloudFilesystemContract { @@ -44,31 +41,10 @@ class FilesystemAdapter implements CloudFilesystemContract /** * The Flysystem filesystem implementation. * - * @var \League\Flysystem\FilesystemOperator + * @var \League\Flysystem\FilesystemInterface */ protected $driver; - /** - * The Flysystem adapter implementation. - * - * @var \League\Flysystem\FilesystemAdapter - */ - protected $adapter; - - /** - * The filesystem configuration. - * - * @var array - */ - protected $config; - - /** - * The Flysystem PathPrefixer instance. - * - * @var \League\Flysystem\PathPrefixer - */ - protected $prefixer; - /** * The temporary URL builder callback. * @@ -79,24 +55,16 @@ class FilesystemAdapter implements CloudFilesystemContract /** * Create a new filesystem adapter instance. * - * @param \League\Flysystem\FilesystemOperator $driver - * @param \League\Flysystem\FilesystemAdapter $adapter - * @param array $config + * @param \League\Flysystem\FilesystemInterface $driver * @return void */ - public function __construct(FilesystemOperator $driver, FlysystemAdapter $adapter, array $config = []) + public function __construct(FilesystemInterface $driver) { $this->driver = $driver; - $this->adapter = $adapter; - $this->config = $config; - - $this->prefixer = new PathPrefixer( - $config['root'] ?? '', $config['directory_separator'] ?? DIRECTORY_SEPARATOR - ); } /** - * Assert that the given file or directory exists. + * Assert that the given file exists. * * @param string|array $path * @param string|null $content @@ -110,7 +78,7 @@ public function assertExists($path, $content = null) foreach ($paths as $path) { PHPUnit::assertTrue( - $this->exists($path), "Unable to find a file or directory at path [{$path}]." + $this->exists($path), "Unable to find a file at path [{$path}]." ); if (! is_null($content)) { @@ -119,7 +87,7 @@ public function assertExists($path, $content = null) PHPUnit::assertSame( $content, $actual, - "File or directory [{$path}] was found, but content [{$actual}] does not match [{$content}]." + "File [{$path}] was found, but content [{$actual}] does not match [{$content}]." ); } } @@ -128,7 +96,7 @@ public function assertExists($path, $content = null) } /** - * Assert that the given file or directory does not exist. + * Assert that the given file does not exist. * * @param string|array $path * @return $this @@ -141,7 +109,7 @@ public function assertMissing($path) foreach ($paths as $path) { PHPUnit::assertFalse( - $this->exists($path), "Found unexpected file or directory at path [{$path}]." + $this->exists($path), "Found unexpected file at path [{$path}]." ); } @@ -149,7 +117,7 @@ public function assertMissing($path) } /** - * Determine if a file or directory exists. + * Determine if a file exists. * * @param string $path * @return bool @@ -170,50 +138,6 @@ public function missing($path) return ! $this->exists($path); } - /** - * Determine if a file exists. - * - * @param string $path - * @return bool - */ - public function fileExists($path) - { - return $this->driver->fileExists($path); - } - - /** - * Determine if a file is missing. - * - * @param string $path - * @return bool - */ - public function fileMissing($path) - { - return ! $this->fileExists($path); - } - - /** - * Determine if a directory exists. - * - * @param string $path - * @return bool - */ - public function directoryExists($path) - { - return $this->driver->directoryExists($path); - } - - /** - * Determine if a directory is missing. - * - * @param string $path - * @return bool - */ - public function directoryMissing($path) - { - return ! $this->directoryExists($path); - } - /** * Get the full path for the file at the given "short" path. * @@ -222,21 +146,29 @@ public function directoryMissing($path) */ public function path($path) { - return $this->prefixer->prefixPath($path); + $adapter = $this->driver->getAdapter(); + + if ($adapter instanceof CachedAdapter) { + $adapter = $adapter->getAdapter(); + } + + return $adapter->getPathPrefix().$path; } /** * Get the contents of a file. * * @param string $path - * @return string|null + * @return string + * + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function get($path) { try { return $this->driver->read($path); - } catch (UnableToReadFile $e) { - // + } catch (FileNotFoundException $e) { + throw new ContractFileNotFoundException($e->getMessage(), $e->getCode(), $e); } } @@ -245,7 +177,7 @@ public function get($path) * * @param string $path * @param string|null $name - * @param array $headers + * @param array|null $headers * @param string|null $disposition * @return \Symfony\Component\HttpFoundation\StreamedResponse */ @@ -279,6 +211,7 @@ public function response($path, $name = null, array $headers = [], $disposition * * @param string $path * @param string|null $name + * @param array|null $headers * @return \Symfony\Component\HttpFoundation\StreamedResponse */ public function download($path, $name = null, array $headers = []) @@ -319,21 +252,13 @@ public function put($path, $contents, $options = []) return $this->putFile($path, $contents, $options); } - try { - if ($contents instanceof StreamInterface) { - $this->driver->writeStream($path, $contents->detach(), $options); - - return true; - } - - is_resource($contents) - ? $this->driver->writeStream($path, $contents, $options) - : $this->driver->write($path, $contents, $options); - } catch (UnableToWriteFile $e) { - return false; + if ($contents instanceof StreamInterface) { + return $this->driver->putStream($path, $contents->detach(), $options); } - return true; + return is_resource($contents) + ? $this->driver->putStream($path, $contents, $options) + : $this->driver->put($path, $contents, $options); } /** @@ -386,7 +311,7 @@ public function putFileAs($path, $file, $name, $options = []) */ public function getVisibility($path) { - if ($this->driver->visibility($path) == Visibility::PUBLIC) { + if ($this->driver->getVisibility($path) == AdapterInterface::VISIBILITY_PUBLIC) { return FilesystemContract::VISIBILITY_PUBLIC; } @@ -402,13 +327,7 @@ public function getVisibility($path) */ public function setVisibility($path, $visibility) { - try { - $this->driver->setVisibility($path, $this->parseVisibility($visibility)); - } catch (UnableToSetVisibility $e) { - return false; - } - - return true; + return $this->driver->setVisibility($path, $this->parseVisibility($visibility)); } /** @@ -421,7 +340,7 @@ public function setVisibility($path, $visibility) */ public function prepend($path, $data, $separator = PHP_EOL) { - if ($this->fileExists($path)) { + if ($this->exists($path)) { return $this->put($path, $data.$separator.$this->get($path)); } @@ -438,7 +357,7 @@ public function prepend($path, $data, $separator = PHP_EOL) */ public function append($path, $data, $separator = PHP_EOL) { - if ($this->fileExists($path)) { + if ($this->exists($path)) { return $this->put($path, $this->get($path).$separator.$data); } @@ -459,8 +378,10 @@ public function delete($paths) foreach ($paths as $path) { try { - $this->driver->delete($path); - } catch (UnableToDeleteFile $e) { + if (! $this->driver->delete($path)) { + $success = false; + } + } catch (FileNotFoundException $e) { $success = false; } } @@ -477,13 +398,7 @@ public function delete($paths) */ public function copy($from, $to) { - try { - $this->driver->copy($from, $to); - } catch (UnableToCopyFile $e) { - return false; - } - - return true; + return $this->driver->copy($from, $to); } /** @@ -495,13 +410,7 @@ public function copy($from, $to) */ public function move($from, $to) { - try { - $this->driver->move($from, $to); - } catch (UnableToMoveFile $e) { - return false; - } - - return true; + return $this->driver->rename($from, $to); } /** @@ -512,7 +421,7 @@ public function move($from, $to) */ public function size($path) { - return $this->driver->fileSize($path); + return $this->driver->getSize($path); } /** @@ -523,7 +432,7 @@ public function size($path) */ public function mimeType($path) { - return $this->driver->mimeType($path); + return $this->driver->getMimetype($path); } /** @@ -534,7 +443,38 @@ public function mimeType($path) */ public function lastModified($path) { - return $this->driver->lastModified($path); + return $this->driver->getTimestamp($path); + } + + /** + * Get the URL for the file at the given path. + * + * @param string $path + * @return string + * + * @throws \RuntimeException + */ + public function url($path) + { + $adapter = $this->driver->getAdapter(); + + if ($adapter instanceof CachedAdapter) { + $adapter = $adapter->getAdapter(); + } + + if (method_exists($adapter, 'getUrl')) { + return $adapter->getUrl($path); + } elseif (method_exists($this->driver, 'getUrl')) { + return $this->driver->getUrl($path); + } elseif ($adapter instanceof AwsS3Adapter) { + return $this->getAwsUrl($adapter, $path); + } elseif ($adapter instanceof Ftp || $adapter instanceof Sftp) { + return $this->getFtpUrl($path); + } elseif ($adapter instanceof LocalAdapter) { + return $this->getLocalUrl($path); + } else { + throw new RuntimeException('This driver does not support retrieving URLs.'); + } } /** @@ -543,9 +483,9 @@ public function lastModified($path) public function readStream($path) { try { - return $this->driver->readStream($path); - } catch (UnableToReadFile $e) { - // + return $this->driver->readStream($path) ?: null; + } catch (FileNotFoundException $e) { + throw new ContractFileNotFoundException($e->getMessage(), $e->getCode(), $e); } } @@ -555,37 +495,31 @@ public function readStream($path) public function writeStream($path, $resource, array $options = []) { try { - $this->driver->writeStream($path, $resource, $options); - } catch (UnableToWriteFile $e) { - return false; + return $this->driver->writeStream($path, $resource, $options); + } catch (FileExistsException $e) { + throw new ContractFileExistsException($e->getMessage(), $e->getCode(), $e); } - - return true; } /** * Get the URL for the file at the given path. * + * @param \League\Flysystem\AwsS3v3\AwsS3Adapter $adapter * @param string $path * @return string - * - * @throws \RuntimeException */ - public function url($path) + protected function getAwsUrl($adapter, $path) { - $adapter = $this->adapter; - - if (method_exists($adapter, 'getUrl')) { - return $adapter->getUrl($path); - } elseif (method_exists($this->driver, 'getUrl')) { - return $this->driver->getUrl($path); - } elseif ($adapter instanceof FtpAdapter || $adapter instanceof SftpAdapter) { - return $this->getFtpUrl($path); - } elseif ($adapter instanceof LocalAdapter) { - return $this->getLocalUrl($path); - } else { - throw new RuntimeException('This driver does not support retrieving URLs.'); + // If an explicit base URL has been set on the disk configuration then we will use + // it as the base URL instead of the default path. This allows the developer to + // have full control over the base path for this filesystem's generated URLs. + if (! is_null($url = $this->driver->getConfig()->get('url'))) { + return $this->concatPathToUrl($url, $adapter->getPathPrefix().$path); } + + return $adapter->getClient()->getObjectUrl( + $adapter->getBucket(), $adapter->getPathPrefix().$path + ); } /** @@ -596,8 +530,10 @@ public function url($path) */ protected function getFtpUrl($path) { - return isset($this->config['url']) - ? $this->concatPathToUrl($this->config['url'], $path) + $config = $this->driver->getConfig(); + + return $config->has('url') + ? $this->concatPathToUrl($config->get('url'), $path) : $path; } @@ -609,11 +545,13 @@ protected function getFtpUrl($path) */ protected function getLocalUrl($path) { + $config = $this->driver->getConfig(); + // If an explicit base URL has been set on the disk configuration then we will use // it as the base URL instead of the default path. This allows the developer to // have full control over the base path for this filesystem's generated URLs. - if (isset($this->config['url'])) { - return $this->concatPathToUrl($this->config['url'], $path); + if ($config->has('url')) { + return $this->concatPathToUrl($config->get('url'), $path); } $path = '/storage/'.$path; @@ -621,7 +559,7 @@ protected function getLocalUrl($path) // If the path contains "storage/public", it probably means the developer is using // the default disk to generate the path instead of the "public" disk like they // are really supposed to use. We will remove the public from this path here. - if (str_contains($path, '/storage/public/')) { + if (Str::contains($path, '/storage/public/')) { return Str::replaceFirst('/public/', '/', $path); } @@ -640,8 +578,14 @@ protected function getLocalUrl($path) */ public function temporaryUrl($path, $expiration, array $options = []) { - if (method_exists($this->adapter, 'getTemporaryUrl')) { - return $this->adapter->getTemporaryUrl($path, $expiration, $options); + $adapter = $this->driver->getAdapter(); + + if ($adapter instanceof CachedAdapter) { + $adapter = $adapter->getAdapter(); + } + + if (method_exists($adapter, 'getTemporaryUrl')) { + return $adapter->getTemporaryUrl($path, $expiration, $options); } if ($this->temporaryUrlCallback) { @@ -650,9 +594,45 @@ public function temporaryUrl($path, $expiration, array $options = []) ); } + if ($adapter instanceof AwsS3Adapter) { + return $this->getAwsTemporaryUrl($adapter, $path, $expiration, $options); + } + throw new RuntimeException('This driver does not support creating temporary URLs.'); } + /** + * Get a temporary URL for the file at the given path. + * + * @param \League\Flysystem\AwsS3v3\AwsS3Adapter $adapter + * @param string $path + * @param \DateTimeInterface $expiration + * @param array $options + * @return string + */ + public function getAwsTemporaryUrl($adapter, $path, $expiration, $options) + { + $client = $adapter->getClient(); + + $command = $client->getCommand('GetObject', array_merge([ + 'Bucket' => $adapter->getBucket(), + 'Key' => $adapter->getPathPrefix().$path, + ], $options)); + + $uri = $client->createPresignedRequest( + $command, $expiration + )->getUri(); + + // If an explicit base URL has been set on the disk configuration then we will use + // it as the base URL instead of the default path. This allows the developer to + // have full control over the base path for this filesystem's generated URLs. + if (! is_null($url = $this->driver->getConfig()->get('temporary_url'))) { + $uri = $this->replaceBaseUrl($uri, $url); + } + + return (string) $uri; + } + /** * Concatenate a path to a URL. * @@ -691,14 +671,9 @@ protected function replaceBaseUrl($uri, $url) */ public function files($directory = null, $recursive = false) { - return $this->driver->listContents($directory ?? '', $recursive) - ->filter(function (StorageAttributes $attributes) { - return $attributes->isFile(); - }) - ->map(function (StorageAttributes $attributes) { - return $attributes->path(); - }) - ->toArray(); + $contents = $this->driver->listContents($directory ?? '', $recursive); + + return $this->filterContentsByType($contents, 'file'); } /** @@ -721,18 +696,13 @@ public function allFiles($directory = null) */ public function directories($directory = null, $recursive = false) { - return $this->driver->listContents($directory ?? '', $recursive) - ->filter(function (StorageAttributes $attributes) { - return $attributes->isDir(); - }) - ->map(function (StorageAttributes $attributes) { - return $attributes->path(); - }) - ->toArray(); + $contents = $this->driver->listContents($directory ?? '', $recursive); + + return $this->filterContentsByType($contents, 'dir'); } /** - * Get all the directories within a given directory (recursive). + * Get all (recursive) of the directories within a given directory. * * @param string|null $directory * @return array @@ -750,13 +720,7 @@ public function allDirectories($directory = null) */ public function makeDirectory($path) { - try { - $this->driver->createDirectory($path); - } catch (UnableToCreateDirectory $e) { - return false; - } - - return true; + return $this->driver->createDir($path); } /** @@ -767,43 +731,47 @@ public function makeDirectory($path) */ public function deleteDirectory($directory) { - try { - $this->driver->deleteDirectory($directory); - } catch (UnableToDeleteDirectory $e) { - return false; - } - - return true; + return $this->driver->deleteDir($directory); } /** - * Get the Flysystem driver. + * Flush the Flysystem cache. * - * @return \League\Flysystem\FilesystemOperator + * @return void */ - public function getDriver() + public function flushCache() { - return $this->driver; + $adapter = $this->driver->getAdapter(); + + if ($adapter instanceof CachedAdapter) { + $adapter->getCache()->flush(); + } } /** - * Get the Flysystem adapter. + * Get the Flysystem driver. * - * @return \League\Flysystem\FilesystemAdapter + * @return \League\Flysystem\FilesystemInterface */ - public function getAdapter() + public function getDriver() { - return $this->adapter; + return $this->driver; } /** - * Get the configuration values. + * Filter directory contents by type. * + * @param array $contents + * @param string $type * @return array */ - public function getConfig() + protected function filterContentsByType($contents, $type) { - return $this->config; + return Collection::make($contents) + ->where('type', $type) + ->pluck('path') + ->values() + ->all(); } /** @@ -820,11 +788,14 @@ protected function parseVisibility($visibility) return; } - return match ($visibility) { - FilesystemContract::VISIBILITY_PUBLIC => Visibility::PUBLIC, - FilesystemContract::VISIBILITY_PRIVATE => Visibility::PRIVATE, - default => throw new InvalidArgumentException("Unknown visibility: {$visibility}."), - }; + switch ($visibility) { + case FilesystemContract::VISIBILITY_PUBLIC: + return AdapterInterface::VISIBILITY_PUBLIC; + case FilesystemContract::VISIBILITY_PRIVATE: + return AdapterInterface::VISIBILITY_PRIVATE; + } + + throw new InvalidArgumentException("Unknown visibility: {$visibility}."); } /** diff --git a/core/vendor/illuminate/filesystem/FilesystemManager.php b/core/vendor/illuminate/filesystem/FilesystemManager.php index 9fb8a45dc0..684c487382 100644 --- a/core/vendor/illuminate/filesystem/FilesystemManager.php +++ b/core/vendor/illuminate/filesystem/FilesystemManager.php @@ -7,17 +7,15 @@ use Illuminate\Contracts\Filesystem\Factory as FactoryContract; use Illuminate\Support\Arr; use InvalidArgumentException; -use League\Flysystem\AwsS3V3\AwsS3V3Adapter as S3Adapter; -use League\Flysystem\AwsS3V3\PortableVisibilityConverter as AwsS3PortableVisibilityConverter; +use League\Flysystem\Adapter\Ftp as FtpAdapter; +use League\Flysystem\Adapter\Local as LocalAdapter; +use League\Flysystem\AdapterInterface; +use League\Flysystem\AwsS3v3\AwsS3Adapter as S3Adapter; +use League\Flysystem\Cached\CachedAdapter; +use League\Flysystem\Cached\Storage\Memory as MemoryStore; use League\Flysystem\Filesystem as Flysystem; -use League\Flysystem\FilesystemAdapter as FlysystemAdapter; -use League\Flysystem\Ftp\FtpAdapter; -use League\Flysystem\Ftp\FtpConnectionOptions; -use League\Flysystem\Local\LocalFilesystemAdapter as LocalAdapter; -use League\Flysystem\PhpseclibV3\SftpAdapter; -use League\Flysystem\PhpseclibV3\SftpConnectionProvider; -use League\Flysystem\UnixVisibility\PortableVisibilityConverter; -use League\Flysystem\Visibility; +use League\Flysystem\FilesystemInterface; +use League\Flysystem\Sftp\SftpAdapter; /** * @mixin \Illuminate\Contracts\Filesystem\Filesystem @@ -157,7 +155,13 @@ protected function resolve($name, $config = null) */ protected function callCustomCreator(array $config) { - return $this->customCreators[$config['driver']]($this->app, $config); + $driver = $this->customCreators[$config['driver']]($this->app, $config); + + if ($driver instanceof FilesystemInterface) { + return $this->adapt($driver); + } + + return $driver; } /** @@ -168,20 +172,15 @@ protected function callCustomCreator(array $config) */ public function createLocalDriver(array $config) { - $visibility = PortableVisibilityConverter::fromArray( - $config['permissions'] ?? [], - $config['directory_visibility'] ?? $config['visibility'] ?? Visibility::PRIVATE - ); + $permissions = $config['permissions'] ?? []; $links = ($config['links'] ?? null) === 'skip' ? LocalAdapter::SKIP_LINKS : LocalAdapter::DISALLOW_LINKS; - $adapter = new LocalAdapter( - $config['root'], $visibility, $config['lock'] ?? LOCK_EX, $links - ); - - return new FilesystemAdapter($this->createFlysystem($adapter, $config), $adapter, $config); + return $this->adapt($this->createFlysystem(new LocalAdapter( + $config['root'], $config['lock'] ?? LOCK_EX, $links, $permissions + ), $config)); } /** @@ -192,13 +191,9 @@ public function createLocalDriver(array $config) */ public function createFtpDriver(array $config) { - if (! isset($config['root'])) { - $config['root'] = ''; - } - - $adapter = new FtpAdapter(FtpConnectionOptions::fromArray($config)); - - return new FilesystemAdapter($this->createFlysystem($adapter, $config), $adapter, $config); + return $this->adapt($this->createFlysystem( + new FtpAdapter($config), $config + )); } /** @@ -209,17 +204,9 @@ public function createFtpDriver(array $config) */ public function createSftpDriver(array $config) { - $provider = SftpConnectionProvider::fromArray($config); - - $root = $config['root'] ?? '/'; - - $visibility = PortableVisibilityConverter::fromArray( - $config['permissions'] ?? [] - ); - - $adapter = new SftpAdapter($provider, $root, $visibility); - - return new FilesystemAdapter($this->createFlysystem($adapter, $config), $adapter, $config); + return $this->adapt($this->createFlysystem( + new SftpAdapter($config), $config + )); } /** @@ -232,21 +219,15 @@ public function createS3Driver(array $config) { $s3Config = $this->formatS3Config($config); - $root = (string) ($s3Config['root'] ?? ''); - - $visibility = new AwsS3PortableVisibilityConverter( - $config['visibility'] ?? Visibility::PUBLIC - ); - - $streamReads = $s3Config['stream_reads'] ?? false; + $root = $s3Config['root'] ?? null; - $client = new S3Client($s3Config); + $options = $config['options'] ?? []; - $adapter = new S3Adapter($client, $s3Config['bucket'], $root, $visibility, null, [], $streamReads); + $streamReads = $config['stream_reads'] ?? false; - return new AwsS3V3Adapter( - $this->createFlysystem($adapter, $config), $adapter, $s3Config, $client - ); + return $this->adapt($this->createFlysystem( + new S3Adapter(new S3Client($s3Config), $s3Config['bucket'], $root, $options, $streamReads), $config + )); } /** @@ -269,19 +250,53 @@ protected function formatS3Config(array $config) /** * Create a Flysystem instance with the given adapter. * - * @param \League\Flysystem\FilesystemAdapter $adapter + * @param \League\Flysystem\AdapterInterface $adapter * @param array $config - * @return \League\Flysystem\FilesystemOperator + * @return \League\Flysystem\FilesystemInterface + */ + protected function createFlysystem(AdapterInterface $adapter, array $config) + { + $cache = Arr::pull($config, 'cache'); + + $config = Arr::only($config, ['visibility', 'disable_asserts', 'url', 'temporary_url']); + + if ($cache) { + $adapter = new CachedAdapter($adapter, $this->createCacheStore($cache)); + } + + return new Flysystem($adapter, count($config) > 0 ? $config : null); + } + + /** + * Create a cache store instance. + * + * @param mixed $config + * @return \League\Flysystem\Cached\CacheInterface + * + * @throws \InvalidArgumentException + */ + protected function createCacheStore($config) + { + if ($config === true) { + return new MemoryStore; + } + + return new Cache( + $this->app['cache']->store($config['store']), + $config['prefix'] ?? 'flysystem', + $config['expire'] ?? null + ); + } + + /** + * Adapt the filesystem implementation. + * + * @param \League\Flysystem\FilesystemInterface $filesystem + * @return \Illuminate\Contracts\Filesystem\Filesystem */ - protected function createFlysystem(FlysystemAdapter $adapter, array $config) + protected function adapt(FilesystemInterface $filesystem) { - return new Flysystem($adapter, Arr::only($config, [ - 'directory_visibility', - 'disable_asserts', - 'temporary_url', - 'url', - 'visibility', - ])); + return new FilesystemAdapter($filesystem); } /** diff --git a/core/vendor/illuminate/filesystem/composer.json b/core/vendor/illuminate/filesystem/composer.json index bb1c217dbc..ca82b7a273 100644 --- a/core/vendor/illuminate/filesystem/composer.json +++ b/core/vendor/illuminate/filesystem/composer.json @@ -14,12 +14,12 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "symfony/finder": "^6.0" + "php": "^7.3|^8.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "symfony/finder": "^5.4" }, "autoload": { "psr-4": { @@ -28,19 +28,19 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { "ext-ftp": "Required to use the Flysystem FTP driver.", "illuminate/http": "Required for handling uploaded files (^7.0).", - "league/flysystem": "Required to use the Flysystem local driver (^3.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", - "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", - "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", + "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", + "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", + "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", - "symfony/mime": "Required to enable support for guessing extensions (^6.0)." + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", + "symfony/mime": "Required to enable support for guessing extensions (^5.4)." }, "config": { "sort-packages": true diff --git a/core/vendor/illuminate/http/Client/Factory.php b/core/vendor/illuminate/http/Client/Factory.php index 6b584a65e8..131e669a4e 100644 --- a/core/vendor/illuminate/http/Client/Factory.php +++ b/core/vendor/illuminate/http/Client/Factory.php @@ -22,11 +22,10 @@ * @method \Illuminate\Http\Client\PendingRequest baseUrl(string $url) * @method \Illuminate\Http\Client\PendingRequest beforeSending(callable $callback) * @method \Illuminate\Http\Client\PendingRequest bodyFormat(string $format) - * @method \Illuminate\Http\Client\PendingRequest connectTimeout(int $seconds) * @method \Illuminate\Http\Client\PendingRequest contentType(string $contentType) * @method \Illuminate\Http\Client\PendingRequest dd() * @method \Illuminate\Http\Client\PendingRequest dump() - * @method \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0, ?callable $when = null, bool $throw = true) + * @method \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0, ?callable $when = null) * @method \Illuminate\Http\Client\PendingRequest sink(string|resource $to) * @method \Illuminate\Http\Client\PendingRequest stub(callable $callback) * @method \Illuminate\Http\Client\PendingRequest timeout(int $seconds) diff --git a/core/vendor/illuminate/http/Client/PendingRequest.php b/core/vendor/illuminate/http/Client/PendingRequest.php index 26e10b1711..26b71253b7 100644 --- a/core/vendor/illuminate/http/Client/PendingRequest.php +++ b/core/vendor/illuminate/http/Client/PendingRequest.php @@ -100,13 +100,6 @@ class PendingRequest */ protected $retryDelay = 100; - /** - * Whether to throw an exception when all retries fail. - * - * @var bool - */ - protected $retryThrow = true; - /** * The callback that will determine if the request should be retried. * @@ -184,9 +177,7 @@ public function __construct(Factory $factory = null) $this->asJson(); $this->options = [ - 'connect_timeout' => 10, 'http_errors' => false, - 'timeout' => 30, ]; $this->beforeSendingCallbacks = collect([function (Request $request, array $options, PendingRequest $pendingRequest) { @@ -470,33 +461,18 @@ public function timeout(int $seconds) }); } - /** - * Specify the connect timeout (in seconds) for the request. - * - * @param int $seconds - * @return $this - */ - public function connectTimeout(int $seconds) - { - return tap($this, function () use ($seconds) { - $this->options['connect_timeout'] = $seconds; - }); - } - /** * Specify the number of times the request should be attempted. * * @param int $times * @param int $sleep * @param callable|null $when - * @param bool $throw * @return $this */ - public function retry(int $times, int $sleep = 0, ?callable $when = null, bool $throw = true) + public function retry(int $times, int $sleep = 0, ?callable $when = null) { $this->tries = $times; $this->retryDelay = $sleep; - $this->retryThrow = $throw; $this->retryWhenCallback = $when; return $this; @@ -613,7 +589,7 @@ public function head(string $url, $query = null) * @param array $data * @return \Illuminate\Http\Client\Response */ - public function post(string $url, $data = []) + public function post(string $url, array $data = []) { return $this->send('POST', $url, [ $this->bodyFormat => $data, @@ -695,7 +671,21 @@ public function send(string $method, string $url, array $options = []) { $url = ltrim(rtrim($this->baseUrl, '/').'/'.ltrim($url, '/'), '/'); - $options = $this->parseHttpOptions($options); + if (isset($options[$this->bodyFormat])) { + if ($this->bodyFormat === 'multipart') { + $options[$this->bodyFormat] = $this->parseMultipartBodyFormat($options[$this->bodyFormat]); + } elseif ($this->bodyFormat === 'body') { + $options[$this->bodyFormat] = $this->pendingBody; + } + + if (is_array($options[$this->bodyFormat])) { + $options[$this->bodyFormat] = array_merge( + $options[$this->bodyFormat], $this->pendingFiles + ); + } + } else { + $options[$this->bodyFormat] = $this->pendingBody; + } [$this->pendingBody, $this->pendingFiles] = [null, []]; @@ -708,7 +698,7 @@ public function send(string $method, string $url, array $options = []) return tap(new Response($this->sendRequest($method, $url, $options)), function ($response) { $this->populateResponse($response); - if ($this->tries > 1 && $this->retryThrow && ! $response->successful()) { + if ($this->tries > 1 && ! $response->successful()) { $response->throw(); } @@ -722,33 +712,6 @@ public function send(string $method, string $url, array $options = []) }, $this->retryDelay ?? 100, $this->retryWhenCallback); } - /** - * Parse the given HTTP options and set the appropriate additional options. - * - * @param array $options - * @return array - */ - protected function parseHttpOptions(array $options) - { - if (isset($options[$this->bodyFormat])) { - if ($this->bodyFormat === 'multipart') { - $options[$this->bodyFormat] = $this->parseMultipartBodyFormat($options[$this->bodyFormat]); - } elseif ($this->bodyFormat === 'body') { - $options[$this->bodyFormat] = $this->pendingBody; - } - - if (is_array($options[$this->bodyFormat])) { - $options[$this->bodyFormat] = array_merge( - $options[$this->bodyFormat], $this->pendingFiles - ); - } - } else { - $options[$this->bodyFormat] = $this->pendingBody; - } - - return collect($options)->toArray(); - } - /** * Parse multi-part form data. * @@ -917,12 +880,11 @@ public function pushHandlers($handlerStack) return tap($handlerStack, function ($stack) { $stack->push($this->buildBeforeSendingHandler()); $stack->push($this->buildRecorderHandler()); + $stack->push($this->buildStubHandler()); $this->middleware->each(function ($middleware) use ($stack) { $stack->push($middleware); }); - - $stack->push($this->buildStubHandler()); }); } @@ -952,7 +914,7 @@ public function buildRecorderHandler() $promise = $handler($request, $options); return $promise->then(function ($response) use ($request, $options) { - $this->factory?->recordRequestResponsePair( + optional($this->factory)->recordRequestResponsePair( (new Request($request))->withData($options['laravel_data']), new Response($response) ); @@ -1092,7 +1054,7 @@ public function getPromise() */ protected function dispatchRequestSendingEvent() { - if ($dispatcher = $this->factory?->getDispatcher()) { + if ($dispatcher = optional($this->factory)->getDispatcher()) { $dispatcher->dispatch(new RequestSending($this->request)); } } @@ -1105,7 +1067,7 @@ protected function dispatchRequestSendingEvent() */ protected function dispatchResponseReceivedEvent(Response $response) { - if (! ($dispatcher = $this->factory?->getDispatcher()) || + if (! ($dispatcher = optional($this->factory)->getDispatcher()) || ! $this->request) { return; } @@ -1120,7 +1082,7 @@ protected function dispatchResponseReceivedEvent(Response $response) */ protected function dispatchConnectionFailedEvent() { - if ($dispatcher = $this->factory?->getDispatcher()) { + if ($dispatcher = optional($this->factory)->getDispatcher()) { $dispatcher->dispatch(new ConnectionFailed($this->request)); } } diff --git a/core/vendor/illuminate/http/Client/Request.php b/core/vendor/illuminate/http/Client/Request.php index 3c2d6a9bdb..0e493f1fa9 100644 --- a/core/vendor/illuminate/http/Client/Request.php +++ b/core/vendor/illuminate/http/Client/Request.php @@ -4,6 +4,7 @@ use ArrayAccess; use Illuminate\Support\Arr; +use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; use LogicException; @@ -217,7 +218,7 @@ public function isForm() public function isJson() { return $this->hasHeader('Content-Type') && - str_contains($this->header('Content-Type')[0], 'json'); + Str::contains($this->header('Content-Type')[0], 'json'); } /** @@ -228,7 +229,7 @@ public function isJson() public function isMultipart() { return $this->hasHeader('Content-Type') && - str_contains($this->header('Content-Type')[0], 'multipart'); + Str::contains($this->header('Content-Type')[0], 'multipart'); } /** @@ -260,7 +261,8 @@ public function toPsrRequest() * @param string $offset * @return bool */ - public function offsetExists($offset): bool + #[\ReturnTypeWillChange] + public function offsetExists($offset) { return isset($this->data()[$offset]); } @@ -271,7 +273,8 @@ public function offsetExists($offset): bool * @param string $offset * @return mixed */ - public function offsetGet($offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($offset) { return $this->data()[$offset]; } @@ -285,7 +288,8 @@ public function offsetGet($offset): mixed * * @throws \LogicException */ - public function offsetSet($offset, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) { throw new LogicException('Request data may not be mutated using array access.'); } @@ -298,7 +302,8 @@ public function offsetSet($offset, $value): void * * @throws \LogicException */ - public function offsetUnset($offset): void + #[\ReturnTypeWillChange] + public function offsetUnset($offset) { throw new LogicException('Request data may not be mutated using array access.'); } diff --git a/core/vendor/illuminate/http/Client/Response.php b/core/vendor/illuminate/http/Client/Response.php index c79b993e82..703b3570df 100644 --- a/core/vendor/illuminate/http/Client/Response.php +++ b/core/vendor/illuminate/http/Client/Response.php @@ -137,7 +137,7 @@ public function reason() */ public function effectiveUri() { - return $this->transferStats?->getEffectiveUri(); + return optional($this->transferStats)->getEffectiveUri(); } /** @@ -252,7 +252,7 @@ public function cookies() */ public function handlerStats() { - return $this->transferStats?->getHandlerStats() ?? []; + return optional($this->transferStats)->getHandlerStats() ?? []; } /** @@ -331,7 +331,8 @@ public function throwIf($condition) * @param string $offset * @return bool */ - public function offsetExists($offset): bool + #[\ReturnTypeWillChange] + public function offsetExists($offset) { return isset($this->json()[$offset]); } @@ -342,7 +343,8 @@ public function offsetExists($offset): bool * @param string $offset * @return mixed */ - public function offsetGet($offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($offset) { return $this->json()[$offset]; } @@ -356,7 +358,8 @@ public function offsetGet($offset): mixed * * @throws \LogicException */ - public function offsetSet($offset, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) { throw new LogicException('Response data may not be mutated using array access.'); } @@ -369,7 +372,8 @@ public function offsetSet($offset, $value): void * * @throws \LogicException */ - public function offsetUnset($offset): void + #[\ReturnTypeWillChange] + public function offsetUnset($offset) { throw new LogicException('Response data may not be mutated using array access.'); } diff --git a/core/vendor/illuminate/http/Concerns/InteractsWithInput.php b/core/vendor/illuminate/http/Concerns/InteractsWithInput.php index 56dc17542b..ae8b6fe738 100644 --- a/core/vendor/illuminate/http/Concerns/InteractsWithInput.php +++ b/core/vendor/illuminate/http/Concerns/InteractsWithInput.php @@ -7,7 +7,6 @@ use Illuminate\Support\Facades\Date; use SplFileInfo; use stdClass; -use Symfony\Component\HttpFoundation\InputBag; use Symfony\Component\VarDumper\VarDumper; trait InteractsWithInput @@ -61,7 +60,7 @@ public function bearerToken() if ($position !== false) { $header = substr($header, $position + 7); - return str_contains($header, ',') ? strstr($header, ',', true) : $header; + return strpos($header, ',') !== false ? strstr($header, ',', true) : $header; } } @@ -508,10 +507,6 @@ protected function retrieveItem($source, $key, $default) return $this->$source->all(); } - if ($this->$source instanceof InputBag) { - return $this->$source->all()[$key] ?? $default; - } - return $this->$source->get($key, $default); } diff --git a/core/vendor/illuminate/http/Exceptions/PostTooLargeException.php b/core/vendor/illuminate/http/Exceptions/PostTooLargeException.php index d5bbc60dc4..75f6cdde31 100644 --- a/core/vendor/illuminate/http/Exceptions/PostTooLargeException.php +++ b/core/vendor/illuminate/http/Exceptions/PostTooLargeException.php @@ -10,13 +10,13 @@ class PostTooLargeException extends HttpException /** * Create a new "post too large" exception instance. * - * @param string $message + * @param string|null $message * @param \Throwable|null $previous * @param array $headers * @param int $code * @return void */ - public function __construct($message = '', Throwable $previous = null, array $headers = [], $code = 0) + public function __construct($message = null, Throwable $previous = null, array $headers = [], $code = 0) { parent::__construct(413, $message, $previous, $headers, $code); } diff --git a/core/vendor/illuminate/http/Exceptions/ThrottleRequestsException.php b/core/vendor/illuminate/http/Exceptions/ThrottleRequestsException.php index d6c6e33680..c09393174d 100644 --- a/core/vendor/illuminate/http/Exceptions/ThrottleRequestsException.php +++ b/core/vendor/illuminate/http/Exceptions/ThrottleRequestsException.php @@ -10,13 +10,13 @@ class ThrottleRequestsException extends TooManyRequestsHttpException /** * Create a new throttle requests exception instance. * - * @param string $message + * @param string|null $message * @param \Throwable|null $previous * @param array $headers * @param int $code * @return void */ - public function __construct($message = '', Throwable $previous = null, array $headers = [], $code = 0) + public function __construct($message = null, Throwable $previous = null, array $headers = [], $code = 0) { parent::__construct(null, $message, $previous, $code, $headers); } diff --git a/core/vendor/illuminate/http/JsonResponse.php b/core/vendor/illuminate/http/JsonResponse.php index ee46d8baf6..b2e205ce8f 100755 --- a/core/vendor/illuminate/http/JsonResponse.php +++ b/core/vendor/illuminate/http/JsonResponse.php @@ -37,7 +37,7 @@ public function __construct($data = null, $status = 200, $headers = [], $options * * @return static */ - public static function fromJsonString(?string $data = null, int $status = 200, array $headers = []): static + public static function fromJsonString(?string $data = null, int $status = 200, array $headers = []) { return new static($data, $status, $headers, 0, true); } @@ -70,7 +70,7 @@ public function getData($assoc = false, $depth = 512) * * @return static */ - public function setData($data = []): static + public function setData($data = []) { $this->original = $data; @@ -116,7 +116,7 @@ protected function hasValidJson($jsonError) * * @return static */ - public function setEncodingOptions($options): static + public function setEncodingOptions($options) { $this->encodingOptions = (int) $options; diff --git a/core/vendor/illuminate/http/Middleware/SetCacheHeaders.php b/core/vendor/illuminate/http/Middleware/SetCacheHeaders.php index 770a523ae2..b42dc2f2f8 100644 --- a/core/vendor/illuminate/http/Middleware/SetCacheHeaders.php +++ b/core/vendor/illuminate/http/Middleware/SetCacheHeaders.php @@ -30,7 +30,7 @@ public function handle($request, Closure $next, $options = []) } if (isset($options['etag']) && $options['etag'] === true) { - $options['etag'] = $response->getEtag() ?? md5($response->getContent()); + $options['etag'] = md5($response->getContent()); } if (isset($options['last_modified'])) { diff --git a/core/vendor/illuminate/http/Middleware/TrustHosts.php b/core/vendor/illuminate/http/Middleware/TrustHosts.php index fd7e601518..8b563151ad 100644 --- a/core/vendor/illuminate/http/Middleware/TrustHosts.php +++ b/core/vendor/illuminate/http/Middleware/TrustHosts.php @@ -55,7 +55,7 @@ public function handle(Request $request, $next) */ protected function shouldSpecifyTrustedHosts() { - return ! $this->app->environment('local') && + return config('app.env') !== 'local' && ! $this->app->runningUnitTests(); } diff --git a/core/vendor/illuminate/http/Middleware/TrustProxies.php b/core/vendor/illuminate/http/Middleware/TrustProxies.php index 5086bd8297..e9e06968b8 100644 --- a/core/vendor/illuminate/http/Middleware/TrustProxies.php +++ b/core/vendor/illuminate/http/Middleware/TrustProxies.php @@ -19,7 +19,7 @@ class TrustProxies * * @var int */ - protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_PREFIX | Request::HEADER_X_FORWARDED_AWS_ELB; + protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB; /** * Handle an incoming request. @@ -92,16 +92,36 @@ protected function setTrustedProxyIpAddressesToTheCallingIp(Request $request) */ protected function getTrustedHeaderNames() { - return match ($this->headers) { - 'HEADER_X_FORWARDED_AWS_ELB', Request::HEADER_X_FORWARDED_AWS_ELB => Request::HEADER_X_FORWARDED_AWS_ELB, - 'HEADER_FORWARDED', Request::HEADER_FORWARDED => Request::HEADER_FORWARDED, - 'HEADER_X_FORWARDED_FOR', Request::HEADER_X_FORWARDED_FOR => Request::HEADER_X_FORWARDED_FOR, - 'HEADER_X_FORWARDED_HOST', Request::HEADER_X_FORWARDED_HOST => Request::HEADER_X_FORWARDED_HOST, - 'HEADER_X_FORWARDED_PORT', Request::HEADER_X_FORWARDED_PORT => Request::HEADER_X_FORWARDED_PORT, - 'HEADER_X_FORWARDED_PROTO', Request::HEADER_X_FORWARDED_PROTO => Request::HEADER_X_FORWARDED_PROTO, - 'HEADER_X_FORWARDED_PREFIX', Request::HEADER_X_FORWARDED_PREFIX => Request::HEADER_X_FORWARDED_PREFIX, - default => Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_PREFIX | Request::HEADER_X_FORWARDED_AWS_ELB, - }; + switch ($this->headers) { + case 'HEADER_X_FORWARDED_AWS_ELB': + case Request::HEADER_X_FORWARDED_AWS_ELB: + return Request::HEADER_X_FORWARDED_AWS_ELB; + + case 'HEADER_FORWARDED': + case Request::HEADER_FORWARDED: + return Request::HEADER_FORWARDED; + + case 'HEADER_X_FORWARDED_FOR': + case Request::HEADER_X_FORWARDED_FOR: + return Request::HEADER_X_FORWARDED_FOR; + + case 'HEADER_X_FORWARDED_HOST': + case Request::HEADER_X_FORWARDED_HOST: + return Request::HEADER_X_FORWARDED_HOST; + + case 'HEADER_X_FORWARDED_PORT': + case Request::HEADER_X_FORWARDED_PORT: + return Request::HEADER_X_FORWARDED_PORT; + + case 'HEADER_X_FORWARDED_PROTO': + case Request::HEADER_X_FORWARDED_PROTO: + return Request::HEADER_X_FORWARDED_PROTO; + + default: + return Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB; + } + + return $this->headers; } /** diff --git a/core/vendor/illuminate/http/RedirectResponse.php b/core/vendor/illuminate/http/RedirectResponse.php index 6edd57efe9..32bb5fcffb 100755 --- a/core/vendor/illuminate/http/RedirectResponse.php +++ b/core/vendor/illuminate/http/RedirectResponse.php @@ -249,7 +249,7 @@ public function __call($method, $parameters) return $this->macroCall($method, $parameters); } - if (str_starts_with($method, 'with')) { + if (Str::startsWith($method, 'with')) { return $this->with(Str::snake(substr($method, 4)), $parameters[0]); } diff --git a/core/vendor/illuminate/http/Request.php b/core/vendor/illuminate/http/Request.php index a628bdb0c0..06bc955633 100644 --- a/core/vendor/illuminate/http/Request.php +++ b/core/vendor/illuminate/http/Request.php @@ -5,15 +5,12 @@ use ArrayAccess; use Closure; use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Session\SymfonySessionDecorator; use Illuminate\Support\Arr; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; use RuntimeException; -use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\Request as SymfonyRequest; -use Symfony\Component\HttpFoundation\Session\SessionInterface; /** * @method array validate(array $rules, ...$params) @@ -139,7 +136,7 @@ public function fullUrlWithQuery(array $query) /** * Get the full URL for the request without the given query string parameters. * - * @param array|string $keys + * @param array|string $query * @return string */ public function fullUrlWithoutQuery($keys) @@ -211,7 +208,13 @@ public function is(...$patterns) { $path = $this->decodedPath(); - return collect($patterns)->contains(fn ($pattern) => Str::is($pattern, $path)); + foreach ($patterns as $pattern) { + if (Str::is($pattern, $path)) { + return true; + } + } + + return false; } /** @@ -235,7 +238,13 @@ public function fullUrlIs(...$patterns) { $url = $this->fullUrl(); - return collect($patterns)->contains(fn ($pattern) => Str::is($pattern, $url)); + foreach ($patterns as $pattern) { + if (Str::is($pattern, $url)) { + return true; + } + } + + return false; } /** @@ -357,7 +366,7 @@ public function replace(array $input) * @param mixed $default * @return mixed */ - public function get(string $key, mixed $default = null): mixed + public function get(string $key, $default = null) { return parent::get($key, $default); } @@ -425,7 +434,7 @@ public static function createFrom(self $from, $to = null) $request->setJson($from->json()); - if ($from->hasSession() && $session = $from->session()) { + if ($session = $from->getSession()) { $request->setLaravelSession($session); } @@ -453,9 +462,7 @@ public static function createFromBase(SymfonyRequest $request) $newRequest->content = $request->content; - if ($newRequest->isJson()) { - $newRequest->request = $newRequest->json(); - } + $newRequest->request = $newRequest->getInputSource(); return $newRequest; } @@ -465,7 +472,7 @@ public static function createFromBase(SymfonyRequest $request) * * @return static */ - public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null): static + public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) { return parent::duplicate($query, $request, $attributes, $cookies, $this->filterFiles($files), $server); } @@ -495,28 +502,10 @@ protected function filterFiles($files) return $files; } - /** - * {@inheritdoc} - */ - public function hasSession(bool $skipIfUninitialized = false): bool - { - return ! is_null($this->session); - } - - /** - * {@inheritdoc} - */ - public function getSession(): SessionInterface - { - return $this->hasSession() - ? new SymfonySessionDecorator($this->session()) - : throw new SessionNotFoundException; - } - /** * Get the session associated with the request. * - * @return \Illuminate\Contracts\Session\Session + * @return \Illuminate\Session\Store * * @throws \RuntimeException */ @@ -529,6 +518,16 @@ public function session() return $this->session; } + /** + * Get the session associated with the request. + * + * @return \Illuminate\Session\Store|null + */ + public function getSession() + { + return $this->session; + } + /** * Set the session instance on the request. * @@ -656,7 +655,7 @@ public function setRouteResolver(Closure $callback) * * @return array */ - public function toArray(): array + public function toArray() { return $this->all(); } @@ -667,7 +666,8 @@ public function toArray(): array * @param string $offset * @return bool */ - public function offsetExists($offset): bool + #[\ReturnTypeWillChange] + public function offsetExists($offset) { return Arr::has( $this->all() + $this->route()->parameters(), @@ -681,7 +681,8 @@ public function offsetExists($offset): bool * @param string $offset * @return mixed */ - public function offsetGet($offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($offset) { return $this->__get($offset); } @@ -693,7 +694,8 @@ public function offsetGet($offset): mixed * @param mixed $value * @return void */ - public function offsetSet($offset, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) { $this->getInputSource()->set($offset, $value); } @@ -704,7 +706,8 @@ public function offsetSet($offset, $value): void * @param string $offset * @return void */ - public function offsetUnset($offset): void + #[\ReturnTypeWillChange] + public function offsetUnset($offset) { $this->getInputSource()->remove($offset); } diff --git a/core/vendor/illuminate/http/Resources/CollectsResources.php b/core/vendor/illuminate/http/Resources/CollectsResources.php index b84c344539..a4d4faba27 100644 --- a/core/vendor/illuminate/http/Resources/CollectsResources.php +++ b/core/vendor/illuminate/http/Resources/CollectsResources.php @@ -2,14 +2,11 @@ namespace Illuminate\Http\Resources; -use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Pagination\AbstractCursorPaginator; use Illuminate\Pagination\AbstractPaginator; use Illuminate\Support\Collection; use Illuminate\Support\Str; -use LogicException; use ReflectionClass; -use Traversable; trait CollectsResources { @@ -47,21 +44,15 @@ protected function collectResource($resource) */ protected function collects() { - $collects = null; - if ($this->collects) { - $collects = $this->collects; - } elseif (str_ends_with(class_basename($this), 'Collection') && - (class_exists($class = Str::replaceLast('Collection', '', get_class($this))) || - class_exists($class = Str::replaceLast('Collection', 'Resource', get_class($this))))) { - $collects = $class; + return $this->collects; } - if (! $collects || is_a($collects, JsonResource::class, true)) { - return $collects; + if (Str::endsWith(class_basename($this), 'Collection') && + (class_exists($class = Str::replaceLast('Collection', '', get_class($this))) || + class_exists($class = Str::replaceLast('Collection', 'Resource', get_class($this))))) { + return $class; } - - throw new LogicException('Resource collections must collect instances of '.JsonResource::class.'.'); } /** @@ -87,7 +78,8 @@ public function jsonOptions() * * @return \ArrayIterator */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { return $this->collection->getIterator(); } diff --git a/core/vendor/illuminate/http/Resources/DelegatesToResource.php b/core/vendor/illuminate/http/Resources/DelegatesToResource.php index 5390052282..48f455f97e 100644 --- a/core/vendor/illuminate/http/Resources/DelegatesToResource.php +++ b/core/vendor/illuminate/http/Resources/DelegatesToResource.php @@ -64,7 +64,8 @@ public function resolveChildRouteBinding($childType, $value, $field = null) * @param mixed $offset * @return bool */ - public function offsetExists($offset): bool + #[\ReturnTypeWillChange] + public function offsetExists($offset) { return isset($this->resource[$offset]); } @@ -75,7 +76,8 @@ public function offsetExists($offset): bool * @param mixed $offset * @return mixed */ - public function offsetGet($offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($offset) { return $this->resource[$offset]; } @@ -87,7 +89,8 @@ public function offsetGet($offset): mixed * @param mixed $value * @return void */ - public function offsetSet($offset, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) { $this->resource[$offset] = $value; } @@ -98,7 +101,8 @@ public function offsetSet($offset, $value): void * @param mixed $offset * @return void */ - public function offsetUnset($offset): void + #[\ReturnTypeWillChange] + public function offsetUnset($offset) { unset($this->resource[$offset]); } diff --git a/core/vendor/illuminate/http/Resources/Json/JsonResource.php b/core/vendor/illuminate/http/Resources/Json/JsonResource.php index 6314af3204..8c8bf000bd 100644 --- a/core/vendor/illuminate/http/Resources/Json/JsonResource.php +++ b/core/vendor/illuminate/http/Resources/Json/JsonResource.php @@ -236,7 +236,8 @@ public function toResponse($request) * * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->resolve(Container::getInstance()->make('request')); } diff --git a/core/vendor/illuminate/http/Resources/Json/ResourceCollection.php b/core/vendor/illuminate/http/Resources/Json/ResourceCollection.php index 6b825cb764..65710aa327 100644 --- a/core/vendor/illuminate/http/Resources/Json/ResourceCollection.php +++ b/core/vendor/illuminate/http/Resources/Json/ResourceCollection.php @@ -85,7 +85,8 @@ public function withQuery(array $query) * * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return $this->collection->count(); } diff --git a/core/vendor/illuminate/http/Response.php b/core/vendor/illuminate/http/Response.php index dad783fcd6..8599a8e53a 100755 --- a/core/vendor/illuminate/http/Response.php +++ b/core/vendor/illuminate/http/Response.php @@ -45,7 +45,7 @@ public function __construct($content = '', $status = 200, array $headers = []) * * @throws \InvalidArgumentException */ - public function setContent(mixed $content): static + public function setContent($content) { $this->original = $content; diff --git a/core/vendor/illuminate/http/Testing/File.php b/core/vendor/illuminate/http/Testing/File.php index aaba539cfb..c714529feb 100644 --- a/core/vendor/illuminate/http/Testing/File.php +++ b/core/vendor/illuminate/http/Testing/File.php @@ -107,7 +107,8 @@ public function size($kilobytes) * * @return int */ - public function getSize(): int + #[\ReturnTypeWillChange] + public function getSize() { return $this->sizeToReport ?: parent::getSize(); } @@ -130,7 +131,7 @@ public function mimeType($mimeType) * * @return string */ - public function getMimeType(): string + public function getMimeType() { return $this->mimeTypeToReport ?: MimeType::from($this->name); } diff --git a/core/vendor/illuminate/http/composer.json b/core/vendor/illuminate/http/composer.json index 6d0f3d634c..564c398d68 100755 --- a/core/vendor/illuminate/http/composer.json +++ b/core/vendor/illuminate/http/composer.json @@ -14,15 +14,15 @@ } ], "require": { - "php": "^8.0.2", + "php": "^7.3|^8.0", "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/session": "^9.0", - "illuminate/support": "^9.0", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/mime": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/session": "^8.0", + "illuminate/support": "^8.0", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/mime": "^5.4" }, "autoload": { "psr-4": { @@ -31,11 +31,11 @@ }, "suggest": { "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", - "guzzlehttp/guzzle": "Required to use the HTTP Client (^7.2)." + "guzzlehttp/guzzle": "Required to use the HTTP Client (^6.5.5|^7.0.1)." }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/log/LogManager.php b/core/vendor/illuminate/log/LogManager.php index 99e88358b1..44601a7e32 100644 --- a/core/vendor/illuminate/log/LogManager.php +++ b/core/vendor/illuminate/log/LogManager.php @@ -160,7 +160,7 @@ protected function tap($name, Logger $logger) */ protected function parseTap($tap) { - return str_contains($tap, ':') ? explode(':', $tap, 2) : [$tap, '']; + return Str::contains($tap, ':') ? explode(':', $tap, 2) : [$tap, '']; } /** @@ -543,7 +543,7 @@ public function getChannels() * @param array $context * @return void */ - public function emergency($message, array $context = []): void + public function emergency($message, array $context = []) { $this->driver()->emergency($message, $context); } @@ -558,7 +558,7 @@ public function emergency($message, array $context = []): void * @param array $context * @return void */ - public function alert($message, array $context = []): void + public function alert($message, array $context = []) { $this->driver()->alert($message, $context); } @@ -572,7 +572,7 @@ public function alert($message, array $context = []): void * @param array $context * @return void */ - public function critical($message, array $context = []): void + public function critical($message, array $context = []) { $this->driver()->critical($message, $context); } @@ -585,7 +585,7 @@ public function critical($message, array $context = []): void * @param array $context * @return void */ - public function error($message, array $context = []): void + public function error($message, array $context = []) { $this->driver()->error($message, $context); } @@ -600,7 +600,7 @@ public function error($message, array $context = []): void * @param array $context * @return void */ - public function warning($message, array $context = []): void + public function warning($message, array $context = []) { $this->driver()->warning($message, $context); } @@ -612,7 +612,7 @@ public function warning($message, array $context = []): void * @param array $context * @return void */ - public function notice($message, array $context = []): void + public function notice($message, array $context = []) { $this->driver()->notice($message, $context); } @@ -626,7 +626,7 @@ public function notice($message, array $context = []): void * @param array $context * @return void */ - public function info($message, array $context = []): void + public function info($message, array $context = []) { $this->driver()->info($message, $context); } @@ -638,7 +638,7 @@ public function info($message, array $context = []): void * @param array $context * @return void */ - public function debug($message, array $context = []): void + public function debug($message, array $context = []) { $this->driver()->debug($message, $context); } @@ -651,7 +651,7 @@ public function debug($message, array $context = []): void * @param array $context * @return void */ - public function log($level, $message, array $context = []): void + public function log($level, $message, array $context = []) { $this->driver()->log($level, $message, $context); } diff --git a/core/vendor/illuminate/log/Logger.php b/core/vendor/illuminate/log/Logger.php index 40626a0331..382b77c644 100755 --- a/core/vendor/illuminate/log/Logger.php +++ b/core/vendor/illuminate/log/Logger.php @@ -49,11 +49,11 @@ public function __construct(LoggerInterface $logger, Dispatcher $dispatcher = nu /** * Log an emergency message to the logs. * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function emergency($message, array $context = []): void + public function emergency($message, array $context = []) { $this->writeLog(__FUNCTION__, $message, $context); } @@ -61,11 +61,11 @@ public function emergency($message, array $context = []): void /** * Log an alert message to the logs. * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function alert($message, array $context = []): void + public function alert($message, array $context = []) { $this->writeLog(__FUNCTION__, $message, $context); } @@ -73,11 +73,11 @@ public function alert($message, array $context = []): void /** * Log a critical message to the logs. * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function critical($message, array $context = []): void + public function critical($message, array $context = []) { $this->writeLog(__FUNCTION__, $message, $context); } @@ -85,11 +85,11 @@ public function critical($message, array $context = []): void /** * Log an error message to the logs. * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function error($message, array $context = []): void + public function error($message, array $context = []) { $this->writeLog(__FUNCTION__, $message, $context); } @@ -97,11 +97,11 @@ public function error($message, array $context = []): void /** * Log a warning message to the logs. * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function warning($message, array $context = []): void + public function warning($message, array $context = []) { $this->writeLog(__FUNCTION__, $message, $context); } @@ -109,11 +109,11 @@ public function warning($message, array $context = []): void /** * Log a notice to the logs. * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function notice($message, array $context = []): void + public function notice($message, array $context = []) { $this->writeLog(__FUNCTION__, $message, $context); } @@ -121,11 +121,11 @@ public function notice($message, array $context = []): void /** * Log an informational message to the logs. * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function info($message, array $context = []): void + public function info($message, array $context = []) { $this->writeLog(__FUNCTION__, $message, $context); } @@ -133,11 +133,11 @@ public function info($message, array $context = []): void /** * Log a debug message to the logs. * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function debug($message, array $context = []): void + public function debug($message, array $context = []) { $this->writeLog(__FUNCTION__, $message, $context); } @@ -146,11 +146,11 @@ public function debug($message, array $context = []): void * Log a message to the logs. * * @param string $level - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function log($level, $message, array $context = []): void + public function log($level, $message, array $context = []) { $this->writeLog($level, $message, $context); } @@ -159,11 +159,11 @@ public function log($level, $message, array $context = []): void * Dynamically pass log calls into the writer. * * @param string $level - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - public function write($level, $message, array $context = []): void + public function write($level, $message, array $context = []) { $this->writeLog($level, $message, $context); } @@ -172,11 +172,11 @@ public function write($level, $message, array $context = []): void * Write a message to the log. * * @param string $level - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message + * @param string $message * @param array $context * @return void */ - protected function writeLog($level, $message, $context): void + protected function writeLog($level, $message, $context) { $this->logger->{$level}( $message = $this->formatMessage($message), @@ -249,8 +249,8 @@ protected function fireLogEvent($level, $message, array $context = []) /** * Format the parameters for the logger. * - * @param \Illuminate\Contracts\Support\Arrayable|\Illuminate\Contracts\Support\Jsonable|\Illuminate\Support\Stringable|array|string $message - * @return string + * @param mixed $message + * @return mixed */ protected function formatMessage($message) { @@ -262,7 +262,7 @@ protected function formatMessage($message) return var_export($message->toArray(), true); } - return (string) $message; + return $message; } /** diff --git a/core/vendor/illuminate/log/composer.json b/core/vendor/illuminate/log/composer.json index f6bfd0e9dc..1fd148d9a9 100755 --- a/core/vendor/illuminate/log/composer.json +++ b/core/vendor/illuminate/log/composer.json @@ -14,9 +14,9 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0", + "php": "^7.3|^8.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", "monolog/monolog": "^2.0" }, "autoload": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/macroable/composer.json b/core/vendor/illuminate/macroable/composer.json index 0417dbe40d..dfa5c62be1 100644 --- a/core/vendor/illuminate/macroable/composer.json +++ b/core/vendor/illuminate/macroable/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^8.0.2" + "php": "^7.3|^8.0" }, "autoload": { "psr-4": { @@ -23,7 +23,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/pagination/AbstractCursorPaginator.php b/core/vendor/illuminate/pagination/AbstractCursorPaginator.php index d8f1898ed7..1965588137 100644 --- a/core/vendor/illuminate/pagination/AbstractCursorPaginator.php +++ b/core/vendor/illuminate/pagination/AbstractCursorPaginator.php @@ -14,7 +14,6 @@ use Illuminate\Support\Str; use Illuminate\Support\Traits\ForwardsCalls; use Illuminate\Support\Traits\Tappable; -use Traversable; /** * @mixin \Illuminate\Support\Collection @@ -111,7 +110,7 @@ public function url($cursor) } return $this->path() - .(str_contains($this->path(), '?') ? '&' : '?') + .(Str::contains($this->path(), '?') ? '&' : '?') .Arr::query($parameters) .$this->buildFragment(); } @@ -516,7 +515,8 @@ public static function viewFactory() * * @return \ArrayIterator */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { return $this->items->getIterator(); } @@ -546,7 +546,8 @@ public function isNotEmpty() * * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return $this->items->count(); } @@ -590,7 +591,8 @@ public function getOptions() * @param mixed $key * @return bool */ - public function offsetExists($key): bool + #[\ReturnTypeWillChange] + public function offsetExists($key) { return $this->items->has($key); } @@ -601,7 +603,8 @@ public function offsetExists($key): bool * @param mixed $key * @return mixed */ - public function offsetGet($key): mixed + #[\ReturnTypeWillChange] + public function offsetGet($key) { return $this->items->get($key); } @@ -613,7 +616,8 @@ public function offsetGet($key): mixed * @param mixed $value * @return void */ - public function offsetSet($key, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) { $this->items->put($key, $value); } @@ -624,7 +628,8 @@ public function offsetSet($key, $value): void * @param mixed $key * @return void */ - public function offsetUnset($key): void + #[\ReturnTypeWillChange] + public function offsetUnset($key) { $this->items->forget($key); } diff --git a/core/vendor/illuminate/pagination/AbstractPaginator.php b/core/vendor/illuminate/pagination/AbstractPaginator.php index a4979840f3..ac9ef40350 100644 --- a/core/vendor/illuminate/pagination/AbstractPaginator.php +++ b/core/vendor/illuminate/pagination/AbstractPaginator.php @@ -6,9 +6,9 @@ use Illuminate\Contracts\Support\Htmlable; use Illuminate\Support\Arr; use Illuminate\Support\Collection; +use Illuminate\Support\Str; use Illuminate\Support\Traits\ForwardsCalls; use Illuminate\Support\Traits\Tappable; -use Traversable; /** * @mixin \Illuminate\Support\Collection @@ -181,7 +181,7 @@ public function url($page) } return $this->path() - .(str_contains($this->path(), '?') ? '&' : '?') + .(Str::contains($this->path(), '?') ? '&' : '?') .Arr::query($parameters) .$this->buildFragment(); } @@ -609,7 +609,8 @@ public static function useTailwind() */ public static function useBootstrap() { - static::useBootstrapFour(); + static::defaultView('pagination::bootstrap-4'); + static::defaultSimpleView('pagination::simple-bootstrap-4'); } /** @@ -623,34 +624,13 @@ public static function useBootstrapThree() static::defaultSimpleView('pagination::simple-default'); } - /** - * Indicate that Bootstrap 4 styling should be used for generated links. - * - * @return void - */ - public static function useBootstrapFour() - { - static::defaultView('pagination::bootstrap-4'); - static::defaultSimpleView('pagination::simple-bootstrap-4'); - } - - /** - * Indicate that Bootstrap 5 styling should be used for generated links. - * - * @return void - */ - public static function useBootstrapFive() - { - static::defaultView('pagination::bootstrap-5'); - static::defaultSimpleView('pagination::simple-bootstrap-5'); - } - /** * Get an iterator for the items. * * @return \ArrayIterator */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { return $this->items->getIterator(); } @@ -680,7 +660,8 @@ public function isNotEmpty() * * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return $this->items->count(); } @@ -724,7 +705,8 @@ public function getOptions() * @param mixed $key * @return bool */ - public function offsetExists($key): bool + #[\ReturnTypeWillChange] + public function offsetExists($key) { return $this->items->has($key); } @@ -735,7 +717,8 @@ public function offsetExists($key): bool * @param mixed $key * @return mixed */ - public function offsetGet($key): mixed + #[\ReturnTypeWillChange] + public function offsetGet($key) { return $this->items->get($key); } @@ -747,7 +730,8 @@ public function offsetGet($key): mixed * @param mixed $value * @return void */ - public function offsetSet($key, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) { $this->items->put($key, $value); } @@ -758,7 +742,8 @@ public function offsetSet($key, $value): void * @param mixed $key * @return void */ - public function offsetUnset($key): void + #[\ReturnTypeWillChange] + public function offsetUnset($key) { $this->items->forget($key); } diff --git a/core/vendor/illuminate/pagination/CursorPaginationException.php b/core/vendor/illuminate/pagination/CursorPaginationException.php new file mode 100644 index 0000000000..b12ca607f1 --- /dev/null +++ b/core/vendor/illuminate/pagination/CursorPaginationException.php @@ -0,0 +1,13 @@ +<?php + +namespace Illuminate\Pagination; + +use RuntimeException; + +/** + * @deprecated Will be removed in a future Laravel version. + */ +class CursorPaginationException extends RuntimeException +{ + // +} diff --git a/core/vendor/illuminate/pagination/CursorPaginator.php b/core/vendor/illuminate/pagination/CursorPaginator.php index 7ec38b7bfc..63798b94ad 100644 --- a/core/vendor/illuminate/pagination/CursorPaginator.php +++ b/core/vendor/illuminate/pagination/CursorPaginator.php @@ -132,9 +132,7 @@ public function toArray() 'data' => $this->items->toArray(), 'path' => $this->path(), 'per_page' => $this->perPage(), - 'next_cursor' => $this->nextCursor()?->encode(), 'next_page_url' => $this->nextPageUrl(), - 'prev_cursor' => $this->previousCursor()?->encode(), 'prev_page_url' => $this->previousPageUrl(), ]; } @@ -144,7 +142,8 @@ public function toArray() * * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->toArray(); } diff --git a/core/vendor/illuminate/pagination/LengthAwarePaginator.php b/core/vendor/illuminate/pagination/LengthAwarePaginator.php index 92edd22f4d..24f68b121b 100644 --- a/core/vendor/illuminate/pagination/LengthAwarePaginator.php +++ b/core/vendor/illuminate/pagination/LengthAwarePaginator.php @@ -213,7 +213,8 @@ public function toArray() * * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->toArray(); } diff --git a/core/vendor/illuminate/pagination/Paginator.php b/core/vendor/illuminate/pagination/Paginator.php index d307ee9ff3..733edb8e00 100644 --- a/core/vendor/illuminate/pagination/Paginator.php +++ b/core/vendor/illuminate/pagination/Paginator.php @@ -158,7 +158,8 @@ public function toArray() * * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->toArray(); } diff --git a/core/vendor/illuminate/pagination/composer.json b/core/vendor/illuminate/pagination/composer.json index 3edd0d73ff..5c8a380b2a 100755 --- a/core/vendor/illuminate/pagination/composer.json +++ b/core/vendor/illuminate/pagination/composer.json @@ -14,11 +14,11 @@ } ], "require": { - "php": "^8.0.2", + "php": "^7.3|^8.0", "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0" }, "autoload": { "psr-4": { @@ -27,7 +27,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/pagination/resources/views/bootstrap-5.blade.php b/core/vendor/illuminate/pagination/resources/views/bootstrap-5.blade.php deleted file mode 100644 index f753c8448a..0000000000 --- a/core/vendor/illuminate/pagination/resources/views/bootstrap-5.blade.php +++ /dev/null @@ -1,88 +0,0 @@ -@if ($paginator->hasPages()) - <nav class="d-flex justify-items-center justify-content-between"> - <div class="d-flex justify-content-between flex-fill d-sm-none"> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">@lang('pagination.previous')</span> - </li> - @else - <li class="page-item"> - <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a> - </li> - @endif - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li class="page-item"> - <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a> - </li> - @else - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">@lang('pagination.next')</span> - </li> - @endif - </ul> - </div> - - <div class="d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between"> - <div> - <p class="small text-muted"> - {!! __('Showing') !!} - <span class="font-medium">{{ $paginator->firstItem() }}</span> - {!! __('to') !!} - <span class="font-medium">{{ $paginator->lastItem() }}</span> - {!! __('of') !!} - <span class="font-medium">{{ $paginator->total() }}</span> - {!! __('results') !!} - </p> - </div> - - <div> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')"> - <span class="page-link" aria-hidden="true">‹</span> - </li> - @else - <li class="page-item"> - <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a> - </li> - @endif - - {{-- Pagination Elements --}} - @foreach ($elements as $element) - {{-- "Three Dots" Separator --}} - @if (is_string($element)) - <li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li> - @endif - - {{-- Array Of Links --}} - @if (is_array($element)) - @foreach ($element as $page => $url) - @if ($page == $paginator->currentPage()) - <li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li> - @else - <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li> - @endif - @endforeach - @endif - @endforeach - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li class="page-item"> - <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a> - </li> - @else - <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')"> - <span class="page-link" aria-hidden="true">›</span> - </li> - @endif - </ul> - </div> - </div> - </nav> -@endif diff --git a/core/vendor/illuminate/pagination/resources/views/simple-bootstrap-5.blade.php b/core/vendor/illuminate/pagination/resources/views/simple-bootstrap-5.blade.php deleted file mode 100644 index a89005ee7d..0000000000 --- a/core/vendor/illuminate/pagination/resources/views/simple-bootstrap-5.blade.php +++ /dev/null @@ -1,29 +0,0 @@ -@if ($paginator->hasPages()) - <nav role="navigation" aria-label="Pagination Navigation"> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">{!! __('pagination.previous') !!}</span> - </li> - @else - <li class="page-item"> - <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev"> - {!! __('pagination.previous') !!} - </a> - </li> - @endif - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li class="page-item"> - <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">{!! __('pagination.next') !!}</a> - </li> - @else - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">{!! __('pagination.next') !!}</span> - </li> - @endif - </ul> - </nav> -@endif diff --git a/core/vendor/illuminate/pipeline/composer.json b/core/vendor/illuminate/pipeline/composer.json index 7e640af364..ef6805bdef 100644 --- a/core/vendor/illuminate/pipeline/composer.json +++ b/core/vendor/illuminate/pipeline/composer.json @@ -14,9 +14,9 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0" + "php": "^7.3|^8.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/redis/Connections/PhpRedisConnection.php b/core/vendor/illuminate/redis/Connections/PhpRedisConnection.php index 2bfd427b78..4e68547de3 100644 --- a/core/vendor/illuminate/redis/Connections/PhpRedisConnection.php +++ b/core/vendor/illuminate/redis/Connections/PhpRedisConnection.php @@ -5,6 +5,7 @@ use Closure; use Illuminate\Contracts\Redis\Connection as ConnectionContract; use Illuminate\Support\Arr; +use Illuminate\Support\Str; use Redis; use RedisException; @@ -531,7 +532,7 @@ public function command($method, array $parameters = []) try { return parent::command($method, $parameters); } catch (RedisException $e) { - if (str_contains($e->getMessage(), 'went away')) { + if (Str::contains($e->getMessage(), 'went away')) { $this->client = $this->connector ? call_user_func($this->connector) : $this->client; } diff --git a/core/vendor/illuminate/redis/Connections/PredisConnection.php b/core/vendor/illuminate/redis/Connections/PredisConnection.php index f642dd622a..e0a8be033f 100644 --- a/core/vendor/illuminate/redis/Connections/PredisConnection.php +++ b/core/vendor/illuminate/redis/Connections/PredisConnection.php @@ -44,7 +44,7 @@ public function createSubscription($channels, Closure $callback, $method = 'subs foreach ($loop as $message) { if ($message->kind === 'message' || $message->kind === 'pmessage') { - $callback($message->payload, $message->channel); + call_user_func($callback, $message->payload, $message->channel); } } diff --git a/core/vendor/illuminate/redis/Connectors/PhpRedisConnector.php b/core/vendor/illuminate/redis/Connectors/PhpRedisConnector.php index 62c4ed1262..1c48bdfaaa 100644 --- a/core/vendor/illuminate/redis/Connectors/PhpRedisConnector.php +++ b/core/vendor/illuminate/redis/Connectors/PhpRedisConnector.php @@ -144,8 +144,10 @@ protected function establishConnection($client, array $config) $parameters[] = Arr::get($config, 'read_timeout', 0.0); } - if (version_compare(phpversion('redis'), '5.3.0', '>=') && ! is_null($context = Arr::get($config, 'context'))) { - $parameters[] = $context; + if (version_compare(phpversion('redis'), '5.3.0', '>=')) { + if (! is_null($context = Arr::get($config, 'context'))) { + $parameters[] = $context; + } } $client->{($persistent ? 'pconnect' : 'connect')}(...$parameters); @@ -172,8 +174,10 @@ protected function createRedisClusterInstance(array $servers, array $options) $parameters[] = $options['password'] ?? null; } - if (version_compare(phpversion('redis'), '5.3.2', '>=') && ! is_null($context = Arr::get($options, 'context'))) { - $parameters[] = $context; + if (version_compare(phpversion('redis'), '5.3.2', '>=')) { + if (! is_null($context = Arr::get($options, 'context'))) { + $parameters[] = $context; + } } return tap(new RedisCluster(...$parameters), function ($client) use ($options) { diff --git a/core/vendor/illuminate/redis/RedisManager.php b/core/vendor/illuminate/redis/RedisManager.php index d7c976210f..d69f2116a1 100644 --- a/core/vendor/illuminate/redis/RedisManager.php +++ b/core/vendor/illuminate/redis/RedisManager.php @@ -168,11 +168,12 @@ protected function connector() return $customCreator(); } - return match ($this->driver) { - 'predis' => new PredisConnector, - 'phpredis' => new PhpRedisConnector, - default => null, - }; + switch ($this->driver) { + case 'predis': + return new PredisConnector; + case 'phpredis': + return new PhpRedisConnector; + } } /** diff --git a/core/vendor/illuminate/redis/composer.json b/core/vendor/illuminate/redis/composer.json index 99e2ad4ed6..52cd8c9844 100755 --- a/core/vendor/illuminate/redis/composer.json +++ b/core/vendor/illuminate/redis/composer.json @@ -14,11 +14,11 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0" + "php": "^7.3|^8.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0" }, "autoload": { "psr-4": { @@ -31,7 +31,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/routing/AbstractRouteCollection.php b/core/vendor/illuminate/routing/AbstractRouteCollection.php index 1650ff3708..9599d0e45f 100644 --- a/core/vendor/illuminate/routing/AbstractRouteCollection.php +++ b/core/vendor/illuminate/routing/AbstractRouteCollection.php @@ -13,7 +13,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Routing\Matcher\Dumper\CompiledUrlMatcherDumper; use Symfony\Component\Routing\RouteCollection as SymfonyRouteCollection; -use Traversable; abstract class AbstractRouteCollection implements Countable, IteratorAggregate, RouteCollectionInterface { @@ -95,7 +94,7 @@ protected function matchAgainstRoutes(array $routes, $request, $includingMethod */ protected function getRouteForMethods($request, array $methods) { - if ($request->isMethod('OPTIONS')) { + if ($request->method() === 'OPTIONS') { return (new Route('OPTIONS', $request->path(), function () use ($methods) { return new Response('', 200, ['Allow' => implode(',', $methods)]); }))->bind($request); @@ -205,7 +204,7 @@ protected function addToSymfonyRoutesCollection(SymfonyRouteCollection $symfonyR if ( ! is_null($name) - && str_ends_with($name, '.') + && Str::endsWith($name, '.') && ! is_null($symfonyRoutes->get($name)) ) { $name = null; @@ -239,7 +238,8 @@ protected function generateRouteName() * * @return \ArrayIterator */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { return new ArrayIterator($this->getRoutes()); } @@ -249,7 +249,8 @@ public function getIterator(): Traversable * * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return count($this->getRoutes()); } diff --git a/core/vendor/illuminate/routing/Console/ControllerMakeCommand.php b/core/vendor/illuminate/routing/Console/ControllerMakeCommand.php index 6768692dac..fe31bea6e2 100755 --- a/core/vendor/illuminate/routing/Console/ControllerMakeCommand.php +++ b/core/vendor/illuminate/routing/Console/ControllerMakeCommand.php @@ -18,15 +18,6 @@ class ControllerMakeCommand extends GeneratorCommand */ protected $name = 'make:controller'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'make:controller'; - /** * The console command description. * @@ -135,9 +126,10 @@ protected function buildParentReplacements() { $parentModelClass = $this->parseModel($this->option('parent')); - if (! class_exists($parentModelClass) && - $this->confirm("A {$parentModelClass} model does not exist. Do you want to generate it?", true)) { - $this->call('make:model', ['name' => $parentModelClass]); + if (! class_exists($parentModelClass)) { + if ($this->confirm("A {$parentModelClass} model does not exist. Do you want to generate it?", true)) { + $this->call('make:model', ['name' => $parentModelClass]); + } } return [ @@ -163,8 +155,10 @@ protected function buildModelReplacements(array $replace) { $modelClass = $this->parseModel($this->option('model')); - if (! class_exists($modelClass) && $this->confirm("A {$modelClass} model does not exist. Do you want to generate it?", true)) { - $this->call('make:model', ['name' => $modelClass]); + if (! class_exists($modelClass)) { + if ($this->confirm("A {$modelClass} model does not exist. Do you want to generate it?", true)) { + $this->call('make:model', ['name' => $modelClass]); + } } $replace = $this->buildFormRequestReplacements($replace, $modelClass); @@ -243,7 +237,7 @@ protected function buildFormRequestReplacements(array $replace, $modelClass) /** * Generate the form requests for the given model and classes. * - * @param string $modelClass + * @param string $modelName * @param string $storeRequestClass * @param string $updateRequestClass * @return array diff --git a/core/vendor/illuminate/routing/Console/MiddlewareMakeCommand.php b/core/vendor/illuminate/routing/Console/MiddlewareMakeCommand.php index 2cf6f3754d..ddd591c0fc 100644 --- a/core/vendor/illuminate/routing/Console/MiddlewareMakeCommand.php +++ b/core/vendor/illuminate/routing/Console/MiddlewareMakeCommand.php @@ -16,15 +16,6 @@ class MiddlewareMakeCommand extends GeneratorCommand */ protected $name = 'make:middleware'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'make:middleware'; - /** * The console command description. * diff --git a/core/vendor/illuminate/routing/Exceptions/BackedEnumCaseNotFoundException.php b/core/vendor/illuminate/routing/Exceptions/BackedEnumCaseNotFoundException.php deleted file mode 100644 index 468583d2a5..0000000000 --- a/core/vendor/illuminate/routing/Exceptions/BackedEnumCaseNotFoundException.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Illuminate\Routing\Exceptions; - -use RuntimeException; - -class BackedEnumCaseNotFoundException extends RuntimeException -{ - /** - * Create a new exception instance. - * - * @param string $backedEnumClass - * @param string $case - * @return void - */ - public function __construct($backedEnumClass, $case) - { - parent::__construct("Case [{$case}] not found on Backed Enum [{$backedEnumClass}]."); - } -} diff --git a/core/vendor/illuminate/routing/Exceptions/StreamedResponseException.php b/core/vendor/illuminate/routing/Exceptions/StreamedResponseException.php deleted file mode 100644 index 87ae6438ee..0000000000 --- a/core/vendor/illuminate/routing/Exceptions/StreamedResponseException.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Illuminate\Routing\Exceptions; - -use Illuminate\Http\Response; -use RuntimeException; -use Throwable; - -class StreamedResponseException extends RuntimeException -{ - /** - * The actual exception thrown during the stream. - * - * @var \Throwable - */ - public $originalException; - - /** - * Create a new exception instance. - * - * @param \Throwable $originalException - * @return void - */ - public function __construct(Throwable $originalException) - { - $this->originalException = $originalException; - - parent::__construct($originalException->message); - } - - /** - * Render the exception. - * - * @return \Illuminate\Http\Response - */ - public function render() - { - return new Response(''); - } - - /** - * Get the actual exception thrown during the stream. - * - * @return \Throwable - */ - public function getInnerException() - { - return $this->originalException; - } -} diff --git a/core/vendor/illuminate/routing/ImplicitRouteBinding.php b/core/vendor/illuminate/routing/ImplicitRouteBinding.php index 2a643fcd28..413f56bd89 100644 --- a/core/vendor/illuminate/routing/ImplicitRouteBinding.php +++ b/core/vendor/illuminate/routing/ImplicitRouteBinding.php @@ -5,7 +5,6 @@ use Illuminate\Contracts\Routing\UrlRoutable; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\SoftDeletes; -use Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException; use Illuminate\Support\Reflector; use Illuminate\Support\Str; @@ -19,15 +18,12 @@ class ImplicitRouteBinding * @return void * * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException */ public static function resolveForRoute($container, $route) { $parameters = $route->parameters(); - $route = static::resolveBackedEnumsForRoute($route, $parameters); - - foreach ($route->signatureParameters(['subClass' => UrlRoutable::class]) as $parameter) { + foreach ($route->signatureParameters(UrlRoutable::class) as $parameter) { if (! $parameterName = static::getParameterName($parameter->getName(), $parameters)) { continue; } @@ -64,38 +60,6 @@ public static function resolveForRoute($container, $route) } } - /** - * Resolve the Backed Enums route bindings for the route. - * - * @param \Illuminate\Routing\Route $route - * @param array $parameters - * @return \Illuminate\Routing\Route - * - * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException - */ - protected static function resolveBackedEnumsForRoute($route, $parameters) - { - foreach ($route->signatureParameters(['backedEnum' => true]) as $parameter) { - if (! $parameterName = static::getParameterName($parameter->getName(), $parameters)) { - continue; - } - - $parameterValue = $parameters[$parameterName]; - - $backedEnumClass = (string) $parameter->getType(); - - $backedEnum = $backedEnumClass::tryFrom((string) $parameterValue); - - if (is_null($backedEnum)) { - throw new BackedEnumCaseNotFoundException($backedEnumClass, $parameterValue); - } - - $route->setParameter($parameterName, $backedEnum); - } - - return $route; - } - /** * Return the parameter name if it exists in the given parameters. * diff --git a/core/vendor/illuminate/routing/Middleware/ThrottleRequests.php b/core/vendor/illuminate/routing/Middleware/ThrottleRequests.php index 09675250fa..d570da4409 100644 --- a/core/vendor/illuminate/routing/Middleware/ThrottleRequests.php +++ b/core/vendor/illuminate/routing/Middleware/ThrottleRequests.php @@ -9,6 +9,7 @@ use Illuminate\Http\Exceptions\ThrottleRequestsException; use Illuminate\Support\Arr; use Illuminate\Support\InteractsWithTime; +use Illuminate\Support\Str; use RuntimeException; use Symfony\Component\HttpFoundation\Response; @@ -81,7 +82,7 @@ public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes */ protected function handleRequestUsingNamedLimiter($request, Closure $next, $limiterName, Closure $limiter) { - $limiterResponse = $limiter($request); + $limiterResponse = call_user_func($limiter, $request); if ($limiterResponse instanceof Response) { return $limiterResponse; @@ -145,7 +146,7 @@ protected function handleRequest($request, Closure $next, array $limits) */ protected function resolveMaxAttempts($request, $maxAttempts) { - if (str_contains($maxAttempts, '|')) { + if (Str::contains($maxAttempts, '|')) { $maxAttempts = explode('|', $maxAttempts, 2)[$request->user() ? 1 : 0]; } diff --git a/core/vendor/illuminate/routing/RedirectController.php b/core/vendor/illuminate/routing/RedirectController.php index 3dd2489583..e98414ba84 100644 --- a/core/vendor/illuminate/routing/RedirectController.php +++ b/core/vendor/illuminate/routing/RedirectController.php @@ -35,7 +35,7 @@ public function __invoke(Request $request, UrlGenerator $url) $url = $url->toRoute($route, $parameters, false); - if (! str_starts_with($destination, '/') && str_starts_with($url, '/')) { + if (! Str::startsWith($destination, '/') && Str::startsWith($url, '/')) { $url = Str::after($url, '/'); } diff --git a/core/vendor/illuminate/routing/Redirector.php b/core/vendor/illuminate/routing/Redirector.php index 05f50745a2..99e7c22698 100755 --- a/core/vendor/illuminate/routing/Redirector.php +++ b/core/vendor/illuminate/routing/Redirector.php @@ -84,7 +84,7 @@ public function guest($path, $status = 302, $headers = [], $secure = null) { $request = $this->generator->getRequest(); - $intended = $request->isMethod('GET') && $request->route() && ! $request->expectsJson() + $intended = $request->method() === 'GET' && $request->route() && ! $request->expectsJson() ? $this->generator->full() : $this->generator->previous(); @@ -115,13 +115,11 @@ public function intended($default = '/', $status = 302, $headers = [], $secure = * Set the intended url. * * @param string $url - * @return $this + * @return void */ public function setIntendedUrl($url) { $this->session->put('url.intended', $url); - - return $this; } /** diff --git a/core/vendor/illuminate/routing/ResourceRegistrar.php b/core/vendor/illuminate/routing/ResourceRegistrar.php index b74da439bd..c32de58c29 100644 --- a/core/vendor/illuminate/routing/ResourceRegistrar.php +++ b/core/vendor/illuminate/routing/ResourceRegistrar.php @@ -79,7 +79,7 @@ public function register($name, $controller, array $options = []) // If the resource name contains a slash, we will assume the developer wishes to // register these resource routes with a prefix so we will set that up out of // the box so they don't have to mess with it. Otherwise, we will continue. - if (str_contains($name, '/')) { + if (Str::contains($name, '/')) { $this->prefixedResource($name, $controller, $options); return; @@ -351,7 +351,7 @@ protected function setResourceBindingFields($route, $bindingFields) */ public function getResourceUri($resource) { - if (! str_contains($resource, '.')) { + if (! Str::contains($resource, '.')) { return $resource; } diff --git a/core/vendor/illuminate/routing/ResponseFactory.php b/core/vendor/illuminate/routing/ResponseFactory.php index 29ba323e36..8a914f8dd0 100644 --- a/core/vendor/illuminate/routing/ResponseFactory.php +++ b/core/vendor/illuminate/routing/ResponseFactory.php @@ -6,12 +6,10 @@ use Illuminate\Contracts\View\Factory as ViewFactory; use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; -use Illuminate\Routing\Exceptions\StreamedResponseException; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\StreamedResponse; -use Throwable; class ResponseFactory implements FactoryContract { @@ -140,15 +138,7 @@ public function stream($callback, $status = 200, array $headers = []) */ public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment') { - $withWrappedException = function () use ($callback) { - try { - $callback(); - } catch (Throwable $e) { - throw new StreamedResponseException($e); - } - }; - - $response = new StreamedResponse($withWrappedException, 200, $headers); + $response = new StreamedResponse($callback, 200, $headers); if (! is_null($name)) { $response->headers->set('Content-Disposition', $response->headers->makeDisposition( diff --git a/core/vendor/illuminate/routing/Route.php b/core/vendor/illuminate/routing/Route.php index fc30acb65a..05aa9a3838 100755 --- a/core/vendor/illuminate/routing/Route.php +++ b/core/vendor/illuminate/routing/Route.php @@ -16,6 +16,7 @@ use Illuminate\Support\Traits\Macroable; use Laravel\SerializableClosure\SerializableClosure; use LogicException; +use Opis\Closure\SerializableClosure as OpisSerializableClosure; use ReflectionFunction; use Symfony\Component\Routing\Route as SymfonyRoute; @@ -505,16 +506,12 @@ protected function compileParameterNames() /** * Get the parameters that are listed in the route / controller signature. * - * @param array $conditions + * @param string|null $subClass * @return array */ - public function signatureParameters($conditions = []) + public function signatureParameters($subClass = null) { - if (is_string($conditions)) { - $conditions = ['subClass' => $conditions]; - } - - return RouteSignatureParameters::fromAction($this->action, $conditions); + return RouteSignatureParameters::fromAction($this->action, $subClass); } /** @@ -914,7 +911,7 @@ protected function addGroupNamespaceToStringUses($action) { $groupStack = last($this->router->getGroupStack()); - if (isset($groupStack['namespace']) && ! str_starts_with($action, '\\')) { + if (isset($groupStack['namespace']) && strpos($action, '\\') !== 0) { return $groupStack['namespace'].'\\'.$action; } @@ -980,6 +977,7 @@ public function getMissing() return is_string($missing) && Str::startsWith($missing, [ + 'C:32:"Opis\\Closure\\SerializableClosure', 'O:47:"Laravel\\SerializableClosure\\SerializableClosure', ]) ? unserialize($missing) : $missing; } @@ -1207,7 +1205,7 @@ public function toSymfonyRoute() { return new SymfonyRoute( preg_replace('/\{(\w+?)\?\}/', '{$1}', $this->uri()), $this->getOptionalParameterNames(), - $this->wheres, ['utf8' => true], + $this->wheres, ['utf8' => true, 'action' => $this->action], $this->getDomain() ?: '', [], $this->methods ); } @@ -1270,14 +1268,16 @@ public function setContainer(Container $container) public function prepareForSerialization() { if ($this->action['uses'] instanceof Closure) { - $this->action['uses'] = serialize( - new SerializableClosure($this->action['uses']) + $this->action['uses'] = serialize(\PHP_VERSION_ID < 70400 + ? new OpisSerializableClosure($this->action['uses']) + : new SerializableClosure($this->action['uses']) ); } if (isset($this->action['missing']) && $this->action['missing'] instanceof Closure) { - $this->action['missing'] = serialize( - new SerializableClosure($this->action['missing']) + $this->action['missing'] = serialize(\PHP_VERSION_ID < 70400 + ? new OpisSerializableClosure($this->action['missing']) + : new SerializableClosure($this->action['missing']) ); } diff --git a/core/vendor/illuminate/routing/RouteAction.php b/core/vendor/illuminate/routing/RouteAction.php index ad47a872ee..b356f974cc 100644 --- a/core/vendor/illuminate/routing/RouteAction.php +++ b/core/vendor/illuminate/routing/RouteAction.php @@ -43,7 +43,7 @@ public static function parse($uri, $action) $action['uses'] = static::findCallable($action); } - if (! static::containsSerializedClosure($action) && is_string($action['uses']) && ! str_contains($action['uses'], '@')) { + if (! static::containsSerializedClosure($action) && is_string($action['uses']) && ! Str::contains($action['uses'], '@')) { $action['uses'] = static::makeInvokable($action['uses']); } @@ -104,6 +104,7 @@ protected static function makeInvokable($action) public static function containsSerializedClosure(array $action) { return is_string($action['uses']) && Str::startsWith($action['uses'], [ + 'C:32:"Opis\\Closure\\SerializableClosure', 'O:47:"Laravel\\SerializableClosure\\SerializableClosure', ]) !== false; } diff --git a/core/vendor/illuminate/routing/RouteDependencyResolverTrait.php b/core/vendor/illuminate/routing/RouteDependencyResolverTrait.php index 2555d317fb..122f266c84 100644 --- a/core/vendor/illuminate/routing/RouteDependencyResolverTrait.php +++ b/core/vendor/illuminate/routing/RouteDependencyResolverTrait.php @@ -7,7 +7,6 @@ use ReflectionFunctionAbstract; use ReflectionMethod; use ReflectionParameter; -use stdClass; trait RouteDependencyResolverTrait { @@ -43,7 +42,7 @@ public function resolveMethodDependencies(array $parameters, ReflectionFunctionA $values = array_values($parameters); - $skippableValue = new stdClass; + $skippableValue = new \stdClass; foreach ($reflector->getParameters() as $key => $parameter) { $instance = $this->transformDependency($parameter, $parameters, $skippableValue); diff --git a/core/vendor/illuminate/routing/RouteGroup.php b/core/vendor/illuminate/routing/RouteGroup.php index 28e05d55dd..18dbb5245b 100644 --- a/core/vendor/illuminate/routing/RouteGroup.php +++ b/core/vendor/illuminate/routing/RouteGroup.php @@ -45,7 +45,7 @@ public static function merge($new, $old, $prependExistingPrefix = true) protected static function formatNamespace($new, $old) { if (isset($new['namespace'])) { - return isset($old['namespace']) && ! str_starts_with($new['namespace'], '\\') + return isset($old['namespace']) && strpos($new['namespace'], '\\') !== 0 ? trim($old['namespace'], '\\').'\\'.trim($new['namespace'], '\\') : trim($new['namespace'], '\\'); } diff --git a/core/vendor/illuminate/routing/RouteSignatureParameters.php b/core/vendor/illuminate/routing/RouteSignatureParameters.php index 7a4b6dadb9..03d3137b51 100644 --- a/core/vendor/illuminate/routing/RouteSignatureParameters.php +++ b/core/vendor/illuminate/routing/RouteSignatureParameters.php @@ -13,10 +13,10 @@ class RouteSignatureParameters * Extract the route action's signature parameters. * * @param array $action - * @param array $conditions + * @param string|null $subClass * @return array */ - public static function fromAction(array $action, $conditions = []) + public static function fromAction(array $action, $subClass = null) { $callback = RouteAction::containsSerializedClosure($action) ? unserialize($action['uses'])->getClosure() @@ -26,11 +26,9 @@ public static function fromAction(array $action, $conditions = []) ? static::fromClassMethodString($callback) : (new ReflectionFunction($callback))->getParameters(); - return match (true) { - ! empty($conditions['subClass']) => array_filter($parameters, fn ($p) => Reflector::isParameterSubclassOf($p, $conditions['subClass'])), - ! empty($conditions['backedEnum']) => array_filter($parameters, fn ($p) => Reflector::isParameterBackedEnumWithStringBackingType($p)), - default => $parameters, - }; + return is_null($subClass) ? $parameters : array_filter($parameters, function ($p) use ($subClass) { + return Reflector::isParameterSubclassOf($p, $subClass); + }); } /** diff --git a/core/vendor/illuminate/routing/RouteUri.php b/core/vendor/illuminate/routing/RouteUri.php index f34e752f19..ad69527e0b 100644 --- a/core/vendor/illuminate/routing/RouteUri.php +++ b/core/vendor/illuminate/routing/RouteUri.php @@ -44,7 +44,7 @@ public static function parse($uri) $bindingFields = []; foreach ($matches[0] as $match) { - if (! str_contains($match, ':')) { + if (strpos($match, ':') === false) { continue; } @@ -52,7 +52,7 @@ public static function parse($uri) $bindingFields[$segments[0]] = $segments[1]; - $uri = str_contains($match, '?') + $uri = strpos($match, '?') !== false ? str_replace($match, '{'.$segments[0].'?}', $uri) : str_replace($match, '{'.$segments[0].'}', $uri); } diff --git a/core/vendor/illuminate/routing/RouteUrlGenerator.php b/core/vendor/illuminate/routing/RouteUrlGenerator.php index a0e5cf6413..5f1248966c 100644 --- a/core/vendor/illuminate/routing/RouteUrlGenerator.php +++ b/core/vendor/illuminate/routing/RouteUrlGenerator.php @@ -4,6 +4,7 @@ use Illuminate\Routing\Exceptions\UrlGenerationException; use Illuminate\Support\Arr; +use Illuminate\Support\Str; class RouteUrlGenerator { @@ -199,7 +200,7 @@ protected function replaceRouteParameters($path, array &$parameters) // Reset only the numeric keys... $parameters = array_merge($parameters); - return (! isset($parameters[0]) && ! str_ends_with($match[0], '?}')) + return (! isset($parameters[0]) && ! Str::endsWith($match[0], '?}')) ? $match[0] : Arr::pull($parameters, 0); }, $path); diff --git a/core/vendor/illuminate/routing/Router.php b/core/vendor/illuminate/routing/Router.php index 22c5e00ad2..26f6ec9ba2 100644 --- a/core/vendor/illuminate/routing/Router.php +++ b/core/vendor/illuminate/routing/Router.php @@ -16,7 +16,6 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Routing\Events\RouteMatched; -use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Illuminate\Support\Str; use Illuminate\Support\Stringable; @@ -370,21 +369,19 @@ public function apiResource($name, $controller, array $options = []) * Create a route group with shared attributes. * * @param array $attributes - * @param \Closure|array|string $routes + * @param \Closure|string $routes * @return void */ public function group(array $attributes, $routes) { - foreach (Arr::wrap($routes) as $groupRoutes) { - $this->updateGroupStack($attributes); + $this->updateGroupStack($attributes); - // Once we have updated the group stack, we'll load the provided routes and - // merge in the group's attributes when the routes are created. After we - // have created the routes, we will pop the attributes off the stack. - $this->loadRoutes($groupRoutes); + // Once we have updated the group stack, we'll load the provided routes and + // merge in the group's attributes when the routes are created. After we + // have created the routes, we will pop the attributes off the stack. + $this->loadRoutes($routes); - array_pop($this->groupStack); - } + array_pop($this->groupStack); } /** @@ -544,7 +541,7 @@ protected function prependGroupNamespace($class) { $group = end($this->groupStack); - return isset($group['namespace']) && ! str_starts_with($class, '\\') && ! str_starts_with($class, $group['namespace']) + return isset($group['namespace']) && strpos($class, '\\') !== 0 ? $group['namespace'].'\\'.$class : $class; } @@ -566,7 +563,7 @@ protected function prependGroupController($class) return $class; } - if (str_contains($class, '@')) { + if (strpos($class, '@') !== false) { return $class; } @@ -734,23 +731,13 @@ protected function runRouteWithinStack(Route $route, Request $request) */ public function gatherRouteMiddleware(Route $route) { - return $this->resolveMiddleware($route->gatherMiddleware(), $route->excludedMiddleware()); - } + $computedMiddleware = $route->gatherMiddleware(); - /** - * Resolve a flat array of middleware classes from the provided array. - * - * @param array $middleware - * @param array $excluded - * @return array - */ - public function resolveMiddleware(array $middleware, array $excluded = []) - { - $excluded = collect($excluded)->map(function ($name) { + $excluded = collect($route->excludedMiddleware())->map(function ($name) { return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups); })->flatten()->values()->all(); - $middleware = collect($middleware)->map(function ($name) { + $middleware = collect($computedMiddleware)->map(function ($name) { return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups); })->flatten()->reject(function ($name) use ($excluded) { if (empty($excluded)) { @@ -847,7 +834,6 @@ public static function toResponse($request, $response) * @return \Illuminate\Routing\Route * * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException */ public function substituteBindings($route) { @@ -861,13 +847,12 @@ public function substituteBindings($route) } /** - * Substitute the implicit route bindings for the given route. + * Substitute the implicit Eloquent model bindings for the route. * * @param \Illuminate\Routing\Route $route * @return void * * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - * @throws \Illuminate\Routing\Exceptions\BackedEnumCaseNotFoundException */ public function substituteImplicitBindings($route) { diff --git a/core/vendor/illuminate/routing/UrlGenerator.php b/core/vendor/illuminate/routing/UrlGenerator.php index 5fc4a58820..f40491de50 100755 --- a/core/vendor/illuminate/routing/UrlGenerator.php +++ b/core/vendor/illuminate/routing/UrlGenerator.php @@ -283,7 +283,7 @@ protected function removeIndex($root) { $i = 'index.php'; - return str_contains($root, $i) ? str_replace('/'.$i, '', $root) : $root; + return Str::contains($root, $i) ? str_replace('/'.$i, '', $root) : $root; } /** @@ -375,12 +375,11 @@ public function temporarySignedRoute($name, $expiration, $parameters = [], $abso * * @param \Illuminate\Http\Request $request * @param bool $absolute - * @param array $ignoreQuery * @return bool */ - public function hasValidSignature(Request $request, $absolute = true, array $ignoreQuery = []) + public function hasValidSignature(Request $request, $absolute = true) { - return $this->hasCorrectSignature($request, $absolute, $ignoreQuery) + return $this->hasCorrectSignature($request, $absolute) && $this->signatureHasNotExpired($request); } @@ -388,12 +387,11 @@ public function hasValidSignature(Request $request, $absolute = true, array $ign * Determine if the given request has a valid signature for a relative URL. * * @param \Illuminate\Http\Request $request - * @param array $ignoreQuery * @return bool */ - public function hasValidRelativeSignature(Request $request, array $ignoreQuery = []) + public function hasValidRelativeSignature(Request $request) { - return $this->hasValidSignature($request, false, $ignoreQuery); + return $this->hasValidSignature($request, false); } /** @@ -401,22 +399,15 @@ public function hasValidRelativeSignature(Request $request, array $ignoreQuery = * * @param \Illuminate\Http\Request $request * @param bool $absolute - * @param array $ignoreQuery * @return bool */ - public function hasCorrectSignature(Request $request, $absolute = true, array $ignoreQuery = []) + public function hasCorrectSignature(Request $request, $absolute = true) { - $ignoreQuery[] = 'signature'; - $url = $absolute ? $request->url() : '/'.$request->path(); - $queryString = collect(explode('&', $request->server->get('QUERY_STRING'))) - ->reject(fn ($parameter) => in_array(Str::before($parameter, '='), $ignoreQuery)) - ->join('&'); - - $original = rtrim($url.'?'.$queryString, '?'); + $queryString = ltrim(preg_replace('/(^|&)signature=[^&]+/', '', $request->server->get('QUERY_STRING')), '&'); - $signature = hash_hmac('sha256', $original, call_user_func($this->keyResolver)); + $signature = hash_hmac('sha256', rtrim($url.'?'.$queryString, '?'), call_user_func($this->keyResolver)); return hash_equals($signature, (string) $request->query('signature', '')); } @@ -507,7 +498,7 @@ protected function formatAction($action) $action = '\\'.implode('@', $action); } - if ($this->rootNamespace && ! str_starts_with($action, '\\')) { + if ($this->rootNamespace && strpos($action, '\\') !== 0) { return $this->rootNamespace.'\\'.$action; } else { return trim($action, '\\'); @@ -568,7 +559,7 @@ public function formatRoot($scheme, $root = null) $root = $this->cachedRoot; } - $start = str_starts_with($root, 'http://') ? 'http://' : 'https://'; + $start = Str::startsWith($root, 'http://') ? 'http://' : 'https://'; return preg_replace('~'.$start.'~', $scheme, $root, 1); } @@ -793,16 +784,6 @@ public function setKeyResolver(callable $keyResolver) return $this; } - /** - * Get the root controller namespace. - * - * @return string - */ - public function getRootControllerNamespace() - { - return $this->rootNamespace; - } - /** * Set the root controller namespace. * diff --git a/core/vendor/illuminate/routing/composer.json b/core/vendor/illuminate/routing/composer.json index 2b3aa1a7a4..96c3488e4b 100644 --- a/core/vendor/illuminate/routing/composer.json +++ b/core/vendor/illuminate/routing/composer.json @@ -14,19 +14,19 @@ } ], "require": { - "php": "^8.0.2", + "php": "^7.3|^8.0", "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/http": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/pipeline": "^9.0", - "illuminate/session": "^9.0", - "illuminate/support": "^9.0", - "symfony/http-foundation": "^6.0", - "symfony/http-kernel": "^6.0", - "symfony/routing": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/http": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/pipeline": "^8.0", + "illuminate/session": "^8.0", + "illuminate/support": "^8.0", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/routing": "^5.4" }, "autoload": { "psr-4": { @@ -35,11 +35,11 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { - "illuminate/console": "Required to use the make commands (^9.0).", + "illuminate/console": "Required to use the make commands (^8.0).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." }, diff --git a/core/vendor/illuminate/session/ArraySessionHandler.php b/core/vendor/illuminate/session/ArraySessionHandler.php index 44d50dafd9..9a0dff1850 100644 --- a/core/vendor/illuminate/session/ArraySessionHandler.php +++ b/core/vendor/illuminate/session/ArraySessionHandler.php @@ -39,7 +39,8 @@ public function __construct($minutes) * * @return bool */ - public function open($savePath, $sessionName): bool + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { return true; } @@ -49,7 +50,8 @@ public function open($savePath, $sessionName): bool * * @return bool */ - public function close(): bool + #[\ReturnTypeWillChange] + public function close() { return true; } @@ -59,7 +61,8 @@ public function close(): bool * * @return string|false */ - public function read($sessionId): string|false + #[\ReturnTypeWillChange] + public function read($sessionId) { if (! isset($this->storage[$sessionId])) { return ''; @@ -81,7 +84,8 @@ public function read($sessionId): string|false * * @return bool */ - public function write($sessionId, $data): bool + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { $this->storage[$sessionId] = [ 'data' => $data, @@ -96,7 +100,8 @@ public function write($sessionId, $data): bool * * @return bool */ - public function destroy($sessionId): bool + #[\ReturnTypeWillChange] + public function destroy($sessionId) { if (isset($this->storage[$sessionId])) { unset($this->storage[$sessionId]); @@ -108,22 +113,20 @@ public function destroy($sessionId): bool /** * {@inheritdoc} * - * @return int + * @return int|false */ - public function gc($lifetime): int + #[\ReturnTypeWillChange] + public function gc($lifetime) { $expiration = $this->calculateExpiration($lifetime); - $deletedSessions = 0; - foreach ($this->storage as $sessionId => $session) { if ($session['time'] < $expiration) { unset($this->storage[$sessionId]); - $deletedSessions++; } } - return $deletedSessions; + return true; } /** diff --git a/core/vendor/illuminate/session/CacheBasedSessionHandler.php b/core/vendor/illuminate/session/CacheBasedSessionHandler.php index 0cccdf2d92..5db2ac5553 100755 --- a/core/vendor/illuminate/session/CacheBasedSessionHandler.php +++ b/core/vendor/illuminate/session/CacheBasedSessionHandler.php @@ -39,7 +39,8 @@ public function __construct(CacheContract $cache, $minutes) * * @return bool */ - public function open($savePath, $sessionName): bool + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { return true; } @@ -49,7 +50,8 @@ public function open($savePath, $sessionName): bool * * @return bool */ - public function close(): bool + #[\ReturnTypeWillChange] + public function close() { return true; } @@ -57,9 +59,10 @@ public function close(): bool /** * {@inheritdoc} * - * @return string + * @return string|false */ - public function read($sessionId): string + #[\ReturnTypeWillChange] + public function read($sessionId) { return $this->cache->get($sessionId, ''); } @@ -69,7 +72,8 @@ public function read($sessionId): string * * @return bool */ - public function write($sessionId, $data): bool + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { return $this->cache->put($sessionId, $data, $this->minutes * 60); } @@ -79,7 +83,8 @@ public function write($sessionId, $data): bool * * @return bool */ - public function destroy($sessionId): bool + #[\ReturnTypeWillChange] + public function destroy($sessionId) { return $this->cache->forget($sessionId); } @@ -87,11 +92,12 @@ public function destroy($sessionId): bool /** * {@inheritdoc} * - * @return int + * @return int|false */ - public function gc($lifetime): int + #[\ReturnTypeWillChange] + public function gc($lifetime) { - return 0; + return true; } /** diff --git a/core/vendor/illuminate/session/Console/SessionTableCommand.php b/core/vendor/illuminate/session/Console/SessionTableCommand.php index 5deacd011e..1675c19c2a 100644 --- a/core/vendor/illuminate/session/Console/SessionTableCommand.php +++ b/core/vendor/illuminate/session/Console/SessionTableCommand.php @@ -15,15 +15,6 @@ class SessionTableCommand extends Command */ protected $name = 'session:table'; - /** - * The name of the console command. - * - * This name is used to identify the command during lazy loading. - * - * @var string|null - */ - protected static $defaultName = 'session:table'; - /** * The console command description. * diff --git a/core/vendor/illuminate/session/Console/stubs/database.stub b/core/vendor/illuminate/session/Console/stubs/database.stub index c455537a9c..88b4a316e6 100755 --- a/core/vendor/illuminate/session/Console/stubs/database.stub +++ b/core/vendor/illuminate/session/Console/stubs/database.stub @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration +class CreateSessionsTable extends Migration { /** * Run the migrations. @@ -32,4 +32,4 @@ return new class extends Migration { Schema::dropIfExists('sessions'); } -}; +} diff --git a/core/vendor/illuminate/session/CookieSessionHandler.php b/core/vendor/illuminate/session/CookieSessionHandler.php index 213b5cb432..0a1d9cd4e1 100755 --- a/core/vendor/illuminate/session/CookieSessionHandler.php +++ b/core/vendor/illuminate/session/CookieSessionHandler.php @@ -50,7 +50,8 @@ public function __construct(CookieJar $cookie, $minutes) * * @return bool */ - public function open($savePath, $sessionName): bool + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { return true; } @@ -60,7 +61,8 @@ public function open($savePath, $sessionName): bool * * @return bool */ - public function close(): bool + #[\ReturnTypeWillChange] + public function close() { return true; } @@ -70,13 +72,15 @@ public function close(): bool * * @return string|false */ - public function read($sessionId): string|false + #[\ReturnTypeWillChange] + public function read($sessionId) { $value = $this->request->cookies->get($sessionId) ?: ''; - if (! is_null($decoded = json_decode($value, true)) && is_array($decoded) && - isset($decoded['expires']) && $this->currentTime() <= $decoded['expires']) { - return $decoded['data']; + if (! is_null($decoded = json_decode($value, true)) && is_array($decoded)) { + if (isset($decoded['expires']) && $this->currentTime() <= $decoded['expires']) { + return $decoded['data']; + } } return ''; @@ -87,7 +91,8 @@ public function read($sessionId): string|false * * @return bool */ - public function write($sessionId, $data): bool + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { $this->cookie->queue($sessionId, json_encode([ 'data' => $data, @@ -102,7 +107,8 @@ public function write($sessionId, $data): bool * * @return bool */ - public function destroy($sessionId): bool + #[\ReturnTypeWillChange] + public function destroy($sessionId) { $this->cookie->queue($this->cookie->forget($sessionId)); @@ -112,11 +118,12 @@ public function destroy($sessionId): bool /** * {@inheritdoc} * - * @return int + * @return int|false */ - public function gc($lifetime): int + #[\ReturnTypeWillChange] + public function gc($lifetime) { - return 0; + return true; } /** diff --git a/core/vendor/illuminate/session/DatabaseSessionHandler.php b/core/vendor/illuminate/session/DatabaseSessionHandler.php index 6cbf6471c3..18846add33 100644 --- a/core/vendor/illuminate/session/DatabaseSessionHandler.php +++ b/core/vendor/illuminate/session/DatabaseSessionHandler.php @@ -72,7 +72,8 @@ public function __construct(ConnectionInterface $connection, $table, $minutes, C * * @return bool */ - public function open($savePath, $sessionName): bool + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { return true; } @@ -82,7 +83,8 @@ public function open($savePath, $sessionName): bool * * @return bool */ - public function close(): bool + #[\ReturnTypeWillChange] + public function close() { return true; } @@ -92,7 +94,8 @@ public function close(): bool * * @return string|false */ - public function read($sessionId): string|false + #[\ReturnTypeWillChange] + public function read($sessionId) { $session = (object) $this->getQuery()->find($sessionId); @@ -128,7 +131,8 @@ protected function expired($session) * * @return bool */ - public function write($sessionId, $data): bool + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { $payload = $this->getDefaultPayload($data); @@ -264,7 +268,8 @@ protected function userAgent() * * @return bool */ - public function destroy($sessionId): bool + #[\ReturnTypeWillChange] + public function destroy($sessionId) { $this->getQuery()->where('id', $sessionId)->delete(); @@ -274,11 +279,12 @@ public function destroy($sessionId): bool /** * {@inheritdoc} * - * @return int + * @return int|false */ - public function gc($lifetime): int + #[\ReturnTypeWillChange] + public function gc($lifetime) { - return $this->getQuery()->where('last_activity', '<=', $this->currentTime() - $lifetime)->delete(); + $this->getQuery()->where('last_activity', '<=', $this->currentTime() - $lifetime)->delete(); } /** diff --git a/core/vendor/illuminate/session/EncryptedStore.php b/core/vendor/illuminate/session/EncryptedStore.php index b8ae8cfaf3..106fe135f3 100644 --- a/core/vendor/illuminate/session/EncryptedStore.php +++ b/core/vendor/illuminate/session/EncryptedStore.php @@ -22,14 +22,13 @@ class EncryptedStore extends Store * @param \SessionHandlerInterface $handler * @param \Illuminate\Contracts\Encryption\Encrypter $encrypter * @param string|null $id - * @param string $serialization * @return void */ - public function __construct($name, SessionHandlerInterface $handler, EncrypterContract $encrypter, $id = null, $serialization = 'php') + public function __construct($name, SessionHandlerInterface $handler, EncrypterContract $encrypter, $id = null) { $this->encrypter = $encrypter; - parent::__construct($name, $handler, $id, $serialization); + parent::__construct($name, $handler, $id); } /** @@ -43,7 +42,7 @@ protected function prepareForUnserialize($data) try { return $this->encrypter->decrypt($data); } catch (DecryptException $e) { - return $this->serialization === 'json' ? json_encode([]) : serialize([]); + return serialize([]); } } diff --git a/core/vendor/illuminate/session/FileSessionHandler.php b/core/vendor/illuminate/session/FileSessionHandler.php index 08b2d80bd7..27c5e8fb52 100644 --- a/core/vendor/illuminate/session/FileSessionHandler.php +++ b/core/vendor/illuminate/session/FileSessionHandler.php @@ -50,7 +50,8 @@ public function __construct(Filesystem $files, $path, $minutes) * * @return bool */ - public function open($savePath, $sessionName): bool + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { return true; } @@ -60,7 +61,8 @@ public function open($savePath, $sessionName): bool * * @return bool */ - public function close(): bool + #[\ReturnTypeWillChange] + public function close() { return true; } @@ -70,11 +72,13 @@ public function close(): bool * * @return string|false */ - public function read($sessionId): string|false + #[\ReturnTypeWillChange] + public function read($sessionId) { - if ($this->files->isFile($path = $this->path.'/'.$sessionId) && - $this->files->lastModified($path) >= Carbon::now()->subMinutes($this->minutes)->getTimestamp()) { - return $this->files->sharedGet($path); + if ($this->files->isFile($path = $this->path.'/'.$sessionId)) { + if ($this->files->lastModified($path) >= Carbon::now()->subMinutes($this->minutes)->getTimestamp()) { + return $this->files->sharedGet($path); + } } return ''; @@ -85,7 +89,8 @@ public function read($sessionId): string|false * * @return bool */ - public function write($sessionId, $data): bool + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { $this->files->put($this->path.'/'.$sessionId, $data, true); @@ -97,7 +102,8 @@ public function write($sessionId, $data): bool * * @return bool */ - public function destroy($sessionId): bool + #[\ReturnTypeWillChange] + public function destroy($sessionId) { $this->files->delete($this->path.'/'.$sessionId); @@ -107,9 +113,10 @@ public function destroy($sessionId): bool /** * {@inheritdoc} * - * @return int + * @return int|false */ - public function gc($lifetime): int + #[\ReturnTypeWillChange] + public function gc($lifetime) { $files = Finder::create() ->in($this->path) @@ -117,13 +124,8 @@ public function gc($lifetime): int ->ignoreDotFiles(true) ->date('<= now - '.$lifetime.' seconds'); - $deletedSessions = 0; - foreach ($files as $file) { $this->files->delete($file->getRealPath()); - $deletedSessions++; } - - return $deletedSessions; } } diff --git a/core/vendor/illuminate/session/Middleware/StartSession.php b/core/vendor/illuminate/session/Middleware/StartSession.php index de5a87ee05..e7d2daa223 100644 --- a/core/vendor/illuminate/session/Middleware/StartSession.php +++ b/core/vendor/illuminate/session/Middleware/StartSession.php @@ -95,7 +95,7 @@ protected function handleRequestWhileBlocking(Request $request, $session, Closur return $this->handleStatefulRequest($request, $session, $next); } finally { - $lock?->release(); + optional($lock)->release(); } } @@ -199,7 +199,7 @@ protected function configHitsLottery(array $config) */ protected function storeCurrentUrl(Request $request, $session) { - if ($request->isMethod('GET') && + if ($request->method() === 'GET' && $request->route() instanceof Route && ! $request->ajax() && ! $request->prefetch()) { diff --git a/core/vendor/illuminate/session/NullSessionHandler.php b/core/vendor/illuminate/session/NullSessionHandler.php index fbebd5d74b..b9af93ab63 100644 --- a/core/vendor/illuminate/session/NullSessionHandler.php +++ b/core/vendor/illuminate/session/NullSessionHandler.php @@ -11,7 +11,8 @@ class NullSessionHandler implements SessionHandlerInterface * * @return bool */ - public function open($savePath, $sessionName): bool + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { return true; } @@ -21,7 +22,8 @@ public function open($savePath, $sessionName): bool * * @return bool */ - public function close(): bool + #[\ReturnTypeWillChange] + public function close() { return true; } @@ -29,9 +31,10 @@ public function close(): bool /** * {@inheritdoc} * - * @return string + * @return string|false */ - public function read($sessionId): string + #[\ReturnTypeWillChange] + public function read($sessionId) { return ''; } @@ -41,7 +44,8 @@ public function read($sessionId): string * * @return bool */ - public function write($sessionId, $data): bool + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { return true; } @@ -51,7 +55,8 @@ public function write($sessionId, $data): bool * * @return bool */ - public function destroy($sessionId): bool + #[\ReturnTypeWillChange] + public function destroy($sessionId) { return true; } @@ -59,10 +64,11 @@ public function destroy($sessionId): bool /** * {@inheritdoc} * - * @return int + * @return int|false */ - public function gc($lifetime): int + #[\ReturnTypeWillChange] + public function gc($lifetime) { - return 0; + return true; } } diff --git a/core/vendor/illuminate/session/SessionManager.php b/core/vendor/illuminate/session/SessionManager.php index 9502f90000..6d881fc222 100755 --- a/core/vendor/illuminate/session/SessionManager.php +++ b/core/vendor/illuminate/session/SessionManager.php @@ -186,12 +186,7 @@ protected function buildSession($handler) { return $this->config->get('session.encrypt') ? $this->buildEncryptedSession($handler) - : new Store( - $this->config->get('session.cookie'), - $handler, - $id = null, - $this->config->get('session.serialization', 'php') - ); + : new Store($this->config->get('session.cookie'), $handler); } /** @@ -203,11 +198,7 @@ protected function buildSession($handler) protected function buildEncryptedSession($handler) { return new EncryptedStore( - $this->config->get('session.cookie'), - $handler, - $this->container['encrypter'], - $id = null, - $this->config->get('session.serialization', 'php'), + $this->config->get('session.cookie'), $handler, $this->container['encrypter'] ); } diff --git a/core/vendor/illuminate/session/Store.php b/core/vendor/illuminate/session/Store.php index ae3c78e5f5..151e8b6330 100755 --- a/core/vendor/illuminate/session/Store.php +++ b/core/vendor/illuminate/session/Store.php @@ -39,13 +39,6 @@ class Store implements Session */ protected $handler; - /** - * The session store's serialization strategy. - * - * @var string - */ - protected $serialization = 'php'; - /** * Session store started status. * @@ -59,15 +52,13 @@ class Store implements Session * @param string $name * @param \SessionHandlerInterface $handler * @param string|null $id - * @param string $serialization * @return void */ - public function __construct($name, SessionHandlerInterface $handler, $id = null, $serialization = 'php') + public function __construct($name, SessionHandlerInterface $handler, $id = null) { $this->setId($id); $this->name = $name; $this->handler = $handler; - $this->serialization = $serialization; } /** @@ -104,11 +95,7 @@ protected function loadSession() protected function readFromHandler() { if ($data = $this->handler->read($this->getId())) { - if ($this->serialization === 'json') { - $data = json_decode($this->prepareForUnserialize($data), true); - } else { - $data = @unserialize($this->prepareForUnserialize($data)); - } + $data = @unserialize($this->prepareForUnserialize($data)); if ($data !== false && ! is_null($data) && is_array($data)) { return $data; @@ -139,7 +126,7 @@ public function save() $this->ageFlashData(); $this->handler->write($this->getId(), $this->prepareForStorage( - $this->serialization === 'json' ? json_encode($this->attributes) : serialize($this->attributes) + serialize($this->attributes) )); $this->started = false; diff --git a/core/vendor/illuminate/session/SymfonySessionDecorator.php b/core/vendor/illuminate/session/SymfonySessionDecorator.php deleted file mode 100644 index 889560b15b..0000000000 --- a/core/vendor/illuminate/session/SymfonySessionDecorator.php +++ /dev/null @@ -1,186 +0,0 @@ -<?php - -namespace Illuminate\Session; - -use BadMethodCallException; -use Illuminate\Contracts\Session\Session; -use Symfony\Component\HttpFoundation\Session\SessionBagInterface; -use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; - -class SymfonySessionDecorator implements SessionInterface -{ - /** - * The underlying Laravel session store. - * - * @var \Illuminate\Session\Store - */ - protected $store; - - /** - * Create a new session decorator. - * - * @param \Illuminate\Contracts\Session\Session $store - * @return void - */ - public function __construct(Session $store) - { - $this->store = $store; - } - - /** - * {@inheritdoc} - */ - public function start(): bool - { - return $this->store->start(); - } - - /** - * {@inheritdoc} - */ - public function getId(): string - { - return $this->store->getId(); - } - - /** - * {@inheritdoc} - */ - public function setId(string $id) - { - $this->store->setId($id); - } - - /** - * {@inheritdoc} - */ - public function getName(): string - { - return $this->store->getName(); - } - - /** - * {@inheritdoc} - */ - public function setName(string $name) - { - $this->store->setName($name); - } - - /** - * {@inheritdoc} - */ - public function invalidate(int $lifetime = null): bool - { - $this->store->invalidate(); - - return true; - } - - /** - * {@inheritdoc} - */ - public function migrate(bool $destroy = false, int $lifetime = null): bool - { - $this->store->migrate($destroy); - - return true; - } - - /** - * {@inheritdoc} - */ - public function save() - { - $this->store->save(); - } - - /** - * {@inheritdoc} - */ - public function has(string $name): bool - { - return $this->store->has($name); - } - - /** - * {@inheritdoc} - */ - public function get(string $name, mixed $default = null): mixed - { - return $this->store->get($name, $default); - } - - /** - * {@inheritdoc} - */ - public function set(string $name, mixed $value) - { - $this->store->put($name, $value); - } - - /** - * {@inheritdoc} - */ - public function all(): array - { - return $this->store->all(); - } - - /** - * {@inheritdoc} - */ - public function replace(array $attributes) - { - $this->store->replace($attributes); - } - - /** - * {@inheritdoc} - */ - public function remove(string $name): mixed - { - return $this->store->remove($name); - } - - /** - * {@inheritdoc} - */ - public function clear() - { - $this->store->flush(); - } - - /** - * {@inheritdoc} - */ - public function isStarted(): bool - { - return $this->store->isStarted(); - } - - /** - * {@inheritdoc} - */ - public function registerBag(SessionBagInterface $bag) - { - throw new BadMethodCallException('Method not implemented by Laravel.'); - } - - /** - * {@inheritdoc} - */ - public function getBag(string $name): SessionBagInterface - { - throw new BadMethodCallException('Method not implemented by Laravel.'); - } - - /** - * {@inheritdoc} - */ - public function getMetadataBag(): MetadataBag - { - throw new BadMethodCallException('Method not implemented by Laravel.'); - } -} diff --git a/core/vendor/illuminate/session/composer.json b/core/vendor/illuminate/session/composer.json index f29d59d4d0..dc1c3ea30d 100755 --- a/core/vendor/illuminate/session/composer.json +++ b/core/vendor/illuminate/session/composer.json @@ -14,14 +14,14 @@ } ], "require": { - "php": "^8.0.2", + "php": "^7.3|^8.0", "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/support": "^9.0", - "symfony/finder": "^6.0", - "symfony/http-foundation": "^6.0" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/support": "^8.0", + "symfony/finder": "^5.4", + "symfony/http-foundation": "^5.4" }, "autoload": { "psr-4": { @@ -30,11 +30,11 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { - "illuminate/console": "Required to use the session:table command (^9.0)." + "illuminate/console": "Required to use the session:table command (^8.0)." }, "config": { "sort-packages": true diff --git a/core/vendor/illuminate/support/Facades/Cache.php b/core/vendor/illuminate/support/Facades/Cache.php index 18fb9c48de..70aa1dc483 100755 --- a/core/vendor/illuminate/support/Facades/Cache.php +++ b/core/vendor/illuminate/support/Facades/Cache.php @@ -14,10 +14,10 @@ * @method static bool forget(string $key) * @method static bool has(string $key) * @method static bool missing(string $key) - * @method static bool put(array|string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null) + * @method static bool put(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null) * @method static int|bool decrement(string $key, $value = 1) * @method static int|bool increment(string $key, $value = 1) - * @method static mixed get(array|string $key, mixed $default = null) + * @method static mixed get(string $key, mixed $default = null) * @method static mixed pull(string $key, mixed $default = null) * @method static mixed remember(string $key, \DateTimeInterface|\DateInterval|int $ttl, \Closure $callback) * @method static mixed rememberForever(string $key, \Closure $callback) diff --git a/core/vendor/illuminate/support/Facades/DB.php b/core/vendor/illuminate/support/Facades/DB.php index 08ca4a9c57..554dd22030 100755 --- a/core/vendor/illuminate/support/Facades/DB.php +++ b/core/vendor/illuminate/support/Facades/DB.php @@ -28,7 +28,6 @@ * @method static void enableQueryLog() * @method static void disableQueryLog() * @method static void flushQueryLog() - * @method static void registerDoctrineType(string $class, string $name, string $type) * @method static \Illuminate\Database\Connection beforeExecuting(\Closure $callback) * @method static void listen(\Closure $callback) * @method static void rollBack(int $toLevel = null) diff --git a/core/vendor/illuminate/support/Facades/Facade.php b/core/vendor/illuminate/support/Facades/Facade.php index d17e16c7c0..befe902d09 100755 --- a/core/vendor/illuminate/support/Facades/Facade.php +++ b/core/vendor/illuminate/support/Facades/Facade.php @@ -3,10 +3,6 @@ namespace Illuminate\Support\Facades; use Closure; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Arr; -use Illuminate\Support\Js; -use Illuminate\Support\Str; use Mockery; use Mockery\LegacyMockInterface; use RuntimeException; @@ -27,13 +23,6 @@ abstract class Facade */ protected static $resolvedInstance; - /** - * Indicates if the resolved instance should be cached. - * - * @var bool - */ - protected static $cached = true; - /** * Run a Closure when the facade has been resolved. * @@ -95,28 +84,12 @@ public static function shouldReceive() $name = static::getFacadeAccessor(); $mock = static::isMock() - ? static::$resolvedInstance[$name] - : static::createFreshMockInstance(); + ? static::$resolvedInstance[$name] + : static::createFreshMockInstance(); return $mock->shouldReceive(...func_get_args()); } - /** - * Initiate a mock expectation on the facade. - * - * @return \Mockery\Expectation - */ - public static function expects() - { - $name = static::getFacadeAccessor(); - - $mock = static::isMock() - ? static::$resolvedInstance[$name] - : static::createFreshMockInstance(); - - return $mock->expects(...func_get_args()); - } - /** * Create a fresh mock instance for the given class. * @@ -208,21 +181,21 @@ protected static function getFacadeAccessor() /** * Resolve the facade root instance from the container. * - * @param string $name + * @param object|string $name * @return mixed */ protected static function resolveFacadeInstance($name) { + if (is_object($name)) { + return $name; + } + if (isset(static::$resolvedInstance[$name])) { return static::$resolvedInstance[$name]; } if (static::$app) { - if (static::$cached) { - return static::$resolvedInstance[$name] = static::$app[$name]; - } - - return static::$app[$name]; + return static::$resolvedInstance[$name] = static::$app[$name]; } } @@ -247,55 +220,6 @@ public static function clearResolvedInstances() static::$resolvedInstance = []; } - /** - * Get the application default aliases. - * - * @return \Illuminate\Support\Collection - */ - public static function defaultAliases() - { - return collect([ - 'App' => App::class, - 'Arr' => Arr::class, - 'Artisan' => Artisan::class, - 'Auth' => Auth::class, - 'Blade' => Blade::class, - 'Broadcast' => Broadcast::class, - 'Bus' => Bus::class, - 'Cache' => Cache::class, - 'Config' => Config::class, - 'Cookie' => Cookie::class, - 'Crypt' => Crypt::class, - 'Date' => Date::class, - 'DB' => DB::class, - 'Eloquent' => Model::class, - 'Event' => Event::class, - 'File' => File::class, - 'Gate' => Gate::class, - 'Hash' => Hash::class, - 'Http' => Http::class, - 'Js' => Js::class, - 'Lang' => Lang::class, - 'Log' => Log::class, - 'Mail' => Mail::class, - 'Notification' => Notification::class, - 'Password' => Password::class, - 'Queue' => Queue::class, - 'RateLimiter' => RateLimiter::class, - 'Redirect' => Redirect::class, - 'Request' => Request::class, - 'Response' => Response::class, - 'Route' => Route::class, - 'Schema' => Schema::class, - 'Session' => Session::class, - 'Storage' => Storage::class, - 'Str' => Str::class, - 'URL' => URL::class, - 'Validator' => Validator::class, - 'View' => View::class, - ]); - } - /** * Get the application instance behind the facade. * diff --git a/core/vendor/illuminate/support/Facades/Http.php b/core/vendor/illuminate/support/Facades/Http.php index 8a40efc4e5..d6f2f66485 100644 --- a/core/vendor/illuminate/support/Facades/Http.php +++ b/core/vendor/illuminate/support/Facades/Http.php @@ -6,6 +6,7 @@ /** * @method static \GuzzleHttp\Promise\PromiseInterface response($body = null, $status = 200, $headers = []) + * @method static \Illuminate\Http\Client\Factory fake($callback = null) * @method static \Illuminate\Http\Client\PendingRequest accept(string $contentType) * @method static \Illuminate\Http\Client\PendingRequest acceptJson() * @method static \Illuminate\Http\Client\PendingRequest asForm() @@ -42,6 +43,7 @@ * @method static \Illuminate\Http\Client\Response post(string $url, array $data = []) * @method static \Illuminate\Http\Client\Response put(string $url, array $data = []) * @method static \Illuminate\Http\Client\Response send(string $method, string $url, array $options = []) + * @method static \Illuminate\Http\Client\ResponseSequence fakeSequence(string $urlPattern = '*') * @method static void assertSent(callable $callback) * @method static void assertSentInOrder(array $callbacks) * @method static void assertNotSent(callable $callback) @@ -62,46 +64,4 @@ protected static function getFacadeAccessor() { return Factory::class; } - - /** - * Register a stub callable that will intercept requests and be able to return stub responses. - * - * @param \Closure|array $callback - * @return \Illuminate\Http\Client\Factory - */ - public static function fake($callback = null) - { - return tap(static::getFacadeRoot(), function ($fake) use ($callback) { - static::swap($fake->fake($callback)); - }); - } - - /** - * Register a response sequence for the given URL pattern. - * - * @param string $urlPattern - * @return \Illuminate\Http\Client\ResponseSequence - */ - public static function fakeSequence(string $urlPattern = '*') - { - $fake = tap(static::getFacadeRoot(), function ($fake) { - static::swap($fake); - }); - - return $fake->fakeSequence($urlPattern); - } - - /** - * Stub the given URL using the given callback. - * - * @param string $url - * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable $callback - * @return \Illuminate\Http\Client\Factory - */ - public static function stubUrl($url, $callback) - { - return tap(static::getFacadeRoot(), function ($fake) use ($url, $callback) { - static::swap($fake->stubUrl($url, $callback)); - }); - } } diff --git a/core/vendor/illuminate/support/Facades/Mail.php b/core/vendor/illuminate/support/Facades/Mail.php index 0097834b52..103884c477 100755 --- a/core/vendor/illuminate/support/Facades/Mail.php +++ b/core/vendor/illuminate/support/Facades/Mail.php @@ -14,10 +14,6 @@ * @method static \Illuminate\Mail\PendingMail to($users) * @method static \Illuminate\Support\Collection queued(string $mailable, \Closure|string $callback = null) * @method static \Illuminate\Support\Collection sent(string $mailable, \Closure|string $callback = null) - * @method static \Illuminate\Mail\SentMessage|null raw(string $text, $callback) - * @method static \Illuminate\Mail\SentMessage|null plain(string $view, array $data, $callback) - * @method static \Illuminate\Mail\SentMessage|null html(string $html, $callback) - * @method static \Illuminate\Mail\SentMessage|null send(\Illuminate\Contracts\Mail\Mailable|string|array $view, array $data = [], \Closure|string $callback = null) * @method static array failures() * @method static bool hasQueued(string $mailable) * @method static bool hasSent(string $mailable) @@ -31,6 +27,10 @@ * @method static void assertNothingSent() * @method static void assertQueued(string|\Closure $mailable, callable|int $callback = null) * @method static void assertSent(string|\Closure $mailable, callable|int $callback = null) + * @method static void raw(string $text, $callback) + * @method static void plain(string $view, array $data, $callback) + * @method static void html(string $html, $callback) + * @method static void send(\Illuminate\Contracts\Mail\Mailable|string|array $view, array $data = [], \Closure|string $callback = null) * * @see \Illuminate\Mail\Mailer * @see \Illuminate\Support\Testing\Fakes\MailFake diff --git a/core/vendor/illuminate/support/Facades/RateLimiter.php b/core/vendor/illuminate/support/Facades/RateLimiter.php index 3c33eb266c..5cfd78462f 100644 --- a/core/vendor/illuminate/support/Facades/RateLimiter.php +++ b/core/vendor/illuminate/support/Facades/RateLimiter.php @@ -25,6 +25,6 @@ class RateLimiter extends Facade */ protected static function getFacadeAccessor() { - return \Illuminate\Cache\RateLimiter::class; + return 'Illuminate\Cache\RateLimiter'; } } diff --git a/core/vendor/illuminate/support/Facades/Schema.php b/core/vendor/illuminate/support/Facades/Schema.php index 2b0584d3fa..ffe59cb262 100755 --- a/core/vendor/illuminate/support/Facades/Schema.php +++ b/core/vendor/illuminate/support/Facades/Schema.php @@ -17,6 +17,7 @@ * @method static bool dropColumns(string $table, array $columns) * @method static bool hasTable(string $table) * @method static void defaultStringLength(int $length) + * @method static void registerCustomDoctrineType(string $class, string $name, string $type) * @method static array getColumnListing(string $table) * @method static string getColumnType(string $table, string $column) * @method static void morphUsingUuids() @@ -27,13 +28,6 @@ */ class Schema extends Facade { - /** - * Indicates if the resolved facade should be cached. - * - * @var bool - */ - protected static $cached = false; - /** * Get a schema builder instance for a connection. * @@ -46,12 +40,12 @@ public static function connection($name) } /** - * Get the registered name of the component. + * Get a schema builder instance for the default connection. * - * @return string + * @return \Illuminate\Database\Schema\Builder */ protected static function getFacadeAccessor() { - return 'db.schema'; + return static::$app['db']->connection()->getSchemaBuilder(); } } diff --git a/core/vendor/illuminate/support/Fluent.php b/core/vendor/illuminate/support/Fluent.php index f7e67c9e89..4660283b87 100755 --- a/core/vendor/illuminate/support/Fluent.php +++ b/core/vendor/illuminate/support/Fluent.php @@ -7,26 +7,19 @@ use Illuminate\Contracts\Support\Jsonable; use JsonSerializable; -/** - * @template TKey of array-key - * @template TValue - * - * @implements \Illuminate\Contracts\Support\Arrayable<TKey, TValue> - * @implements \ArrayAccess<TKey, TValue> - */ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable { /** * All of the attributes set on the fluent instance. * - * @var array<TKey, TValue> + * @var array */ protected $attributes = []; /** * Create a new fluent instance. * - * @param iterable<TKey, TValue> $attributes + * @param array|object $attributes * @return void */ public function __construct($attributes = []) @@ -39,11 +32,9 @@ public function __construct($attributes = []) /** * Get an attribute from the fluent instance. * - * @template TGetDefault - * - * @param TKey $key - * @param TGetDefault|(\Closure(): TGetDefault) $default - * @return TValue|TGetDefault + * @param string $key + * @param mixed $default + * @return mixed */ public function get($key, $default = null) { @@ -57,7 +48,7 @@ public function get($key, $default = null) /** * Get the attributes from the fluent instance. * - * @return array<TKey, TValue> + * @return array */ public function getAttributes() { @@ -67,7 +58,7 @@ public function getAttributes() /** * Convert the fluent instance to an array. * - * @return array<TKey, TValue> + * @return array */ public function toArray() { @@ -77,9 +68,10 @@ public function toArray() /** * Convert the object into something JSON serializable. * - * @return array<TKey, TValue> + * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->toArray(); } @@ -98,10 +90,11 @@ public function toJson($options = 0) /** * Determine if the given offset exists. * - * @param TKey $offset + * @param string $offset * @return bool */ - public function offsetExists($offset): bool + #[\ReturnTypeWillChange] + public function offsetExists($offset) { return isset($this->attributes[$offset]); } @@ -109,10 +102,11 @@ public function offsetExists($offset): bool /** * Get the value for a given offset. * - * @param TKey $offset - * @return TValue|null + * @param string $offset + * @return mixed */ - public function offsetGet($offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($offset) { return $this->get($offset); } @@ -120,11 +114,12 @@ public function offsetGet($offset): mixed /** * Set the value at the given offset. * - * @param TKey $offset - * @param TValue $value + * @param string $offset + * @param mixed $value * @return void */ - public function offsetSet($offset, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) { $this->attributes[$offset] = $value; } @@ -132,10 +127,11 @@ public function offsetSet($offset, $value): void /** * Unset the value at the given offset. * - * @param TKey $offset + * @param string $offset * @return void */ - public function offsetUnset($offset): void + #[\ReturnTypeWillChange] + public function offsetUnset($offset) { unset($this->attributes[$offset]); } @@ -143,8 +139,8 @@ public function offsetUnset($offset): void /** * Handle dynamic calls to the fluent instance to set attributes. * - * @param TKey $method - * @param array{0: ?TValue} $parameters + * @param string $method + * @param array $parameters * @return $this */ public function __call($method, $parameters) @@ -157,8 +153,8 @@ public function __call($method, $parameters) /** * Dynamically retrieve the value of an attribute. * - * @param TKey $key - * @return TValue|null + * @param string $key + * @return mixed */ public function __get($key) { @@ -168,8 +164,8 @@ public function __get($key) /** * Dynamically set the value of an attribute. * - * @param TKey $key - * @param TValue $value + * @param string $key + * @param mixed $value * @return void */ public function __set($key, $value) @@ -180,7 +176,7 @@ public function __set($key, $value) /** * Dynamically check if an attribute is set. * - * @param TKey $key + * @param string $key * @return bool */ public function __isset($key) @@ -191,7 +187,7 @@ public function __isset($key) /** * Dynamically unset an attribute. * - * @param TKey $key + * @param string $key * @return void */ public function __unset($key) diff --git a/core/vendor/illuminate/support/MessageBag.php b/core/vendor/illuminate/support/MessageBag.php index cfc6d88fee..e53d509d37 100755 --- a/core/vendor/illuminate/support/MessageBag.php +++ b/core/vendor/illuminate/support/MessageBag.php @@ -193,7 +193,7 @@ public function get($key, $format = null) ); } - if (str_contains($key, '*')) { + if (Str::contains($key, '*')) { return $this->getMessagesForWildcardKey($key, $format); } @@ -368,7 +368,8 @@ public function any() * * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return count($this->messages, COUNT_RECURSIVE) - count($this->messages); } @@ -388,7 +389,8 @@ public function toArray() * * @return array */ - public function jsonSerialize(): array + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->toArray(); } diff --git a/core/vendor/illuminate/support/NamespacedItemResolver.php b/core/vendor/illuminate/support/NamespacedItemResolver.php index a059c6daff..a0d8508b28 100755 --- a/core/vendor/illuminate/support/NamespacedItemResolver.php +++ b/core/vendor/illuminate/support/NamespacedItemResolver.php @@ -29,7 +29,7 @@ public function parseKey($key) // If the key does not contain a double colon, it means the key is not in a // namespace, and is just a regular configuration item. Namespaces are a // tool for organizing configuration items for things such as modules. - if (! str_contains($key, '::')) { + if (strpos($key, '::') === false) { $segments = explode('.', $key); $parsed = $this->parseBasicSegments($segments); diff --git a/core/vendor/illuminate/support/Optional.php b/core/vendor/illuminate/support/Optional.php index ba84a2ccf2..816190dd7a 100644 --- a/core/vendor/illuminate/support/Optional.php +++ b/core/vendor/illuminate/support/Optional.php @@ -68,7 +68,8 @@ public function __isset($name) * @param mixed $key * @return bool */ - public function offsetExists($key): bool + #[\ReturnTypeWillChange] + public function offsetExists($key) { return Arr::accessible($this->value) && Arr::exists($this->value, $key); } @@ -79,7 +80,8 @@ public function offsetExists($key): bool * @param mixed $key * @return mixed */ - public function offsetGet($key): mixed + #[\ReturnTypeWillChange] + public function offsetGet($key) { return Arr::get($this->value, $key); } @@ -91,7 +93,8 @@ public function offsetGet($key): mixed * @param mixed $value * @return void */ - public function offsetSet($key, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) { if (Arr::accessible($this->value)) { $this->value[$key] = $value; @@ -104,7 +107,8 @@ public function offsetSet($key, $value): void * @param string $key * @return void */ - public function offsetUnset($key): void + #[\ReturnTypeWillChange] + public function offsetUnset($key) { if (Arr::accessible($this->value)) { unset($this->value[$key]); diff --git a/core/vendor/illuminate/support/Pluralizer.php b/core/vendor/illuminate/support/Pluralizer.php index fbe518286f..109a10816d 100755 --- a/core/vendor/illuminate/support/Pluralizer.php +++ b/core/vendor/illuminate/support/Pluralizer.php @@ -2,6 +2,7 @@ namespace Illuminate\Support; +use Doctrine\Inflector\Inflector; use Doctrine\Inflector\InflectorFactory; class Pluralizer diff --git a/core/vendor/illuminate/support/ProcessUtils.php b/core/vendor/illuminate/support/ProcessUtils.php index 463c536e64..1caa9e168a 100644 --- a/core/vendor/illuminate/support/ProcessUtils.php +++ b/core/vendor/illuminate/support/ProcessUtils.php @@ -37,7 +37,7 @@ public static function escapeArgument($argument) $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; } else { // escape trailing backslash - if (str_ends_with($part, '\\')) { + if ('\\' === substr($part, -1)) { $part .= '\\'; } $quote = true; diff --git a/core/vendor/illuminate/support/Reflector.php b/core/vendor/illuminate/support/Reflector.php index b9007ed03d..841bad6862 100644 --- a/core/vendor/illuminate/support/Reflector.php +++ b/core/vendor/illuminate/support/Reflector.php @@ -3,7 +3,6 @@ namespace Illuminate\Support; use ReflectionClass; -use ReflectionEnum; use ReflectionMethod; use ReflectionNamedType; use ReflectionUnionType; @@ -140,24 +139,4 @@ public static function isParameterSubclassOf($parameter, $className) && (class_exists($paramClassName) || interface_exists($paramClassName)) && (new ReflectionClass($paramClassName))->isSubclassOf($className); } - - /** - * Determine if the parameter's type is a Backed Enum with a string backing type. - * - * @param \ReflectionParameter $parameter - * @return bool - */ - public static function isParameterBackedEnumWithStringBackingType($parameter) - { - $backedEnumClass = (string) $parameter->getType(); - - if (function_exists('enum_exists') && enum_exists($backedEnumClass)) { - $reflectionBackedEnum = new ReflectionEnum($backedEnumClass); - - return $reflectionBackedEnum->isBacked() - && $reflectionBackedEnum->getBackingType()->getName() == 'string'; - } - - return false; - } } diff --git a/core/vendor/illuminate/support/Str.php b/core/vendor/illuminate/support/Str.php index b6198d0f56..2ffea75d16 100644 --- a/core/vendor/illuminate/support/Str.php +++ b/core/vendor/illuminate/support/Str.php @@ -189,18 +189,12 @@ public static function camel($value) * * @param string $haystack * @param string|string[] $needles - * @param bool $ignoreCase * @return bool */ - public static function contains($haystack, $needles, $ignoreCase = false) + public static function contains($haystack, $needles) { - if ($ignoreCase) { - $haystack = mb_strtolower($haystack); - $needles = array_map('mb_strtolower', (array) $needles); - } - foreach ((array) $needles as $needle) { - if ($needle !== '' && str_contains($haystack, $needle)) { + if ($needle !== '' && mb_strpos($haystack, $needle) !== false) { return true; } } @@ -213,16 +207,10 @@ public static function contains($haystack, $needles, $ignoreCase = false) * * @param string $haystack * @param string[] $needles - * @param bool $ignoreCase * @return bool */ - public static function containsAll($haystack, array $needles, $ignoreCase = false) + public static function containsAll($haystack, array $needles) { - if ($ignoreCase) { - $haystack = mb_strtolower($haystack); - $needles = array_map('mb_strtolower', $needles); - } - foreach ($needles as $needle) { if (! static::contains($haystack, $needle)) { return false; @@ -244,7 +232,7 @@ public static function endsWith($haystack, $needles) foreach ((array) $needles as $needle) { if ( $needle !== '' && $needle !== null - && str_ends_with($haystack, $needle) + && substr($haystack, -strlen($needle)) === (string) $needle ) { return true; } @@ -253,42 +241,6 @@ public static function endsWith($haystack, $needles) return false; } - /** - * Extracts an excerpt from text that matches the first instance of a phrase. - * - * @param string $text - * @param string $phrase - * @param array $options - * @return string|null - */ - public static function excerpt($text, $phrase = '', $options = []) - { - $radius = $options['radius'] ?? 100; - $omission = $options['omission'] ?? '...'; - - preg_match('/^(.*?)('.preg_quote((string) $phrase).')(.*)$/iu', (string) $text, $matches); - - if (empty($matches)) { - return null; - } - - $start = ltrim($matches[1]); - - $start = str(mb_substr($start, max(mb_strlen($start, 'UTF-8') - $radius, 0), $radius, 'UTF-8'))->ltrim()->unless( - fn ($startWithRadius) => $startWithRadius->exactly($start), - fn ($startWithRadius) => $startWithRadius->prepend($omission), - ); - - $end = rtrim($matches[3]); - - $end = str(mb_substr($end, 0, $radius, 'UTF-8'))->rtrim()->unless( - fn ($endWithRadius) => $endWithRadius->exactly($end), - fn ($endWithRadius) => $endWithRadius->append($omission), - ); - - return $start->append($matches[2], $end)->toString(); - } - /** * Cap a string with a single instance of a given value. * @@ -326,7 +278,7 @@ public static function is($pattern, $value) // If the given value is an exact match we can of course return true right // from the beginning. Otherwise, we will translate asterisks and do an // actual pattern match against the two strings to see if they match. - if ($pattern === $value) { + if ($pattern == $value) { return true; } @@ -683,8 +635,6 @@ public static function replace($search, $replace, $subject) */ public static function replaceFirst($search, $replace, $subject) { - $search = (string) $search; - if ($search === '') { return $subject; } @@ -878,7 +828,7 @@ public static function snake($value, $delimiter = '_') public static function startsWith($haystack, $needles) { foreach ((array) $needles as $needle) { - if ((string) $needle !== '' && str_starts_with($haystack, $needle)) { + if ((string) $needle !== '' && strncmp($haystack, $needle, strlen($needle)) === 0) { return true; } } diff --git a/core/vendor/illuminate/support/Stringable.php b/core/vendor/illuminate/support/Stringable.php index 3ae7ed89f0..414be0c273 100644 --- a/core/vendor/illuminate/support/Stringable.php +++ b/core/vendor/illuminate/support/Stringable.php @@ -195,18 +195,6 @@ public function exactly($value) return $this->value === $value; } - /** - * Extracts an excerpt from text that matches the first instance of a phrase. - * - * @param string $phrase - * @param array $options - * @return string|null - */ - public function excerpt($phrase = '', $options = []) - { - return Str::excerpt($this->value, $phrase, $options); - } - /** * Explode the string into an array. * @@ -456,7 +444,7 @@ public function parseCallback($default = null) */ public function pipe(callable $callback) { - return new static($callback($this)); + return new static(call_user_func($callback, $this)); } /** @@ -522,7 +510,7 @@ public function reverse() */ public function repeat(int $times) { - return new static(str_repeat($this->value, $times)); + return new static(Str::repeat($this->value, $times)); } /** @@ -534,7 +522,7 @@ public function repeat(int $times) */ public function replace($search, $replace) { - return new static(str_replace($search, $replace, $this->value)); + return new static(Str::replace($search, $replace, $this->value)); } /** @@ -1004,32 +992,13 @@ public function dd() exit(1); } - /** - * Get the underlying string value. - * - * @return string - */ - public function value() - { - return $this->toString(); - } - - /** - * Get the underlying string value. - * - * @return string - */ - public function toString() - { - return $this->value; - } - /** * Convert the object to a string when JSON encoded. * * @return string */ - public function jsonSerialize(): string + #[\ReturnTypeWillChange] + public function jsonSerialize() { return $this->__toString(); } diff --git a/core/vendor/illuminate/support/Traits/Conditionable.php b/core/vendor/illuminate/support/Traits/Conditionable.php new file mode 100644 index 0000000000..798082794f --- /dev/null +++ b/core/vendor/illuminate/support/Traits/Conditionable.php @@ -0,0 +1,44 @@ +<?php + +namespace Illuminate\Support\Traits; + +trait Conditionable +{ + /** + * Apply the callback if the given "value" is truthy. + * + * @param mixed $value + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + */ + public function when($value, $callback, $default = null) + { + if ($value) { + return $callback($this, $value) ?: $this; + } elseif ($default) { + return $default($this, $value) ?: $this; + } + + return $this; + } + + /** + * Apply the callback if the given "value" is falsy. + * + * @param mixed $value + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + */ + public function unless($value, $callback, $default = null) + { + if (! $value) { + return $callback($this, $value) ?: $this; + } elseif ($default) { + return $default($this, $value) ?: $this; + } + + return $this; + } +} diff --git a/core/vendor/illuminate/support/ValidatedInput.php b/core/vendor/illuminate/support/ValidatedInput.php index 084cb24d83..07df014f70 100644 --- a/core/vendor/illuminate/support/ValidatedInput.php +++ b/core/vendor/illuminate/support/ValidatedInput.php @@ -5,7 +5,6 @@ use ArrayIterator; use Illuminate\Contracts\Support\ValidatedData; use stdClass; -use Traversable; class ValidatedInput implements ValidatedData { @@ -160,7 +159,8 @@ public function __unset($name) * @param mixed $key * @return bool */ - public function offsetExists($key): bool + #[\ReturnTypeWillChange] + public function offsetExists($key) { return isset($this->input[$key]); } @@ -171,7 +171,8 @@ public function offsetExists($key): bool * @param mixed $key * @return mixed */ - public function offsetGet($key): mixed + #[\ReturnTypeWillChange] + public function offsetGet($key) { return $this->input[$key]; } @@ -183,7 +184,8 @@ public function offsetGet($key): mixed * @param mixed $value * @return void */ - public function offsetSet($key, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) { if (is_null($key)) { $this->input[] = $value; @@ -198,7 +200,8 @@ public function offsetSet($key, $value): void * @param string $key * @return void */ - public function offsetUnset($key): void + #[\ReturnTypeWillChange] + public function offsetUnset($key) { unset($this->input[$key]); } @@ -208,7 +211,8 @@ public function offsetUnset($key): void * * @return \ArrayIterator */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { return new ArrayIterator($this->input); } diff --git a/core/vendor/illuminate/support/ViewErrorBag.php b/core/vendor/illuminate/support/ViewErrorBag.php index ff9da4fc58..d51bb534d8 100644 --- a/core/vendor/illuminate/support/ViewErrorBag.php +++ b/core/vendor/illuminate/support/ViewErrorBag.php @@ -78,7 +78,8 @@ public function any() * * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return $this->getBag('default')->count(); } diff --git a/core/vendor/illuminate/support/composer.json b/core/vendor/illuminate/support/composer.json index 1e1681cee1..527bdcbb86 100644 --- a/core/vendor/illuminate/support/composer.json +++ b/core/vendor/illuminate/support/composer.json @@ -14,16 +14,15 @@ } ], "require": { - "php": "^8.0.2", + "php": "^7.3|^8.0", "ext-json": "*", "ext-mbstring": "*", - "doctrine/inflector": "^2.0", - "illuminate/collections": "^9.0", - "illuminate/conditionable": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", + "doctrine/inflector": "^1.4|^2.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", "nesbot/carbon": "^2.53.1", - "voku/portable-ascii": "^2.0" + "voku/portable-ascii": "^1.6.1" }, "conflict": { "tightenco/collect": "<5.5.33" @@ -38,15 +37,15 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^9.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", + "illuminate/filesystem": "Required to use the composer class (^8.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", - "symfony/process": "Required to use the composer class (^6.0).", - "symfony/var-dumper": "Required to use the dd function (^6.0).", + "symfony/process": "Required to use the composer class (^5.4).", + "symfony/var-dumper": "Required to use the dd function (^5.4).", "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, "config": { diff --git a/core/vendor/illuminate/support/helpers.php b/core/vendor/illuminate/support/helpers.php index 4e0294b9bc..0b82fe7693 100755 --- a/core/vendor/illuminate/support/helpers.php +++ b/core/vendor/illuminate/support/helpers.php @@ -6,7 +6,6 @@ use Illuminate\Support\Env; use Illuminate\Support\HigherOrderTapProxy; use Illuminate\Support\Optional; -use Illuminate\Support\Str; if (! function_exists('append_config')) { /** @@ -215,7 +214,7 @@ function preg_replace_array($pattern, array $replacements, $subject) /** * Retry an operation a given number of times. * - * @param int|array $times + * @param int $times * @param callable $callback * @param int|\Closure $sleepMilliseconds * @param callable|null $when @@ -227,14 +226,6 @@ function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null) { $attempts = 0; - $backoff = []; - - if (is_array($times)) { - $backoff = $times; - - $times = count($times) + 1; - } - beginning: $attempts++; $times--; @@ -246,8 +237,6 @@ function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null) throw $e; } - $sleepMilliseconds = $backoff[$attempts - 1] ?? $sleepMilliseconds; - if ($sleepMilliseconds) { usleep(value($sleepMilliseconds, $attempts) * 1000); } @@ -257,34 +246,6 @@ function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null) } } -if (! function_exists('str')) { - /** - * Get a new stringable object from the given string. - * - * @param string|null $string - * @return \Illuminate\Support\Stringable|mixed - */ - function str($string = null) - { - if (func_num_args() === 0) { - return new class - { - public function __call($method, $parameters) - { - return Str::$method(...$parameters); - } - - public function __toString() - { - return ''; - } - }; - } - - return Str::of($string); - } -} - if (! function_exists('tap')) { /** * Call the given Closure with the given value then return the value. @@ -407,11 +368,9 @@ function windows_os() /** * Return the given value, optionally passed through the given callback. * - * @template TValue - * - * @param TValue $value - * @param (callable(TValue): TValue)|null $callback - * @return TValue + * @param mixed $value + * @param callable|null $callback + * @return mixed */ function with($value, callable $callback = null) { diff --git a/core/vendor/illuminate/translation/MessageSelector.php b/core/vendor/illuminate/translation/MessageSelector.php index 37c9b31fc4..177fa12f48 100755 --- a/core/vendor/illuminate/translation/MessageSelector.php +++ b/core/vendor/illuminate/translation/MessageSelector.php @@ -2,6 +2,8 @@ namespace Illuminate\Translation; +use Illuminate\Support\Str; + class MessageSelector { /** @@ -66,7 +68,7 @@ private function extractFromString($part, $number) $value = $matches[2]; - if (str_contains($condition, ',')) { + if (Str::contains($condition, ',')) { [$from, $to] = explode(',', $condition, 2); if ($to === '*' && $number >= $from) { diff --git a/core/vendor/illuminate/translation/composer.json b/core/vendor/illuminate/translation/composer.json index fc6bd262d3..ccd7142499 100755 --- a/core/vendor/illuminate/translation/composer.json +++ b/core/vendor/illuminate/translation/composer.json @@ -14,13 +14,13 @@ } ], "require": { - "php": "^8.0.2", + "php": "^7.3|^8.0", "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/support": "^9.0" + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/support": "^8.0" }, "autoload": { "psr-4": { @@ -29,7 +29,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/illuminate/validation/Concerns/FilterEmailValidation.php b/core/vendor/illuminate/validation/Concerns/FilterEmailValidation.php index 84ed212f27..2d21b6c5b2 100644 --- a/core/vendor/illuminate/validation/Concerns/FilterEmailValidation.php +++ b/core/vendor/illuminate/validation/Concerns/FilterEmailValidation.php @@ -3,7 +3,6 @@ namespace Illuminate\Validation\Concerns; use Egulias\EmailValidator\EmailLexer; -use Egulias\EmailValidator\Result\InvalidEmail; use Egulias\EmailValidator\Validation\EmailValidation; class FilterEmailValidation implements EmailValidation @@ -43,7 +42,7 @@ public static function unicode() * @param \Egulias\EmailValidator\EmailLexer $emailLexer * @return bool */ - public function isValid(string $email, EmailLexer $emailLexer): bool + public function isValid($email, EmailLexer $emailLexer) { return is_null($this->flags) ? filter_var($email, FILTER_VALIDATE_EMAIL) !== false @@ -53,11 +52,11 @@ public function isValid(string $email, EmailLexer $emailLexer): bool /** * Returns the validation error. * - * @return \Egulias\EmailValidator\Result\InvalidEmail|null + * @return \Egulias\EmailValidator\Exception\InvalidEmail|null */ - public function getError(): ?InvalidEmail + public function getError() { - return null; + // } /** @@ -65,7 +64,7 @@ public function getError(): ?InvalidEmail * * @return \Egulias\EmailValidator\Warning\Warning[] */ - public function getWarnings(): array + public function getWarnings() { return []; } diff --git a/core/vendor/illuminate/validation/Concerns/FormatsMessages.php b/core/vendor/illuminate/validation/Concerns/FormatsMessages.php index c9c1596fda..c95cd3a805 100644 --- a/core/vendor/illuminate/validation/Concerns/FormatsMessages.php +++ b/core/vendor/illuminate/validation/Concerns/FormatsMessages.php @@ -31,12 +31,8 @@ protected function getMessage($attribute, $rule) $lowerRule = Str::snake($rule); - $customKey = "validation.custom.{$attribute}.{$lowerRule}"; - $customMessage = $this->getCustomMessageFromTranslator( - in_array($rule, $this->sizeRules) - ? [$customKey.".{$this->getAttributeType($attribute)}", $customKey] - : $customKey + $customKey = "validation.custom.{$attribute}.{$lowerRule}" ); // First we check for a custom defined validation message for the attribute @@ -102,7 +98,7 @@ protected function getFromLocalArray($attribute, $lowerRule, $source = null) // that is not attribute specific. If we find either we'll return it. foreach ($keys as $key) { foreach (array_keys($source) as $sourceKey) { - if (str_contains($sourceKey, '*')) { + if (strpos($sourceKey, '*') !== false) { $pattern = str_replace('\*', '([^.]*)', preg_quote($sourceKey, '#')); if (preg_match('#^'.$pattern.'\z#u', $key) === 1) { @@ -122,33 +118,25 @@ protected function getFromLocalArray($attribute, $lowerRule, $source = null) /** * Get the custom error message from the translator. * - * @param array|string $keys + * @param string $key * @return string */ - protected function getCustomMessageFromTranslator($keys) + protected function getCustomMessageFromTranslator($key) { - foreach (Arr::wrap($keys) as $key) { - if (($message = $this->translator->get($key)) !== $key) { - return $message; - } - - // If an exact match was not found for the key, we will collapse all of these - // messages and loop through them and try to find a wildcard match for the - // given key. Otherwise, we will simply return the key's value back out. - $shortKey = preg_replace( - '/^validation\.custom\./', '', $key - ); - - $message = $this->getWildcardCustomMessages(Arr::dot( - (array) $this->translator->get('validation.custom') - ), $shortKey, $key); - - if ($message !== $key) { - return $message; - } + if (($message = $this->translator->get($key)) !== $key) { + return $message; } - return Arr::last(Arr::wrap($keys)); + // If an exact match was not found for the key, we will collapse all of these + // messages and loop through them and try to find a wildcard match for the + // given key. Otherwise, we will simply return the key's value back out. + $shortKey = preg_replace( + '/^validation\.custom\./', '', $key + ); + + return $this->getWildcardCustomMessages(Arr::dot( + (array) $this->translator->get('validation.custom') + ), $shortKey, $key); } /** diff --git a/core/vendor/illuminate/validation/Concerns/ValidatesAttributes.php b/core/vendor/illuminate/validation/Concerns/ValidatesAttributes.php index dfa74cdfb4..3a4d2da477 100644 --- a/core/vendor/illuminate/validation/Concerns/ValidatesAttributes.php +++ b/core/vendor/illuminate/validation/Concerns/ValidatesAttributes.php @@ -7,10 +7,10 @@ use DateTimeInterface; use Egulias\EmailValidator\EmailValidator; use Egulias\EmailValidator\Validation\DNSCheckValidation; -use Egulias\EmailValidator\Validation\Extra\SpoofCheckValidation; use Egulias\EmailValidator\Validation\MultipleValidationWithAnd; use Egulias\EmailValidator\Validation\NoRFCWarningsValidation; use Egulias\EmailValidator\Validation\RFCValidation; +use Egulias\EmailValidator\Validation\SpoofCheckValidation; use Exception; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Arr; @@ -917,15 +917,15 @@ protected function getUniqueExtra($parameters) */ public function parseTable($table) { - [$connection, $table] = str_contains($table, '.') ? explode('.', $table, 2) : [null, $table]; + [$connection, $table] = Str::contains($table, '.') ? explode('.', $table, 2) : [null, $table]; - if (str_contains($table, '\\') && class_exists($table) && is_a($table, Model::class, true)) { + if (Str::contains($table, '\\') && class_exists($table) && is_a($table, Model::class, true)) { $model = new $table; $table = $model->getTable(); $connection = $connection ?? $model->getConnectionName(); - if (str_contains($table, '.') && Str::startsWith($table, $connection)) { + if (Str::contains($table, '.') && Str::startsWith($table, $connection)) { $connection = null; } @@ -1455,6 +1455,19 @@ public function validateNumeric($attribute, $value) return is_numeric($value); } + /** + * Validate that the password of the currently authenticated user matches the given value. + * + * @param string $attribute + * @param mixed $value + * @param array $parameters + * @return bool + */ + protected function validatePassword($attribute, $value, $parameters) + { + return $this->validateCurrentPassword($attribute, $value, $parameters); + } + /** * Validate that an attribute exists even if not filled. * @@ -1557,6 +1570,7 @@ public function validateRequiredIf($attribute, $value, $parameters) * * @param string $attribute * @param mixed $value + * @param mixed $parameters * @return bool */ public function validateProhibited($attribute, $value) @@ -2073,14 +2087,20 @@ public function isValidFileInstance($value) */ protected function compare($first, $second, $operator) { - return match ($operator) { - '<' => $first < $second, - '>' => $first > $second, - '<=' => $first <= $second, - '>=' => $first >= $second, - '=' => $first == $second, - default => throw new InvalidArgumentException, - }; + switch ($operator) { + case '<': + return $first < $second; + case '>': + return $first > $second; + case '<=': + return $first <= $second; + case '>=': + return $first >= $second; + case '=': + return $first == $second; + default: + throw new InvalidArgumentException; + } } /** diff --git a/core/vendor/illuminate/validation/ConditionalRules.php b/core/vendor/illuminate/validation/ConditionalRules.php index f71e99186b..d52455a5d7 100644 --- a/core/vendor/illuminate/validation/ConditionalRules.php +++ b/core/vendor/illuminate/validation/ConditionalRules.php @@ -58,26 +58,20 @@ public function passes(array $data = []) /** * Get the rules. * - * @param array $data * @return array */ - public function rules(array $data = []) + public function rules() { - return is_string($this->rules) - ? explode('|', $this->rules) - : value($this->rules, new Fluent($data)); + return is_string($this->rules) ? explode('|', $this->rules) : $this->rules; } /** * Get the default rules. * - * @param array $data * @return array */ - public function defaultRules(array $data = []) + public function defaultRules() { - return is_string($this->defaultRules) - ? explode('|', $this->defaultRules) - : value($this->defaultRules, new Fluent($data)); + return is_string($this->defaultRules) ? explode('|', $this->defaultRules) : $this->defaultRules; } } diff --git a/core/vendor/illuminate/validation/DatabasePresenceVerifier.php b/core/vendor/illuminate/validation/DatabasePresenceVerifier.php index 9229f06b70..b5255e3457 100755 --- a/core/vendor/illuminate/validation/DatabasePresenceVerifier.php +++ b/core/vendor/illuminate/validation/DatabasePresenceVerifier.php @@ -4,6 +4,7 @@ use Closure; use Illuminate\Database\ConnectionResolverInterface; +use Illuminate\Support\Str; class DatabasePresenceVerifier implements DatabasePresenceVerifierInterface { @@ -106,7 +107,7 @@ protected function addWhere($query, $key, $extraValue) $query->whereNull($key); } elseif ($extraValue === 'NOT_NULL') { $query->whereNotNull($key); - } elseif (str_starts_with($extraValue, '!')) { + } elseif (Str::startsWith($extraValue, '!')) { $query->where($key, '!=', mb_substr($extraValue, 1)); } else { $query->where($key, $extraValue); diff --git a/core/vendor/illuminate/validation/Factory.php b/core/vendor/illuminate/validation/Factory.php index e2c2314034..3d9d190355 100755 --- a/core/vendor/illuminate/validation/Factory.php +++ b/core/vendor/illuminate/validation/Factory.php @@ -71,7 +71,7 @@ class Factory implements FactoryContract * * @var bool */ - protected $excludeUnvalidatedArrayKeys = true; + protected $excludeUnvalidatedArrayKeys; /** * The Validator resolver instance. @@ -249,17 +249,7 @@ public function replacer($rule, $replacer) } /** - * Indicate that unvalidated array keys should be included in validated data when the parent array is validated. - * - * @return void - */ - public function includeUnvalidatedArrayKeys() - { - $this->excludeUnvalidatedArrayKeys = false; - } - - /** - * Indicate that unvalidated array keys should be excluded from the validated data, even if the parent array was validated. + * Indicate that unvalidated array keys should be excluded, even if the parent array was validated. * * @return void */ diff --git a/core/vendor/illuminate/validation/NestedRules.php b/core/vendor/illuminate/validation/NestedRules.php deleted file mode 100644 index 7a18fe11e0..0000000000 --- a/core/vendor/illuminate/validation/NestedRules.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -namespace Illuminate\Validation; - -use Illuminate\Support\Arr; - -class NestedRules -{ - /** - * The callback to execute. - * - * @var callable - */ - protected $callback; - - /** - * Create a new nested rule instance. - * - * @param callable $callback - * @return void - */ - public function __construct(callable $callback) - { - $this->callback = $callback; - } - - /** - * Compile the callback into an array of rules. - * - * @param string $attribute - * @param mixed $value - * @param mixed $data - * @return \stdClass - */ - public function compile($attribute, $value, $data = null) - { - $rules = call_user_func($this->callback, $value, $attribute, $data); - - $parser = new ValidationRuleParser( - Arr::undot(Arr::wrap($data)) - ); - - if (is_array($rules) && Arr::isAssoc($rules)) { - $nested = []; - - foreach ($rules as $key => $rule) { - $nested[$attribute.'.'.$key] = $rule; - } - - return $parser->explode($nested); - } - - return $parser->explode([$attribute => $rules]); - } -} diff --git a/core/vendor/illuminate/validation/NotPwnedVerifier.php b/core/vendor/illuminate/validation/NotPwnedVerifier.php index 1a3511e467..f1c2f1de67 100644 --- a/core/vendor/illuminate/validation/NotPwnedVerifier.php +++ b/core/vendor/illuminate/validation/NotPwnedVerifier.php @@ -98,7 +98,7 @@ protected function search($hashPrefix) : ''; return Str::of($body)->trim()->explode("\n")->filter(function ($line) { - return str_contains($line, ':'); + return Str::contains($line, ':'); }); } } diff --git a/core/vendor/illuminate/validation/Rule.php b/core/vendor/illuminate/validation/Rule.php index e445df3dda..fba3e7c7dd 100644 --- a/core/vendor/illuminate/validation/Rule.php +++ b/core/vendor/illuminate/validation/Rule.php @@ -81,17 +81,6 @@ public static function notIn($values) return new NotIn(is_array($values) ? $values : func_get_args()); } - /** - * Create a new nested rule set. - * - * @param callable $callback - * @return \Illuminate\Validation\NestedRules - */ - public static function forEach($callback) - { - return new NestedRules($callback); - } - /** * Get a required_if constraint builder instance. * diff --git a/core/vendor/illuminate/validation/Rules/DatabaseRule.php b/core/vendor/illuminate/validation/Rules/DatabaseRule.php index 03f1cae6c1..7789008483 100644 --- a/core/vendor/illuminate/validation/Rules/DatabaseRule.php +++ b/core/vendor/illuminate/validation/Rules/DatabaseRule.php @@ -3,8 +3,8 @@ namespace Illuminate\Validation\Rules; use Closure; -use Illuminate\Contracts\Support\Arrayable; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Str; trait DatabaseRule { @@ -58,14 +58,14 @@ public function __construct($table, $column = 'NULL') */ public function resolveTableName($table) { - if (! str_contains($table, '\\') || ! class_exists($table)) { + if (! Str::contains($table, '\\') || ! class_exists($table)) { return $table; } if (is_subclass_of($table, Model::class)) { $model = new $table; - if (str_contains($model->getTable(), '.')) { + if (Str::contains($model->getTable(), '.')) { return $table; } @@ -81,12 +81,12 @@ public function resolveTableName($table) * Set a "where" constraint on the query. * * @param \Closure|string $column - * @param \Illuminate\Contracts\Support\Arrayable|array|string|int|null $value + * @param array|string|int|null $value * @return $this */ public function where($column, $value = null) { - if ($value instanceof Arrayable || is_array($value)) { + if (is_array($value)) { return $this->whereIn($column, $value); } @@ -107,12 +107,12 @@ public function where($column, $value = null) * Set a "where not" constraint on the query. * * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array|string $value + * @param array|string $value * @return $this */ public function whereNot($column, $value) { - if ($value instanceof Arrayable || is_array($value)) { + if (is_array($value)) { return $this->whereNotIn($column, $value); } @@ -145,10 +145,10 @@ public function whereNotNull($column) * Set a "where in" constraint on the query. * * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array $values + * @param array $values * @return $this */ - public function whereIn($column, $values) + public function whereIn($column, array $values) { return $this->where(function ($query) use ($column, $values) { $query->whereIn($column, $values); @@ -159,10 +159,10 @@ public function whereIn($column, $values) * Set a "where not in" constraint on the query. * * @param string $column - * @param \Illuminate\Contracts\Support\Arrayable|array $values + * @param array $values * @return $this */ - public function whereNotIn($column, $values) + public function whereNotIn($column, array $values) { return $this->where(function ($query) use ($column, $values) { $query->whereNotIn($column, $values); diff --git a/core/vendor/illuminate/validation/ValidationData.php b/core/vendor/illuminate/validation/ValidationData.php index 8d4962d764..86da0fd3a1 100644 --- a/core/vendor/illuminate/validation/ValidationData.php +++ b/core/vendor/illuminate/validation/ValidationData.php @@ -3,6 +3,7 @@ namespace Illuminate\Validation; use Illuminate\Support\Arr; +use Illuminate\Support\Str; class ValidationData { @@ -35,7 +36,7 @@ protected static function initializeAttributeOnData($attribute, $masterData) $data = static::extractDataFromPath($explicitPath, $masterData); - if (! str_contains($attribute, '*') || str_ends_with($attribute, '*')) { + if (! Str::contains($attribute, '*') || Str::endsWith($attribute, '*')) { return $data; } diff --git a/core/vendor/illuminate/validation/ValidationException.php b/core/vendor/illuminate/validation/ValidationException.php index 960171901b..460f959f1f 100644 --- a/core/vendor/illuminate/validation/ValidationException.php +++ b/core/vendor/illuminate/validation/ValidationException.php @@ -53,7 +53,7 @@ class ValidationException extends Exception */ public function __construct($validator, $response = null, $errorBag = 'default') { - parent::__construct(static::summarize($validator)); + parent::__construct('The given data was invalid.'); $this->response = $response; $this->errorBag = $errorBag; @@ -77,31 +77,6 @@ public static function withMessages(array $messages) })); } - /** - * Create a error message summary from the validation errors. - * - * @param \Illuminate\Contracts\Validation\Validator $validator - * @return string - */ - protected static function summarize($validator) - { - $messages = $validator->errors()->all(); - - if (! count($messages)) { - return 'The given data was invalid.'; - } - - $message = array_shift($messages); - - if ($additional = count($messages)) { - $pluralized = 1 === $additional ? 'error' : 'errors'; - - $message .= " (and {$additional} more {$pluralized})"; - } - - return $message; - } - /** * Get all of the validation error messages. * diff --git a/core/vendor/illuminate/validation/ValidationRuleParser.php b/core/vendor/illuminate/validation/ValidationRuleParser.php index 653cbd6bd5..ce499a55a5 100644 --- a/core/vendor/illuminate/validation/ValidationRuleParser.php +++ b/core/vendor/illuminate/validation/ValidationRuleParser.php @@ -63,12 +63,12 @@ public function explode($rules) protected function explodeRules($rules) { foreach ($rules as $key => $rule) { - if (str_contains($key, '*')) { + if (Str::contains($key, '*')) { $rules = $this->explodeWildcardRules($rules, $key, [$rule]); unset($rules[$key]); } else { - $rules[$key] = $this->explodeExplicitRule($rule, $key); + $rules[$key] = $this->explodeExplicitRule($rule); } } @@ -79,36 +79,26 @@ protected function explodeRules($rules) * Explode the explicit rule into an array if necessary. * * @param mixed $rule - * @param string $attribute * @return array */ - protected function explodeExplicitRule($rule, $attribute) + protected function explodeExplicitRule($rule) { if (is_string($rule)) { - [$name] = static::parseStringRule($rule); - - return static::ruleIsRegex($name) ? [$rule] : explode('|', $rule); + return explode('|', $rule); + } elseif (is_object($rule)) { + return [$this->prepareRule($rule)]; } - if (is_object($rule)) { - return Arr::wrap($this->prepareRule($rule, $attribute)); - } - - return array_map( - [$this, 'prepareRule'], - $rule, - array_fill(array_key_first($rule), count($rule), $attribute) - ); + return array_map([$this, 'prepareRule'], $rule); } /** * Prepare the given rule for the Validator. * * @param mixed $rule - * @param string $attribute * @return mixed */ - protected function prepareRule($rule, $attribute) + protected function prepareRule($rule) { if ($rule instanceof Closure) { $rule = new ClosureValidationRule($rule); @@ -121,12 +111,6 @@ protected function prepareRule($rule, $attribute) return $rule; } - if ($rule instanceof NestedRules) { - return $rule->compile( - $attribute, $this->data[$attribute] ?? null, Arr::dot($this->data) - )->rules[$attribute]; - } - return (string) $rule; } @@ -146,22 +130,10 @@ protected function explodeWildcardRules($results, $attribute, $rules) foreach ($data as $key => $value) { if (Str::startsWith($key, $attribute) || (bool) preg_match('/^'.$pattern.'\z/', $key)) { - foreach (Arr::flatten((array) $rules) as $rule) { - if ($rule instanceof NestedRules) { - $compiled = $rule->compile($key, $value, $data); - - $this->implicitAttributes = array_merge_recursive( - $compiled->implicitAttributes, - $this->implicitAttributes, - [$attribute => [$key]] - ); - - $results = $this->mergeRules($results, $compiled->rules); - } else { - $this->implicitAttributes[$attribute][] = $key; - - $results = $this->mergeRules($results, $key, $rule); - } + foreach ((array) $rules as $rule) { + $this->implicitAttributes[$attribute][] = $key; + + $results = $this->mergeRules($results, $key, $rule); } } } @@ -205,7 +177,7 @@ protected function mergeRulesForAttribute($results, $attribute, $rules) $merge = head($this->explodeRules([$rules])); $results[$attribute] = array_merge( - isset($results[$attribute]) ? $this->explodeExplicitRule($results[$attribute], $attribute) : [], $merge + isset($results[$attribute]) ? $this->explodeExplicitRule($results[$attribute]) : [], $merge ); return $results; @@ -219,7 +191,7 @@ protected function mergeRulesForAttribute($results, $attribute, $rules) */ public static function parse($rule) { - if ($rule instanceof RuleContract || $rule instanceof NestedRules) { + if ($rule instanceof RuleContract) { return [$rule, []]; } @@ -258,7 +230,7 @@ protected static function parseStringRule($rule) // The format for specifying validation rules and parameters follows an // easy {rule}:{parameters} formatting convention. For instance the // rule "Max:3" states that the value may only be three letters. - if (str_contains($rule, ':')) { + if (strpos($rule, ':') !== false) { [$rule, $parameter] = explode(':', $rule, 2); $parameters = static::parseParameters($rule, $parameter); @@ -276,18 +248,13 @@ protected static function parseStringRule($rule) */ protected static function parseParameters($rule, $parameter) { - return static::ruleIsRegex($rule) ? [$parameter] : str_getcsv($parameter); - } + $rule = strtolower($rule); - /** - * Determine if the rule is a regular expression. - * - * @param string $rule - * @return bool - */ - protected static function ruleIsRegex($rule) - { - return in_array(strtolower($rule), ['regex', 'not_regex', 'notregex'], true); + if (in_array($rule, ['regex', 'not_regex', 'notregex'], true)) { + return [$parameter]; + } + + return str_getcsv($parameter); } /** @@ -298,11 +265,14 @@ protected static function ruleIsRegex($rule) */ protected static function normalizeRule($rule) { - return match ($rule) { - 'Int' => 'Integer', - 'Bool' => 'Boolean', - default => $rule, - }; + switch ($rule) { + case 'Int': + return 'Integer'; + case 'Bool': + return 'Boolean'; + default: + return $rule; + } } /** @@ -322,8 +292,8 @@ public static function filterConditionalRules($rules, array $data = []) if ($attributeRules instanceof ConditionalRules) { return [$attribute => $attributeRules->passes($data) - ? array_filter($attributeRules->rules($data)) - : array_filter($attributeRules->defaultRules($data)), ]; + ? array_filter($attributeRules->rules()) + : array_filter($attributeRules->defaultRules()), ]; } return [$attribute => collect($attributeRules)->map(function ($rule) use ($data) { @@ -331,7 +301,7 @@ public static function filterConditionalRules($rules, array $data = []) return [$rule]; } - return $rule->passes($data) ? $rule->rules($data) : $rule->defaultRules($data); + return $rule->passes($data) ? $rule->rules() : $rule->defaultRules(); })->filter()->flatten(1)->values()->all()]; })->all(); } diff --git a/core/vendor/illuminate/validation/Validator.php b/core/vendor/illuminate/validation/Validator.php index 9e75b5d4af..f79314da47 100755 --- a/core/vendor/illuminate/validation/Validator.php +++ b/core/vendor/illuminate/validation/Validator.php @@ -667,6 +667,7 @@ protected function getPrimaryAttribute($attribute) * Replace each field parameter which has an escaped dot with the dot placeholder. * * @param array $parameters + * @param array $keys * @return array */ protected function replaceDotInParameters(array $parameters) @@ -1148,7 +1149,7 @@ public function sometimes($attribute, $rules, callable $callback) $this->implicitAttributes = array_merge($response->implicitAttributes, $this->implicitAttributes); foreach ($response->rules as $ruleKey => $ruleValue) { - if ($callback($payload, $this->dataForSometimesIteration($ruleKey, ! str_ends_with($key, '.*')))) { + if ($callback($payload, $this->dataForSometimesIteration($ruleKey, ! Str::endsWith($key, '.*')))) { $this->addRules([$ruleKey => $ruleValue]); } } diff --git a/core/vendor/illuminate/validation/composer.json b/core/vendor/illuminate/validation/composer.json index 281cec4b88..f4a0babc73 100755 --- a/core/vendor/illuminate/validation/composer.json +++ b/core/vendor/illuminate/validation/composer.json @@ -14,17 +14,17 @@ } ], "require": { - "php": "^8.0.2", + "php": "^7.3|^8.0", "ext-json": "*", - "egulias/email-validator": "^3.1", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0", - "illuminate/translation": "^9.0", - "symfony/http-foundation": "^6.0", - "symfony/mime": "^6.0" + "egulias/email-validator": "^2.1.10", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "illuminate/translation": "^8.0", + "symfony/http-foundation": "^5.4", + "symfony/mime": "^5.4" }, "autoload": { "psr-4": { @@ -33,12 +33,12 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "suggest": { "ext-bcmath": "Required to use the multiple_of validation rule.", - "illuminate/database": "Required to use the database presence verifier (^9.0)." + "illuminate/database": "Required to use the database presence verifier (^8.0)." }, "config": { "sort-packages": true diff --git a/core/vendor/illuminate/view/AnonymousComponent.php b/core/vendor/illuminate/view/AnonymousComponent.php index eba6436562..2fb21e1afc 100644 --- a/core/vendor/illuminate/view/AnonymousComponent.php +++ b/core/vendor/illuminate/view/AnonymousComponent.php @@ -51,7 +51,7 @@ public function data() $this->attributes = $this->attributes ?: $this->newAttributeBag(); return array_merge( - ($this->data['attributes'] ?? null)?->getAttributes() ?: [], + optional($this->data['attributes'] ?? null)->getAttributes() ?: [], $this->attributes->getAttributes(), $this->data, ['attributes' => $this->attributes] diff --git a/core/vendor/illuminate/view/Compilers/BladeCompiler.php b/core/vendor/illuminate/view/Compilers/BladeCompiler.php index 1e96b17703..fd3f91a271 100644 --- a/core/vendor/illuminate/view/Compilers/BladeCompiler.php +++ b/core/vendor/illuminate/view/Compilers/BladeCompiler.php @@ -241,7 +241,7 @@ public function compileString($value) ); foreach ($this->precompilers as $precompiler) { - $value = $precompiler($value); + $value = call_user_func($precompiler, $value); } // Here we will loop through all of the tokens returned by the Zend lexer and @@ -340,11 +340,11 @@ public static function renderComponent(Component $component) */ protected function storeUncompiledBlocks($value) { - if (str_contains($value, '@verbatim')) { + if (strpos($value, '@verbatim') !== false) { $value = $this->storeVerbatimBlocks($value); } - if (str_contains($value, '@php')) { + if (strpos($value, '@php') !== false) { $value = $this->storePhpBlocks($value); } @@ -504,7 +504,7 @@ protected function compileStatements($value) */ protected function compileStatement($match) { - if (str_contains($match[1], '@')) { + if (Str::contains($match[1], '@')) { $match[0] = isset($match[3]) ? $match[1].$match[3] : $match[1]; } elseif (isset($this->customDirectives[$match[1]])) { $match[0] = $this->callCustomDirective($match[1], Arr::get($match, 3)); @@ -526,7 +526,7 @@ protected function callCustomDirective($name, $value) { $value = $value ?? ''; - if (str_starts_with($value, '(') && str_ends_with($value, ')')) { + if (Str::startsWith($value, '(') && Str::endsWith($value, ')')) { $value = Str::substr($value, 1, -1); } @@ -625,12 +625,12 @@ public function check($name, ...$parameters) */ public function component($class, $alias = null, $prefix = '') { - if (! is_null($alias) && str_contains($alias, '\\')) { + if (! is_null($alias) && Str::contains($alias, '\\')) { [$class, $alias] = [$alias, $class]; } if (is_null($alias)) { - $alias = str_contains($class, '\\View\\Components\\') + $alias = Str::contains($class, '\\View\\Components\\') ? collect(explode('\\', Str::after($class, '\\View\\Components\\')))->map(function ($segment) { return Str::kebab($segment); })->implode(':') diff --git a/core/vendor/illuminate/view/Compilers/Compiler.php b/core/vendor/illuminate/view/Compilers/Compiler.php index 42aa0f6d7b..e14c8524cc 100755 --- a/core/vendor/illuminate/view/Compilers/Compiler.php +++ b/core/vendor/illuminate/view/Compilers/Compiler.php @@ -3,43 +3,34 @@ namespace Illuminate\View\Compilers; use Illuminate\Filesystem\Filesystem; -use Illuminate\Support\Str; use InvalidArgumentException; abstract class Compiler { /** - * The filesystem instance. + * The Filesystem instance. * * @var \Illuminate\Filesystem\Filesystem */ protected $files; /** - * The cache path for the compiled views. + * Get the cache path for the compiled views. * * @var string */ protected $cachePath; - /** - * The base path that should be removed from paths before hashing. - * - * @var string - */ - protected $basePath; - /** * Create a new compiler instance. * * @param \Illuminate\Filesystem\Filesystem $files * @param string $cachePath - * @param string $basePath * @return void * * @throws \InvalidArgumentException */ - public function __construct(Filesystem $files, $cachePath, $basePath = '') + public function __construct(Filesystem $files, $cachePath) { if (! $cachePath) { throw new InvalidArgumentException('Please provide a valid cache path.'); @@ -47,7 +38,6 @@ public function __construct(Filesystem $files, $cachePath, $basePath = '') $this->files = $files; $this->cachePath = $cachePath; - $this->basePath = $basePath; } /** @@ -58,7 +48,7 @@ public function __construct(Filesystem $files, $cachePath, $basePath = '') */ public function getCompiledPath($path) { - return $this->cachePath.'/'.sha1('v2'.Str::after($path, $this->basePath)).'.php'; + return $this->cachePath.'/'.sha1('v2'.$path).'.php'; } /** diff --git a/core/vendor/illuminate/view/Compilers/ComponentTagCompiler.php b/core/vendor/illuminate/view/Compilers/ComponentTagCompiler.php index 58a68b49d4..469bd78366 100644 --- a/core/vendor/illuminate/view/Compilers/ComponentTagCompiler.php +++ b/core/vendor/illuminate/view/Compilers/ComponentTagCompiler.php @@ -231,9 +231,6 @@ protected function componentString(string $component, array $attributes) } return "##BEGIN-COMPONENT-CLASS##@component('{$class}', '{$component}', [".$this->attributesToString($parameters, $escapeBound = false).']) -<?php if (isset($attributes) && $constructor = (new ReflectionClass('.$class.'::class))->getConstructor()): ?> -<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?> -<?php endif; ?> <?php $component->withAttributes(['.$this->attributesToString($attributes->all(), $escapeAttributes = $class !== DynamicComponent::class).']); ?>'; } @@ -349,7 +346,7 @@ public function guessViewName($name) $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER; - if (str_contains($name, $delimiter)) { + if (Str::contains($name, $delimiter)) { return Str::replaceFirst($delimiter, $delimiter.$prefix, $name); } @@ -406,8 +403,8 @@ public function compileSlots(string $value) < \s* x[\-\:]slot - (?:\:(?<inlineName>\w+))? - (?:\s+(:?)name=(?<name>(\"[^\"]+\"|\\\'[^\\\']+\\\'|[^\s>]+)))? + \s+ + (:?)name=(?<name>(\"[^\"]+\"|\\\'[^\\\']+\\\'|[^\s>]+)) (?<attributes> (?: \s+ @@ -438,9 +435,9 @@ public function compileSlots(string $value) /x"; $value = preg_replace_callback($pattern, function ($matches) { - $name = $this->stripQuotes($matches['inlineName'] ?: $matches['name']); + $name = $this->stripQuotes($matches['name']); - if ($matches[2] !== ':') { + if ($matches[1] !== ':') { $name = "'{$name}'"; } @@ -498,7 +495,7 @@ protected function getAttributesFromAttributeString(string $attributeString) $value = $this->stripQuotes($value); - if (str_starts_with($attribute, 'bind:')) { + if (Str::startsWith($attribute, 'bind:')) { $attribute = Str::after($attribute, 'bind:'); $this->boundAttributes[$attribute] = true; @@ -506,7 +503,7 @@ protected function getAttributesFromAttributeString(string $attributeString) $value = "'".$this->compileAttributeEchos($value)."'"; } - if (str_starts_with($attribute, '::')) { + if (Str::startsWith($attribute, '::')) { $attribute = substr($attribute, 1); } diff --git a/core/vendor/illuminate/view/Compilers/Concerns/CompilesComponents.php b/core/vendor/illuminate/view/Compilers/Concerns/CompilesComponents.php index 16570192ed..db4f0e88ab 100644 --- a/core/vendor/illuminate/view/Compilers/Concerns/CompilesComponents.php +++ b/core/vendor/illuminate/view/Compilers/Concerns/CompilesComponents.php @@ -23,7 +23,7 @@ trait CompilesComponents */ protected function compileComponent($expression) { - [$component, $alias, $data] = str_contains($expression, ',') + [$component, $alias, $data] = strpos($expression, ',') !== false ? array_map('trim', explode(',', trim($expression, '()'), 3)) + ['', '', ''] : [trim($expression, '()'), '', '']; @@ -64,7 +64,7 @@ public static function compileClassComponentOpening(string $component, string $a { return implode("\n", [ '<?php if (isset($component)) { $__componentOriginal'.$hash.' = $component; } ?>', - '<?php $component = $__env->getContainer()->make('.Str::finish($component, '::class').', '.($data ?: '[]').' + (isset($attributes) ? (array) $attributes->getIterator() : [])); ?>', + '<?php $component = $__env->getContainer()->make('.Str::finish($component, '::class').', '.($data ?: '[]').'); ?>', '<?php $component->withName('.$alias.'); ?>', '<?php if ($component->shouldRender()): ?>', '<?php $__env->startComponent($component->resolveView(), $component->data()); ?>', @@ -149,10 +149,7 @@ protected function compileEndComponentFirst() */ protected function compileProps($expression) { - return "<?php foreach(\$attributes->onlyProps{$expression} as \$__key => \$__value) { - \$\$__key = \$\$__key ?? \$__value; -} ?> -<?php \$attributes = \$attributes->exceptProps{$expression}; ?> + return "<?php \$attributes = \$attributes->exceptProps{$expression}; ?> <?php foreach (array_filter({$expression}, 'is_string', ARRAY_FILTER_USE_KEY) as \$__key => \$__value) { \$\$__key = \$\$__key ?? \$__value; } ?> diff --git a/core/vendor/illuminate/view/Compilers/Concerns/CompilesConditionals.php b/core/vendor/illuminate/view/Compilers/Concerns/CompilesConditionals.php index 3b278d1cc4..6bae1e1cba 100644 --- a/core/vendor/illuminate/view/Compilers/Concerns/CompilesConditionals.php +++ b/core/vendor/illuminate/view/Compilers/Concerns/CompilesConditionals.php @@ -304,37 +304,4 @@ public function compileEndOnce() { return '<?php endif; ?>'; } - - /** - * Compile a selected block into valid PHP. - * - * @param string $condition - * @return string - */ - protected function compileSelected($condition) - { - return "<?php if{$condition}: echo 'selected'; endif; ?>"; - } - - /** - * Compile a checked block into valid PHP. - * - * @param string $condition - * @return string - */ - protected function compileChecked($condition) - { - return "<?php if{$condition}: echo 'checked'; endif; ?>"; - } - - /** - * Compile a disabled block into valid PHP. - * - * @param string $condition - * @return string - */ - protected function compileDisabled($condition) - { - return "<?php if{$condition}: echo 'disabled'; endif; ?>"; - } } diff --git a/core/vendor/illuminate/view/Compilers/Concerns/CompilesEchos.php b/core/vendor/illuminate/view/Compilers/Concerns/CompilesEchos.php index 37f1cbc9e3..5924a0ac31 100644 --- a/core/vendor/illuminate/view/Compilers/Concerns/CompilesEchos.php +++ b/core/vendor/illuminate/view/Compilers/Concerns/CompilesEchos.php @@ -143,7 +143,7 @@ protected function wrapInEchoHandler($value) { $value = Str::of($value) ->trim() - ->when(str_ends_with($value, ';'), function ($str) { + ->when(Str::endsWith($value, ';'), function ($str) { return $str->beforeLast(';'); }); diff --git a/core/vendor/illuminate/view/Compilers/Concerns/CompilesStacks.php b/core/vendor/illuminate/view/Compilers/Concerns/CompilesStacks.php index dc5192580f..79a380e6cb 100644 --- a/core/vendor/illuminate/view/Compilers/Concerns/CompilesStacks.php +++ b/core/vendor/illuminate/view/Compilers/Concerns/CompilesStacks.php @@ -2,8 +2,6 @@ namespace Illuminate\View\Compilers\Concerns; -use Illuminate\Support\Str; - trait CompilesStacks { /** @@ -28,24 +26,6 @@ protected function compilePush($expression) return "<?php \$__env->startPush{$expression}; ?>"; } - /** - * Compile the push-once statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compilePushOnce($expression) - { - $parts = explode(',', $this->stripParentheses($expression), 2); - - [$stack, $id] = [$parts[0], $parts[1] ?? null]; - - $id = trim($id) ?: "'".(string) Str::uuid()."'"; - - return '<?php if (! $__env->hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.'); -$__env->startPush('.$stack.'); ?>'; - } - /** * Compile the end-push statements into valid PHP. * @@ -56,16 +36,6 @@ protected function compileEndpush() return '<?php $__env->stopPush(); ?>'; } - /** - * Compile the end-push-once statements into valid PHP. - * - * @return string - */ - protected function compileEndpushOnce() - { - return '<?php $__env->stopPush(); endif; ?>'; - } - /** * Compile the prepend statements into valid PHP. * @@ -77,24 +47,6 @@ protected function compilePrepend($expression) return "<?php \$__env->startPrepend{$expression}; ?>"; } - /** - * Compile the prepend-once statements into valid PHP. - * - * @param string $expression - * @return string - */ - protected function compilePrependOnce($expression) - { - $parts = explode(',', $this->stripParentheses($expression), 2); - - [$stack, $id] = [$parts[0], $parts[1] ?? null]; - - $id = trim($id) ?: "'".(string) Str::uuid()."'"; - - return '<?php if (! $__env->hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.'); -$__env->startPrepend('.$stack.'); ?>'; - } - /** * Compile the end-prepend statements into valid PHP. * @@ -104,14 +56,4 @@ protected function compileEndprepend() { return '<?php $__env->stopPrepend(); ?>'; } - - /** - * Compile the end-prepend-once statements into valid PHP. - * - * @return string - */ - protected function compileEndprependOnce() - { - return '<?php $__env->stopPrepend(); endif; ?>'; - } } diff --git a/core/vendor/illuminate/view/Component.php b/core/vendor/illuminate/view/Component.php index 7dd14a65e2..402a13abdc 100644 --- a/core/vendor/illuminate/view/Component.php +++ b/core/vendor/illuminate/view/Component.php @@ -6,6 +6,7 @@ use Illuminate\Container\Container; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Contracts\View\View as ViewContract; +use Illuminate\Support\Str; use ReflectionClass; use ReflectionMethod; use ReflectionProperty; @@ -222,7 +223,7 @@ protected function createInvokableVariable(string $method) */ protected function shouldIgnore($name) { - return str_starts_with($name, '__') || + return Str::startsWith($name, '__') || in_array($name, $this->ignoredMethods()); } diff --git a/core/vendor/illuminate/view/ComponentAttributeBag.php b/core/vendor/illuminate/view/ComponentAttributeBag.php index 1be7382eca..255d164541 100644 --- a/core/vendor/illuminate/view/ComponentAttributeBag.php +++ b/core/vendor/illuminate/view/ComponentAttributeBag.php @@ -11,7 +11,6 @@ use Illuminate\Support\Traits\Conditionable; use Illuminate\Support\Traits\Macroable; use IteratorAggregate; -use Traversable; class ComponentAttributeBag implements ArrayAccess, Htmlable, IteratorAggregate { @@ -155,17 +154,6 @@ public function thatStartWith($needles) return $this->whereStartsWith($needles); } - /** - * Only include the given attribute from the attribute array. - * - * @param mixed|array $keys - * @return static - */ - public function onlyProps($keys) - { - return $this->only($this->extractPropNames($keys)); - } - /** * Exclude the given attribute from the attribute array. * @@ -173,17 +161,6 @@ public function onlyProps($keys) * @return static */ public function exceptProps($keys) - { - return $this->except($this->extractPropNames($keys)); - } - - /** - * Extract prop names from given keys. - * - * @param mixed|array $keys - * @return array - */ - protected function extractPropNames($keys) { $props = []; @@ -194,7 +171,7 @@ protected function extractPropNames($keys) $props[] = Str::kebab($key); } - return $props; + return $this->except($props); } /** @@ -346,7 +323,8 @@ public function __invoke(array $attributeDefaults = []) * @param string $offset * @return bool */ - public function offsetExists($offset): bool + #[\ReturnTypeWillChange] + public function offsetExists($offset) { return isset($this->attributes[$offset]); } @@ -357,7 +335,8 @@ public function offsetExists($offset): bool * @param string $offset * @return mixed */ - public function offsetGet($offset): mixed + #[\ReturnTypeWillChange] + public function offsetGet($offset) { return $this->get($offset); } @@ -369,7 +348,8 @@ public function offsetGet($offset): mixed * @param mixed $value * @return void */ - public function offsetSet($offset, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) { $this->attributes[$offset] = $value; } @@ -380,7 +360,8 @@ public function offsetSet($offset, $value): void * @param string $offset * @return void */ - public function offsetUnset($offset): void + #[\ReturnTypeWillChange] + public function offsetUnset($offset) { unset($this->attributes[$offset]); } @@ -390,7 +371,8 @@ public function offsetUnset($offset): void * * @return \ArrayIterator */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { return new ArrayIterator($this->attributes); } diff --git a/core/vendor/illuminate/view/Concerns/ManagesEvents.php b/core/vendor/illuminate/view/Concerns/ManagesEvents.php index b8583b8e13..39902905de 100644 --- a/core/vendor/illuminate/view/Concerns/ManagesEvents.php +++ b/core/vendor/illuminate/view/Concerns/ManagesEvents.php @@ -145,7 +145,7 @@ protected function parseClassEvent($class, $prefix) */ protected function classEventMethodForPrefix($prefix) { - return str_contains($prefix, 'composing') ? 'compose' : 'create'; + return Str::contains($prefix, 'composing') ? 'compose' : 'create'; } /** @@ -157,7 +157,7 @@ protected function classEventMethodForPrefix($prefix) */ protected function addEventListener($name, $callback) { - if (str_contains($name, '*')) { + if (Str::contains($name, '*')) { $callback = function ($name, array $data) use ($callback) { return $callback($data[0]); }; diff --git a/core/vendor/illuminate/view/Concerns/ManagesLoops.php b/core/vendor/illuminate/view/Concerns/ManagesLoops.php index 95f06c825c..edd6363ec7 100644 --- a/core/vendor/illuminate/view/Concerns/ManagesLoops.php +++ b/core/vendor/illuminate/view/Concerns/ManagesLoops.php @@ -2,8 +2,8 @@ namespace Illuminate\View\Concerns; +use Countable; use Illuminate\Support\Arr; -use Illuminate\Support\LazyCollection; trait ManagesLoops { @@ -22,9 +22,7 @@ trait ManagesLoops */ public function addLoop($data) { - $length = is_countable($data) && ! $data instanceof LazyCollection - ? count($data) - : null; + $length = is_array($data) || $data instanceof Countable ? count($data) : null; $parent = Arr::last($this->loopsStack); diff --git a/core/vendor/illuminate/view/Factory.php b/core/vendor/illuminate/view/Factory.php index 1bcac2f40d..de431f77e4 100755 --- a/core/vendor/illuminate/view/Factory.php +++ b/core/vendor/illuminate/view/Factory.php @@ -7,6 +7,7 @@ use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\View\Factory as FactoryContract; use Illuminate\Support\Arr; +use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; use Illuminate\View\Engines\EngineResolver; use InvalidArgumentException; @@ -230,7 +231,7 @@ public function renderEach($view, $data, $iterator, $empty = 'raw|') // view. Alternatively, the "empty view" could be a raw string that begins // with "raw|" for convenience and to let this know that it is a string. else { - $result = str_starts_with($empty, 'raw|') + $result = Str::startsWith($empty, 'raw|') ? substr($empty, 4) : $this->make($empty)->render(); } @@ -320,7 +321,7 @@ protected function getExtension($path) $extensions = array_keys($this->extensions); return Arr::first($extensions, function ($value) use ($path) { - return str_ends_with($path, '.'.$value); + return Str::endsWith($path, '.'.$value); }); } diff --git a/core/vendor/illuminate/view/InvokableComponentVariable.php b/core/vendor/illuminate/view/InvokableComponentVariable.php index 0d43ae3d35..b9db6570be 100644 --- a/core/vendor/illuminate/view/InvokableComponentVariable.php +++ b/core/vendor/illuminate/view/InvokableComponentVariable.php @@ -7,7 +7,6 @@ use Illuminate\Contracts\Support\DeferringDisplayableValue; use Illuminate\Support\Enumerable; use IteratorAggregate; -use Traversable; class InvokableComponentVariable implements DeferringDisplayableValue, IteratorAggregate { @@ -44,7 +43,8 @@ public function resolveDisplayableValue() * * @return \ArrayIterator */ - public function getIterator(): Traversable + #[\ReturnTypeWillChange] + public function getIterator() { $result = $this->__invoke(); diff --git a/core/vendor/illuminate/view/View.php b/core/vendor/illuminate/view/View.php index 013501f7f6..a1969350c1 100755 --- a/core/vendor/illuminate/view/View.php +++ b/core/vendor/illuminate/view/View.php @@ -306,7 +306,8 @@ public function getEngine() * @param string $key * @return bool */ - public function offsetExists($key): bool + #[\ReturnTypeWillChange] + public function offsetExists($key) { return array_key_exists($key, $this->data); } @@ -317,7 +318,8 @@ public function offsetExists($key): bool * @param string $key * @return mixed */ - public function offsetGet($key): mixed + #[\ReturnTypeWillChange] + public function offsetGet($key) { return $this->data[$key]; } @@ -329,7 +331,8 @@ public function offsetGet($key): mixed * @param mixed $value * @return void */ - public function offsetSet($key, $value): void + #[\ReturnTypeWillChange] + public function offsetSet($key, $value) { $this->with($key, $value); } @@ -340,7 +343,8 @@ public function offsetSet($key, $value): void * @param string $key * @return void */ - public function offsetUnset($key): void + #[\ReturnTypeWillChange] + public function offsetUnset($key) { unset($this->data[$key]); } @@ -405,7 +409,7 @@ public function __call($method, $parameters) return $this->macroCall($method, $parameters); } - if (! str_starts_with($method, 'with')) { + if (! Str::startsWith($method, 'with')) { throw new BadMethodCallException(sprintf( 'Method %s::%s does not exist.', static::class, $method )); diff --git a/core/vendor/illuminate/view/ViewException.php b/core/vendor/illuminate/view/ViewException.php index 77f9ee65b9..e6797a29a1 100644 --- a/core/vendor/illuminate/view/ViewException.php +++ b/core/vendor/illuminate/view/ViewException.php @@ -28,7 +28,7 @@ public function report() * Render the exception into an HTTP response. * * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response|null + * @return \Illuminate\Http\Response */ public function render($request) { diff --git a/core/vendor/illuminate/view/ViewName.php b/core/vendor/illuminate/view/ViewName.php index 2808b134f4..9b803332fb 100644 --- a/core/vendor/illuminate/view/ViewName.php +++ b/core/vendor/illuminate/view/ViewName.php @@ -14,7 +14,7 @@ public static function normalize($name) { $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER; - if (! str_contains($name, $delimiter)) { + if (strpos($name, $delimiter) === false) { return str_replace('/', '.', $name); } diff --git a/core/vendor/illuminate/view/ViewServiceProvider.php b/core/vendor/illuminate/view/ViewServiceProvider.php index 9baeb2c837..7eb731f53c 100755 --- a/core/vendor/illuminate/view/ViewServiceProvider.php +++ b/core/vendor/illuminate/view/ViewServiceProvider.php @@ -85,11 +85,7 @@ public function registerViewFinder() public function registerBladeCompiler() { $this->app->singleton('blade.compiler', function ($app) { - return tap(new BladeCompiler( - $app['files'], - $app['config']['view.compiled'], - $app['config']->get('view.relative_hash', false) ? $app->basePath() : '', - ), function ($blade) { + return tap(new BladeCompiler($app['files'], $app['config']['view.compiled']), function ($blade) { $blade->component('dynamic-component', DynamicComponent::class); }); }); diff --git a/core/vendor/illuminate/view/composer.json b/core/vendor/illuminate/view/composer.json index 7487d55d7b..942435b633 100644 --- a/core/vendor/illuminate/view/composer.json +++ b/core/vendor/illuminate/view/composer.json @@ -14,15 +14,15 @@ } ], "require": { - "php": "^8.0.2", + "php": "^7.3|^8.0", "ext-json": "*", - "illuminate/collections": "^9.0", - "illuminate/container": "^9.0", - "illuminate/contracts": "^9.0", - "illuminate/events": "^9.0", - "illuminate/filesystem": "^9.0", - "illuminate/macroable": "^9.0", - "illuminate/support": "^9.0" + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/events": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0" }, "autoload": { "psr-4": { @@ -31,7 +31,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "8.x-dev" } }, "config": { diff --git a/core/vendor/psr/container/composer.json b/core/vendor/psr/container/composer.json index baf6cd1a03..017f41ea69 100644 --- a/core/vendor/psr/container/composer.json +++ b/core/vendor/psr/container/composer.json @@ -18,10 +18,5 @@ "psr-4": { "Psr\\Container\\": "src/" } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } } } diff --git a/core/vendor/psr/container/src/ContainerInterface.php b/core/vendor/psr/container/src/ContainerInterface.php index b2cad40153..cf8e7fd330 100644 --- a/core/vendor/psr/container/src/ContainerInterface.php +++ b/core/vendor/psr/container/src/ContainerInterface.php @@ -32,5 +32,5 @@ public function get(string $id); * * @return bool */ - public function has(string $id): bool; + public function has(string $id); } diff --git a/core/vendor/psr/simple-cache/composer.json b/core/vendor/psr/simple-cache/composer.json index f307a84568..2978fa559a 100644 --- a/core/vendor/psr/simple-cache/composer.json +++ b/core/vendor/psr/simple-cache/composer.json @@ -6,11 +6,11 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "autoload": { "psr-4": { @@ -19,7 +19,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "1.0.x-dev" } } } diff --git a/core/vendor/psr/simple-cache/src/CacheException.php b/core/vendor/psr/simple-cache/src/CacheException.php index f61b24c2b4..eba53815c0 100644 --- a/core/vendor/psr/simple-cache/src/CacheException.php +++ b/core/vendor/psr/simple-cache/src/CacheException.php @@ -5,6 +5,6 @@ /** * Interface used for all types of exceptions thrown by the implementing library. */ -interface CacheException extends \Throwable +interface CacheException { } diff --git a/core/vendor/psr/simple-cache/src/CacheInterface.php b/core/vendor/psr/simple-cache/src/CacheInterface.php index 671e340c57..99e8d95748 100644 --- a/core/vendor/psr/simple-cache/src/CacheInterface.php +++ b/core/vendor/psr/simple-cache/src/CacheInterface.php @@ -15,7 +15,7 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function get(string $key, mixed $default = null): mixed; + public function get($key, $default = null); /** * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. @@ -31,7 +31,7 @@ public function get(string $key, mixed $default = null): mixed; * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool; + public function set($key, $value, $ttl = null); /** * Delete an item from the cache by its unique key. @@ -43,28 +43,28 @@ public function set(string $key, mixed $value, null|int|\DateInterval $ttl = nul * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function delete(string $key): bool; + public function delete($key); /** * Wipes clean the entire cache's keys. * * @return bool True on success and false on failure. */ - public function clear(): bool; + public function clear(); /** * Obtains multiple cache items by their unique keys. * - * @param iterable<string> $keys A list of keys that can be obtained in a single operation. - * @param mixed $default Default value to return for keys that do not exist. + * @param iterable $keys A list of keys that can obtained in a single operation. + * @param mixed $default Default value to return for keys that do not exist. * - * @return iterable<string, mixed> A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. + * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. * * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if $keys is neither an array nor a Traversable, * or if any of the $keys are not a legal value. */ - public function getMultiple(iterable $keys, mixed $default = null): iterable; + public function getMultiple($keys, $default = null); /** * Persists a set of key => value pairs in the cache, with an optional TTL. @@ -80,12 +80,12 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable; * MUST be thrown if $values is neither an array nor a Traversable, * or if any of the $values are not a legal value. */ - public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool; + public function setMultiple($values, $ttl = null); /** * Deletes multiple cache items in a single operation. * - * @param iterable<string> $keys A list of string-based keys to be deleted. + * @param iterable $keys A list of string-based keys to be deleted. * * @return bool True if the items were successfully removed. False if there was an error. * @@ -93,7 +93,7 @@ public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null * MUST be thrown if $keys is neither an array nor a Traversable, * or if any of the $keys are not a legal value. */ - public function deleteMultiple(iterable $keys): bool; + public function deleteMultiple($keys); /** * Determines whether an item is present in the cache. @@ -110,5 +110,5 @@ public function deleteMultiple(iterable $keys): bool; * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function has(string $key): bool; + public function has($key); } diff --git a/core/vendor/symfony/console/Application.php b/core/vendor/symfony/console/Application.php index 5a2323db60..a81cfdcbbc 100644 --- a/core/vendor/symfony/console/Application.php +++ b/core/vendor/symfony/console/Application.php @@ -70,23 +70,23 @@ */ class Application implements ResetInterface { - private array $commands = []; - private bool $wantHelps = false; - private $runningCommand = null; - private string $name; - private string $version; - private $commandLoader = null; - private bool $catchExceptions = true; - private bool $autoExit = true; + private $commands = []; + private $wantHelps = false; + private $runningCommand; + private $name; + private $version; + private $commandLoader; + private $catchExceptions = true; + private $autoExit = true; private $definition; private $helperSet; - private $dispatcher = null; + private $dispatcher; private $terminal; - private string $defaultCommand; - private bool $singleCommand = false; - private bool $initialized = false; + private $defaultCommand; + private $singleCommand = false; + private $initialized; private $signalRegistry; - private array $signalsToDispatchEvent = []; + private $signalsToDispatchEvent = []; public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') { @@ -134,7 +134,7 @@ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) * * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. */ - public function run(InputInterface $input = null, OutputInterface $output = null): int + public function run(InputInterface $input = null, OutputInterface $output = null) { if (\function_exists('putenv')) { @putenv('LINES='.$this->terminal->getHeight()); @@ -316,10 +316,16 @@ public function setHelperSet(HelperSet $helperSet) /** * Get the helper set associated with the command. + * + * @return HelperSet */ - public function getHelperSet(): HelperSet + public function getHelperSet() { - return $this->helperSet ??= $this->getDefaultHelperSet(); + if (!$this->helperSet) { + $this->helperSet = $this->getDefaultHelperSet(); + } + + return $this->helperSet; } public function setDefinition(InputDefinition $definition) @@ -329,10 +335,14 @@ public function setDefinition(InputDefinition $definition) /** * Gets the InputDefinition related to this Application. + * + * @return InputDefinition */ - public function getDefinition(): InputDefinition + public function getDefinition() { - $this->definition ??= $this->getDefaultInputDefinition(); + if (!$this->definition) { + $this->definition = $this->getDefaultInputDefinition(); + } if ($this->singleCommand) { $inputDefinition = $this->definition; @@ -369,16 +379,20 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti /** * Gets the help message. + * + * @return string */ - public function getHelp(): string + public function getHelp() { return $this->getLongVersion(); } /** * Gets whether to catch exceptions or not during commands execution. + * + * @return bool */ - public function areExceptionsCaught(): bool + public function areExceptionsCaught() { return $this->catchExceptions; } @@ -393,8 +407,10 @@ public function setCatchExceptions(bool $boolean) /** * Gets whether to automatically exit after a command execution or not. + * + * @return bool */ - public function isAutoExitEnabled(): bool + public function isAutoExitEnabled() { return $this->autoExit; } @@ -409,8 +425,10 @@ public function setAutoExit(bool $boolean) /** * Gets the name of the application. + * + * @return string */ - public function getName(): string + public function getName() { return $this->name; } @@ -425,8 +443,10 @@ public function setName(string $name) /** * Gets the application version. + * + * @return string */ - public function getVersion(): string + public function getVersion() { return $this->version; } @@ -459,8 +479,10 @@ public function getLongVersion() /** * Registers a new command. + * + * @return Command */ - public function register(string $name): Command + public function register(string $name) { return $this->add(new Command($name)); } @@ -553,8 +575,10 @@ public function get(string $name) /** * Returns true if the command exists, false otherwise. + * + * @return bool */ - public function has(string $name): bool + public function has(string $name) { $this->init(); @@ -568,7 +592,7 @@ public function has(string $name): bool * * @return string[] */ - public function getNamespaces(): array + public function getNamespaces() { $namespaces = []; foreach ($this->all() as $command) { @@ -589,9 +613,11 @@ public function getNamespaces(): array /** * Finds a registered namespace by a name or an abbreviation. * + * @return string + * * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous */ - public function findNamespace(string $namespace): string + public function findNamespace(string $namespace) { $allNamespaces = $this->getNamespaces(); $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; @@ -783,7 +809,7 @@ public function all(string $namespace = null) * * @return string[][] */ - public static function getAbbreviations(array $names): array + public static function getAbbreviations(array $names) { $abbrevs = []; foreach ($names as $name) { @@ -1030,16 +1056,20 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI /** * Gets the name of the command based on input. + * + * @return string|null */ - protected function getCommandName(InputInterface $input): ?string + protected function getCommandName(InputInterface $input) { return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument(); } /** * Gets the default input definition. + * + * @return InputDefinition */ - protected function getDefaultInputDefinition(): InputDefinition + protected function getDefaultInputDefinition() { return new InputDefinition([ new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), @@ -1057,15 +1087,17 @@ protected function getDefaultInputDefinition(): InputDefinition * * @return Command[] */ - protected function getDefaultCommands(): array + protected function getDefaultCommands() { return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()]; } /** * Gets the default helper set with the helpers that should always be available. + * + * @return HelperSet */ - protected function getDefaultHelperSet(): HelperSet + protected function getDefaultHelperSet() { return new HelperSet([ new FormatterHelper(), @@ -1087,8 +1119,10 @@ private function getAbbreviationSuggestions(array $abbrevs): string * Returns the namespace part of the command name. * * This method is not part of public API and should not be used directly. + * + * @return string */ - public function extractNamespace(string $name, int $limit = null): string + public function extractNamespace(string $name, int $limit = null) { $parts = explode(':', $name, -1); @@ -1148,7 +1182,7 @@ private function findAlternatives(string $name, iterable $collection): array * * @return $this */ - public function setDefaultCommand(string $commandName, bool $isSingleCommand = false): static + public function setDefaultCommand(string $commandName, bool $isSingleCommand = false) { $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0]; diff --git a/core/vendor/symfony/console/CHANGELOG.md b/core/vendor/symfony/console/CHANGELOG.md index 9a93c7991d..6662dd1eb7 100644 --- a/core/vendor/symfony/console/CHANGELOG.md +++ b/core/vendor/symfony/console/CHANGELOG.md @@ -1,15 +1,6 @@ CHANGELOG ========= -6.0 ---- - - * `Command::setHidden()` has a default value (`true`) for `$hidden` parameter and is final - * Remove `Helper::strlen()`, use `Helper::width()` instead - * Remove `Helper::strlenWithoutDecoration()`, use `Helper::removeDecoration()` instead - * `AddConsoleCommandPass` can not be configured anymore - * Remove `HelperSet::setCommand()` and `getCommand()` without replacement - 5.4 --- diff --git a/core/vendor/symfony/console/Color.php b/core/vendor/symfony/console/Color.php index 7fcc507079..22a4ce9ffb 100644 --- a/core/vendor/symfony/console/Color.php +++ b/core/vendor/symfony/console/Color.php @@ -49,9 +49,9 @@ final class Color 'conceal' => ['set' => 8, 'unset' => 28], ]; - private string $foreground; - private string $background; - private array $options = []; + private $foreground; + private $background; + private $options = []; public function __construct(string $foreground = '', string $background = '', array $options = []) { diff --git a/core/vendor/symfony/console/Command/Command.php b/core/vendor/symfony/console/Command/Command.php index e69bae0982..146f6017ba 100644 --- a/core/vendor/symfony/console/Command/Command.php +++ b/core/vendor/symfony/console/Command/Command.php @@ -47,26 +47,29 @@ class Command */ protected static $defaultDescription; - private $application = null; - private ?string $name = null; - private ?string $processTitle = null; - private array $aliases = []; + private $application; + private $name; + private $processTitle; + private $aliases = []; private $definition; - private bool $hidden = false; - private string $help = ''; - private string $description = ''; - private $fullDefinition = null; - private bool $ignoreValidationErrors = false; - private ?\Closure $code = null; - private array $synopsis = []; - private array $usages = []; - private $helperSet = null; - - public static function getDefaultName(): ?string + private $hidden = false; + private $help = ''; + private $description = ''; + private $fullDefinition; + private $ignoreValidationErrors = false; + private $code; + private $synopsis = []; + private $usages = []; + private $helperSet; + + /** + * @return string|null + */ + public static function getDefaultName() { $class = static::class; - if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { + if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { return $attribute[0]->newInstance()->name; } @@ -79,7 +82,7 @@ public static function getDefaultDescription(): ?string { $class = static::class; - if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { + if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { return $attribute[0]->newInstance()->description; } @@ -148,16 +151,20 @@ public function setHelperSet(HelperSet $helperSet) /** * Gets the helper set. + * + * @return HelperSet|null */ - public function getHelperSet(): ?HelperSet + public function getHelperSet() { return $this->helperSet; } /** * Gets the application instance for this command. + * + * @return Application|null */ - public function getApplication(): ?Application + public function getApplication() { return $this->application; } @@ -240,7 +247,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) * @see setCode() * @see execute() */ - public function run(InputInterface $input, OutputInterface $output): int + public function run(InputInterface $input, OutputInterface $output) { // add the application arguments and options $this->mergeApplicationDefinition(); @@ -319,7 +326,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti * * @see execute() */ - public function setCode(callable $code): static + public function setCode(callable $code) { if ($code instanceof \Closure) { $r = new \ReflectionFunction($code); @@ -333,8 +340,6 @@ public function setCode(callable $code): static restore_error_handler(); } } - } else { - $code = \Closure::fromCallable($code); } $this->code = $code; @@ -372,9 +377,11 @@ public function mergeApplicationDefinition(bool $mergeArgs = true) /** * Sets an array of argument and option instances. * + * @param array|InputDefinition $definition An array of argument and option instances or a definition instance + * * @return $this */ - public function setDefinition(array|InputDefinition $definition): static + public function setDefinition($definition) { if ($definition instanceof InputDefinition) { $this->definition = $definition; @@ -389,8 +396,10 @@ public function setDefinition(array|InputDefinition $definition): static /** * Gets the InputDefinition attached to this Command. + * + * @return InputDefinition */ - public function getDefinition(): InputDefinition + public function getDefinition() { return $this->fullDefinition ?? $this->getNativeDefinition(); } @@ -402,10 +411,16 @@ public function getDefinition(): InputDefinition * be changed by merging with the application InputDefinition. * * This method is not part of public API and should not be used directly. + * + * @return InputDefinition */ - public function getNativeDefinition(): InputDefinition + public function getNativeDefinition() { - return $this->definition ?? throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); + if (null === $this->definition) { + throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); + } + + return $this->definition; } /** @@ -418,7 +433,7 @@ public function getNativeDefinition(): InputDefinition * * @return $this */ - public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null): static + public function addArgument(string $name, int $mode = null, string $description = '', $default = null) { $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); if (null !== $this->fullDefinition) { @@ -431,15 +446,15 @@ public function addArgument(string $name, int $mode = null, string $description /** * Adds an option. * - * @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param $mode The option mode: One of the InputOption::VALUE_* constants - * @param $default The default value (must be null for InputOption::VALUE_NONE) + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants + * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) * * @throws InvalidArgumentException If option mode is invalid or incompatible * * @return $this */ - public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null): static + public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) { $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); if (null !== $this->fullDefinition) { @@ -461,7 +476,7 @@ public function addOption(string $name, string|array $shortcut = null, int $mode * * @throws InvalidArgumentException When the name is invalid */ - public function setName(string $name): static + public function setName(string $name) { $this->validateName($name); @@ -478,7 +493,7 @@ public function setName(string $name): static * * @return $this */ - public function setProcessTitle(string $title): static + public function setProcessTitle(string $title) { $this->processTitle = $title; @@ -487,18 +502,23 @@ public function setProcessTitle(string $title): static /** * Returns the command name. + * + * @return string|null */ - public function getName(): ?string + public function getName() { return $this->name; } /** * @param bool $hidden Whether or not the command should be hidden from the list of commands + * The default value will be true in Symfony 6.0 * * @return $this + * + * @final since Symfony 5.1 */ - public function setHidden(bool $hidden = true): static + public function setHidden(bool $hidden /*= true*/) { $this->hidden = $hidden; @@ -508,7 +528,7 @@ public function setHidden(bool $hidden = true): static /** * @return bool whether the command should be publicly shown or not */ - public function isHidden(): bool + public function isHidden() { return $this->hidden; } @@ -518,7 +538,7 @@ public function isHidden(): bool * * @return $this */ - public function setDescription(string $description): static + public function setDescription(string $description) { $this->description = $description; @@ -527,8 +547,10 @@ public function setDescription(string $description): static /** * Returns the description for the command. + * + * @return string */ - public function getDescription(): string + public function getDescription() { return $this->description; } @@ -538,7 +560,7 @@ public function getDescription(): string * * @return $this */ - public function setHelp(string $help): static + public function setHelp(string $help) { $this->help = $help; @@ -547,8 +569,10 @@ public function setHelp(string $help): static /** * Returns the help for the command. + * + * @return string */ - public function getHelp(): string + public function getHelp() { return $this->help; } @@ -556,8 +580,10 @@ public function getHelp(): string /** * Returns the processed help for the command replacing the %command.name% and * %command.full_name% patterns with the real values dynamically. + * + * @return string */ - public function getProcessedHelp(): string + public function getProcessedHelp() { $name = $this->name; $isSingleCommand = $this->application && $this->application->isSingleCommand(); @@ -583,7 +609,7 @@ public function getProcessedHelp(): string * * @throws InvalidArgumentException When an alias is invalid */ - public function setAliases(iterable $aliases): static + public function setAliases(iterable $aliases) { $list = []; @@ -599,8 +625,10 @@ public function setAliases(iterable $aliases): static /** * Returns the aliases for the command. + * + * @return array */ - public function getAliases(): array + public function getAliases() { return $this->aliases; } @@ -609,8 +637,10 @@ public function getAliases(): array * Returns the synopsis for the command. * * @param bool $short Whether to show the short version of the synopsis (with options folded) or not + * + * @return string */ - public function getSynopsis(bool $short = false): string + public function getSynopsis(bool $short = false) { $key = $short ? 'short' : 'long'; @@ -626,7 +656,7 @@ public function getSynopsis(bool $short = false): string * * @return $this */ - public function addUsage(string $usage): static + public function addUsage(string $usage) { if (!str_starts_with($usage, $this->name)) { $usage = sprintf('%s %s', $this->name, $usage); @@ -639,8 +669,10 @@ public function addUsage(string $usage): static /** * Returns alternative usages of the command. + * + * @return array */ - public function getUsages(): array + public function getUsages() { return $this->usages; } @@ -648,10 +680,12 @@ public function getUsages(): array /** * Gets a helper instance by name. * + * @return mixed + * * @throws LogicException if no HelperSet is defined * @throws InvalidArgumentException if the helper is not defined */ - public function getHelper(string $name): mixed + public function getHelper(string $name) { if (null === $this->helperSet) { throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); diff --git a/core/vendor/symfony/console/Command/HelpCommand.php b/core/vendor/symfony/console/Command/HelpCommand.php index 66f8593ebc..c66ef463ea 100644 --- a/core/vendor/symfony/console/Command/HelpCommand.php +++ b/core/vendor/symfony/console/Command/HelpCommand.php @@ -67,9 +67,11 @@ public function setCommand(Command $command) /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output): int + protected function execute(InputInterface $input, OutputInterface $output) { - $this->command ??= $this->getApplication()->find($input->getArgument('command_name')); + if (null === $this->command) { + $this->command = $this->getApplication()->find($input->getArgument('command_name')); + } $helper = new DescriptorHelper(); $helper->describe($output, $this->command, [ @@ -77,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'raw_text' => $input->getOption('raw'), ]); - unset($this->command); + $this->command = null; return 0; } diff --git a/core/vendor/symfony/console/Command/LazyCommand.php b/core/vendor/symfony/console/Command/LazyCommand.php index aec4126791..e576ad03fe 100644 --- a/core/vendor/symfony/console/Command/LazyCommand.php +++ b/core/vendor/symfony/console/Command/LazyCommand.php @@ -25,7 +25,7 @@ final class LazyCommand extends Command { private $command; - private ?bool $isEnabled; + private $isEnabled; public function __construct(string $name, array $aliases, string $description, bool $isHidden, \Closure $commandFactory, ?bool $isEnabled = true) { @@ -76,7 +76,10 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti $this->getCommand()->complete($input, $suggestions); } - public function setCode(callable $code): static + /** + * @return $this + */ + public function setCode(callable $code): self { $this->getCommand()->setCode($code); @@ -91,7 +94,10 @@ public function mergeApplicationDefinition(bool $mergeArgs = true): void $this->getCommand()->mergeApplicationDefinition($mergeArgs); } - public function setDefinition(array|InputDefinition $definition): static + /** + * @return $this + */ + public function setDefinition($definition): self { $this->getCommand()->setDefinition($definition); @@ -108,28 +114,40 @@ public function getNativeDefinition(): InputDefinition return $this->getCommand()->getNativeDefinition(); } - public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null): static + /** + * @return $this + */ + public function addArgument(string $name, int $mode = null, string $description = '', $default = null): self { $this->getCommand()->addArgument($name, $mode, $description, $default); return $this; } - public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null): static + /** + * @return $this + */ + public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null): self { $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default); return $this; } - public function setProcessTitle(string $title): static + /** + * @return $this + */ + public function setProcessTitle(string $title): self { $this->getCommand()->setProcessTitle($title); return $this; } - public function setHelp(string $help): static + /** + * @return $this + */ + public function setHelp(string $help): self { $this->getCommand()->setHelp($help); @@ -151,7 +169,10 @@ public function getSynopsis(bool $short = false): string return $this->getCommand()->getSynopsis($short); } - public function addUsage(string $usage): static + /** + * @return $this + */ + public function addUsage(string $usage): self { $this->getCommand()->addUsage($usage); @@ -163,7 +184,10 @@ public function getUsages(): array return $this->getCommand()->getUsages(); } - public function getHelper(string $name): mixed + /** + * @return mixed + */ + public function getHelper(string $name) { return $this->getCommand()->getHelper($name); } diff --git a/core/vendor/symfony/console/Command/ListCommand.php b/core/vendor/symfony/console/Command/ListCommand.php index 5c7260fe4c..f04a4ef670 100644 --- a/core/vendor/symfony/console/Command/ListCommand.php +++ b/core/vendor/symfony/console/Command/ListCommand.php @@ -65,7 +65,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output): int + protected function execute(InputInterface $input, OutputInterface $output) { $helper = new DescriptorHelper(); $helper->describe($output, $this->getApplication(), [ diff --git a/core/vendor/symfony/console/Command/LockableTrait.php b/core/vendor/symfony/console/Command/LockableTrait.php index 796955142e..b1856dca7c 100644 --- a/core/vendor/symfony/console/Command/LockableTrait.php +++ b/core/vendor/symfony/console/Command/LockableTrait.php @@ -13,6 +13,7 @@ use Symfony\Component\Console\Exception\LogicException; use Symfony\Component\Lock\LockFactory; +use Symfony\Component\Lock\LockInterface; use Symfony\Component\Lock\Store\FlockStore; use Symfony\Component\Lock\Store\SemaphoreStore; @@ -23,7 +24,8 @@ */ trait LockableTrait { - private $lock = null; + /** @var LockInterface|null */ + private $lock; /** * Locks a command. diff --git a/core/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/core/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php index b6b637ce6b..0adaf886ff 100644 --- a/core/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php +++ b/core/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php @@ -22,17 +22,21 @@ interface CommandLoaderInterface /** * Loads a command. * + * @return Command + * * @throws CommandNotFoundException */ - public function get(string $name): Command; + public function get(string $name); /** * Checks if a command exists. + * + * @return bool */ - public function has(string $name): bool; + public function has(string $name); /** * @return string[] */ - public function getNames(): array; + public function getNames(); } diff --git a/core/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/core/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php index 9b26577f02..ddccb3d45f 100644 --- a/core/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ b/core/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Console\CommandLoader; use Psr\Container\ContainerInterface; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\CommandNotFoundException; /** @@ -23,7 +22,7 @@ class ContainerCommandLoader implements CommandLoaderInterface { private $container; - private array $commandMap; + private $commandMap; /** * @param array $commandMap An array with command names as keys and service ids as values @@ -37,7 +36,7 @@ public function __construct(ContainerInterface $container, array $commandMap) /** * {@inheritdoc} */ - public function get(string $name): Command + public function get(string $name) { if (!$this->has($name)) { throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); @@ -49,7 +48,7 @@ public function get(string $name): Command /** * {@inheritdoc} */ - public function has(string $name): bool + public function has(string $name) { return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]); } @@ -57,7 +56,7 @@ public function has(string $name): bool /** * {@inheritdoc} */ - public function getNames(): array + public function getNames() { return array_keys($this->commandMap); } diff --git a/core/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/core/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php index c55dc1d02b..7e2db34647 100644 --- a/core/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ b/core/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Console\CommandLoader; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\CommandNotFoundException; /** @@ -21,7 +20,7 @@ */ class FactoryCommandLoader implements CommandLoaderInterface { - private array $factories; + private $factories; /** * @param callable[] $factories Indexed by command names @@ -34,7 +33,7 @@ public function __construct(array $factories) /** * {@inheritdoc} */ - public function has(string $name): bool + public function has(string $name) { return isset($this->factories[$name]); } @@ -42,7 +41,7 @@ public function has(string $name): bool /** * {@inheritdoc} */ - public function get(string $name): Command + public function get(string $name) { if (!isset($this->factories[$name])) { throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); @@ -56,7 +55,7 @@ public function get(string $name): Command /** * {@inheritdoc} */ - public function getNames(): array + public function getNames() { return array_keys($this->factories); } diff --git a/core/vendor/symfony/console/Completion/CompletionSuggestions.php b/core/vendor/symfony/console/Completion/CompletionSuggestions.php index 719118177f..d8905e5ee7 100644 --- a/core/vendor/symfony/console/Completion/CompletionSuggestions.php +++ b/core/vendor/symfony/console/Completion/CompletionSuggestions.php @@ -26,9 +26,11 @@ final class CompletionSuggestions /** * Add a suggested value for an input option or argument. * + * @param string|Suggestion $value + * * @return $this */ - public function suggestValue(string|Suggestion $value): static + public function suggestValue($value): self { $this->valueSuggestions[] = !$value instanceof Suggestion ? new Suggestion($value) : $value; @@ -42,7 +44,7 @@ public function suggestValue(string|Suggestion $value): static * * @return $this */ - public function suggestValues(array $values): static + public function suggestValues(array $values): self { foreach ($values as $value) { $this->suggestValue($value); @@ -56,7 +58,7 @@ public function suggestValues(array $values): static * * @return $this */ - public function suggestOption(InputOption $option): static + public function suggestOption(InputOption $option): self { $this->optionSuggestions[] = $option; @@ -70,7 +72,7 @@ public function suggestOption(InputOption $option): static * * @return $this */ - public function suggestOptions(array $options): static + public function suggestOptions(array $options): self { foreach ($options as $option) { $this->suggestOption($option); diff --git a/core/vendor/symfony/console/Completion/Suggestion.php b/core/vendor/symfony/console/Completion/Suggestion.php index ff156f84ce..6c7bc4dc4c 100644 --- a/core/vendor/symfony/console/Completion/Suggestion.php +++ b/core/vendor/symfony/console/Completion/Suggestion.php @@ -18,7 +18,7 @@ */ class Suggestion { - private string $value; + private $value; public function __construct(string $value) { diff --git a/core/vendor/symfony/console/Cursor.php b/core/vendor/symfony/console/Cursor.php index 995e3d7dd7..0c4dafb6ca 100644 --- a/core/vendor/symfony/console/Cursor.php +++ b/core/vendor/symfony/console/Cursor.php @@ -33,7 +33,7 @@ public function __construct(OutputInterface $output, $input = null) /** * @return $this */ - public function moveUp(int $lines = 1): static + public function moveUp(int $lines = 1): self { $this->output->write(sprintf("\x1b[%dA", $lines)); @@ -43,7 +43,7 @@ public function moveUp(int $lines = 1): static /** * @return $this */ - public function moveDown(int $lines = 1): static + public function moveDown(int $lines = 1): self { $this->output->write(sprintf("\x1b[%dB", $lines)); @@ -53,7 +53,7 @@ public function moveDown(int $lines = 1): static /** * @return $this */ - public function moveRight(int $columns = 1): static + public function moveRight(int $columns = 1): self { $this->output->write(sprintf("\x1b[%dC", $columns)); @@ -63,7 +63,7 @@ public function moveRight(int $columns = 1): static /** * @return $this */ - public function moveLeft(int $columns = 1): static + public function moveLeft(int $columns = 1): self { $this->output->write(sprintf("\x1b[%dD", $columns)); @@ -73,7 +73,7 @@ public function moveLeft(int $columns = 1): static /** * @return $this */ - public function moveToColumn(int $column): static + public function moveToColumn(int $column): self { $this->output->write(sprintf("\x1b[%dG", $column)); @@ -83,7 +83,7 @@ public function moveToColumn(int $column): static /** * @return $this */ - public function moveToPosition(int $column, int $row): static + public function moveToPosition(int $column, int $row): self { $this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column)); @@ -93,7 +93,7 @@ public function moveToPosition(int $column, int $row): static /** * @return $this */ - public function savePosition(): static + public function savePosition(): self { $this->output->write("\x1b7"); @@ -103,7 +103,7 @@ public function savePosition(): static /** * @return $this */ - public function restorePosition(): static + public function restorePosition(): self { $this->output->write("\x1b8"); @@ -113,7 +113,7 @@ public function restorePosition(): static /** * @return $this */ - public function hide(): static + public function hide(): self { $this->output->write("\x1b[?25l"); @@ -123,7 +123,7 @@ public function hide(): static /** * @return $this */ - public function show(): static + public function show(): self { $this->output->write("\x1b[?25h\x1b[?0c"); @@ -135,7 +135,7 @@ public function show(): static * * @return $this */ - public function clearLine(): static + public function clearLine(): self { $this->output->write("\x1b[2K"); @@ -157,7 +157,7 @@ public function clearLineAfter(): self * * @return $this */ - public function clearOutput(): static + public function clearOutput(): self { $this->output->write("\x1b[0J"); @@ -169,7 +169,7 @@ public function clearOutput(): static * * @return $this */ - public function clearScreen(): static + public function clearScreen(): self { $this->output->write("\x1b[2J"); diff --git a/core/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/core/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php index efaf39a2c9..743e306d07 100644 --- a/core/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ b/core/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php @@ -29,16 +29,33 @@ */ class AddConsoleCommandPass implements CompilerPassInterface { + private $commandLoaderServiceId; + private $commandTag; + private $noPreloadTag; + private $privateTagName; + + public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command', string $noPreloadTag = 'container.no_preload', string $privateTagName = 'container.private') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/console', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->commandLoaderServiceId = $commandLoaderServiceId; + $this->commandTag = $commandTag; + $this->noPreloadTag = $noPreloadTag; + $this->privateTagName = $privateTagName; + } + public function process(ContainerBuilder $container) { - $commandServices = $container->findTaggedServiceIds('console.command', true); + $commandServices = $container->findTaggedServiceIds($this->commandTag, true); $lazyCommandMap = []; $lazyCommandRefs = []; $serviceIds = []; foreach ($commandServices as $id => $tags) { $definition = $container->getDefinition($id); - $definition->addTag('container.no_preload'); + $definition->addTag($this->noPreloadTag); $class = $container->getParameterBag()->resolveValue($definition->getClass()); if (isset($tags[0]['command'])) { @@ -48,7 +65,7 @@ public function process(ContainerBuilder $container) throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); } if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); + throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); } $aliases = $class::getDefaultName(); } @@ -61,7 +78,7 @@ public function process(ContainerBuilder $container) } if (null === $commandName) { - if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag('container.private')) { + if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag($this->privateTagName)) { $commandId = 'console.command.public_alias.'.$id; $container->setAlias($commandId, $id)->setPublic(true); $id = $commandId; @@ -105,7 +122,7 @@ public function process(ContainerBuilder $container) throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); } if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); + throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); } $description = $class::getDefaultDescription(); } @@ -121,9 +138,9 @@ public function process(ContainerBuilder $container) } $container - ->register('console.command_loader', ContainerCommandLoader::class) + ->register($this->commandLoaderServiceId, ContainerCommandLoader::class) ->setPublic(true) - ->addTag('container.no_preload') + ->addTag($this->noPreloadTag) ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); $container->setParameter('console.command.ids', $serviceIds); diff --git a/core/vendor/symfony/console/Descriptor/ApplicationDescription.php b/core/vendor/symfony/console/Descriptor/ApplicationDescription.php index 0802f1b38b..fac01ad37c 100644 --- a/core/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/core/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -25,19 +25,23 @@ class ApplicationDescription public const GLOBAL_NAMESPACE = '_global'; private $application; - private ?string $namespace; - private bool $showHidden; - private array $namespaces; + private $namespace; + private $showHidden; + + /** + * @var array + */ + private $namespaces; /** * @var array<string, Command> */ - private array $commands; + private $commands; /** * @var array<string, Command> */ - private array $aliases = []; + private $aliases; public function __construct(Application $application, string $namespace = null, bool $showHidden = false) { @@ -48,7 +52,7 @@ public function __construct(Application $application, string $namespace = null, public function getNamespaces(): array { - if (!isset($this->namespaces)) { + if (null === $this->namespaces) { $this->inspectApplication(); } @@ -60,7 +64,7 @@ public function getNamespaces(): array */ public function getCommands(): array { - if (!isset($this->commands)) { + if (null === $this->commands) { $this->inspectApplication(); } diff --git a/core/vendor/symfony/console/Descriptor/TextDescriptor.php b/core/vendor/symfony/console/Descriptor/TextDescriptor.php index 3f309f5d4f..fbb140ae76 100644 --- a/core/vendor/symfony/console/Descriptor/TextDescriptor.php +++ b/core/vendor/symfony/console/Descriptor/TextDescriptor.php @@ -273,8 +273,10 @@ private function getCommandAliasesText(Command $command): string /** * Formats input option/argument default value. + * + * @param mixed $default */ - private function formatDefaultValue(mixed $default): string + private function formatDefaultValue($default): string { if (\INF === $default) { return 'INF'; diff --git a/core/vendor/symfony/console/Event/ConsoleCommandEvent.php b/core/vendor/symfony/console/Event/ConsoleCommandEvent.php index 31c9ee99a2..08bd18fd1f 100644 --- a/core/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ b/core/vendor/symfony/console/Event/ConsoleCommandEvent.php @@ -26,7 +26,7 @@ final class ConsoleCommandEvent extends ConsoleEvent /** * Indicates if the command should be run or skipped. */ - private bool $commandShouldRun = true; + private $commandShouldRun = true; /** * Disables the command, so it won't be run. diff --git a/core/vendor/symfony/console/Event/ConsoleErrorEvent.php b/core/vendor/symfony/console/Event/ConsoleErrorEvent.php index 19bd4bfddf..57d9b38ba0 100644 --- a/core/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ b/core/vendor/symfony/console/Event/ConsoleErrorEvent.php @@ -22,8 +22,8 @@ */ final class ConsoleErrorEvent extends ConsoleEvent { - private \Throwable $error; - private int $exitCode; + private $error; + private $exitCode; public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) { diff --git a/core/vendor/symfony/console/Event/ConsoleEvent.php b/core/vendor/symfony/console/Event/ConsoleEvent.php index 56b8a9a60e..be7937d514 100644 --- a/core/vendor/symfony/console/Event/ConsoleEvent.php +++ b/core/vendor/symfony/console/Event/ConsoleEvent.php @@ -37,24 +37,30 @@ public function __construct(?Command $command, InputInterface $input, OutputInte /** * Gets the command that is executed. + * + * @return Command|null */ - public function getCommand(): ?Command + public function getCommand() { return $this->command; } /** * Gets the input instance. + * + * @return InputInterface */ - public function getInput(): InputInterface + public function getInput() { return $this->input; } /** * Gets the output instance. + * + * @return OutputInterface */ - public function getOutput(): OutputInterface + public function getOutput() { return $this->output; } diff --git a/core/vendor/symfony/console/Event/ConsoleSignalEvent.php b/core/vendor/symfony/console/Event/ConsoleSignalEvent.php index 766af691aa..ef13ed2f5d 100644 --- a/core/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ b/core/vendor/symfony/console/Event/ConsoleSignalEvent.php @@ -20,7 +20,7 @@ */ final class ConsoleSignalEvent extends ConsoleEvent { - private int $handlingSignal; + private $handlingSignal; public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) { diff --git a/core/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/core/vendor/symfony/console/Event/ConsoleTerminateEvent.php index de63c8ffa8..190038d1a2 100644 --- a/core/vendor/symfony/console/Event/ConsoleTerminateEvent.php +++ b/core/vendor/symfony/console/Event/ConsoleTerminateEvent.php @@ -22,7 +22,7 @@ */ final class ConsoleTerminateEvent extends ConsoleEvent { - private int $exitCode; + private $exitCode; public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) { diff --git a/core/vendor/symfony/console/EventListener/ErrorListener.php b/core/vendor/symfony/console/EventListener/ErrorListener.php index 61bd9d3443..897d9853f2 100644 --- a/core/vendor/symfony/console/EventListener/ErrorListener.php +++ b/core/vendor/symfony/console/EventListener/ErrorListener.php @@ -69,7 +69,7 @@ public function onConsoleTerminate(ConsoleTerminateEvent $event) $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); } - public static function getSubscribedEvents(): array + public static function getSubscribedEvents() { return [ ConsoleEvents::ERROR => ['onConsoleError', -128], @@ -82,7 +82,7 @@ private static function getInputString(ConsoleEvent $event): ?string $commandName = $event->getCommand() ? $event->getCommand()->getName() : null; $input = $event->getInput(); - if ($input instanceof \Stringable) { + if (method_exists($input, '__toString')) { if ($commandName) { return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input); } diff --git a/core/vendor/symfony/console/Exception/CommandNotFoundException.php b/core/vendor/symfony/console/Exception/CommandNotFoundException.php index 1e9f1c7937..910ae19286 100644 --- a/core/vendor/symfony/console/Exception/CommandNotFoundException.php +++ b/core/vendor/symfony/console/Exception/CommandNotFoundException.php @@ -18,7 +18,7 @@ */ class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface { - private array $alternatives; + private $alternatives; /** * @param string $message Exception message to throw @@ -36,7 +36,7 @@ public function __construct(string $message, array $alternatives = [], int $code /** * @return string[] */ - public function getAlternatives(): array + public function getAlternatives() { return $this->alternatives; } diff --git a/core/vendor/symfony/console/Formatter/OutputFormatter.php b/core/vendor/symfony/console/Formatter/OutputFormatter.php index 7a09956e21..02cc8d76a1 100644 --- a/core/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/core/vendor/symfony/console/Formatter/OutputFormatter.php @@ -21,8 +21,8 @@ */ class OutputFormatter implements WrappableOutputFormatterInterface { - private bool $decorated; - private array $styles = []; + private $decorated; + private $styles = []; private $styleStack; public function __clone() @@ -35,8 +35,10 @@ public function __clone() /** * Escapes "<" and ">" special chars in given text. + * + * @return string */ - public static function escape(string $text): string + public static function escape(string $text) { $text = preg_replace('/([^\\\\]|^)([<>])/', '$1\\\\$2', $text); @@ -92,7 +94,7 @@ public function setDecorated(bool $decorated) /** * {@inheritdoc} */ - public function isDecorated(): bool + public function isDecorated() { return $this->decorated; } @@ -108,7 +110,7 @@ public function setStyle(string $name, OutputFormatterStyleInterface $style) /** * {@inheritdoc} */ - public function hasStyle(string $name): bool + public function hasStyle(string $name) { return isset($this->styles[strtolower($name)]); } @@ -116,7 +118,7 @@ public function hasStyle(string $name): bool /** * {@inheritdoc} */ - public function getStyle(string $name): OutputFormatterStyleInterface + public function getStyle(string $name) { if (!$this->hasStyle($name)) { throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); @@ -128,7 +130,7 @@ public function getStyle(string $name): OutputFormatterStyleInterface /** * {@inheritdoc} */ - public function format(?string $message): ?string + public function format(?string $message) { return $this->formatAndWrap($message, 0); } @@ -180,7 +182,10 @@ public function formatAndWrap(?string $message, int $width) return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']); } - public function getStyleStack(): OutputFormatterStyleStack + /** + * @return OutputFormatterStyleStack + */ + public function getStyleStack() { return $this->styleStack; } diff --git a/core/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/core/vendor/symfony/console/Formatter/OutputFormatterInterface.php index b94e51dedb..0b5f839a2b 100644 --- a/core/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ b/core/vendor/symfony/console/Formatter/OutputFormatterInterface.php @@ -25,8 +25,10 @@ public function setDecorated(bool $decorated); /** * Whether the output will decorate messages. + * + * @return bool */ - public function isDecorated(): bool; + public function isDecorated(); /** * Sets a new style. @@ -35,18 +37,24 @@ public function setStyle(string $name, OutputFormatterStyleInterface $style); /** * Checks if output formatter has style with specified name. + * + * @return bool */ - public function hasStyle(string $name): bool; + public function hasStyle(string $name); /** * Gets style options from style with specified name. * + * @return OutputFormatterStyleInterface + * * @throws \InvalidArgumentException When style isn't defined */ - public function getStyle(string $name): OutputFormatterStyleInterface; + public function getStyle(string $name); /** * Formats a message according to the given styles. + * + * @return string|null */ - public function format(?string $message): ?string; + public function format(?string $message); } diff --git a/core/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/core/vendor/symfony/console/Formatter/OutputFormatterStyle.php index 0a009e962c..0fb36ac632 100644 --- a/core/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/core/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -21,11 +21,11 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface { private $color; - private string $foreground; - private string $background; - private array $options; - private ?string $href = null; - private bool $handlesHrefGracefully; + private $foreground; + private $background; + private $options; + private $href; + private $handlesHrefGracefully; /** * Initializes output formatter style. @@ -92,10 +92,12 @@ public function setOptions(array $options) /** * {@inheritdoc} */ - public function apply(string $text): string + public function apply(string $text) { - $this->handlesHrefGracefully ??= 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + if (null === $this->handlesHrefGracefully) { + $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + } if (null !== $this->href && $this->handlesHrefGracefully) { $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; diff --git a/core/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/core/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php index 91d50aad2c..b30560d22e 100644 --- a/core/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ b/core/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php @@ -45,6 +45,8 @@ public function setOptions(array $options); /** * Applies the style to a given text. + * + * @return string */ - public function apply(string $text): string; + public function apply(string $text); } diff --git a/core/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/core/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php index b425449ef3..fc48dc0e15 100644 --- a/core/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ b/core/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @@ -22,7 +22,7 @@ class OutputFormatterStyleStack implements ResetInterface /** * @var OutputFormatterStyleInterface[] */ - private array $styles = []; + private $styles; private $emptyStyle; @@ -51,9 +51,11 @@ public function push(OutputFormatterStyleInterface $style) /** * Pops a style from the stack. * + * @return OutputFormatterStyleInterface + * * @throws InvalidArgumentException When style tags incorrectly nested */ - public function pop(OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface + public function pop(OutputFormatterStyleInterface $style = null) { if (empty($this->styles)) { return $this->emptyStyle; @@ -76,8 +78,10 @@ public function pop(OutputFormatterStyleInterface $style = null): OutputFormatte /** * Computes current style with stacks top codes. + * + * @return OutputFormatterStyle */ - public function getCurrent(): OutputFormatterStyle + public function getCurrent() { if (empty($this->styles)) { return $this->emptyStyle; @@ -89,14 +93,17 @@ public function getCurrent(): OutputFormatterStyle /** * @return $this */ - public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle): static + public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) { $this->emptyStyle = $emptyStyle; return $this; } - public function getEmptyStyle(): OutputFormatterStyleInterface + /** + * @return OutputFormatterStyleInterface + */ + public function getEmptyStyle() { return $this->emptyStyle; } diff --git a/core/vendor/symfony/console/Helper/DebugFormatterHelper.php b/core/vendor/symfony/console/Helper/DebugFormatterHelper.php index 64c7cffffd..e258ba0501 100644 --- a/core/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ b/core/vendor/symfony/console/Helper/DebugFormatterHelper.php @@ -21,13 +21,15 @@ class DebugFormatterHelper extends Helper { private const COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; - private array $started = []; - private int $count = -1; + private $started = []; + private $count = -1; /** * Starts a debug formatting session. + * + * @return string */ - public function start(string $id, string $message, string $prefix = 'RUN'): string + public function start(string $id, string $message, string $prefix = 'RUN') { $this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)]; @@ -36,8 +38,10 @@ public function start(string $id, string $message, string $prefix = 'RUN'): stri /** * Adds progress to a formatting session. + * + * @return string */ - public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR'): string + public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR') { $message = ''; @@ -70,8 +74,10 @@ public function progress(string $id, string $buffer, bool $error = false, string /** * Stops a formatting session. + * + * @return string */ - public function stop(string $id, string $message, bool $successful, string $prefix = 'RES'): string + public function stop(string $id, string $message, bool $successful, string $prefix = 'RES') { $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; @@ -94,7 +100,7 @@ private function getBorder(string $id): string /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'debug_formatter'; } diff --git a/core/vendor/symfony/console/Helper/DescriptorHelper.php b/core/vendor/symfony/console/Helper/DescriptorHelper.php index 63597c6307..af85e9c0a7 100644 --- a/core/vendor/symfony/console/Helper/DescriptorHelper.php +++ b/core/vendor/symfony/console/Helper/DescriptorHelper.php @@ -29,7 +29,7 @@ class DescriptorHelper extends Helper /** * @var DescriptorInterface[] */ - private array $descriptors = []; + private $descriptors = []; public function __construct() { @@ -70,7 +70,7 @@ public function describe(OutputInterface $output, ?object $object, array $option * * @return $this */ - public function register(string $format, DescriptorInterface $descriptor): static + public function register(string $format, DescriptorInterface $descriptor) { $this->descriptors[$format] = $descriptor; @@ -80,7 +80,7 @@ public function register(string $format, DescriptorInterface $descriptor): stati /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'descriptor'; } diff --git a/core/vendor/symfony/console/Helper/Dumper.php b/core/vendor/symfony/console/Helper/Dumper.php index 50190951b4..b013b6c527 100644 --- a/core/vendor/symfony/console/Helper/Dumper.php +++ b/core/vendor/symfony/console/Helper/Dumper.php @@ -24,7 +24,7 @@ final class Dumper private $output; private $dumper; private $cloner; - private \Closure $handler; + private $handler; public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null) { @@ -57,7 +57,7 @@ public function __construct(OutputInterface $output, CliDumper $dumper = null, C } } - public function __invoke(mixed $var): string + public function __invoke($var): string { return ($this->handler)($var); } diff --git a/core/vendor/symfony/console/Helper/FormatterHelper.php b/core/vendor/symfony/console/Helper/FormatterHelper.php index 2d7d1fade5..92d8dc7245 100644 --- a/core/vendor/symfony/console/Helper/FormatterHelper.php +++ b/core/vendor/symfony/console/Helper/FormatterHelper.php @@ -22,16 +22,22 @@ class FormatterHelper extends Helper { /** * Formats a message within a section. + * + * @return string */ - public function formatSection(string $section, string $message, string $style = 'info'): string + public function formatSection(string $section, string $message, string $style = 'info') { return sprintf('<%s>[%s]</%s> %s', $style, $section, $style, $message); } /** * Formats a message as a block of text. + * + * @param string|array $messages The message to write in the block + * + * @return string */ - public function formatBlock(string|array $messages, string $style, bool $large = false): string + public function formatBlock($messages, string $style, bool $large = false) { if (!\is_array($messages)) { $messages = [$messages]; @@ -62,8 +68,10 @@ public function formatBlock(string|array $messages, string $style, bool $large = /** * Truncates a message to the given length. + * + * @return string */ - public function truncate(string $message, int $length, string $suffix = '...'): string + public function truncate(string $message, int $length, string $suffix = '...') { $computedLength = $length - self::width($suffix); @@ -77,7 +85,7 @@ public function truncate(string $message, int $length, string $suffix = '...'): /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'formatter'; } diff --git a/core/vendor/symfony/console/Helper/Helper.php b/core/vendor/symfony/console/Helper/Helper.php index 01e39a9b38..50f51c7902 100644 --- a/core/vendor/symfony/console/Helper/Helper.php +++ b/core/vendor/symfony/console/Helper/Helper.php @@ -34,11 +34,25 @@ public function setHelperSet(HelperSet $helperSet = null) /** * {@inheritdoc} */ - public function getHelperSet(): ?HelperSet + public function getHelperSet() { return $this->helperSet; } + /** + * Returns the length of a string, using mb_strwidth if it is available. + * + * @deprecated since Symfony 5.3 + * + * @return int + */ + public static function strlen(?string $string) + { + trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::width() or Helper::length() instead.', __METHOD__); + + return self::width($string); + } + /** * Returns the width of a string, using mb_strwidth if it is available. * The width is how many characters positions the string will use. @@ -79,8 +93,10 @@ public static function length(?string $string): int /** * Returns the subset of a string, using mb_substr if it is available. + * + * @return string */ - public static function substr(?string $string, int $from, int $length = null): string + public static function substr(?string $string, int $from, int $length = null) { $string ?? $string = ''; @@ -91,7 +107,7 @@ public static function substr(?string $string, int $from, int $length = null): s return mb_substr($string, $from, $length, $encoding); } - public static function formatTime(int|float $secs) + public static function formatTime($secs) { static $timeFormats = [ [0, '< 1 sec'], @@ -137,6 +153,16 @@ public static function formatMemory(int $memory) return sprintf('%d B', $memory); } + /** + * @deprecated since Symfony 5.3 + */ + public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, ?string $string) + { + trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::removeDecoration() instead.', __METHOD__); + + return self::width(self::removeDecoration($formatter, $string)); + } + public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) { $isDecorated = $formatter->isDecorated(); diff --git a/core/vendor/symfony/console/Helper/HelperInterface.php b/core/vendor/symfony/console/Helper/HelperInterface.php index 1d2b7bfb84..fc952b4861 100644 --- a/core/vendor/symfony/console/Helper/HelperInterface.php +++ b/core/vendor/symfony/console/Helper/HelperInterface.php @@ -25,8 +25,10 @@ public function setHelperSet(HelperSet $helperSet = null); /** * Gets the helper set associated with this helper. + * + * @return HelperSet|null */ - public function getHelperSet(): ?HelperSet; + public function getHelperSet(); /** * Returns the canonical name of this helper. diff --git a/core/vendor/symfony/console/Helper/HelperSet.php b/core/vendor/symfony/console/Helper/HelperSet.php index be0beca00c..719762d242 100644 --- a/core/vendor/symfony/console/Helper/HelperSet.php +++ b/core/vendor/symfony/console/Helper/HelperSet.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Console\Helper; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\InvalidArgumentException; /** @@ -23,7 +24,8 @@ class HelperSet implements \IteratorAggregate { /** @var array<string, Helper> */ - private array $helpers = []; + private $helpers = []; + private $command; /** * @param Helper[] $helpers An array of helper @@ -47,8 +49,10 @@ public function set(HelperInterface $helper, string $alias = null) /** * Returns true if the helper if defined. + * + * @return bool */ - public function has(string $name): bool + public function has(string $name) { return isset($this->helpers[$name]); } @@ -56,9 +60,11 @@ public function has(string $name): bool /** * Gets a helper value. * + * @return HelperInterface + * * @throws InvalidArgumentException if the helper is not defined */ - public function get(string $name): HelperInterface + public function get(string $name) { if (!$this->has($name)) { throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); @@ -67,7 +73,35 @@ public function get(string $name): HelperInterface return $this->helpers[$name]; } - public function getIterator(): \Traversable + /** + * @deprecated since Symfony 5.4 + */ + public function setCommand(Command $command = null) + { + trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); + + $this->command = $command; + } + + /** + * Gets the command associated with this helper set. + * + * @return Command + * + * @deprecated since Symfony 5.4 + */ + public function getCommand() + { + trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); + + return $this->command; + } + + /** + * @return \Traversable<string, Helper> + */ + #[\ReturnTypeWillChange] + public function getIterator() { return new \ArrayIterator($this->helpers); } diff --git a/core/vendor/symfony/console/Helper/ProcessHelper.php b/core/vendor/symfony/console/Helper/ProcessHelper.php index e5ba4db44b..4ea3d724d8 100644 --- a/core/vendor/symfony/console/Helper/ProcessHelper.php +++ b/core/vendor/symfony/console/Helper/ProcessHelper.php @@ -32,7 +32,7 @@ class ProcessHelper extends Helper * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR */ - public function run(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process + public function run(OutputInterface $output, $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process { if (!class_exists(Process::class)) { throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); @@ -48,6 +48,10 @@ public function run(OutputInterface $output, array|Process $cmd, string $error = $cmd = [$cmd]; } + if (!\is_array($cmd)) { + throw new \TypeError(sprintf('The "command" argument of "%s()" must be an array or a "%s" instance, "%s" given.', __METHOD__, Process::class, get_debug_type($cmd))); + } + if (\is_string($cmd[0] ?? null)) { $process = new Process($cmd); $cmd = []; @@ -94,7 +98,7 @@ public function run(OutputInterface $output, array|Process $cmd, string $error = * * @see run() */ - public function mustRun(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null): Process + public function mustRun(OutputInterface $output, $cmd, string $error = null, callable $callback = null): Process { $process = $this->run($output, $cmd, $error, $callback); diff --git a/core/vendor/symfony/console/Helper/ProgressBar.php b/core/vendor/symfony/console/Helper/ProgressBar.php index 72c26f2f32..b1fb213b61 100644 --- a/core/vendor/symfony/console/Helper/ProgressBar.php +++ b/core/vendor/symfony/console/Helper/ProgressBar.php @@ -36,32 +36,32 @@ final class ProgressBar private const FORMAT_DEBUG_NOMAX = 'debug_nomax'; private const FORMAT_NORMAL_NOMAX = 'normal_nomax'; - private int $barWidth = 28; - private string $barChar; - private string $emptyBarChar = '-'; - private string $progressChar = '>'; - private ?string $format = null; - private ?string $internalFormat = null; - private ?int $redrawFreq = 1; - private int $writeCount = 0; - private float $lastWriteTime = 0; - private float $minSecondsBetweenRedraws = 0; - private float $maxSecondsBetweenRedraws = 1; + private $barWidth = 28; + private $barChar; + private $emptyBarChar = '-'; + private $progressChar = '>'; + private $format; + private $internalFormat; + private $redrawFreq = 1; + private $writeCount; + private $lastWriteTime; + private $minSecondsBetweenRedraws = 0; + private $maxSecondsBetweenRedraws = 1; private $output; - private int $step = 0; - private ?int $max = null; - private int $startTime; - private int $stepWidth; - private float $percent = 0.0; - private int $formatLineCount; - private array $messages = []; - private bool $overwrite = true; + private $step = 0; + private $max; + private $startTime; + private $stepWidth; + private $percent = 0.0; + private $formatLineCount; + private $messages = []; + private $overwrite = true; private $terminal; - private ?string $previousMessage = null; + private $previousMessage; private $cursor; - private static array $formatters; - private static array $formats; + private static $formatters; + private static $formats; /** * @param int $max Maximum steps (0 if unknown) @@ -103,7 +103,9 @@ public function __construct(OutputInterface $output, int $max = 0, float $minSec */ public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void { - self::$formatters ??= self::initPlaceholderFormatters(); + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } self::$formatters[$name] = $callable; } @@ -115,7 +117,9 @@ public static function setPlaceholderFormatterDefinition(string $name, callable */ public static function getPlaceholderFormatterDefinition(string $name): ?callable { - self::$formatters ??= self::initPlaceholderFormatters(); + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } return self::$formatters[$name] ?? null; } @@ -130,7 +134,9 @@ public static function getPlaceholderFormatterDefinition(string $name): ?callabl */ public static function setFormatDefinition(string $name, string $format): void { - self::$formats ??= self::initFormats(); + if (!self::$formats) { + self::$formats = self::initFormats(); + } self::$formats[$name] = $format; } @@ -142,7 +148,9 @@ public static function setFormatDefinition(string $name, string $format): void */ public static function getFormatDefinition(string $name): ?string { - self::$formats ??= self::initFormats(); + if (!self::$formats) { + self::$formats = self::initFormats(); + } return self::$formats[$name] ?? null; } @@ -566,8 +574,6 @@ private static function initFormats(): array private function buildLine(): string { - \assert(null !== $this->format); - $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; $callback = function ($matches) { if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { diff --git a/core/vendor/symfony/console/Helper/ProgressIndicator.php b/core/vendor/symfony/console/Helper/ProgressIndicator.php index c746f9b92e..3482343fcd 100644 --- a/core/vendor/symfony/console/Helper/ProgressIndicator.php +++ b/core/vendor/symfony/console/Helper/ProgressIndicator.php @@ -32,19 +32,19 @@ class ProgressIndicator ]; private $output; - private int $startTime; - private ?string $format = null; - private ?string $message = null; - private array $indicatorValues; - private int $indicatorCurrent; - private int $indicatorChangeInterval; - private float $indicatorUpdateTime; - private bool $started = false; + private $startTime; + private $format; + private $message; + private $indicatorValues; + private $indicatorCurrent; + private $indicatorChangeInterval; + private $indicatorUpdateTime; + private $started = false; /** * @var array<string, callable> */ - private static array $formatters; + private static $formatters; /** * @param int $indicatorChangeInterval Change interval in milliseconds @@ -146,8 +146,10 @@ public function finish(string $message) /** * Gets the format for a given name. + * + * @return string|null */ - public static function getFormatDefinition(string $name): ?string + public static function getFormatDefinition(string $name) { return self::FORMATS[$name] ?? null; } @@ -159,17 +161,23 @@ public static function getFormatDefinition(string $name): ?string */ public static function setPlaceholderFormatterDefinition(string $name, callable $callable) { - self::$formatters ??= self::initPlaceholderFormatters(); + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } self::$formatters[$name] = $callable; } /** * Gets the placeholder formatter for a given name (including the delimiter char like %). + * + * @return callable|null */ - public static function getPlaceholderFormatterDefinition(string $name): ?callable + public static function getPlaceholderFormatterDefinition(string $name) { - self::$formatters ??= self::initPlaceholderFormatters(); + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } return self::$formatters[$name] ?? null; } @@ -221,9 +229,6 @@ private function getCurrentTimeInMilliseconds(): float return round(microtime(true) * 1000); } - /** - * @return array<string, \Closure> - */ private static function initPlaceholderFormatters(): array { return [ diff --git a/core/vendor/symfony/console/Helper/QuestionHelper.php b/core/vendor/symfony/console/Helper/QuestionHelper.php index 2e1ccb2abc..842a618ef6 100644 --- a/core/vendor/symfony/console/Helper/QuestionHelper.php +++ b/core/vendor/symfony/console/Helper/QuestionHelper.php @@ -38,8 +38,8 @@ class QuestionHelper extends Helper */ private $inputStream; - private static bool $stty = true; - private static bool $stdinIsInteractive; + private static $stty = true; + private static $stdinIsInteractive; /** * Asks a question to the user. @@ -48,7 +48,7 @@ class QuestionHelper extends Helper * * @throws RuntimeException If there is no data to read in the input stream */ - public function ask(InputInterface $input, OutputInterface $output, Question $question): mixed + public function ask(InputInterface $input, OutputInterface $output, Question $question) { if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); @@ -86,7 +86,7 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'question'; } @@ -102,9 +102,11 @@ public static function disableStty() /** * Asks the question to the user. * + * @return mixed + * * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden */ - private function doAsk(OutputInterface $output, Question $question): mixed + private function doAsk(OutputInterface $output, Question $question) { $this->writePrompt($output, $question); @@ -151,7 +153,10 @@ private function doAsk(OutputInterface $output, Question $question): mixed return $ret; } - private function getDefaultAnswer(Question $question): mixed + /** + * @return mixed + */ + private function getDefaultAnswer(Question $question) { $default = $question->getDefault(); @@ -199,7 +204,7 @@ protected function writePrompt(OutputInterface $output, Question $question) /** * @return string[] */ - protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag): array + protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag) { $messages = []; @@ -451,9 +456,11 @@ private function getHiddenResponse(OutputInterface $output, $inputStream, bool $ * * @param callable $interviewer A callable that will ask for a question and return the result * + * @return mixed The validated response + * * @throws \Exception In case the max number of attempts has been reached and no valid response has been given */ - private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question): mixed + private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question) { $error = null; $attempts = $question->getMaxAttempts(); @@ -480,7 +487,7 @@ private function isInteractiveInput($inputStream): bool return false; } - if (isset(self::$stdinIsInteractive)) { + if (null !== self::$stdinIsInteractive) { return self::$stdinIsInteractive; } @@ -506,8 +513,10 @@ private function isInteractiveInput($inputStream): bool * * @param resource $inputStream The handler resource * @param Question $question The question being asked + * + * @return string|false The input received, false in case input could not be read */ - private function readInput($inputStream, Question $question): string|false + private function readInput($inputStream, Question $question) { if (!$question->isMultiline()) { $cp = $this->setIOCodepage(); @@ -533,6 +542,11 @@ private function readInput($inputStream, Question $question): string|false return $this->resetIOCodepage($cp, $ret); } + /** + * Sets console I/O to the host code page. + * + * @return int Previous code page in IBM/EBCDIC format + */ private function setIOCodepage(): int { if (\function_exists('sapi_windows_cp_set')) { @@ -547,8 +561,12 @@ private function setIOCodepage(): int /** * Sets console I/O to the specified code page and converts the user input. + * + * @param string|false $input + * + * @return string|false */ - private function resetIOCodepage(int $cp, string|false $input): string|false + private function resetIOCodepage(int $cp, $input) { if (0 !== $cp) { sapi_windows_cp_set($cp); diff --git a/core/vendor/symfony/console/Helper/Table.php b/core/vendor/symfony/console/Helper/Table.php index 2e87ed9c74..6ade1360d4 100644 --- a/core/vendor/symfony/console/Helper/Table.php +++ b/core/vendor/symfony/console/Helper/Table.php @@ -36,27 +36,69 @@ class Table private const BORDER_OUTSIDE = 0; private const BORDER_INSIDE = 1; - private ?string $headerTitle = null; - private ?string $footerTitle = null; - private array $headers = []; - private array $rows = []; - private bool $horizontal = false; - private array $effectiveColumnWidths = []; - private int $numberOfColumns; + private $headerTitle; + private $footerTitle; + + /** + * Table headers. + */ + private $headers = []; + + /** + * Table rows. + */ + private $rows = []; + private $horizontal = false; + + /** + * Column widths cache. + */ + private $effectiveColumnWidths = []; + + /** + * Number of columns cache. + * + * @var int + */ + private $numberOfColumns; + + /** + * @var OutputInterface + */ private $output; + + /** + * @var TableStyle + */ private $style; - private array $columnStyles = []; - private array $columnWidths = []; - private array $columnMaxWidths = []; - private bool $rendered = false; - private static array $styles; + /** + * @var array + */ + private $columnStyles = []; + + /** + * User set column widths. + * + * @var array + */ + private $columnWidths = []; + private $columnMaxWidths = []; + + /** + * @var array<string, TableStyle>|null + */ + private static $styles; + + private $rendered = false; public function __construct(OutputInterface $output) { $this->output = $output; - self::$styles ??= self::initStyles(); + if (!self::$styles) { + self::$styles = self::initStyles(); + } $this->setStyle('default'); } @@ -66,27 +108,39 @@ public function __construct(OutputInterface $output) */ public static function setStyleDefinition(string $name, TableStyle $style) { - self::$styles ??= self::initStyles(); + if (!self::$styles) { + self::$styles = self::initStyles(); + } self::$styles[$name] = $style; } /** * Gets a style definition by name. + * + * @return TableStyle */ - public static function getStyleDefinition(string $name): TableStyle + public static function getStyleDefinition(string $name) { - self::$styles ??= self::initStyles(); + if (!self::$styles) { + self::$styles = self::initStyles(); + } - return self::$styles[$name] ?? throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + if (isset(self::$styles[$name])) { + return self::$styles[$name]; + } + + throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); } /** * Sets table style. * + * @param TableStyle|string $name The style name or a TableStyle instance + * * @return $this */ - public function setStyle(TableStyle|string $name): static + public function setStyle($name) { $this->style = $this->resolveStyle($name); @@ -95,8 +149,10 @@ public function setStyle(TableStyle|string $name): static /** * Gets the current table style. + * + * @return TableStyle */ - public function getStyle(): TableStyle + public function getStyle() { return $this->style; } @@ -108,7 +164,7 @@ public function getStyle(): TableStyle * * @return $this */ - public function setColumnStyle(int $columnIndex, TableStyle|string $name): static + public function setColumnStyle(int $columnIndex, $name) { $this->columnStyles[$columnIndex] = $this->resolveStyle($name); @@ -119,8 +175,10 @@ public function setColumnStyle(int $columnIndex, TableStyle|string $name): stati * Gets the current style for a column. * * If style was not set, it returns the global table style. + * + * @return TableStyle */ - public function getColumnStyle(int $columnIndex): TableStyle + public function getColumnStyle(int $columnIndex) { return $this->columnStyles[$columnIndex] ?? $this->getStyle(); } @@ -130,7 +188,7 @@ public function getColumnStyle(int $columnIndex): TableStyle * * @return $this */ - public function setColumnWidth(int $columnIndex, int $width): static + public function setColumnWidth(int $columnIndex, int $width) { $this->columnWidths[$columnIndex] = $width; @@ -142,7 +200,7 @@ public function setColumnWidth(int $columnIndex, int $width): static * * @return $this */ - public function setColumnWidths(array $widths): static + public function setColumnWidths(array $widths) { $this->columnWidths = []; foreach ($widths as $index => $width) { @@ -160,7 +218,7 @@ public function setColumnWidths(array $widths): static * * @return $this */ - public function setColumnMaxWidth(int $columnIndex, int $width): static + public function setColumnMaxWidth(int $columnIndex, int $width): self { if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); @@ -174,7 +232,7 @@ public function setColumnMaxWidth(int $columnIndex, int $width): static /** * @return $this */ - public function setHeaders(array $headers): static + public function setHeaders(array $headers) { $headers = array_values($headers); if (!empty($headers) && !\is_array($headers[0])) { @@ -196,7 +254,7 @@ public function setRows(array $rows) /** * @return $this */ - public function addRows(array $rows): static + public function addRows(array $rows) { foreach ($rows as $row) { $this->addRow($row); @@ -208,7 +266,7 @@ public function addRows(array $rows): static /** * @return $this */ - public function addRow(TableSeparator|array $row): static + public function addRow($row) { if ($row instanceof TableSeparator) { $this->rows[] = $row; @@ -216,6 +274,10 @@ public function addRow(TableSeparator|array $row): static return $this; } + if (!\is_array($row)) { + throw new InvalidArgumentException('A row must be an array or a TableSeparator instance.'); + } + $this->rows[] = array_values($row); return $this; @@ -226,7 +288,7 @@ public function addRow(TableSeparator|array $row): static * * @return $this */ - public function appendRow(TableSeparator|array $row): static + public function appendRow($row): self { if (!$this->output instanceof ConsoleSectionOutput) { throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); @@ -245,7 +307,7 @@ public function appendRow(TableSeparator|array $row): static /** * @return $this */ - public function setRow(int|string $column, array $row): static + public function setRow($column, array $row) { $this->rows[$column] = $row; @@ -255,7 +317,7 @@ public function setRow(int|string $column, array $row): static /** * @return $this */ - public function setHeaderTitle(?string $title): static + public function setHeaderTitle(?string $title): self { $this->headerTitle = $title; @@ -265,7 +327,7 @@ public function setHeaderTitle(?string $title): static /** * @return $this */ - public function setFooterTitle(?string $title): static + public function setFooterTitle(?string $title): self { $this->footerTitle = $title; @@ -275,7 +337,7 @@ public function setFooterTitle(?string $title): static /** * @return $this */ - public function setHorizontal(bool $horizontal = true): static + public function setHorizontal(bool $horizontal = true): self { $this->horizontal = $horizontal; @@ -597,7 +659,7 @@ private function fillNextRows(array $rows, int $line): array { $unmergedRows = []; foreach ($rows[$line] as $column => $cell) { - if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !$cell instanceof \Stringable) { + if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); } if ($cell instanceof TableCell && $cell->getRowspan() > 1) { @@ -764,7 +826,7 @@ private function getCellWidth(array $row, int $column): int private function cleanup() { $this->effectiveColumnWidths = []; - unset($this->numberOfColumns); + $this->numberOfColumns = null; } /** @@ -817,12 +879,16 @@ private static function initStyles(): array ]; } - private function resolveStyle(TableStyle|string $name): TableStyle + private function resolveStyle($name): TableStyle { if ($name instanceof TableStyle) { return $name; } - return self::$styles[$name] ?? throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + if (isset(self::$styles[$name])) { + return self::$styles[$name]; + } + + throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); } } diff --git a/core/vendor/symfony/console/Helper/TableCell.php b/core/vendor/symfony/console/Helper/TableCell.php index 394b2bc959..1a7bc6ede6 100644 --- a/core/vendor/symfony/console/Helper/TableCell.php +++ b/core/vendor/symfony/console/Helper/TableCell.php @@ -18,8 +18,8 @@ */ class TableCell { - private string $value; - private array $options = [ + private $value; + private $options = [ 'rowspan' => 1, 'colspan' => 1, 'style' => null, @@ -43,24 +43,30 @@ public function __construct(string $value = '', array $options = []) /** * Returns the cell value. + * + * @return string */ - public function __toString(): string + public function __toString() { return $this->value; } /** * Gets number of colspan. + * + * @return int */ - public function getColspan(): int + public function getColspan() { return (int) $this->options['colspan']; } /** * Gets number of rowspan. + * + * @return int */ - public function getRowspan(): int + public function getRowspan() { return (int) $this->options['rowspan']; } diff --git a/core/vendor/symfony/console/Helper/TableCellStyle.php b/core/vendor/symfony/console/Helper/TableCellStyle.php index 65ae9e7281..19cd0ffc68 100644 --- a/core/vendor/symfony/console/Helper/TableCellStyle.php +++ b/core/vendor/symfony/console/Helper/TableCellStyle.php @@ -32,7 +32,7 @@ class TableCellStyle 'right' => \STR_PAD_LEFT, ]; - private array $options = [ + private $options = [ 'fg' => 'default', 'bg' => 'default', 'options' => null, @@ -63,7 +63,7 @@ public function getOptions(): array * * @return string[] */ - public function getTagOptions(): array + public function getTagOptions() { return array_filter( $this->getOptions(), @@ -74,7 +74,10 @@ function ($key) { ); } - public function getPadByAlign(): int + /** + * @return int + */ + public function getPadByAlign() { return self::ALIGN_MAP[$this->getOptions()['align']]; } diff --git a/core/vendor/symfony/console/Helper/TableRows.php b/core/vendor/symfony/console/Helper/TableRows.php index 97d07726e4..cbc07d2943 100644 --- a/core/vendor/symfony/console/Helper/TableRows.php +++ b/core/vendor/symfony/console/Helper/TableRows.php @@ -16,7 +16,7 @@ */ class TableRows implements \IteratorAggregate { - private \Closure $generator; + private $generator; public function __construct(\Closure $generator) { diff --git a/core/vendor/symfony/console/Helper/TableStyle.php b/core/vendor/symfony/console/Helper/TableStyle.php index bbad98e73c..dfc41e6a4c 100644 --- a/core/vendor/symfony/console/Helper/TableStyle.php +++ b/core/vendor/symfony/console/Helper/TableStyle.php @@ -23,37 +23,37 @@ */ class TableStyle { - private string $paddingChar = ' '; - private string $horizontalOutsideBorderChar = '-'; - private string $horizontalInsideBorderChar = '-'; - private string $verticalOutsideBorderChar = '|'; - private string $verticalInsideBorderChar = '|'; - private string $crossingChar = '+'; - private string $crossingTopRightChar = '+'; - private string $crossingTopMidChar = '+'; - private string $crossingTopLeftChar = '+'; - private string $crossingMidRightChar = '+'; - private string $crossingBottomRightChar = '+'; - private string $crossingBottomMidChar = '+'; - private string $crossingBottomLeftChar = '+'; - private string $crossingMidLeftChar = '+'; - private string $crossingTopLeftBottomChar = '+'; - private string $crossingTopMidBottomChar = '+'; - private string $crossingTopRightBottomChar = '+'; - private string $headerTitleFormat = '<fg=black;bg=white;options=bold> %s </>'; - private string $footerTitleFormat = '<fg=black;bg=white;options=bold> %s </>'; - private string $cellHeaderFormat = '<info>%s</info>'; - private string $cellRowFormat = '%s'; - private string $cellRowContentFormat = ' %s '; - private string $borderFormat = '%s'; - private int $padType = \STR_PAD_RIGHT; + private $paddingChar = ' '; + private $horizontalOutsideBorderChar = '-'; + private $horizontalInsideBorderChar = '-'; + private $verticalOutsideBorderChar = '|'; + private $verticalInsideBorderChar = '|'; + private $crossingChar = '+'; + private $crossingTopRightChar = '+'; + private $crossingTopMidChar = '+'; + private $crossingTopLeftChar = '+'; + private $crossingMidRightChar = '+'; + private $crossingBottomRightChar = '+'; + private $crossingBottomMidChar = '+'; + private $crossingBottomLeftChar = '+'; + private $crossingMidLeftChar = '+'; + private $crossingTopLeftBottomChar = '+'; + private $crossingTopMidBottomChar = '+'; + private $crossingTopRightBottomChar = '+'; + private $headerTitleFormat = '<fg=black;bg=white;options=bold> %s </>'; + private $footerTitleFormat = '<fg=black;bg=white;options=bold> %s </>'; + private $cellHeaderFormat = '<info>%s</info>'; + private $cellRowFormat = '%s'; + private $cellRowContentFormat = ' %s '; + private $borderFormat = '%s'; + private $padType = \STR_PAD_RIGHT; /** * Sets padding character, used for cell padding. * * @return $this */ - public function setPaddingChar(string $paddingChar): static + public function setPaddingChar(string $paddingChar) { if (!$paddingChar) { throw new LogicException('The padding char must not be empty.'); @@ -66,8 +66,10 @@ public function setPaddingChar(string $paddingChar): static /** * Gets padding character, used for cell padding. + * + * @return string */ - public function getPaddingChar(): string + public function getPaddingChar() { return $this->paddingChar; } @@ -88,7 +90,7 @@ public function getPaddingChar(): string * * @return $this */ - public function setHorizontalBorderChars(string $outside, string $inside = null): static + public function setHorizontalBorderChars(string $outside, string $inside = null): self { $this->horizontalOutsideBorderChar = $outside; $this->horizontalInsideBorderChar = $inside ?? $outside; @@ -113,7 +115,7 @@ public function setHorizontalBorderChars(string $outside, string $inside = null) * * @return $this */ - public function setVerticalBorderChars(string $outside, string $inside = null): static + public function setVerticalBorderChars(string $outside, string $inside = null): self { $this->verticalOutsideBorderChar = $outside; $this->verticalInsideBorderChar = $inside ?? $outside; @@ -167,7 +169,7 @@ public function getBorderChars(): array * * @return $this */ - public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): static + public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): self { $this->crossingChar = $cross; $this->crossingTopLeftChar = $topLeft; @@ -197,8 +199,10 @@ public function setDefaultCrossingChar(string $char): self /** * Gets crossing character. + * + * @return string */ - public function getCrossingChar(): string + public function getCrossingChar() { return $this->crossingChar; } @@ -231,7 +235,7 @@ public function getCrossingChars(): array * * @return $this */ - public function setCellHeaderFormat(string $cellHeaderFormat): static + public function setCellHeaderFormat(string $cellHeaderFormat) { $this->cellHeaderFormat = $cellHeaderFormat; @@ -240,8 +244,10 @@ public function setCellHeaderFormat(string $cellHeaderFormat): static /** * Gets header cell format. + * + * @return string */ - public function getCellHeaderFormat(): string + public function getCellHeaderFormat() { return $this->cellHeaderFormat; } @@ -251,7 +257,7 @@ public function getCellHeaderFormat(): string * * @return $this */ - public function setCellRowFormat(string $cellRowFormat): static + public function setCellRowFormat(string $cellRowFormat) { $this->cellRowFormat = $cellRowFormat; @@ -260,8 +266,10 @@ public function setCellRowFormat(string $cellRowFormat): static /** * Gets row cell format. + * + * @return string */ - public function getCellRowFormat(): string + public function getCellRowFormat() { return $this->cellRowFormat; } @@ -271,7 +279,7 @@ public function getCellRowFormat(): string * * @return $this */ - public function setCellRowContentFormat(string $cellRowContentFormat): static + public function setCellRowContentFormat(string $cellRowContentFormat) { $this->cellRowContentFormat = $cellRowContentFormat; @@ -280,8 +288,10 @@ public function setCellRowContentFormat(string $cellRowContentFormat): static /** * Gets row cell content format. + * + * @return string */ - public function getCellRowContentFormat(): string + public function getCellRowContentFormat() { return $this->cellRowContentFormat; } @@ -291,7 +301,7 @@ public function getCellRowContentFormat(): string * * @return $this */ - public function setBorderFormat(string $borderFormat): static + public function setBorderFormat(string $borderFormat) { $this->borderFormat = $borderFormat; @@ -300,8 +310,10 @@ public function setBorderFormat(string $borderFormat): static /** * Gets table border format. + * + * @return string */ - public function getBorderFormat(): string + public function getBorderFormat() { return $this->borderFormat; } @@ -311,7 +323,7 @@ public function getBorderFormat(): string * * @return $this */ - public function setPadType(int $padType): static + public function setPadType(int $padType) { if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) { throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); @@ -324,8 +336,10 @@ public function setPadType(int $padType): static /** * Gets cell padding type. + * + * @return int */ - public function getPadType(): int + public function getPadType() { return $this->padType; } @@ -338,7 +352,7 @@ public function getHeaderTitleFormat(): string /** * @return $this */ - public function setHeaderTitleFormat(string $format): static + public function setHeaderTitleFormat(string $format): self { $this->headerTitleFormat = $format; @@ -353,7 +367,7 @@ public function getFooterTitleFormat(): string /** * @return $this */ - public function setFooterTitleFormat(string $format): static + public function setFooterTitleFormat(string $format): self { $this->footerTitleFormat = $format; diff --git a/core/vendor/symfony/console/Input/ArgvInput.php b/core/vendor/symfony/console/Input/ArgvInput.php index 4e90c812e2..675b9ef589 100644 --- a/core/vendor/symfony/console/Input/ArgvInput.php +++ b/core/vendor/symfony/console/Input/ArgvInput.php @@ -40,8 +40,8 @@ */ class ArgvInput extends Input { - private array $tokens; - private array $parsed; + private $tokens; + private $parsed; public function __construct(array $argv = null, InputDefinition $definition = null) { @@ -199,7 +199,7 @@ private function parseArgument(string $token) * * @throws RuntimeException When option given doesn't exist */ - private function addShortOption(string $shortcut, mixed $value) + private function addShortOption(string $shortcut, $value) { if (!$this->definition->hasShortcut($shortcut)) { throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); @@ -213,7 +213,7 @@ private function addShortOption(string $shortcut, mixed $value) * * @throws RuntimeException When option given doesn't exist */ - private function addLongOption(string $name, mixed $value) + private function addLongOption(string $name, $value) { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { @@ -266,7 +266,7 @@ private function addLongOption(string $name, mixed $value) /** * {@inheritdoc} */ - public function getFirstArgument(): ?string + public function getFirstArgument() { $isOption = false; foreach ($this->tokens as $i => $token) { @@ -301,7 +301,7 @@ public function getFirstArgument(): ?string /** * {@inheritdoc} */ - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool + public function hasParameterOption($values, bool $onlyParams = false) { $values = (array) $values; @@ -326,7 +326,7 @@ public function hasParameterOption(string|array $values, bool $onlyParams = fals /** * {@inheritdoc} */ - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed + public function getParameterOption($values, $default = false, bool $onlyParams = false) { $values = (array) $values; $tokens = $this->tokens; @@ -356,8 +356,10 @@ public function getParameterOption(string|array $values, string|bool|int|float|a /** * Returns a stringified representation of the args passed to the command. + * + * @return string */ - public function __toString(): string + public function __toString() { $tokens = array_map(function ($token) { if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { diff --git a/core/vendor/symfony/console/Input/ArrayInput.php b/core/vendor/symfony/console/Input/ArrayInput.php index fdb47df4de..c65161484e 100644 --- a/core/vendor/symfony/console/Input/ArrayInput.php +++ b/core/vendor/symfony/console/Input/ArrayInput.php @@ -25,7 +25,7 @@ */ class ArrayInput extends Input { - private array $parameters; + private $parameters; public function __construct(array $parameters, InputDefinition $definition = null) { @@ -37,7 +37,7 @@ public function __construct(array $parameters, InputDefinition $definition = nul /** * {@inheritdoc} */ - public function getFirstArgument(): ?string + public function getFirstArgument() { foreach ($this->parameters as $param => $value) { if ($param && \is_string($param) && '-' === $param[0]) { @@ -53,7 +53,7 @@ public function getFirstArgument(): ?string /** * {@inheritdoc} */ - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool + public function hasParameterOption($values, bool $onlyParams = false) { $values = (array) $values; @@ -77,7 +77,7 @@ public function hasParameterOption(string|array $values, bool $onlyParams = fals /** * {@inheritdoc} */ - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed + public function getParameterOption($values, $default = false, bool $onlyParams = false) { $values = (array) $values; @@ -100,8 +100,10 @@ public function getParameterOption(string|array $values, string|bool|int|float|a /** * Returns a stringified representation of the args passed to the command. + * + * @return string */ - public function __toString(): string + public function __toString() { $params = []; foreach ($this->parameters as $param => $val) { @@ -146,7 +148,7 @@ protected function parse() * * @throws InvalidOptionException When option given doesn't exist */ - private function addShortOption(string $shortcut, mixed $value) + private function addShortOption(string $shortcut, $value) { if (!$this->definition->hasShortcut($shortcut)) { throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); @@ -161,7 +163,7 @@ private function addShortOption(string $shortcut, mixed $value) * @throws InvalidOptionException When option given doesn't exist * @throws InvalidOptionException When a required value is missing */ - private function addLongOption(string $name, mixed $value) + private function addLongOption(string $name, $value) { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { @@ -192,9 +194,12 @@ private function addLongOption(string $name, mixed $value) /** * Adds an argument value. * + * @param string|int $name The argument name + * @param mixed $value The value for the argument + * * @throws InvalidArgumentException When argument given doesn't exist */ - private function addArgument(string|int $name, mixed $value) + private function addArgument($name, $value) { if (!$this->definition->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); diff --git a/core/vendor/symfony/console/Input/Input.php b/core/vendor/symfony/console/Input/Input.php index 1db503cb27..d37460ed3a 100644 --- a/core/vendor/symfony/console/Input/Input.php +++ b/core/vendor/symfony/console/Input/Input.php @@ -80,7 +80,7 @@ public function validate() /** * {@inheritdoc} */ - public function isInteractive(): bool + public function isInteractive() { return $this->interactive; } @@ -96,7 +96,7 @@ public function setInteractive(bool $interactive) /** * {@inheritdoc} */ - public function getArguments(): array + public function getArguments() { return array_merge($this->definition->getArgumentDefaults(), $this->arguments); } @@ -104,7 +104,7 @@ public function getArguments(): array /** * {@inheritdoc} */ - public function getArgument(string $name): mixed + public function getArgument(string $name) { if (!$this->definition->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); @@ -116,7 +116,7 @@ public function getArgument(string $name): mixed /** * {@inheritdoc} */ - public function setArgument(string $name, mixed $value) + public function setArgument(string $name, $value) { if (!$this->definition->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); @@ -128,7 +128,7 @@ public function setArgument(string $name, mixed $value) /** * {@inheritdoc} */ - public function hasArgument(string $name): bool + public function hasArgument(string $name) { return $this->definition->hasArgument($name); } @@ -136,7 +136,7 @@ public function hasArgument(string $name): bool /** * {@inheritdoc} */ - public function getOptions(): array + public function getOptions() { return array_merge($this->definition->getOptionDefaults(), $this->options); } @@ -144,7 +144,7 @@ public function getOptions(): array /** * {@inheritdoc} */ - public function getOption(string $name): mixed + public function getOption(string $name) { if ($this->definition->hasNegation($name)) { if (null === $value = $this->getOption($this->definition->negationToName($name))) { @@ -164,7 +164,7 @@ public function getOption(string $name): mixed /** * {@inheritdoc} */ - public function setOption(string $name, mixed $value) + public function setOption(string $name, $value) { if ($this->definition->hasNegation($name)) { $this->options[$this->definition->negationToName($name)] = !$value; @@ -180,15 +180,17 @@ public function setOption(string $name, mixed $value) /** * {@inheritdoc} */ - public function hasOption(string $name): bool + public function hasOption(string $name) { return $this->definition->hasOption($name) || $this->definition->hasNegation($name); } /** * Escapes a token through escapeshellarg if it contains unsafe chars. + * + * @return string */ - public function escapeToken(string $token): string + public function escapeToken(string $token) { return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); } diff --git a/core/vendor/symfony/console/Input/InputArgument.php b/core/vendor/symfony/console/Input/InputArgument.php index 143e4b10ae..e891b9443f 100644 --- a/core/vendor/symfony/console/Input/InputArgument.php +++ b/core/vendor/symfony/console/Input/InputArgument.php @@ -25,10 +25,10 @@ class InputArgument public const OPTIONAL = 2; public const IS_ARRAY = 4; - private string $name; - private int $mode; - private string|int|bool|array|null|float $default; - private string $description; + private $name; + private $mode; + private $default; + private $description; /** * @param string $name The argument name @@ -38,7 +38,7 @@ class InputArgument * * @throws InvalidArgumentException When argument mode is not valid */ - public function __construct(string $name, int $mode = null, string $description = '', string|bool|int|float|array $default = null) + public function __construct(string $name, int $mode = null, string $description = '', $default = null) { if (null === $mode) { $mode = self::OPTIONAL; @@ -55,8 +55,10 @@ public function __construct(string $name, int $mode = null, string $description /** * Returns the argument name. + * + * @return string */ - public function getName(): string + public function getName() { return $this->name; } @@ -66,7 +68,7 @@ public function getName(): string * * @return bool true if parameter mode is self::REQUIRED, false otherwise */ - public function isRequired(): bool + public function isRequired() { return self::REQUIRED === (self::REQUIRED & $this->mode); } @@ -76,7 +78,7 @@ public function isRequired(): bool * * @return bool true if mode is self::IS_ARRAY, false otherwise */ - public function isArray(): bool + public function isArray() { return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); } @@ -84,9 +86,11 @@ public function isArray(): bool /** * Sets the default value. * + * @param string|bool|int|float|array|null $default + * * @throws LogicException When incorrect default value is given */ - public function setDefault(string|bool|int|float|array $default = null) + public function setDefault($default = null) { if (self::REQUIRED === $this->mode && null !== $default) { throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); @@ -105,16 +109,20 @@ public function setDefault(string|bool|int|float|array $default = null) /** * Returns the default value. + * + * @return string|bool|int|float|array|null */ - public function getDefault(): string|bool|int|float|array|null + public function getDefault() { return $this->default; } /** * Returns the description text. + * + * @return string */ - public function getDescription(): string + public function getDescription() { return $this->description; } diff --git a/core/vendor/symfony/console/Input/InputDefinition.php b/core/vendor/symfony/console/Input/InputDefinition.php index cb270d81fa..11f704f0e0 100644 --- a/core/vendor/symfony/console/Input/InputDefinition.php +++ b/core/vendor/symfony/console/Input/InputDefinition.php @@ -28,13 +28,13 @@ */ class InputDefinition { - private array $arguments = []; - private int $requiredCount = 0; - private $lastArrayArgument = null; - private $lastOptionalArgument = null; - private array $options = []; - private array $negations = []; - private array $shortcuts = []; + private $arguments; + private $requiredCount; + private $lastArrayArgument; + private $lastOptionalArgument; + private $options; + private $negations; + private $shortcuts; /** * @param array $definition An array of InputArgument and InputOption instance @@ -124,9 +124,13 @@ public function addArgument(InputArgument $argument) /** * Returns an InputArgument by name or by position. * + * @param string|int $name The InputArgument name or position + * + * @return InputArgument + * * @throws InvalidArgumentException When argument given doesn't exist */ - public function getArgument(string|int $name): InputArgument + public function getArgument($name) { if (!$this->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); @@ -139,8 +143,12 @@ public function getArgument(string|int $name): InputArgument /** * Returns true if an InputArgument object exists by name or position. + * + * @param string|int $name The InputArgument name or position + * + * @return bool */ - public function hasArgument(string|int $name): bool + public function hasArgument($name) { $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; @@ -152,23 +160,27 @@ public function hasArgument(string|int $name): bool * * @return InputArgument[] */ - public function getArguments(): array + public function getArguments() { return $this->arguments; } /** * Returns the number of InputArguments. + * + * @return int */ - public function getArgumentCount(): int + public function getArgumentCount() { return null !== $this->lastArrayArgument ? \PHP_INT_MAX : \count($this->arguments); } /** * Returns the number of required InputArguments. + * + * @return int */ - public function getArgumentRequiredCount(): int + public function getArgumentRequiredCount() { return $this->requiredCount; } @@ -176,7 +188,7 @@ public function getArgumentRequiredCount(): int /** * @return array<string|bool|int|float|array|null> */ - public function getArgumentDefaults(): array + public function getArgumentDefaults() { $values = []; foreach ($this->arguments as $argument) { @@ -250,9 +262,11 @@ public function addOption(InputOption $option) /** * Returns an InputOption by name. * + * @return InputOption + * * @throws InvalidArgumentException When option given doesn't exist */ - public function getOption(string $name): InputOption + public function getOption(string $name) { if (!$this->hasOption($name)) { throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); @@ -266,8 +280,10 @@ public function getOption(string $name): InputOption * * This method can't be used to check if the user included the option when * executing the command (use getOption() instead). + * + * @return bool */ - public function hasOption(string $name): bool + public function hasOption(string $name) { return isset($this->options[$name]); } @@ -277,15 +293,17 @@ public function hasOption(string $name): bool * * @return InputOption[] */ - public function getOptions(): array + public function getOptions() { return $this->options; } /** * Returns true if an InputOption object exists by shortcut. + * + * @return bool */ - public function hasShortcut(string $name): bool + public function hasShortcut(string $name) { return isset($this->shortcuts[$name]); } @@ -300,8 +318,10 @@ public function hasNegation(string $name): bool /** * Gets an InputOption by shortcut. + * + * @return InputOption */ - public function getOptionForShortcut(string $shortcut): InputOption + public function getOptionForShortcut(string $shortcut) { return $this->getOption($this->shortcutToName($shortcut)); } @@ -309,7 +329,7 @@ public function getOptionForShortcut(string $shortcut): InputOption /** * @return array<string|bool|int|float|array|null> */ - public function getOptionDefaults(): array + public function getOptionDefaults() { $values = []; foreach ($this->options as $option) { @@ -353,8 +373,10 @@ public function negationToName(string $negation): string /** * Gets the synopsis. + * + * @return string */ - public function getSynopsis(bool $short = false): string + public function getSynopsis(bool $short = false) { $elements = []; diff --git a/core/vendor/symfony/console/Input/InputInterface.php b/core/vendor/symfony/console/Input/InputInterface.php index 024da1884e..628b6037ac 100644 --- a/core/vendor/symfony/console/Input/InputInterface.php +++ b/core/vendor/symfony/console/Input/InputInterface.php @@ -23,8 +23,10 @@ interface InputInterface { /** * Returns the first argument from the raw parameters (not parsed). + * + * @return string|null */ - public function getFirstArgument(): ?string; + public function getFirstArgument(); /** * Returns true if the raw parameters (not parsed) contain a value. @@ -36,8 +38,10 @@ public function getFirstArgument(): ?string; * * @param string|array $values The values to look for in the raw parameters (can be an array) * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal + * + * @return bool */ - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool; + public function hasParameterOption($values, bool $onlyParams = false); /** * Returns the value of a raw option (not parsed). @@ -53,7 +57,7 @@ public function hasParameterOption(string|array $values, bool $onlyParams = fals * * @return mixed */ - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false); + public function getParameterOption($values, $default = false, bool $onlyParams = false); /** * Binds the current Input instance with the given arguments and options. @@ -74,7 +78,7 @@ public function validate(); * * @return array<string|bool|int|float|array|null> */ - public function getArguments(): array; + public function getArguments(); /** * Returns the argument value for a given argument name. @@ -88,21 +92,25 @@ public function getArgument(string $name); /** * Sets an argument value by name. * + * @param mixed $value The argument value + * * @throws InvalidArgumentException When argument given doesn't exist */ - public function setArgument(string $name, mixed $value); + public function setArgument(string $name, $value); /** * Returns true if an InputArgument object exists by name or position. + * + * @return bool */ - public function hasArgument(string $name): bool; + public function hasArgument(string $name); /** * Returns all the given options merged with the default values. * * @return array<string|bool|int|float|array|null> */ - public function getOptions(): array; + public function getOptions(); /** * Returns the option value for a given option name. @@ -116,19 +124,25 @@ public function getOption(string $name); /** * Sets an option value by name. * + * @param mixed $value The option value + * * @throws InvalidArgumentException When option given doesn't exist */ - public function setOption(string $name, mixed $value); + public function setOption(string $name, $value); /** * Returns true if an InputOption object exists by name. + * + * @return bool */ - public function hasOption(string $name): bool; + public function hasOption(string $name); /** * Is this input means interactive? + * + * @return bool */ - public function isInteractive(): bool; + public function isInteractive(); /** * Sets the input interactivity. diff --git a/core/vendor/symfony/console/Input/InputOption.php b/core/vendor/symfony/console/Input/InputOption.php index f9d74a8961..2bec34fe1a 100644 --- a/core/vendor/symfony/console/Input/InputOption.php +++ b/core/vendor/symfony/console/Input/InputOption.php @@ -46,11 +46,11 @@ class InputOption */ public const VALUE_NEGATABLE = 16; - private string $name; - private string|array|null $shortcut; - private int $mode; - private string|int|bool|array|null|float $default; - private string $description; + private $name; + private $shortcut; + private $mode; + private $default; + private $description; /** * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts @@ -59,7 +59,7 @@ class InputOption * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function __construct(string $name, string|array $shortcut = null, int $mode = null, string $description = '', string|bool|int|float|array $default = null) + public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) { if (str_starts_with($name, '--')) { $name = substr($name, 2); @@ -109,16 +109,20 @@ public function __construct(string $name, string|array $shortcut = null, int $mo /** * Returns the option shortcut. + * + * @return string|null */ - public function getShortcut(): ?string + public function getShortcut() { return $this->shortcut; } /** * Returns the option name. + * + * @return string */ - public function getName(): string + public function getName() { return $this->name; } @@ -128,7 +132,7 @@ public function getName(): string * * @return bool true if value mode is not self::VALUE_NONE, false otherwise */ - public function acceptValue(): bool + public function acceptValue() { return $this->isValueRequired() || $this->isValueOptional(); } @@ -138,7 +142,7 @@ public function acceptValue(): bool * * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise */ - public function isValueRequired(): bool + public function isValueRequired() { return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); } @@ -148,7 +152,7 @@ public function isValueRequired(): bool * * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise */ - public function isValueOptional(): bool + public function isValueOptional() { return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); } @@ -158,7 +162,7 @@ public function isValueOptional(): bool * * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise */ - public function isArray(): bool + public function isArray() { return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); } @@ -168,7 +172,10 @@ public function isNegatable(): bool return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); } - public function setDefault(string|bool|int|float|array $default = null) + /** + * @param string|bool|int|float|array|null $default + */ + public function setDefault($default = null) { if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); @@ -187,24 +194,30 @@ public function setDefault(string|bool|int|float|array $default = null) /** * Returns the default value. + * + * @return string|bool|int|float|array|null */ - public function getDefault(): string|bool|int|float|array|null + public function getDefault() { return $this->default; } /** * Returns the description text. + * + * @return string */ - public function getDescription(): string + public function getDescription() { return $this->description; } /** * Checks whether the given option equals this one. + * + * @return bool */ - public function equals(self $option): bool + public function equals(self $option) { return $option->getName() === $this->getName() && $option->getShortcut() === $this->getShortcut() diff --git a/core/vendor/symfony/console/Logger/ConsoleLogger.php b/core/vendor/symfony/console/Logger/ConsoleLogger.php index 61a7821508..c9ee03561b 100644 --- a/core/vendor/symfony/console/Logger/ConsoleLogger.php +++ b/core/vendor/symfony/console/Logger/ConsoleLogger.php @@ -30,7 +30,7 @@ class ConsoleLogger extends AbstractLogger public const ERROR = 'error'; private $output; - private array $verbosityLevelMap = [ + private $verbosityLevelMap = [ LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, @@ -40,7 +40,7 @@ class ConsoleLogger extends AbstractLogger LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, ]; - private array $formatLevelMap = [ + private $formatLevelMap = [ LogLevel::EMERGENCY => self::ERROR, LogLevel::ALERT => self::ERROR, LogLevel::CRITICAL => self::ERROR, @@ -50,7 +50,7 @@ class ConsoleLogger extends AbstractLogger LogLevel::INFO => self::INFO, LogLevel::DEBUG => self::INFO, ]; - private bool $errored = false; + private $errored = false; public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = []) { @@ -61,8 +61,10 @@ public function __construct(OutputInterface $output, array $verbosityLevelMap = /** * {@inheritdoc} + * + * @return void */ - public function log($level, $message, array $context = []): void + public function log($level, $message, array $context = []) { if (!isset($this->verbosityLevelMap[$level])) { throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); @@ -87,8 +89,10 @@ public function log($level, $message, array $context = []): void /** * Returns true when any messages have been logged at error levels. + * + * @return bool */ - public function hasErrored(): bool + public function hasErrored() { return $this->errored; } @@ -106,7 +110,7 @@ private function interpolate(string $message, array $context): string $replacements = []; foreach ($context as $key => $val) { - if (null === $val || is_scalar($val) || $val instanceof \Stringable) { + if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { $replacements["{{$key}}"] = $val; } elseif ($val instanceof \DateTimeInterface) { $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); diff --git a/core/vendor/symfony/console/Output/BufferedOutput.php b/core/vendor/symfony/console/Output/BufferedOutput.php index 784e309bdd..d37c6e3238 100644 --- a/core/vendor/symfony/console/Output/BufferedOutput.php +++ b/core/vendor/symfony/console/Output/BufferedOutput.php @@ -16,12 +16,14 @@ */ class BufferedOutput extends Output { - private string $buffer = ''; + private $buffer = ''; /** * Empties buffer and returns its content. + * + * @return string */ - public function fetch(): string + public function fetch() { $content = $this->buffer; $this->buffer = ''; diff --git a/core/vendor/symfony/console/Output/ConsoleOutput.php b/core/vendor/symfony/console/Output/ConsoleOutput.php index c6ba068a1a..f19f9ebf44 100644 --- a/core/vendor/symfony/console/Output/ConsoleOutput.php +++ b/core/vendor/symfony/console/Output/ConsoleOutput.php @@ -30,7 +30,7 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface { private $stderr; - private array $consoleSectionOutputs = []; + private $consoleSectionOutputs = []; /** * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) @@ -94,7 +94,7 @@ public function setVerbosity(int $level) /** * {@inheritdoc} */ - public function getErrorOutput(): OutputInterface + public function getErrorOutput() { return $this->stderr; } @@ -110,8 +110,10 @@ public function setErrorOutput(OutputInterface $error) /** * Returns true if current environment supports writing console output to * STDOUT. + * + * @return bool */ - protected function hasStdoutSupport(): bool + protected function hasStdoutSupport() { return false === $this->isRunningOS400(); } @@ -119,8 +121,10 @@ protected function hasStdoutSupport(): bool /** * Returns true if current environment supports writing console output to * STDERR. + * + * @return bool */ - protected function hasStderrSupport(): bool + protected function hasStderrSupport() { return false === $this->isRunningOS400(); } diff --git a/core/vendor/symfony/console/Output/ConsoleOutputInterface.php b/core/vendor/symfony/console/Output/ConsoleOutputInterface.php index 6b4babc6dd..6b6635f580 100644 --- a/core/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ b/core/vendor/symfony/console/Output/ConsoleOutputInterface.php @@ -21,8 +21,10 @@ interface ConsoleOutputInterface extends OutputInterface { /** * Gets the OutputInterface for errors. + * + * @return OutputInterface */ - public function getErrorOutput(): OutputInterface; + public function getErrorOutput(); public function setErrorOutput(OutputInterface $error); diff --git a/core/vendor/symfony/console/Output/ConsoleSectionOutput.php b/core/vendor/symfony/console/Output/ConsoleSectionOutput.php index 92dca79682..8f16497583 100644 --- a/core/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ b/core/vendor/symfony/console/Output/ConsoleSectionOutput.php @@ -21,9 +21,9 @@ */ class ConsoleSectionOutput extends StreamOutput { - private array $content = []; - private int $lines = 0; - private array $sections; + private $content = []; + private $lines = 0; + private $sections; private $terminal; /** @@ -63,8 +63,10 @@ public function clear(int $lines = null) /** * Overwrites the previous output with a new message. + * + * @param array|string $message */ - public function overwrite(string|iterable $message) + public function overwrite($message) { $this->clear(); $this->writeln($message); diff --git a/core/vendor/symfony/console/Output/NullOutput.php b/core/vendor/symfony/console/Output/NullOutput.php index 87214ec497..3bbe63ea0a 100644 --- a/core/vendor/symfony/console/Output/NullOutput.php +++ b/core/vendor/symfony/console/Output/NullOutput.php @@ -37,10 +37,13 @@ public function setFormatter(OutputFormatterInterface $formatter) /** * {@inheritdoc} */ - public function getFormatter(): OutputFormatterInterface + public function getFormatter() { + if ($this->formatter) { + return $this->formatter; + } // to comply with the interface we must return a OutputFormatterInterface - return $this->formatter ??= new NullOutputFormatter(); + return $this->formatter = new NullOutputFormatter(); } /** @@ -54,7 +57,7 @@ public function setDecorated(bool $decorated) /** * {@inheritdoc} */ - public function isDecorated(): bool + public function isDecorated() { return false; } @@ -70,7 +73,7 @@ public function setVerbosity(int $level) /** * {@inheritdoc} */ - public function getVerbosity(): int + public function getVerbosity() { return self::VERBOSITY_QUIET; } @@ -78,7 +81,7 @@ public function getVerbosity(): int /** * {@inheritdoc} */ - public function isQuiet(): bool + public function isQuiet() { return true; } @@ -86,7 +89,7 @@ public function isQuiet(): bool /** * {@inheritdoc} */ - public function isVerbose(): bool + public function isVerbose() { return false; } @@ -94,7 +97,7 @@ public function isVerbose(): bool /** * {@inheritdoc} */ - public function isVeryVerbose(): bool + public function isVeryVerbose() { return false; } @@ -102,7 +105,7 @@ public function isVeryVerbose(): bool /** * {@inheritdoc} */ - public function isDebug(): bool + public function isDebug() { return false; } @@ -110,7 +113,7 @@ public function isDebug(): bool /** * {@inheritdoc} */ - public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) + public function writeln($messages, int $options = self::OUTPUT_NORMAL) { // do nothing } @@ -118,7 +121,7 @@ public function writeln(string|iterable $messages, int $options = self::OUTPUT_N /** * {@inheritdoc} */ - public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) { // do nothing } diff --git a/core/vendor/symfony/console/Output/Output.php b/core/vendor/symfony/console/Output/Output.php index 58c1837b74..d7c5fb2d11 100644 --- a/core/vendor/symfony/console/Output/Output.php +++ b/core/vendor/symfony/console/Output/Output.php @@ -29,7 +29,7 @@ */ abstract class Output implements OutputInterface { - private int $verbosity; + private $verbosity; private $formatter; /** @@ -55,7 +55,7 @@ public function setFormatter(OutputFormatterInterface $formatter) /** * {@inheritdoc} */ - public function getFormatter(): OutputFormatterInterface + public function getFormatter() { return $this->formatter; } @@ -71,7 +71,7 @@ public function setDecorated(bool $decorated) /** * {@inheritdoc} */ - public function isDecorated(): bool + public function isDecorated() { return $this->formatter->isDecorated(); } @@ -87,7 +87,7 @@ public function setVerbosity(int $level) /** * {@inheritdoc} */ - public function getVerbosity(): int + public function getVerbosity() { return $this->verbosity; } @@ -95,7 +95,7 @@ public function getVerbosity(): int /** * {@inheritdoc} */ - public function isQuiet(): bool + public function isQuiet() { return self::VERBOSITY_QUIET === $this->verbosity; } @@ -103,7 +103,7 @@ public function isQuiet(): bool /** * {@inheritdoc} */ - public function isVerbose(): bool + public function isVerbose() { return self::VERBOSITY_VERBOSE <= $this->verbosity; } @@ -111,7 +111,7 @@ public function isVerbose(): bool /** * {@inheritdoc} */ - public function isVeryVerbose(): bool + public function isVeryVerbose() { return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity; } @@ -119,7 +119,7 @@ public function isVeryVerbose(): bool /** * {@inheritdoc} */ - public function isDebug(): bool + public function isDebug() { return self::VERBOSITY_DEBUG <= $this->verbosity; } @@ -127,7 +127,7 @@ public function isDebug(): bool /** * {@inheritdoc} */ - public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) + public function writeln($messages, int $options = self::OUTPUT_NORMAL) { $this->write($messages, true, $options); } @@ -135,7 +135,7 @@ public function writeln(string|iterable $messages, int $options = self::OUTPUT_N /** * {@inheritdoc} */ - public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { $messages = [$messages]; diff --git a/core/vendor/symfony/console/Output/OutputInterface.php b/core/vendor/symfony/console/Output/OutputInterface.php index beb92182f0..55caab80b8 100644 --- a/core/vendor/symfony/console/Output/OutputInterface.php +++ b/core/vendor/symfony/console/Output/OutputInterface.php @@ -33,17 +33,19 @@ interface OutputInterface /** * Writes a message to the output. * - * @param $newline Whether to add a newline - * @param $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * @param string|iterable $messages The message as an iterable of strings or a single string + * @param bool $newline Whether to add a newline + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ - public function write(string|iterable $messages, bool $newline = false, int $options = 0); + public function write($messages, bool $newline = false, int $options = 0); /** * Writes a message to the output and adds a newline at the end. * - * @param $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * @param string|iterable $messages The message as an iterable of strings or a single string + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ - public function writeln(string|iterable $messages, int $options = 0); + public function writeln($messages, int $options = 0); /** * Sets the verbosity of the output. @@ -52,28 +54,38 @@ public function setVerbosity(int $level); /** * Gets the current verbosity of the output. + * + * @return int */ - public function getVerbosity(): int; + public function getVerbosity(); /** * Returns whether verbosity is quiet (-q). + * + * @return bool */ - public function isQuiet(): bool; + public function isQuiet(); /** * Returns whether verbosity is verbose (-v). + * + * @return bool */ - public function isVerbose(): bool; + public function isVerbose(); /** * Returns whether verbosity is very verbose (-vv). + * + * @return bool */ - public function isVeryVerbose(): bool; + public function isVeryVerbose(); /** * Returns whether verbosity is debug (-vvv). + * + * @return bool */ - public function isDebug(): bool; + public function isDebug(); /** * Sets the decorated flag. @@ -82,13 +94,17 @@ public function setDecorated(bool $decorated); /** * Gets the decorated flag. + * + * @return bool */ - public function isDecorated(): bool; + public function isDecorated(); public function setFormatter(OutputFormatterInterface $formatter); /** * Returns current output formatter instance. + * + * @return OutputFormatterInterface */ - public function getFormatter(): OutputFormatterInterface; + public function getFormatter(); } diff --git a/core/vendor/symfony/console/Output/StreamOutput.php b/core/vendor/symfony/console/Output/StreamOutput.php index ac58e415cc..7f5551827d 100644 --- a/core/vendor/symfony/console/Output/StreamOutput.php +++ b/core/vendor/symfony/console/Output/StreamOutput.php @@ -91,7 +91,7 @@ protected function doWrite(string $message, bool $newline) * * @return bool true if the stream supports colorization, false otherwise */ - protected function hasColorSupport(): bool + protected function hasColorSupport() { // Follow https://no-color.org/ if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { diff --git a/core/vendor/symfony/console/Output/TrimmedBufferOutput.php b/core/vendor/symfony/console/Output/TrimmedBufferOutput.php index 0d375e0c8d..3f4d375f42 100644 --- a/core/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ b/core/vendor/symfony/console/Output/TrimmedBufferOutput.php @@ -21,8 +21,8 @@ */ class TrimmedBufferOutput extends Output { - private int $maxLength; - private string $buffer = ''; + private $maxLength; + private $buffer = ''; public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) { @@ -36,8 +36,10 @@ public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NO /** * Empties buffer and returns its content. + * + * @return string */ - public function fetch(): string + public function fetch() { $content = $this->buffer; $this->buffer = ''; diff --git a/core/vendor/symfony/console/Question/ChoiceQuestion.php b/core/vendor/symfony/console/Question/ChoiceQuestion.php index e449ff683d..bf1f904878 100644 --- a/core/vendor/symfony/console/Question/ChoiceQuestion.php +++ b/core/vendor/symfony/console/Question/ChoiceQuestion.php @@ -20,17 +20,17 @@ */ class ChoiceQuestion extends Question { - private array $choices; - private bool $multiselect = false; - private string $prompt = ' > '; - private string $errorMessage = 'Value "%s" is invalid'; + private $choices; + private $multiselect = false; + private $prompt = ' > '; + private $errorMessage = 'Value "%s" is invalid'; /** * @param string $question The question to ask to the user * @param array $choices The list of available choices * @param mixed $default The default answer to return */ - public function __construct(string $question, array $choices, mixed $default = null) + public function __construct(string $question, array $choices, $default = null) { if (!$choices) { throw new \LogicException('Choice question must have at least 1 choice available.'); @@ -45,8 +45,10 @@ public function __construct(string $question, array $choices, mixed $default = n /** * Returns available choices. + * + * @return array */ - public function getChoices(): array + public function getChoices() { return $this->choices; } @@ -58,7 +60,7 @@ public function getChoices(): array * * @return $this */ - public function setMultiselect(bool $multiselect): static + public function setMultiselect(bool $multiselect) { $this->multiselect = $multiselect; $this->setValidator($this->getDefaultValidator()); @@ -68,16 +70,20 @@ public function setMultiselect(bool $multiselect): static /** * Returns whether the choices are multiselect. + * + * @return bool */ - public function isMultiselect(): bool + public function isMultiselect() { return $this->multiselect; } /** * Gets the prompt for choices. + * + * @return string */ - public function getPrompt(): string + public function getPrompt() { return $this->prompt; } @@ -87,7 +93,7 @@ public function getPrompt(): string * * @return $this */ - public function setPrompt(string $prompt): static + public function setPrompt(string $prompt) { $this->prompt = $prompt; @@ -101,7 +107,7 @@ public function setPrompt(string $prompt): static * * @return $this */ - public function setErrorMessage(string $errorMessage): static + public function setErrorMessage(string $errorMessage) { $this->errorMessage = $errorMessage; $this->setValidator($this->getDefaultValidator()); diff --git a/core/vendor/symfony/console/Question/ConfirmationQuestion.php b/core/vendor/symfony/console/Question/ConfirmationQuestion.php index 40eab2429c..4228521b9f 100644 --- a/core/vendor/symfony/console/Question/ConfirmationQuestion.php +++ b/core/vendor/symfony/console/Question/ConfirmationQuestion.php @@ -18,7 +18,7 @@ */ class ConfirmationQuestion extends Question { - private string $trueAnswerRegex; + private $trueAnswerRegex; /** * @param string $question The question to ask to the user diff --git a/core/vendor/symfony/console/Question/Question.php b/core/vendor/symfony/console/Question/Question.php index f99e685deb..3a73f04b23 100644 --- a/core/vendor/symfony/console/Question/Question.php +++ b/core/vendor/symfony/console/Question/Question.php @@ -21,22 +21,22 @@ */ class Question { - private string $question; - private ?int $attempts = null; - private bool $hidden = false; - private bool $hiddenFallback = true; - private ?\Closure $autocompleterCallback = null; - private ?\Closure $validator = null; - private string|int|bool|null|float $default; - private ?\Closure $normalizer = null; - private bool $trimmable = true; - private bool $multiline = false; + private $question; + private $attempts; + private $hidden = false; + private $hiddenFallback = true; + private $autocompleterCallback; + private $validator; + private $default; + private $normalizer; + private $trimmable = true; + private $multiline = false; /** * @param string $question The question to ask to the user * @param string|bool|int|float|null $default The default answer to return if the user enters nothing */ - public function __construct(string $question, string|bool|int|float $default = null) + public function __construct(string $question, $default = null) { $this->question = $question; $this->default = $default; @@ -44,16 +44,20 @@ public function __construct(string $question, string|bool|int|float $default = n /** * Returns the question. + * + * @return string */ - public function getQuestion(): string + public function getQuestion() { return $this->question; } /** * Returns the default answer. + * + * @return string|bool|int|float|null */ - public function getDefault(): string|bool|int|float|null + public function getDefault() { return $this->default; } @@ -71,7 +75,7 @@ public function isMultiline(): bool * * @return $this */ - public function setMultiline(bool $multiline): static + public function setMultiline(bool $multiline): self { $this->multiline = $multiline; @@ -80,8 +84,10 @@ public function setMultiline(bool $multiline): static /** * Returns whether the user response must be hidden. + * + * @return bool */ - public function isHidden(): bool + public function isHidden() { return $this->hidden; } @@ -93,7 +99,7 @@ public function isHidden(): bool * * @throws LogicException In case the autocompleter is also used */ - public function setHidden(bool $hidden): static + public function setHidden(bool $hidden) { if ($this->autocompleterCallback) { throw new LogicException('A hidden question cannot use the autocompleter.'); @@ -106,8 +112,10 @@ public function setHidden(bool $hidden): static /** * In case the response cannot be hidden, whether to fallback on non-hidden question or not. + * + * @return bool */ - public function isHiddenFallback(): bool + public function isHiddenFallback() { return $this->hiddenFallback; } @@ -117,7 +125,7 @@ public function isHiddenFallback(): bool * * @return $this */ - public function setHiddenFallback(bool $fallback): static + public function setHiddenFallback(bool $fallback) { $this->hiddenFallback = $fallback; @@ -126,8 +134,10 @@ public function setHiddenFallback(bool $fallback): static /** * Gets values for the autocompleter. + * + * @return iterable|null */ - public function getAutocompleterValues(): ?iterable + public function getAutocompleterValues() { $callback = $this->getAutocompleterCallback(); @@ -141,7 +151,7 @@ public function getAutocompleterValues(): ?iterable * * @throws LogicException */ - public function setAutocompleterValues(?iterable $values): static + public function setAutocompleterValues(?iterable $values) { if (\is_array($values)) { $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); @@ -176,13 +186,13 @@ public function getAutocompleterCallback(): ?callable * * @return $this */ - public function setAutocompleterCallback(callable $callback = null): static + public function setAutocompleterCallback(callable $callback = null): self { if ($this->hidden && null !== $callback) { throw new LogicException('A hidden question cannot use the autocompleter.'); } - $this->autocompleterCallback = null === $callback || $callback instanceof \Closure ? $callback : \Closure::fromCallable($callback); + $this->autocompleterCallback = $callback; return $this; } @@ -192,17 +202,19 @@ public function setAutocompleterCallback(callable $callback = null): static * * @return $this */ - public function setValidator(callable $validator = null): static + public function setValidator(callable $validator = null) { - $this->validator = null === $validator || $validator instanceof \Closure ? $validator : \Closure::fromCallable($validator); + $this->validator = $validator; return $this; } /** * Gets the validator for the question. + * + * @return callable|null */ - public function getValidator(): ?callable + public function getValidator() { return $this->validator; } @@ -216,7 +228,7 @@ public function getValidator(): ?callable * * @throws InvalidArgumentException in case the number of attempts is invalid */ - public function setMaxAttempts(?int $attempts): static + public function setMaxAttempts(?int $attempts) { if (null !== $attempts && $attempts < 1) { throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); @@ -231,8 +243,10 @@ public function setMaxAttempts(?int $attempts): static * Gets the maximum number of attempts. * * Null means an unlimited number of attempts. + * + * @return int|null */ - public function getMaxAttempts(): ?int + public function getMaxAttempts() { return $this->attempts; } @@ -244,9 +258,9 @@ public function getMaxAttempts(): ?int * * @return $this */ - public function setNormalizer(callable $normalizer): static + public function setNormalizer(callable $normalizer) { - $this->normalizer = $normalizer instanceof \Closure ? $normalizer : \Closure::fromCallable($normalizer); + $this->normalizer = $normalizer; return $this; } @@ -255,8 +269,10 @@ public function setNormalizer(callable $normalizer): static * Gets the normalizer for the response. * * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. + * + * @return callable|null */ - public function getNormalizer(): ?callable + public function getNormalizer() { return $this->normalizer; } @@ -274,7 +290,7 @@ public function isTrimmable(): bool /** * @return $this */ - public function setTrimmable(bool $trimmable): static + public function setTrimmable(bool $trimmable): self { $this->trimmable = $trimmable; diff --git a/core/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/core/vendor/symfony/console/SignalRegistry/SignalRegistry.php index 15978febc3..ed93dd062f 100644 --- a/core/vendor/symfony/console/SignalRegistry/SignalRegistry.php +++ b/core/vendor/symfony/console/SignalRegistry/SignalRegistry.php @@ -13,7 +13,7 @@ final class SignalRegistry { - private array $signalHandlers = []; + private $signalHandlers = []; public function __construct() { diff --git a/core/vendor/symfony/console/SingleCommandApplication.php b/core/vendor/symfony/console/SingleCommandApplication.php index 4f0b5ba3cc..e93c1821b8 100644 --- a/core/vendor/symfony/console/SingleCommandApplication.php +++ b/core/vendor/symfony/console/SingleCommandApplication.php @@ -20,14 +20,14 @@ */ class SingleCommandApplication extends Command { - private string $version = 'UNKNOWN'; - private bool $autoExit = true; - private bool $running = false; + private $version = 'UNKNOWN'; + private $autoExit = true; + private $running = false; /** * @return $this */ - public function setVersion(string $version): static + public function setVersion(string $version): self { $this->version = $version; @@ -39,7 +39,7 @@ public function setVersion(string $version): static * * @return $this */ - public function setAutoExit(bool $autoExit): static + public function setAutoExit(bool $autoExit): self { $this->autoExit = $autoExit; diff --git a/core/vendor/symfony/console/Style/OutputStyle.php b/core/vendor/symfony/console/Style/OutputStyle.php index 0b2ded36c4..67a98ff073 100644 --- a/core/vendor/symfony/console/Style/OutputStyle.php +++ b/core/vendor/symfony/console/Style/OutputStyle.php @@ -38,7 +38,10 @@ public function newLine(int $count = 1) $this->output->write(str_repeat(\PHP_EOL, $count)); } - public function createProgressBar(int $max = 0): ProgressBar + /** + * @return ProgressBar + */ + public function createProgressBar(int $max = 0) { return new ProgressBar($this->output, $max); } @@ -46,7 +49,7 @@ public function createProgressBar(int $max = 0): ProgressBar /** * {@inheritdoc} */ - public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) { $this->output->write($messages, $newline, $type); } @@ -54,7 +57,7 @@ public function write(string|iterable $messages, bool $newline = false, int $typ /** * {@inheritdoc} */ - public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) + public function writeln($messages, int $type = self::OUTPUT_NORMAL) { $this->output->writeln($messages, $type); } @@ -70,7 +73,7 @@ public function setVerbosity(int $level) /** * {@inheritdoc} */ - public function getVerbosity(): int + public function getVerbosity() { return $this->output->getVerbosity(); } @@ -86,7 +89,7 @@ public function setDecorated(bool $decorated) /** * {@inheritdoc} */ - public function isDecorated(): bool + public function isDecorated() { return $this->output->isDecorated(); } @@ -102,7 +105,7 @@ public function setFormatter(OutputFormatterInterface $formatter) /** * {@inheritdoc} */ - public function getFormatter(): OutputFormatterInterface + public function getFormatter() { return $this->output->getFormatter(); } @@ -110,7 +113,7 @@ public function getFormatter(): OutputFormatterInterface /** * {@inheritdoc} */ - public function isQuiet(): bool + public function isQuiet() { return $this->output->isQuiet(); } @@ -118,7 +121,7 @@ public function isQuiet(): bool /** * {@inheritdoc} */ - public function isVerbose(): bool + public function isVerbose() { return $this->output->isVerbose(); } @@ -126,7 +129,7 @@ public function isVerbose(): bool /** * {@inheritdoc} */ - public function isVeryVerbose(): bool + public function isVeryVerbose() { return $this->output->isVeryVerbose(); } @@ -134,7 +137,7 @@ public function isVeryVerbose(): bool /** * {@inheritdoc} */ - public function isDebug(): bool + public function isDebug() { return $this->output->isDebug(); } diff --git a/core/vendor/symfony/console/Style/StyleInterface.php b/core/vendor/symfony/console/Style/StyleInterface.php index 0bb1233946..38d23b77eb 100644 --- a/core/vendor/symfony/console/Style/StyleInterface.php +++ b/core/vendor/symfony/console/Style/StyleInterface.php @@ -35,33 +35,45 @@ public function listing(array $elements); /** * Formats informational text. + * + * @param string|array $message */ - public function text(string|array $message); + public function text($message); /** * Formats a success result bar. + * + * @param string|array $message */ - public function success(string|array $message); + public function success($message); /** * Formats an error result bar. + * + * @param string|array $message */ - public function error(string|array $message); + public function error($message); /** * Formats an warning result bar. + * + * @param string|array $message */ - public function warning(string|array $message); + public function warning($message); /** * Formats a note admonition. + * + * @param string|array $message */ - public function note(string|array $message); + public function note($message); /** * Formats a caution admonition. + * + * @param string|array $message */ - public function caution(string|array $message); + public function caution($message); /** * Formats a table. @@ -70,23 +82,33 @@ public function table(array $headers, array $rows); /** * Asks a question. + * + * @return mixed */ - public function ask(string $question, string $default = null, callable $validator = null): mixed; + public function ask(string $question, string $default = null, callable $validator = null); /** * Asks a question with the user input hidden. + * + * @return mixed */ - public function askHidden(string $question, callable $validator = null): mixed; + public function askHidden(string $question, callable $validator = null); /** * Asks for confirmation. + * + * @return bool */ - public function confirm(string $question, bool $default = true): bool; + public function confirm(string $question, bool $default = true); /** * Asks a choice question. + * + * @param string|int|null $default + * + * @return mixed */ - public function choice(string $question, array $choices, mixed $default = null): mixed; + public function choice(string $question, array $choices, $default = null); /** * Add newline(s). diff --git a/core/vendor/symfony/console/Style/SymfonyStyle.php b/core/vendor/symfony/console/Style/SymfonyStyle.php index 56ad30a6f2..bcf30d80cb 100644 --- a/core/vendor/symfony/console/Style/SymfonyStyle.php +++ b/core/vendor/symfony/console/Style/SymfonyStyle.php @@ -42,7 +42,7 @@ class SymfonyStyle extends OutputStyle private $output; private $questionHelper; private $progressBar; - private int $lineLength; + private $lineLength; private $bufferedOutput; public function __construct(InputInterface $input, OutputInterface $output) @@ -58,8 +58,10 @@ public function __construct(InputInterface $input, OutputInterface $output) /** * Formats a message as a block of text. + * + * @param string|array $messages The message to write in the block */ - public function block(string|array $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) + public function block($messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) { $messages = \is_array($messages) ? array_values($messages) : [$messages]; @@ -111,7 +113,7 @@ public function listing(array $elements) /** * {@inheritdoc} */ - public function text(string|array $message) + public function text($message) { $this->autoPrependText(); @@ -123,8 +125,10 @@ public function text(string|array $message) /** * Formats a command comment. + * + * @param string|array $message */ - public function comment(string|array $message) + public function comment($message) { $this->block($message, null, null, '<fg=default;bg=default> // </>', false, false); } @@ -132,7 +136,7 @@ public function comment(string|array $message) /** * {@inheritdoc} */ - public function success(string|array $message) + public function success($message) { $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); } @@ -140,7 +144,7 @@ public function success(string|array $message) /** * {@inheritdoc} */ - public function error(string|array $message) + public function error($message) { $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); } @@ -148,7 +152,7 @@ public function error(string|array $message) /** * {@inheritdoc} */ - public function warning(string|array $message) + public function warning($message) { $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); } @@ -156,15 +160,17 @@ public function warning(string|array $message) /** * {@inheritdoc} */ - public function note(string|array $message) + public function note($message) { $this->block($message, 'NOTE', 'fg=yellow', ' ! '); } /** * Formats an info message. + * + * @param string|array $message */ - public function info(string|array $message) + public function info($message) { $this->block($message, 'INFO', 'fg=green', ' ', true); } @@ -172,7 +178,7 @@ public function info(string|array $message) /** * {@inheritdoc} */ - public function caution(string|array $message) + public function caution($message) { $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); } @@ -213,8 +219,10 @@ public function horizontalTable(array $headers, array $rows) * * 'A title' * * ['key' => 'value'] * * new TableSeparator() + * + * @param string|array|TableSeparator ...$list */ - public function definitionList(string|array|TableSeparator ...$list) + public function definitionList(...$list) { $headers = []; $row = []; @@ -242,7 +250,7 @@ public function definitionList(string|array|TableSeparator ...$list) /** * {@inheritdoc} */ - public function ask(string $question, string $default = null, callable $validator = null): mixed + public function ask(string $question, string $default = null, callable $validator = null) { $question = new Question($question, $default); $question->setValidator($validator); @@ -253,7 +261,7 @@ public function ask(string $question, string $default = null, callable $validato /** * {@inheritdoc} */ - public function askHidden(string $question, callable $validator = null): mixed + public function askHidden(string $question, callable $validator = null) { $question = new Question($question); @@ -266,7 +274,7 @@ public function askHidden(string $question, callable $validator = null): mixed /** * {@inheritdoc} */ - public function confirm(string $question, bool $default = true): bool + public function confirm(string $question, bool $default = true) { return $this->askQuestion(new ConfirmationQuestion($question, $default)); } @@ -274,7 +282,7 @@ public function confirm(string $question, bool $default = true): bool /** * {@inheritdoc} */ - public function choice(string $question, array $choices, mixed $default = null): mixed + public function choice(string $question, array $choices, $default = null) { if (null !== $default) { $values = array_flip($choices); @@ -308,13 +316,13 @@ public function progressFinish() { $this->getProgressBar()->finish(); $this->newLine(2); - unset($this->progressBar); + $this->progressBar = null; } /** * {@inheritdoc} */ - public function createProgressBar(int $max = 0): ProgressBar + public function createProgressBar(int $max = 0) { $progressBar = parent::createProgressBar($max); @@ -337,13 +345,18 @@ public function progressIterate(iterable $iterable, int $max = null): iterable $this->newLine(2); } - public function askQuestion(Question $question): mixed + /** + * @return mixed + */ + public function askQuestion(Question $question) { if ($this->input->isInteractive()) { $this->autoPrependBlock(); } - $this->questionHelper ??= new SymfonyQuestionHelper(); + if (!$this->questionHelper) { + $this->questionHelper = new SymfonyQuestionHelper(); + } $answer = $this->questionHelper->ask($this->input, $this, $question); @@ -358,7 +371,7 @@ public function askQuestion(Question $question): mixed /** * {@inheritdoc} */ - public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) + public function writeln($messages, int $type = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { $messages = [$messages]; @@ -373,7 +386,7 @@ public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORM /** * {@inheritdoc} */ - public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { $messages = [$messages]; @@ -396,8 +409,10 @@ public function newLine(int $count = 1) /** * Returns a new instance which makes use of stderr if available. + * + * @return self */ - public function getErrorStyle(): self + public function getErrorStyle() { return new self($this->input, $this->getErrorOutput()); } @@ -413,8 +428,11 @@ public function createTable(): Table private function getProgressBar(): ProgressBar { - return $this->progressBar - ?? throw new RuntimeException('The ProgressBar is not started.'); + if (!$this->progressBar) { + throw new RuntimeException('The ProgressBar is not started.'); + } + + return $this->progressBar; } private function autoPrependBlock(): void diff --git a/core/vendor/symfony/console/Terminal.php b/core/vendor/symfony/console/Terminal.php index 80020c95da..08c53535b1 100644 --- a/core/vendor/symfony/console/Terminal.php +++ b/core/vendor/symfony/console/Terminal.php @@ -13,14 +13,16 @@ class Terminal { - private static ?int $width = null; - private static ?int $height = null; - private static ?bool $stty = null; + private static $width; + private static $height; + private static $stty; /** * Gets the terminal width. + * + * @return int */ - public function getWidth(): int + public function getWidth() { $width = getenv('COLUMNS'); if (false !== $width) { @@ -36,8 +38,10 @@ public function getWidth(): int /** * Gets the terminal height. + * + * @return int */ - public function getHeight(): int + public function getHeight() { $height = getenv('LINES'); if (false !== $height) { diff --git a/core/vendor/symfony/console/Tester/ApplicationTester.php b/core/vendor/symfony/console/Tester/ApplicationTester.php index 0404020c61..19a95c8e49 100644 --- a/core/vendor/symfony/console/Tester/ApplicationTester.php +++ b/core/vendor/symfony/console/Tester/ApplicationTester.php @@ -47,7 +47,7 @@ public function __construct(Application $application) * * @return int The command exit code */ - public function run(array $input, array $options = []): int + public function run(array $input, array $options = []) { $this->input = new ArrayInput($input); if (isset($options['interactive'])) { diff --git a/core/vendor/symfony/console/Tester/CommandTester.php b/core/vendor/symfony/console/Tester/CommandTester.php index f6ee4b7309..6c15c25fbb 100644 --- a/core/vendor/symfony/console/Tester/CommandTester.php +++ b/core/vendor/symfony/console/Tester/CommandTester.php @@ -46,7 +46,7 @@ public function __construct(Command $command) * * @return int The command exit code */ - public function execute(array $input, array $options = []): int + public function execute(array $input, array $options = []) { // set the command name automatically if the application requires // this argument and no command name was passed diff --git a/core/vendor/symfony/console/Tester/TesterTrait.php b/core/vendor/symfony/console/Tester/TesterTrait.php index b238f958be..40bc581771 100644 --- a/core/vendor/symfony/console/Tester/TesterTrait.php +++ b/core/vendor/symfony/console/Tester/TesterTrait.php @@ -23,20 +23,25 @@ */ trait TesterTrait { + /** @var StreamOutput */ private $output; - private array $inputs = []; - private bool $captureStreamsIndependently = false; + private $inputs = []; + private $captureStreamsIndependently = false; + /** @var InputInterface */ private $input; - private int $statusCode; + /** @var int */ + private $statusCode; /** * Gets the display returned by the last execution of the command or application. * * @throws \RuntimeException If it's called before the execute method + * + * @return string */ - public function getDisplay(bool $normalize = false): string + public function getDisplay(bool $normalize = false) { - if (!isset($this->output)) { + if (null === $this->output) { throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); } @@ -55,8 +60,10 @@ public function getDisplay(bool $normalize = false): string * Gets the output written to STDERR by the application. * * @param bool $normalize Whether to normalize end of lines to \n or not + * + * @return string */ - public function getErrorOutput(bool $normalize = false): string + public function getErrorOutput(bool $normalize = false) { if (!$this->captureStreamsIndependently) { throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); @@ -75,16 +82,20 @@ public function getErrorOutput(bool $normalize = false): string /** * Gets the input instance used by the last execution of the command or application. + * + * @return InputInterface */ - public function getInput(): InputInterface + public function getInput() { return $this->input; } /** * Gets the output instance used by the last execution of the command or application. + * + * @return OutputInterface */ - public function getOutput(): OutputInterface + public function getOutput() { return $this->output; } @@ -93,10 +104,16 @@ public function getOutput(): OutputInterface * Gets the status code returned by the last execution of the command or application. * * @throws \RuntimeException If it's called before the execute method + * + * @return int */ - public function getStatusCode(): int + public function getStatusCode() { - return $this->statusCode ?? throw new \RuntimeException('Status code not initialized, did you execute the command before requesting the status code?'); + if (null === $this->statusCode) { + throw new \RuntimeException('Status code not initialized, did you execute the command before requesting the status code?'); + } + + return $this->statusCode; } public function assertCommandIsSuccessful(string $message = ''): void @@ -112,7 +129,7 @@ public function assertCommandIsSuccessful(string $message = ''): void * * @return $this */ - public function setInputs(array $inputs): static + public function setInputs(array $inputs) { $this->inputs = $inputs; diff --git a/core/vendor/symfony/console/composer.json b/core/vendor/symfony/console/composer.json index 7d3947fcc7..9a565068cd 100644 --- a/core/vendor/symfony/console/composer.json +++ b/core/vendor/symfony/console/composer.json @@ -16,22 +16,25 @@ } ], "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/string": "^5.1|^6.0" }, "require-dev": { - "symfony/config": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0", - "psr/log": "^1|^2|^3" + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^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", + "psr/log": "^1|^2" }, "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "psr/log-implementation": "1.0|2.0" }, "suggest": { "symfony/event-dispatcher": "", @@ -40,11 +43,12 @@ "psr/log": "For using the console logger" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" }, diff --git a/core/vendor/symfony/finder/CHANGELOG.md b/core/vendor/symfony/finder/CHANGELOG.md index 9e2fc5a5e3..6a44e87c2e 100644 --- a/core/vendor/symfony/finder/CHANGELOG.md +++ b/core/vendor/symfony/finder/CHANGELOG.md @@ -1,11 +1,6 @@ CHANGELOG ========= -6.0 ---- - - * Remove `Comparator::setTarget()` and `Comparator::setOperator()` - 5.4.0 ----- diff --git a/core/vendor/symfony/finder/Comparator/Comparator.php b/core/vendor/symfony/finder/Comparator/Comparator.php index f1ba97d3de..3af551f4cc 100644 --- a/core/vendor/symfony/finder/Comparator/Comparator.php +++ b/core/vendor/symfony/finder/Comparator/Comparator.php @@ -16,40 +16,80 @@ */ class Comparator { - private string $target; - private string $operator; + private $target; + private $operator = '=='; - public function __construct(string $target, string $operator = '==') + public function __construct(string $target = null, string $operator = '==') { - if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); + if (null === $target) { + trigger_deprecation('symfony/finder', '5.4', 'Constructing a "%s" without setting "$target" is deprecated.', __CLASS__); } $this->target = $target; - $this->operator = $operator; + $this->doSetOperator($operator); } /** * Gets the target value. + * + * @return string */ - public function getTarget(): string + public function getTarget() { + if (null === $this->target) { + trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); + } + return $this->target; } + /** + * @deprecated set the target via the constructor instead + */ + public function setTarget(string $target) + { + trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the target via the constructor instead.', __METHOD__); + + $this->target = $target; + } + /** * Gets the comparison operator. + * + * @return string */ - public function getOperator(): string + public function getOperator() { return $this->operator; } + /** + * Sets the comparison operator. + * + * @throws \InvalidArgumentException + * + * @deprecated set the operator via the constructor instead + */ + public function setOperator(string $operator) + { + trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the operator via the constructor instead.', __METHOD__); + + $this->doSetOperator('' === $operator ? '==' : $operator); + } + /** * Tests against the target. + * + * @param mixed $test A test value + * + * @return bool */ - public function test(mixed $test): bool + public function test($test) { + if (null === $this->target) { + trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); + } + switch ($this->operator) { case '>': return $test > $this->target; @@ -65,4 +105,13 @@ public function test(mixed $test): bool return $test == $this->target; } + + private function doSetOperator(string $operator): void + { + if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { + throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); + } + + $this->operator = $operator; + } } diff --git a/core/vendor/symfony/finder/Finder.php b/core/vendor/symfony/finder/Finder.php index e5772c459f..8cc564cd67 100644 --- a/core/vendor/symfony/finder/Finder.php +++ b/core/vendor/symfony/finder/Finder.php @@ -45,27 +45,27 @@ class Finder implements \IteratorAggregate, \Countable public const IGNORE_DOT_FILES = 2; public const IGNORE_VCS_IGNORED_FILES = 4; - private int $mode = 0; - private array $names = []; - private array $notNames = []; - private array $exclude = []; - private array $filters = []; - private array $depths = []; - private array $sizes = []; - private bool $followLinks = false; - private bool $reverseSorting = false; - private \Closure|int|false $sort = false; - private int $ignore = 0; - private array $dirs = []; - private array $dates = []; - private array $iterators = []; - private array $contains = []; - private array $notContains = []; - private array $paths = []; - private array $notPaths = []; - private bool $ignoreUnreadableDirs = false; - - private static array $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; + private $mode = 0; + private $names = []; + private $notNames = []; + private $exclude = []; + private $filters = []; + private $depths = []; + private $sizes = []; + private $followLinks = false; + private $reverseSorting = false; + private $sort = false; + private $ignore = 0; + private $dirs = []; + private $dates = []; + private $iterators = []; + private $contains = []; + private $notContains = []; + private $paths = []; + private $notPaths = []; + private $ignoreUnreadableDirs = false; + + private static $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; public function __construct() { @@ -74,8 +74,10 @@ public function __construct() /** * Creates a new Finder. + * + * @return static */ - public static function create(): static + public static function create() { return new static(); } @@ -85,7 +87,7 @@ public static function create(): static * * @return $this */ - public function directories(): static + public function directories() { $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; @@ -97,7 +99,7 @@ public function directories(): static * * @return $this */ - public function files(): static + public function files() { $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; @@ -120,7 +122,7 @@ public function files(): static * @see DepthRangeFilterIterator * @see NumberComparator */ - public function depth(string|int|array $levels): static + public function depth($levels) { foreach ((array) $levels as $level) { $this->depths[] = new Comparator\NumberComparator($level); @@ -148,7 +150,7 @@ public function depth(string|int|array $levels): static * @see DateRangeFilterIterator * @see DateComparator */ - public function date(string|array $dates): static + public function date($dates) { foreach ((array) $dates as $date) { $this->dates[] = new Comparator\DateComparator($date); @@ -173,7 +175,7 @@ public function date(string|array $dates): static * * @see FilenameFilterIterator */ - public function name(string|array $patterns): static + public function name($patterns) { $this->names = array_merge($this->names, (array) $patterns); @@ -189,7 +191,7 @@ public function name(string|array $patterns): static * * @see FilenameFilterIterator */ - public function notName(string|array $patterns): static + public function notName($patterns) { $this->notNames = array_merge($this->notNames, (array) $patterns); @@ -211,7 +213,7 @@ public function notName(string|array $patterns): static * * @see FilecontentFilterIterator */ - public function contains(string|array $patterns): static + public function contains($patterns) { $this->contains = array_merge($this->contains, (array) $patterns); @@ -233,7 +235,7 @@ public function contains(string|array $patterns): static * * @see FilecontentFilterIterator */ - public function notContains(string|array $patterns): static + public function notContains($patterns) { $this->notContains = array_merge($this->notContains, (array) $patterns); @@ -257,7 +259,7 @@ public function notContains(string|array $patterns): static * * @see FilenameFilterIterator */ - public function path(string|array $patterns): static + public function path($patterns) { $this->paths = array_merge($this->paths, (array) $patterns); @@ -281,7 +283,7 @@ public function path(string|array $patterns): static * * @see FilenameFilterIterator */ - public function notPath(string|array $patterns): static + public function notPath($patterns) { $this->notPaths = array_merge($this->notPaths, (array) $patterns); @@ -303,7 +305,7 @@ public function notPath(string|array $patterns): static * @see SizeRangeFilterIterator * @see NumberComparator */ - public function size(string|int|array $sizes): static + public function size($sizes) { foreach ((array) $sizes as $size) { $this->sizes[] = new Comparator\NumberComparator($size); @@ -325,7 +327,7 @@ public function size(string|int|array $sizes): static * * @see ExcludeDirectoryFilterIterator */ - public function exclude(string|array $dirs): static + public function exclude($dirs) { $this->exclude = array_merge($this->exclude, (array) $dirs); @@ -341,7 +343,7 @@ public function exclude(string|array $dirs): static * * @see ExcludeDirectoryFilterIterator */ - public function ignoreDotFiles(bool $ignoreDotFiles): static + public function ignoreDotFiles(bool $ignoreDotFiles) { if ($ignoreDotFiles) { $this->ignore |= static::IGNORE_DOT_FILES; @@ -361,7 +363,7 @@ public function ignoreDotFiles(bool $ignoreDotFiles): static * * @see ExcludeDirectoryFilterIterator */ - public function ignoreVCS(bool $ignoreVCS): static + public function ignoreVCS(bool $ignoreVCS) { if ($ignoreVCS) { $this->ignore |= static::IGNORE_VCS_FILES; @@ -379,7 +381,7 @@ public function ignoreVCS(bool $ignoreVCS): static * * @return $this */ - public function ignoreVCSIgnored(bool $ignoreVCSIgnored): static + public function ignoreVCSIgnored(bool $ignoreVCSIgnored) { if ($ignoreVCSIgnored) { $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; @@ -397,7 +399,7 @@ public function ignoreVCSIgnored(bool $ignoreVCSIgnored): static * * @param string|string[] $pattern VCS patterns to ignore */ - public static function addVCSPattern(string|array $pattern) + public static function addVCSPattern($pattern) { foreach ((array) $pattern as $p) { self::$vcsPatterns[] = $p; @@ -417,7 +419,7 @@ public static function addVCSPattern(string|array $pattern) * * @see SortableIterator */ - public function sort(\Closure $closure): static + public function sort(\Closure $closure) { $this->sort = $closure; @@ -433,7 +435,7 @@ public function sort(\Closure $closure): static * * @see SortableIterator */ - public function sortByName(bool $useNaturalSort = false): static + public function sortByName(bool $useNaturalSort = false) { $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; @@ -449,7 +451,7 @@ public function sortByName(bool $useNaturalSort = false): static * * @see SortableIterator */ - public function sortByType(): static + public function sortByType() { $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; @@ -467,7 +469,7 @@ public function sortByType(): static * * @see SortableIterator */ - public function sortByAccessedTime(): static + public function sortByAccessedTime() { $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; @@ -479,7 +481,7 @@ public function sortByAccessedTime(): static * * @return $this */ - public function reverseSorting(): static + public function reverseSorting() { $this->reverseSorting = true; @@ -499,7 +501,7 @@ public function reverseSorting(): static * * @see SortableIterator */ - public function sortByChangedTime(): static + public function sortByChangedTime() { $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; @@ -517,7 +519,7 @@ public function sortByChangedTime(): static * * @see SortableIterator */ - public function sortByModifiedTime(): static + public function sortByModifiedTime() { $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; @@ -534,7 +536,7 @@ public function sortByModifiedTime(): static * * @see CustomFilterIterator */ - public function filter(\Closure $closure): static + public function filter(\Closure $closure) { $this->filters[] = $closure; @@ -546,7 +548,7 @@ public function filter(\Closure $closure): static * * @return $this */ - public function followLinks(): static + public function followLinks() { $this->followLinks = true; @@ -560,7 +562,7 @@ public function followLinks(): static * * @return $this */ - public function ignoreUnreadableDirs(bool $ignore = true): static + public function ignoreUnreadableDirs(bool $ignore = true) { $this->ignoreUnreadableDirs = $ignore; @@ -576,7 +578,7 @@ public function ignoreUnreadableDirs(bool $ignore = true): static * * @throws DirectoryNotFoundException if one of the directories does not exist */ - public function in(string|array $dirs): static + public function in($dirs) { $resolvedDirs = []; @@ -605,7 +607,8 @@ public function in(string|array $dirs): static * * @throws \LogicException if the in() method has not been called */ - public function getIterator(): \Iterator + #[\ReturnTypeWillChange] + public function getIterator() { if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); @@ -648,7 +651,7 @@ public function getIterator(): \Iterator * * @throws \InvalidArgumentException when the given argument is not iterable */ - public function append(iterable $iterator): static + public function append(iterable $iterator) { if ($iterator instanceof \IteratorAggregate) { $this->iterators[] = $iterator->getIterator(); @@ -670,8 +673,10 @@ public function append(iterable $iterator): static /** * Check if any results were found. + * + * @return bool */ - public function hasResults(): bool + public function hasResults() { foreach ($this->getIterator() as $_) { return true; @@ -682,8 +687,11 @@ public function hasResults(): bool /** * Counts all the results collected by the iterators. + * + * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return iterator_count($this->getIterator()); } diff --git a/core/vendor/symfony/finder/Glob.php b/core/vendor/symfony/finder/Glob.php index 7fe8b1a86c..8447932e57 100644 --- a/core/vendor/symfony/finder/Glob.php +++ b/core/vendor/symfony/finder/Glob.php @@ -37,8 +37,10 @@ class Glob { /** * Returns a regexp which is the equivalent of the glob pattern. + * + * @return string */ - public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#'): string + public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#') { $firstByte = true; $escaping = false; diff --git a/core/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/core/vendor/symfony/finder/Iterator/CustomFilterIterator.php index 82ee81d8c0..f7bf19b876 100644 --- a/core/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/CustomFilterIterator.php @@ -23,7 +23,7 @@ */ class CustomFilterIterator extends \FilterIterator { - private array $filters = []; + private $filters = []; /** * @param \Iterator<string, \SplFileInfo> $iterator The Iterator to filter @@ -45,8 +45,11 @@ public function __construct(\Iterator $iterator, array $filters) /** * Filters the iterator values. + * + * @return bool */ - public function accept(): bool + #[\ReturnTypeWillChange] + public function accept() { $fileinfo = $this->current(); diff --git a/core/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/core/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php index 718d42b162..f592e1913b 100644 --- a/core/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php @@ -22,7 +22,7 @@ */ class DateRangeFilterIterator extends \FilterIterator { - private array $comparators = []; + private $comparators = []; /** * @param \Iterator<string, \SplFileInfo> $iterator @@ -37,8 +37,11 @@ public function __construct(\Iterator $iterator, array $comparators) /** * Filters the iterator values. + * + * @return bool */ - public function accept(): bool + #[\ReturnTypeWillChange] + public function accept() { $fileinfo = $this->current(); diff --git a/core/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/core/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php index 1cddb5fa8c..f593a3f082 100644 --- a/core/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php @@ -23,7 +23,7 @@ */ class DepthRangeFilterIterator extends \FilterIterator { - private int $minDepth = 0; + private $minDepth = 0; /** * @param \RecursiveIteratorIterator<\RecursiveIterator<TKey, TValue>> $iterator The Iterator to filter @@ -40,8 +40,11 @@ public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth /** * Filters the iterator values. + * + * @return bool */ - public function accept(): bool + #[\ReturnTypeWillChange] + public function accept() { return $this->getInnerIterator()->getDepth() >= $this->minDepth; } diff --git a/core/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/core/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php index 467bc19524..d9e182c17a 100644 --- a/core/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php @@ -21,10 +21,10 @@ */ class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator { - private \Iterator $iterator; - private bool $isRecursive; - private array $excludedDirs = []; - private ?string $excludedPattern = null; + private $iterator; + private $isRecursive; + private $excludedDirs = []; + private $excludedPattern; /** * @param \Iterator $iterator The Iterator to filter @@ -52,8 +52,11 @@ public function __construct(\Iterator $iterator, array $directories) /** * Filters the iterator values. + * + * @return bool */ - public function accept(): bool + #[\ReturnTypeWillChange] + public function accept() { if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { return false; @@ -69,12 +72,20 @@ public function accept(): bool return true; } - public function hasChildren(): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function hasChildren() { return $this->isRecursive && $this->iterator->hasChildren(); } - public function getChildren(): self + /** + * @return self + */ + #[\ReturnTypeWillChange] + public function getChildren() { $children = new self($this->iterator->getChildren(), []); $children->excludedDirs = $this->excludedDirs; diff --git a/core/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/core/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php index 2ed48fbada..793ae3509a 100644 --- a/core/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php @@ -23,7 +23,7 @@ class FileTypeFilterIterator extends \FilterIterator public const ONLY_FILES = 1; public const ONLY_DIRECTORIES = 2; - private int $mode; + private $mode; /** * @param \Iterator $iterator The Iterator to filter @@ -38,8 +38,11 @@ public function __construct(\Iterator $iterator, int $mode) /** * Filters the iterator values. + * + * @return bool */ - public function accept(): bool + #[\ReturnTypeWillChange] + public function accept() { $fileinfo = $this->current(); if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { diff --git a/core/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/core/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php index eaa7a5d40b..79f8c29d3f 100644 --- a/core/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php @@ -23,8 +23,11 @@ class FilecontentFilterIterator extends MultiplePcreFilterIterator { /** * Filters the iterator values. + * + * @return bool */ - public function accept(): bool + #[\ReturnTypeWillChange] + public function accept() { if (!$this->matchRegexps && !$this->noMatchRegexps) { return true; @@ -48,8 +51,10 @@ public function accept(): bool * Converts string to regexp if necessary. * * @param string $str Pattern: string or regexp + * + * @return string */ - protected function toRegex(string $str): string + protected function toRegex(string $str) { return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; } diff --git a/core/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/core/vendor/symfony/finder/Iterator/FilenameFilterIterator.php index 05d9535811..77b3b24193 100644 --- a/core/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/FilenameFilterIterator.php @@ -24,8 +24,11 @@ class FilenameFilterIterator extends MultiplePcreFilterIterator { /** * Filters the iterator values. + * + * @return bool */ - public function accept(): bool + #[\ReturnTypeWillChange] + public function accept() { return $this->isAccepted($this->current()->getFilename()); } @@ -37,8 +40,10 @@ public function accept(): bool * Glob strings are transformed with Glob::toRegex(). * * @param string $str Pattern: glob or regexp + * + * @return string */ - protected function toRegex(string $str): string + protected function toRegex(string $str) { return $this->isRegex($str) ? $str : Glob::toRegex($str); } diff --git a/core/vendor/symfony/finder/Iterator/LazyIterator.php b/core/vendor/symfony/finder/Iterator/LazyIterator.php index 71c4be8c50..32cc37ff14 100644 --- a/core/vendor/symfony/finder/Iterator/LazyIterator.php +++ b/core/vendor/symfony/finder/Iterator/LazyIterator.php @@ -18,11 +18,11 @@ */ class LazyIterator implements \IteratorAggregate { - private \Closure $iteratorFactory; + private $iteratorFactory; public function __construct(callable $iteratorFactory) { - $this->iteratorFactory = $iteratorFactory instanceof \Closure ? $iteratorFactory : \Closure::fromCallable($iteratorFactory); + $this->iteratorFactory = $iteratorFactory; } public function getIterator(): \Traversable diff --git a/core/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/core/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php index faa7271109..990517243d 100644 --- a/core/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php @@ -50,8 +50,10 @@ public function __construct(\Iterator $iterator, array $matchPatterns, array $no * If there is no regexps defined in the class, this method will accept the string. * Such case can be handled by child classes before calling the method if they want to * apply a different behavior. + * + * @return bool */ - protected function isAccepted(string $string): bool + protected function isAccepted(string $string) { // should at least not match one rule to exclude foreach ($this->noMatchRegexps as $regex) { @@ -77,8 +79,10 @@ protected function isAccepted(string $string): bool /** * Checks whether the string is a regex. + * + * @return bool */ - protected function isRegex(string $str): bool + protected function isRegex(string $str) { if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) { $start = substr($m[1], 0, 1); @@ -100,6 +104,8 @@ protected function isRegex(string $str): bool /** * Converts string into regexp. + * + * @return string */ - abstract protected function toRegex(string $str): string; + abstract protected function toRegex(string $str); } diff --git a/core/vendor/symfony/finder/Iterator/PathFilterIterator.php b/core/vendor/symfony/finder/Iterator/PathFilterIterator.php index bfe402a92e..7974c4ee31 100644 --- a/core/vendor/symfony/finder/Iterator/PathFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/PathFilterIterator.php @@ -23,8 +23,11 @@ class PathFilterIterator extends MultiplePcreFilterIterator { /** * Filters the iterator values. + * + * @return bool */ - public function accept(): bool + #[\ReturnTypeWillChange] + public function accept() { $filename = $this->current()->getRelativePathname(); @@ -46,8 +49,10 @@ public function accept(): bool * Use only / as directory separator (on Windows also). * * @param string $str Pattern: regexp or dirname + * + * @return string */ - protected function toRegex(string $str): string + protected function toRegex(string $str) { return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; } diff --git a/core/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/core/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php index 4c9779fdb4..27589cdd5f 100644 --- a/core/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ b/core/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php @@ -21,13 +21,20 @@ */ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator { - private bool $ignoreUnreadableDirs; - private ?bool $rewindable = null; + /** + * @var bool + */ + private $ignoreUnreadableDirs; + + /** + * @var bool + */ + private $rewindable; // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private string $rootPath; - private string $subPath; - private string $directorySeparator = '/'; + private $rootPath; + private $subPath; + private $directorySeparator = '/'; /** * @throws \RuntimeException @@ -48,15 +55,17 @@ public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs /** * Return an instance of SplFileInfo with support for relative paths. + * + * @return SplFileInfo */ - public function current(): SplFileInfo + #[\ReturnTypeWillChange] + public function current() { // the logic here avoids redoing the same work in all iterations - if (!isset($this->subPath)) { - $this->subPath = $this->getSubPath(); + if (null === $subPathname = $this->subPath) { + $subPathname = $this->subPath = $this->getSubPath(); } - $subPathname = $this->subPath; if ('' !== $subPathname) { $subPathname .= $this->directorySeparator; } @@ -69,7 +78,13 @@ public function current(): SplFileInfo return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); } - public function hasChildren(bool $allowLinks = false): bool + /** + * @param bool $allowLinks + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function hasChildren($allowLinks = false) { $hasChildren = parent::hasChildren($allowLinks); @@ -88,9 +103,12 @@ public function hasChildren(bool $allowLinks = false): bool } /** + * @return \RecursiveDirectoryIterator + * * @throws AccessDeniedException */ - public function getChildren(): \RecursiveDirectoryIterator + #[\ReturnTypeWillChange] + public function getChildren() { try { $children = parent::getChildren(); @@ -112,8 +130,11 @@ public function getChildren(): \RecursiveDirectoryIterator /** * Do nothing for non rewindable stream. + * + * @return void */ - public function rewind(): void + #[\ReturnTypeWillChange] + public function rewind() { if (false === $this->isRewindable()) { return; @@ -124,8 +145,10 @@ public function rewind(): void /** * Checks if the stream is rewindable. + * + * @return bool */ - public function isRewindable(): bool + public function isRewindable() { if (null !== $this->rewindable) { return $this->rewindable; diff --git a/core/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/core/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php index 925830a2e9..575bf29b7e 100644 --- a/core/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php @@ -22,7 +22,7 @@ */ class SizeRangeFilterIterator extends \FilterIterator { - private array $comparators = []; + private $comparators = []; /** * @param \Iterator<string, \SplFileInfo> $iterator @@ -37,8 +37,11 @@ public function __construct(\Iterator $iterator, array $comparators) /** * Filters the iterator values. + * + * @return bool */ - public function accept(): bool + #[\ReturnTypeWillChange] + public function accept() { $fileinfo = $this->current(); if (!$fileinfo->isFile()) { diff --git a/core/vendor/symfony/finder/Iterator/SortableIterator.php b/core/vendor/symfony/finder/Iterator/SortableIterator.php index b6c34b67c1..9afde5c250 100644 --- a/core/vendor/symfony/finder/Iterator/SortableIterator.php +++ b/core/vendor/symfony/finder/Iterator/SortableIterator.php @@ -28,8 +28,8 @@ class SortableIterator implements \IteratorAggregate public const SORT_BY_MODIFIED_TIME = 5; public const SORT_BY_NAME_NATURAL = 6; - private \Traversable $iterator; - private \Closure|int $sort; + private $iterator; + private $sort; /** * @param \Traversable<string, \SplFileInfo> $iterator @@ -37,7 +37,7 @@ class SortableIterator implements \IteratorAggregate * * @throws \InvalidArgumentException */ - public function __construct(\Traversable $iterator, int|callable $sort, bool $reverseOrder = false) + public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false) { $this->iterator = $iterator; $order = $reverseOrder ? -1 : 1; @@ -75,13 +75,17 @@ public function __construct(\Traversable $iterator, int|callable $sort, bool $re } elseif (self::SORT_BY_NONE === $sort) { $this->sort = $order; } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : \Closure::fromCallable($sort); + $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort; } else { throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); } } - public function getIterator(): \Traversable + /** + * @return \Traversable<string, \SplFileInfo> + */ + #[\ReturnTypeWillChange] + public function getIterator() { if (1 === $this->sort) { return $this->iterator; diff --git a/core/vendor/symfony/finder/SplFileInfo.php b/core/vendor/symfony/finder/SplFileInfo.php index 867e8e81a2..11604a2efa 100644 --- a/core/vendor/symfony/finder/SplFileInfo.php +++ b/core/vendor/symfony/finder/SplFileInfo.php @@ -18,8 +18,8 @@ */ class SplFileInfo extends \SplFileInfo { - private string $relativePath; - private string $relativePathname; + private $relativePath; + private $relativePathname; /** * @param string $file The file name @@ -37,8 +37,10 @@ public function __construct(string $file, string $relativePath, string $relative * Returns the relative path. * * This path does not contain the file name. + * + * @return string */ - public function getRelativePath(): string + public function getRelativePath() { return $this->relativePath; } @@ -47,8 +49,10 @@ public function getRelativePath(): string * Returns the relative path name. * * This path contains the file name. + * + * @return string */ - public function getRelativePathname(): string + public function getRelativePathname() { return $this->relativePathname; } @@ -63,9 +67,11 @@ public function getFilenameWithoutExtension(): string /** * Returns the contents of the file. * + * @return string + * * @throws \RuntimeException */ - public function getContents(): string + public function getContents() { set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); try { diff --git a/core/vendor/symfony/finder/composer.json b/core/vendor/symfony/finder/composer.json index 2e4b324544..ef19911da1 100644 --- a/core/vendor/symfony/finder/composer.json +++ b/core/vendor/symfony/finder/composer.json @@ -16,7 +16,9 @@ } ], "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" }, diff --git a/core/vendor/symfony/http-foundation/AcceptHeader.php b/core/vendor/symfony/http-foundation/AcceptHeader.php index b15ba61d49..057c6b530c 100644 --- a/core/vendor/symfony/http-foundation/AcceptHeader.php +++ b/core/vendor/symfony/http-foundation/AcceptHeader.php @@ -27,9 +27,12 @@ class AcceptHeader /** * @var AcceptHeaderItem[] */ - private array $items = []; + private $items = []; - private bool $sorted = true; + /** + * @var bool + */ + private $sorted = true; /** * @param AcceptHeaderItem[] $items @@ -43,8 +46,10 @@ public function __construct(array $items) /** * Builds an AcceptHeader instance from a string. + * + * @return self */ - public static function fromString(?string $headerValue): self + public static function fromString(?string $headerValue) { $index = 0; @@ -63,24 +68,30 @@ public static function fromString(?string $headerValue): self /** * Returns header value's string representation. + * + * @return string */ - public function __toString(): string + public function __toString() { return implode(',', $this->items); } /** * Tests if header has given value. + * + * @return bool */ - public function has(string $value): bool + public function has(string $value) { return isset($this->items[$value]); } /** * Returns given value's item, if exists. + * + * @return AcceptHeaderItem|null */ - public function get(string $value): ?AcceptHeaderItem + public function get(string $value) { return $this->items[$value] ?? $this->items[explode('/', $value)[0].'/*'] ?? $this->items['*/*'] ?? $this->items['*'] ?? null; } @@ -90,7 +101,7 @@ public function get(string $value): ?AcceptHeaderItem * * @return $this */ - public function add(AcceptHeaderItem $item): static + public function add(AcceptHeaderItem $item) { $this->items[$item->getValue()] = $item; $this->sorted = false; @@ -103,7 +114,7 @@ public function add(AcceptHeaderItem $item): static * * @return AcceptHeaderItem[] */ - public function all(): array + public function all() { $this->sort(); @@ -112,8 +123,10 @@ public function all(): array /** * Filters items on their value using given regex. + * + * @return self */ - public function filter(string $pattern): self + public function filter(string $pattern) { return new self(array_filter($this->items, function (AcceptHeaderItem $item) use ($pattern) { return preg_match($pattern, $item->getValue()); @@ -122,8 +135,10 @@ public function filter(string $pattern): self /** * Returns first item. + * + * @return AcceptHeaderItem|null */ - public function first(): ?AcceptHeaderItem + public function first() { $this->sort(); diff --git a/core/vendor/symfony/http-foundation/AcceptHeaderItem.php b/core/vendor/symfony/http-foundation/AcceptHeaderItem.php index 35ecd4ea2b..8b86eee672 100644 --- a/core/vendor/symfony/http-foundation/AcceptHeaderItem.php +++ b/core/vendor/symfony/http-foundation/AcceptHeaderItem.php @@ -18,10 +18,10 @@ */ class AcceptHeaderItem { - private string $value; - private float $quality = 1.0; - private int $index = 0; - private array $attributes = []; + private $value; + private $quality = 1.0; + private $index = 0; + private $attributes = []; public function __construct(string $value, array $attributes = []) { @@ -33,8 +33,10 @@ public function __construct(string $value, array $attributes = []) /** * Builds an AcceptHeaderInstance instance from a string. + * + * @return self */ - public static function fromString(?string $itemValue): self + public static function fromString(?string $itemValue) { $parts = HeaderUtils::split($itemValue ?? '', ';='); @@ -46,8 +48,10 @@ public static function fromString(?string $itemValue): self /** * Returns header value's string representation. + * + * @return string */ - public function __toString(): string + public function __toString() { $string = $this->value.($this->quality < 1 ? ';q='.$this->quality : ''); if (\count($this->attributes) > 0) { @@ -62,7 +66,7 @@ public function __toString(): string * * @return $this */ - public function setValue(string $value): static + public function setValue(string $value) { $this->value = $value; @@ -71,8 +75,10 @@ public function setValue(string $value): static /** * Returns the item value. + * + * @return string */ - public function getValue(): string + public function getValue() { return $this->value; } @@ -82,7 +88,7 @@ public function getValue(): string * * @return $this */ - public function setQuality(float $quality): static + public function setQuality(float $quality) { $this->quality = $quality; @@ -91,8 +97,10 @@ public function setQuality(float $quality): static /** * Returns the item quality. + * + * @return float */ - public function getQuality(): float + public function getQuality() { return $this->quality; } @@ -102,7 +110,7 @@ public function getQuality(): float * * @return $this */ - public function setIndex(int $index): static + public function setIndex(int $index) { $this->index = $index; @@ -111,32 +119,42 @@ public function setIndex(int $index): static /** * Returns the item index. + * + * @return int */ - public function getIndex(): int + public function getIndex() { return $this->index; } /** * Tests if an attribute exists. + * + * @return bool */ - public function hasAttribute(string $name): bool + public function hasAttribute(string $name) { return isset($this->attributes[$name]); } /** * Returns an attribute by its name. + * + * @param mixed $default + * + * @return mixed */ - public function getAttribute(string $name, mixed $default = null): mixed + public function getAttribute(string $name, $default = null) { return $this->attributes[$name] ?? $default; } /** * Returns all attributes. + * + * @return array */ - public function getAttributes(): array + public function getAttributes() { return $this->attributes; } @@ -146,7 +164,7 @@ public function getAttributes(): array * * @return $this */ - public function setAttribute(string $name, string $value): static + public function setAttribute(string $name, string $value) { if ('q' === $name) { $this->quality = (float) $value; diff --git a/core/vendor/symfony/http-foundation/BinaryFileResponse.php b/core/vendor/symfony/http-foundation/BinaryFileResponse.php index 8d55c7ff87..4769cab08b 100644 --- a/core/vendor/symfony/http-foundation/BinaryFileResponse.php +++ b/core/vendor/symfony/http-foundation/BinaryFileResponse.php @@ -44,7 +44,7 @@ class BinaryFileResponse extends Response * @param bool $autoEtag Whether the ETag header should be automatically set * @param bool $autoLastModified Whether the Last-Modified header should be automatically set */ - public function __construct(\SplFileInfo|string $file, int $status = 200, array $headers = [], bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) + public function __construct($file, int $status = 200, array $headers = [], bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) { parent::__construct(null, $status, $headers); @@ -55,14 +55,36 @@ public function __construct(\SplFileInfo|string $file, int $status = 200, array } } + /** + * @param \SplFileInfo|string $file The file to stream + * @param int $status The response status code + * @param array $headers An array of response headers + * @param bool $public Files are public by default + * @param string|null $contentDisposition The type of Content-Disposition to set automatically with the filename + * @param bool $autoEtag Whether the ETag header should be automatically set + * @param bool $autoLastModified Whether the Last-Modified header should be automatically set + * + * @return static + * + * @deprecated since Symfony 5.2, use __construct() instead. + */ + public static function create($file = null, int $status = 200, array $headers = [], bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) + { + trigger_deprecation('symfony/http-foundation', '5.2', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, static::class); + + return new static($file, $status, $headers, $public, $contentDisposition, $autoEtag, $autoLastModified); + } + /** * Sets the file to stream. * + * @param \SplFileInfo|string $file The file to stream + * * @return $this * * @throws FileException */ - public function setFile(\SplFileInfo|string $file, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true): static + public function setFile($file, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) { if (!$file instanceof File) { if ($file instanceof \SplFileInfo) { @@ -95,8 +117,10 @@ public function setFile(\SplFileInfo|string $file, string $contentDisposition = /** * Gets the file. + * + * @return File */ - public function getFile(): File + public function getFile() { return $this->file; } @@ -106,7 +130,7 @@ public function getFile(): File * * @return $this */ - public function setAutoLastModified(): static + public function setAutoLastModified() { $this->setLastModified(\DateTime::createFromFormat('U', $this->file->getMTime())); @@ -118,7 +142,7 @@ public function setAutoLastModified(): static * * @return $this */ - public function setAutoEtag(): static + public function setAutoEtag() { $this->setEtag(base64_encode(hash_file('sha256', $this->file->getPathname(), true))); @@ -134,7 +158,7 @@ public function setAutoEtag(): static * * @return $this */ - public function setContentDisposition(string $disposition, string $filename = '', string $filenameFallback = ''): static + public function setContentDisposition(string $disposition, string $filename = '', string $filenameFallback = '') { if ('' === $filename) { $filename = $this->file->getFilename(); @@ -163,7 +187,7 @@ public function setContentDisposition(string $disposition, string $filename = '' /** * {@inheritdoc} */ - public function prepare(Request $request): static + public function prepare(Request $request) { if (!$this->headers->has('Content-Type')) { $this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream'); @@ -269,7 +293,7 @@ private function hasValidIfRangeHeader(?string $header): bool /** * {@inheritdoc} */ - public function sendContent(): static + public function sendContent() { if (!$this->isSuccessful()) { return parent::sendContent(); @@ -299,7 +323,7 @@ public function sendContent(): static * * @throws \LogicException when the content is not null */ - public function setContent(?string $content): static + public function setContent(?string $content) { if (null !== $content) { throw new \LogicException('The content cannot be set on a BinaryFileResponse instance.'); @@ -311,7 +335,7 @@ public function setContent(?string $content): static /** * {@inheritdoc} */ - public function getContent(): string|false + public function getContent() { return false; } @@ -330,7 +354,7 @@ public static function trustXSendfileTypeHeader() * * @return $this */ - public function deleteFileAfterSend(bool $shouldDelete = true): static + public function deleteFileAfterSend(bool $shouldDelete = true) { $this->deleteFileAfterSend = $shouldDelete; diff --git a/core/vendor/symfony/http-foundation/CHANGELOG.md b/core/vendor/symfony/http-foundation/CHANGELOG.md index b528419d38..ad7607add3 100644 --- a/core/vendor/symfony/http-foundation/CHANGELOG.md +++ b/core/vendor/symfony/http-foundation/CHANGELOG.md @@ -1,24 +1,6 @@ CHANGELOG ========= -6.0 ---- - - * Remove the `NamespacedAttributeBag` class - * Removed `Response::create()`, `JsonResponse::create()`, - `RedirectResponse::create()`, `StreamedResponse::create()` and - `BinaryFileResponse::create()` methods (use `__construct()` instead) - * Not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()` throws an `\InvalidArgumentException`; wrap your filter in a closure instead - * Not passing a `Closure` together with `FILTER_CALLBACK` to `InputBag::filter()` throws an `\InvalidArgumentException`; wrap your filter in a closure instead - * Removed the `Request::HEADER_X_FORWARDED_ALL` constant, use either `Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO` or `Request::HEADER_X_FORWARDED_AWS_ELB` or `Request::HEADER_X_FORWARDED_TRAEFIK`constants instead - * Rename `RequestStack::getMasterRequest()` to `getMainRequest()` - * Not passing `FILTER_REQUIRE_ARRAY` or `FILTER_FORCE_ARRAY` flags to `InputBag::filter()` when filtering an array will throw `BadRequestException` - * Removed the `Request::HEADER_X_FORWARDED_ALL` constant - * Retrieving non-scalar values using `InputBag::get()` will throw `BadRequestException` (use `InputBad::all()` instead to retrieve an array) - * Passing non-scalar default value as the second argument `InputBag::get()` will throw `\InvalidArgumentException` - * Passing non-scalar, non-array value as the second argument `InputBag::set()` will throw `\InvalidArgumentException` - * Passing `null` as `$requestIp` to `IpUtils::__checkIp()`, `IpUtils::__checkIp4()` or `IpUtils::__checkIp6()` is not supported anymore. - 5.4 --- diff --git a/core/vendor/symfony/http-foundation/Cookie.php b/core/vendor/symfony/http-foundation/Cookie.php index fb2853046c..b4b26c0151 100644 --- a/core/vendor/symfony/http-foundation/Cookie.php +++ b/core/vendor/symfony/http-foundation/Cookie.php @@ -30,9 +30,9 @@ class Cookie protected $secure; protected $httpOnly; - private bool $raw; - private ?string $sameSite = null; - private bool $secureDefault = false; + private $raw; + private $sameSite; + private $secureDefault = false; private const RESERVED_CHARS_LIST = "=,; \t\r\n\v\f"; private const RESERVED_CHARS_FROM = ['=', ',', ';', ' ', "\t", "\r", "\n", "\v", "\f"]; @@ -40,8 +40,10 @@ class Cookie /** * Creates cookie from raw header string. + * + * @return static */ - public static function fromString(string $cookie, bool $decode = false): static + public static function fromString(string $cookie, bool $decode = false) { $data = [ 'expires' => 0, @@ -69,7 +71,7 @@ public static function fromString(string $cookie, bool $decode = false): static return new static($name, $value, $data['expires'], $data['path'], $data['domain'], $data['secure'], $data['httponly'], $data['raw'], $data['samesite']); } - public static function create(string $name, string $value = null, int|string|\DateTimeInterface $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX): self + public static function create(string $name, string $value = null, $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX): self { return new self($name, $value, $expire, $path, $domain, $secure, $httpOnly, $raw, $sameSite); } @@ -87,7 +89,7 @@ public static function create(string $name, string $value = null, int|string|\Da * * @throws \InvalidArgumentException */ - public function __construct(string $name, string $value = null, int|string|\DateTimeInterface $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = 'lax') + public function __construct(string $name, string $value = null, $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = 'lax') { // from PHP source code if ($raw && false !== strpbrk($name, self::RESERVED_CHARS_LIST)) { @@ -111,8 +113,10 @@ public function __construct(string $name, string $value = null, int|string|\Date /** * Creates a cookie copy with a new value. + * + * @return static */ - public function withValue(?string $value): static + public function withValue(?string $value): self { $cookie = clone $this; $cookie->value = $value; @@ -122,8 +126,10 @@ public function withValue(?string $value): static /** * Creates a cookie copy with a new domain that the cookie is available to. + * + * @return static */ - public function withDomain(?string $domain): static + public function withDomain(?string $domain): self { $cookie = clone $this; $cookie->domain = $domain; @@ -133,8 +139,12 @@ public function withDomain(?string $domain): static /** * Creates a cookie copy with a new time the cookie expires. + * + * @param int|string|\DateTimeInterface $expire + * + * @return static */ - public function withExpires(int|string|\DateTimeInterface $expire = 0): static + public function withExpires($expire = 0): self { $cookie = clone $this; $cookie->expire = self::expiresTimestamp($expire); @@ -144,8 +154,10 @@ public function withExpires(int|string|\DateTimeInterface $expire = 0): static /** * Converts expires formats to a unix timestamp. + * + * @param int|string|\DateTimeInterface $expire */ - private static function expiresTimestamp(int|string|\DateTimeInterface $expire = 0): int + private static function expiresTimestamp($expire = 0): int { // convert expiration time to a Unix timestamp if ($expire instanceof \DateTimeInterface) { @@ -163,8 +175,10 @@ private static function expiresTimestamp(int|string|\DateTimeInterface $expire = /** * Creates a cookie copy with a new path on the server in which the cookie will be available on. + * + * @return static */ - public function withPath(string $path): static + public function withPath(string $path): self { $cookie = clone $this; $cookie->path = '' === $path ? '/' : $path; @@ -174,8 +188,10 @@ public function withPath(string $path): static /** * Creates a cookie copy that only be transmitted over a secure HTTPS connection from the client. + * + * @return static */ - public function withSecure(bool $secure = true): static + public function withSecure(bool $secure = true): self { $cookie = clone $this; $cookie->secure = $secure; @@ -185,8 +201,10 @@ public function withSecure(bool $secure = true): static /** * Creates a cookie copy that be accessible only through the HTTP protocol. + * + * @return static */ - public function withHttpOnly(bool $httpOnly = true): static + public function withHttpOnly(bool $httpOnly = true): self { $cookie = clone $this; $cookie->httpOnly = $httpOnly; @@ -196,8 +214,10 @@ public function withHttpOnly(bool $httpOnly = true): static /** * Creates a cookie copy that uses no url encoding. + * + * @return static */ - public function withRaw(bool $raw = true): static + public function withRaw(bool $raw = true): self { if ($raw && false !== strpbrk($this->name, self::RESERVED_CHARS_LIST)) { throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $this->name)); @@ -211,8 +231,10 @@ public function withRaw(bool $raw = true): static /** * Creates a cookie copy with SameSite attribute. + * + * @return static */ - public function withSameSite(?string $sameSite): static + public function withSameSite(?string $sameSite): self { if ('' === $sameSite) { $sameSite = null; @@ -232,8 +254,10 @@ public function withSameSite(?string $sameSite): static /** * Returns the cookie as a string. + * + * @return string */ - public function __toString(): string + public function __toString() { if ($this->isRaw()) { $str = $this->getName(); @@ -278,40 +302,50 @@ public function __toString(): string /** * Gets the name of the cookie. + * + * @return string */ - public function getName(): string + public function getName() { return $this->name; } /** * Gets the value of the cookie. + * + * @return string|null */ - public function getValue(): ?string + public function getValue() { return $this->value; } /** * Gets the domain that the cookie is available to. + * + * @return string|null */ - public function getDomain(): ?string + public function getDomain() { return $this->domain; } /** * Gets the time the cookie expires. + * + * @return int */ - public function getExpiresTime(): int + public function getExpiresTime() { return $this->expire; } /** * Gets the max-age attribute. + * + * @return int */ - public function getMaxAge(): int + public function getMaxAge() { $maxAge = $this->expire - time(); @@ -320,48 +354,60 @@ public function getMaxAge(): int /** * Gets the path on the server in which the cookie will be available on. + * + * @return string */ - public function getPath(): string + public function getPath() { return $this->path; } /** * Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client. + * + * @return bool */ - public function isSecure(): bool + public function isSecure() { return $this->secure ?? $this->secureDefault; } /** * Checks whether the cookie will be made accessible only through the HTTP protocol. + * + * @return bool */ - public function isHttpOnly(): bool + public function isHttpOnly() { return $this->httpOnly; } /** * Whether this cookie is about to be cleared. + * + * @return bool */ - public function isCleared(): bool + public function isCleared() { return 0 !== $this->expire && $this->expire < time(); } /** * Checks if the cookie value should be sent with no url encoding. + * + * @return bool */ - public function isRaw(): bool + public function isRaw() { return $this->raw; } /** * Gets the SameSite attribute. + * + * @return string|null */ - public function getSameSite(): ?string + public function getSameSite() { return $this->sameSite; } diff --git a/core/vendor/symfony/http-foundation/ExpressionRequestMatcher.php b/core/vendor/symfony/http-foundation/ExpressionRequestMatcher.php index 9dbf2f7437..26bed7d371 100644 --- a/core/vendor/symfony/http-foundation/ExpressionRequestMatcher.php +++ b/core/vendor/symfony/http-foundation/ExpressionRequestMatcher.php @@ -11,7 +11,6 @@ namespace Symfony\Component\HttpFoundation; -use Symfony\Component\ExpressionLanguage\Expression; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; /** @@ -24,15 +23,15 @@ class ExpressionRequestMatcher extends RequestMatcher private $language; private $expression; - public function setExpression(ExpressionLanguage $language, Expression|string $expression) + public function setExpression(ExpressionLanguage $language, $expression) { $this->language = $language; $this->expression = $expression; } - public function matches(Request $request): bool + public function matches(Request $request) { - if (!isset($this->language)) { + if (!$this->language) { throw new \LogicException('Unable to match the request as the expression language is not available.'); } diff --git a/core/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php b/core/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php index 905bd59628..8533f99a8c 100644 --- a/core/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php +++ b/core/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php @@ -13,7 +13,7 @@ class UnexpectedTypeException extends FileException { - public function __construct(mixed $value, string $expectedType) + public function __construct($value, string $expectedType) { parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, get_debug_type($value))); } diff --git a/core/vendor/symfony/http-foundation/File/File.php b/core/vendor/symfony/http-foundation/File/File.php index e8ce4bcf80..d941577d25 100644 --- a/core/vendor/symfony/http-foundation/File/File.php +++ b/core/vendor/symfony/http-foundation/File/File.php @@ -47,10 +47,12 @@ public function __construct(string $path, bool $checkPath = true) * This method uses the mime type as guessed by getMimeType() * to guess the file extension. * + * @return string|null + * * @see MimeTypes * @see getMimeType() */ - public function guessExtension(): ?string + public function guessExtension() { if (!class_exists(MimeTypes::class)) { throw new \LogicException('You cannot guess the extension as the Mime component is not installed. Try running "composer require symfony/mime".'); @@ -66,9 +68,11 @@ public function guessExtension(): ?string * which uses finfo_file() then the "file" system binary, * depending on which of those are available. * + * @return string|null + * * @see MimeTypes */ - public function getMimeType(): ?string + public function getMimeType() { if (!class_exists(MimeTypes::class)) { throw new \LogicException('You cannot guess the mime type as the Mime component is not installed. Try running "composer require symfony/mime".'); @@ -80,9 +84,11 @@ public function getMimeType(): ?string /** * Moves the file to a new location. * + * @return self + * * @throws FileException if the target file could not be created */ - public function move(string $directory, string $name = null): self + public function move(string $directory, string $name = null) { $target = $this->getTargetFile($directory, $name); @@ -112,7 +118,10 @@ public function getContent(): string return $content; } - protected function getTargetFile(string $directory, string $name = null): self + /** + * @return self + */ + protected function getTargetFile(string $directory, string $name = null) { if (!is_dir($directory)) { if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) { @@ -129,8 +138,10 @@ protected function getTargetFile(string $directory, string $name = null): self /** * Returns locale independent base name of the given path. + * + * @return string */ - protected function getName(string $name): string + protected function getName(string $name) { $originalName = str_replace('\\', '/', $name); $pos = strrpos($originalName, '/'); diff --git a/core/vendor/symfony/http-foundation/File/Stream.php b/core/vendor/symfony/http-foundation/File/Stream.php index 2c156b2e4e..cef3e03977 100644 --- a/core/vendor/symfony/http-foundation/File/Stream.php +++ b/core/vendor/symfony/http-foundation/File/Stream.php @@ -18,7 +18,13 @@ */ class Stream extends File { - public function getSize(): int|false + /** + * {@inheritdoc} + * + * @return int|false + */ + #[\ReturnTypeWillChange] + public function getSize() { return false; } diff --git a/core/vendor/symfony/http-foundation/File/UploadedFile.php b/core/vendor/symfony/http-foundation/File/UploadedFile.php index 11dad4a9a3..5cfe8c4c27 100644 --- a/core/vendor/symfony/http-foundation/File/UploadedFile.php +++ b/core/vendor/symfony/http-foundation/File/UploadedFile.php @@ -31,10 +31,10 @@ */ class UploadedFile extends File { - private bool $test; - private string $originalName; - private string $mimeType; - private int $error; + private $test; + private $originalName; + private $mimeType; + private $error; /** * Accepts the information of the uploaded file as provided by the PHP global $_FILES. @@ -75,8 +75,10 @@ public function __construct(string $path, string $originalName, string $mimeType * * It is extracted from the request from which the file has been uploaded. * Then it should not be considered as a safe value. + * + * @return string */ - public function getClientOriginalName(): string + public function getClientOriginalName() { return $this->originalName; } @@ -86,8 +88,10 @@ public function getClientOriginalName(): string * * It is extracted from the original file name that was uploaded. * Then it should not be considered as a safe value. + * + * @return string */ - public function getClientOriginalExtension(): string + public function getClientOriginalExtension() { return pathinfo($this->originalName, \PATHINFO_EXTENSION); } @@ -101,9 +105,11 @@ public function getClientOriginalExtension(): string * For a trusted mime type, use getMimeType() instead (which guesses the mime * type based on the file content). * + * @return string + * * @see getMimeType() */ - public function getClientMimeType(): string + public function getClientMimeType() { return $this->mimeType; } @@ -120,10 +126,12 @@ public function getClientMimeType(): string * For a trusted extension, use guessExtension() instead (which guesses * the extension based on the guessed mime type for the file). * + * @return string|null + * * @see guessExtension() * @see getClientMimeType() */ - public function guessClientExtension(): ?string + public function guessClientExtension() { if (!class_exists(MimeTypes::class)) { throw new \LogicException('You cannot guess the extension as the Mime component is not installed. Try running "composer require symfony/mime".'); @@ -137,16 +145,20 @@ public function guessClientExtension(): ?string * * If the upload was successful, the constant UPLOAD_ERR_OK is returned. * Otherwise one of the other UPLOAD_ERR_XXX constants is returned. + * + * @return int */ - public function getError(): int + public function getError() { return $this->error; } /** * Returns whether the file has been uploaded with HTTP and no error occurred. + * + * @return bool */ - public function isValid(): bool + public function isValid() { $isOk = \UPLOAD_ERR_OK === $this->error; @@ -156,9 +168,11 @@ public function isValid(): bool /** * Moves the file to a new location. * + * @return File + * * @throws FileException if, for any reason, the file could not have been moved */ - public function move(string $directory, string $name = null): File + public function move(string $directory, string $name = null) { if ($this->isValid()) { if ($this->test) { @@ -207,7 +221,7 @@ public function move(string $directory, string $name = null): File * * @return int|float The maximum size of an uploaded file in bytes (returns float if size > PHP_INT_MAX) */ - public static function getMaxFilesize(): int|float + public static function getMaxFilesize() { $sizePostMax = self::parseFilesize(ini_get('post_max_size')); $sizeUploadMax = self::parseFilesize(ini_get('upload_max_filesize')); @@ -215,7 +229,12 @@ public static function getMaxFilesize(): int|float return min($sizePostMax ?: \PHP_INT_MAX, $sizeUploadMax ?: \PHP_INT_MAX); } - private static function parseFilesize(string $size): int|float + /** + * Returns the given size from an ini value in bytes. + * + * @return int|float Returns float if size > PHP_INT_MAX + */ + private static function parseFilesize(string $size) { if ('' === $size) { return 0; @@ -247,8 +266,10 @@ private static function parseFilesize(string $size): int|float /** * Returns an informative upload error message. + * + * @return string */ - public function getErrorMessage(): string + public function getErrorMessage() { static $errors = [ \UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d KiB).', diff --git a/core/vendor/symfony/http-foundation/FileBag.php b/core/vendor/symfony/http-foundation/FileBag.php index fdf514a125..ff5ab7778f 100644 --- a/core/vendor/symfony/http-foundation/FileBag.php +++ b/core/vendor/symfony/http-foundation/FileBag.php @@ -43,7 +43,7 @@ public function replace(array $files = []) /** * {@inheritdoc} */ - public function set(string $key, mixed $value) + public function set(string $key, $value) { if (!\is_array($value) && !$value instanceof UploadedFile) { throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.'); @@ -65,9 +65,11 @@ public function add(array $files = []) /** * Converts uploaded files to UploadedFile instances. * + * @param array|UploadedFile $file A (multi-dimensional) array of uploaded file information + * * @return UploadedFile[]|UploadedFile|null */ - protected function convertFileInformation(array|UploadedFile $file): array|UploadedFile|null + protected function convertFileInformation($file) { if ($file instanceof UploadedFile) { return $file; @@ -104,8 +106,10 @@ protected function convertFileInformation(array|UploadedFile $file): array|Uploa * * It's safe to pass an already converted array, in which case this method * just returns the original array unmodified. + * + * @return array */ - protected function fixPhpFilesArray(array $data): array + protected function fixPhpFilesArray(array $data) { // Remove extra key added by PHP 8.1. unset($data['full_path']); diff --git a/core/vendor/symfony/http-foundation/HeaderBag.php b/core/vendor/symfony/http-foundation/HeaderBag.php index 0883024b3b..4683a68409 100644 --- a/core/vendor/symfony/http-foundation/HeaderBag.php +++ b/core/vendor/symfony/http-foundation/HeaderBag.php @@ -38,8 +38,10 @@ public function __construct(array $headers = []) /** * Returns the headers as a string. + * + * @return string */ - public function __toString(): string + public function __toString() { if (!$headers = $this->all()) { return ''; @@ -65,7 +67,7 @@ public function __toString(): string * * @return array<string, array<int, string|null>>|array<int, string|null> */ - public function all(string $key = null): array + public function all(string $key = null) { if (null !== $key) { return $this->headers[strtr($key, self::UPPER, self::LOWER)] ?? []; @@ -79,7 +81,7 @@ public function all(string $key = null): array * * @return string[] */ - public function keys(): array + public function keys() { return array_keys($this->all()); } @@ -105,8 +107,10 @@ public function add(array $headers) /** * Returns the first header by name or the default one. + * + * @return string|null */ - public function get(string $key, string $default = null): ?string + public function get(string $key, string $default = null) { $headers = $this->all($key); @@ -127,7 +131,7 @@ public function get(string $key, string $default = null): ?string * @param string|string[]|null $values The value or an array of values * @param bool $replace Whether to replace the actual value or not (true by default) */ - public function set(string $key, string|array|null $values, bool $replace = true) + public function set(string $key, $values, bool $replace = true) { $key = strtr($key, self::UPPER, self::LOWER); @@ -154,16 +158,20 @@ public function set(string $key, string|array|null $values, bool $replace = true /** * Returns true if the HTTP header is defined. + * + * @return bool */ - public function has(string $key): bool + public function has(string $key) { return \array_key_exists(strtr($key, self::UPPER, self::LOWER), $this->all()); } /** * Returns true if the given HTTP header contains the given value. + * + * @return bool */ - public function contains(string $key, string $value): bool + public function contains(string $key, string $value) { return \in_array($value, $this->all($key)); } @@ -185,9 +193,11 @@ public function remove(string $key) /** * Returns the HTTP header value converted to a date. * + * @return \DateTimeInterface|null + * * @throws \RuntimeException When the HTTP header is not parseable */ - public function getDate(string $key, \DateTime $default = null): ?\DateTimeInterface + public function getDate(string $key, \DateTime $default = null) { if (null === $value = $this->get($key)) { return $default; @@ -202,8 +212,10 @@ public function getDate(string $key, \DateTime $default = null): ?\DateTimeInter /** * Adds a custom Cache-Control directive. + * + * @param bool|string $value The Cache-Control directive value */ - public function addCacheControlDirective(string $key, bool|string $value = true) + public function addCacheControlDirective(string $key, $value = true) { $this->cacheControl[$key] = $value; @@ -212,16 +224,20 @@ public function addCacheControlDirective(string $key, bool|string $value = true) /** * Returns true if the Cache-Control directive is defined. + * + * @return bool */ - public function hasCacheControlDirective(string $key): bool + public function hasCacheControlDirective(string $key) { return \array_key_exists($key, $this->cacheControl); } /** * Returns a Cache-Control directive value by name. + * + * @return bool|string|null */ - public function getCacheControlDirective(string $key): bool|string|null + public function getCacheControlDirective(string $key) { return $this->cacheControl[$key] ?? null; } @@ -241,15 +257,19 @@ public function removeCacheControlDirective(string $key) * * @return \ArrayIterator<string, list<string|null>> */ - public function getIterator(): \ArrayIterator + #[\ReturnTypeWillChange] + public function getIterator() { return new \ArrayIterator($this->headers); } /** * Returns the number of headers. + * + * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return \count($this->headers); } @@ -263,8 +283,10 @@ protected function getCacheControlHeader() /** * Parses a Cache-Control HTTP header. + * + * @return array */ - protected function parseCacheControl(string $header): array + protected function parseCacheControl(string $header) { $parts = HeaderUtils::split($header, ',='); diff --git a/core/vendor/symfony/http-foundation/InputBag.php b/core/vendor/symfony/http-foundation/InputBag.php index a270831c3e..b36001d8b1 100644 --- a/core/vendor/symfony/http-foundation/InputBag.php +++ b/core/vendor/symfony/http-foundation/InputBag.php @@ -24,17 +24,19 @@ final class InputBag extends ParameterBag * Returns a scalar input value by name. * * @param string|int|float|bool|null $default The default value if the input key does not exist + * + * @return string|int|float|bool|null */ - public function get(string $key, mixed $default = null): string|int|float|bool|null + public function get(string $key, $default = null) { - if (null !== $default && !is_scalar($default) && !$default instanceof \Stringable) { - throw new \InvalidArgumentException(sprintf('Excepted a scalar value as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($default))); + if (null !== $default && !is_scalar($default) && !(\is_object($default) && method_exists($default, '__toString'))) { + trigger_deprecation('symfony/http-foundation', '5.1', 'Passing a non-scalar value as 2nd argument to "%s()" is deprecated, pass a scalar or null instead.', __METHOD__); } $value = parent::get($key, $this); - if (null !== $value && $this !== $value && !is_scalar($value)) { - throw new BadRequestException(sprintf('Input value "%s" contains a non-scalar value.', $key)); + if (null !== $value && $this !== $value && !is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + trigger_deprecation('symfony/http-foundation', '5.1', 'Retrieving a non-string value from "%s()" is deprecated, and will throw a "%s" exception in Symfony 6.0, use "%s::all($key)" instead.', __METHOD__, BadRequestException::class, __CLASS__); } return $this === $value ? $default : $value; @@ -72,10 +74,10 @@ public function add(array $inputs = []) * * @param string|int|float|bool|array|null $value */ - public function set(string $key, mixed $value) + public function set(string $key, $value) { - if (null !== $value && !is_scalar($value) && !\is_array($value) && !$value instanceof \Stringable) { - throw new \InvalidArgumentException(sprintf('Excepted a scalar, or an array as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($value))); + if (null !== $value && !is_scalar($value) && !\is_array($value) && !method_exists($value, '__toString')) { + trigger_deprecation('symfony/http-foundation', '5.1', 'Passing "%s" as a 2nd Argument to "%s()" is deprecated, pass a scalar, array, or null instead.', get_debug_type($value), __METHOD__); } $this->parameters[$key] = $value; @@ -84,7 +86,7 @@ public function set(string $key, mixed $value) /** * {@inheritdoc} */ - public function filter(string $key, mixed $default = null, int $filter = \FILTER_DEFAULT, mixed $options = []): mixed + public function filter(string $key, $default = null, int $filter = \FILTER_DEFAULT, $options = []) { $value = $this->has($key) ? $this->all()[$key] : $default; @@ -94,11 +96,16 @@ public function filter(string $key, mixed $default = null, int $filter = \FILTER } if (\is_array($value) && !(($options['flags'] ?? 0) & (\FILTER_REQUIRE_ARRAY | \FILTER_FORCE_ARRAY))) { - throw new BadRequestException(sprintf('Input value "%s" contains an array, but "FILTER_REQUIRE_ARRAY" or "FILTER_FORCE_ARRAY" flags were not set.', $key)); + trigger_deprecation('symfony/http-foundation', '5.1', 'Filtering an array value with "%s()" without passing the FILTER_REQUIRE_ARRAY or FILTER_FORCE_ARRAY flag is deprecated', __METHOD__); + + if (!isset($options['flags'])) { + $options['flags'] = \FILTER_REQUIRE_ARRAY; + } } if ((\FILTER_CALLBACK & $filter) && !(($options['options'] ?? null) instanceof \Closure)) { - throw new \InvalidArgumentException(sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null))); + trigger_deprecation('symfony/http-foundation', '5.2', 'Not passing a Closure together with FILTER_CALLBACK to "%s()" is deprecated. Wrap your filter in a closure instead.', __METHOD__); + // throw new \InvalidArgumentException(sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null))); } return filter_var($value, $filter, $options); diff --git a/core/vendor/symfony/http-foundation/IpUtils.php b/core/vendor/symfony/http-foundation/IpUtils.php index dbd74b9208..24111f1ec4 100644 --- a/core/vendor/symfony/http-foundation/IpUtils.php +++ b/core/vendor/symfony/http-foundation/IpUtils.php @@ -18,7 +18,7 @@ */ class IpUtils { - private static array $checkedIps = []; + private static $checkedIps = []; /** * This class should not be instantiated. @@ -31,9 +31,17 @@ private function __construct() * Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets. * * @param string|array $ips List of IPs or subnets (can be a string if only a single one) + * + * @return bool */ - public static function checkIp(string $requestIp, string|array $ips): bool + public static function checkIp(?string $requestIp, $ips) { + if (null === $requestIp) { + trigger_deprecation('symfony/http-foundation', '5.4', 'Passing null as $requestIp to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + return false; + } + if (!\is_array($ips)) { $ips = [$ips]; } @@ -57,8 +65,14 @@ public static function checkIp(string $requestIp, string|array $ips): bool * * @return bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet */ - public static function checkIp4(string $requestIp, string $ip): bool + public static function checkIp4(?string $requestIp, string $ip) { + if (null === $requestIp) { + trigger_deprecation('symfony/http-foundation', '5.4', 'Passing null as $requestIp to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + return false; + } + $cacheKey = $requestIp.'-'.$ip; if (isset(self::$checkedIps[$cacheKey])) { return self::$checkedIps[$cacheKey]; @@ -100,10 +114,18 @@ public static function checkIp4(string $requestIp, string $ip): bool * * @param string $ip IPv6 address or subnet in CIDR notation * + * @return bool + * * @throws \RuntimeException When IPV6 support is not enabled */ - public static function checkIp6(string $requestIp, string $ip): bool + public static function checkIp6(?string $requestIp, string $ip) { + if (null === $requestIp) { + trigger_deprecation('symfony/http-foundation', '5.4', 'Passing null as $requestIp to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + return false; + } + $cacheKey = $requestIp.'-'.$ip; if (isset(self::$checkedIps[$cacheKey])) { return self::$checkedIps[$cacheKey]; diff --git a/core/vendor/symfony/http-foundation/JsonResponse.php b/core/vendor/symfony/http-foundation/JsonResponse.php index 4d55cd5c49..501a6387d9 100644 --- a/core/vendor/symfony/http-foundation/JsonResponse.php +++ b/core/vendor/symfony/http-foundation/JsonResponse.php @@ -34,9 +34,12 @@ class JsonResponse extends Response protected $encodingOptions = self::DEFAULT_ENCODING_OPTIONS; /** - * @param bool $json If the data is already a JSON string + * @param mixed $data The response data + * @param int $status The response status code + * @param array $headers An array of response headers + * @param bool $json If the data is already a JSON string */ - public function __construct(mixed $data = null, int $status = 200, array $headers = [], bool $json = false) + public function __construct($data = null, int $status = 200, array $headers = [], bool $json = false) { parent::__construct('', $status, $headers); @@ -51,6 +54,29 @@ public function __construct(mixed $data = null, int $status = 200, array $header $json ? $this->setJson($data) : $this->setData($data); } + /** + * Factory method for chainability. + * + * Example: + * + * return JsonResponse::create(['key' => 'value']) + * ->setSharedMaxAge(300); + * + * @param mixed $data The JSON response data + * @param int $status The response status code + * @param array $headers An array of response headers + * + * @return static + * + * @deprecated since Symfony 5.1, use __construct() instead. + */ + public static function create($data = null, int $status = 200, array $headers = []) + { + trigger_deprecation('symfony/http-foundation', '5.1', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, static::class); + + return new static($data, $status, $headers); + } + /** * Factory method for chainability. * @@ -62,8 +88,10 @@ public function __construct(mixed $data = null, int $status = 200, array $header * @param string $data The JSON response string * @param int $status The response status code * @param array $headers An array of response headers + * + * @return static */ - public static function fromJsonString(string $data, int $status = 200, array $headers = []): static + public static function fromJsonString(string $data, int $status = 200, array $headers = []) { return new static($data, $status, $headers, true); } @@ -77,7 +105,7 @@ public static function fromJsonString(string $data, int $status = 200, array $he * * @throws \InvalidArgumentException When the callback name is not valid */ - public function setCallback(string $callback = null): static + public function setCallback(string $callback = null) { if (null !== $callback) { // partially taken from https://geekality.net/2011/08/03/valid-javascript-identifier/ @@ -108,7 +136,7 @@ public function setCallback(string $callback = null): static * * @return $this */ - public function setJson(string $json): static + public function setJson(string $json) { $this->data = $json; @@ -118,11 +146,13 @@ public function setJson(string $json): static /** * Sets the data to be sent as JSON. * + * @param mixed $data + * * @return $this * * @throws \InvalidArgumentException */ - public function setData(mixed $data = []): static + public function setData($data = []) { try { $data = json_encode($data, $this->encodingOptions); @@ -133,7 +163,7 @@ public function setData(mixed $data = []): static throw $e; } - if (\JSON_THROW_ON_ERROR & $this->encodingOptions) { + if (\PHP_VERSION_ID >= 70300 && (\JSON_THROW_ON_ERROR & $this->encodingOptions)) { return $this->setJson($data); } @@ -146,8 +176,10 @@ public function setData(mixed $data = []): static /** * Returns options used while encoding data to JSON. + * + * @return int */ - public function getEncodingOptions(): int + public function getEncodingOptions() { return $this->encodingOptions; } @@ -157,7 +189,7 @@ public function getEncodingOptions(): int * * @return $this */ - public function setEncodingOptions(int $encodingOptions): static + public function setEncodingOptions(int $encodingOptions) { $this->encodingOptions = $encodingOptions; @@ -169,7 +201,7 @@ public function setEncodingOptions(int $encodingOptions): static * * @return $this */ - protected function update(): static + protected function update() { if (null !== $this->callback) { // Not using application/javascript for compatibility reasons with older browsers. diff --git a/core/vendor/symfony/http-foundation/ParameterBag.php b/core/vendor/symfony/http-foundation/ParameterBag.php index 6044dac9fa..7d051abe78 100644 --- a/core/vendor/symfony/http-foundation/ParameterBag.php +++ b/core/vendor/symfony/http-foundation/ParameterBag.php @@ -36,9 +36,13 @@ public function __construct(array $parameters = []) * Returns the parameters. * * @param string|null $key The name of the parameter to return or null to get them all + * + * @return array */ - public function all(string $key = null): array + public function all(/*string $key = null*/) { + $key = \func_num_args() > 0 ? func_get_arg(0) : null; + if (null === $key) { return $this->parameters; } @@ -52,8 +56,10 @@ public function all(string $key = null): array /** * Returns the parameter keys. + * + * @return array */ - public function keys(): array + public function keys() { return array_keys($this->parameters); } @@ -74,20 +80,34 @@ public function add(array $parameters = []) $this->parameters = array_replace($this->parameters, $parameters); } - public function get(string $key, mixed $default = null): mixed + /** + * Returns a parameter by name. + * + * @param mixed $default The default value if the parameter key does not exist + * + * @return mixed + */ + public function get(string $key, $default = null) { return \array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default; } - public function set(string $key, mixed $value) + /** + * Sets a parameter by name. + * + * @param mixed $value The value + */ + public function set(string $key, $value) { $this->parameters[$key] = $value; } /** * Returns true if the parameter is defined. + * + * @return bool */ - public function has(string $key): bool + public function has(string $key) { return \array_key_exists($key, $this->parameters); } @@ -102,24 +122,30 @@ public function remove(string $key) /** * Returns the alphabetic characters of the parameter value. + * + * @return string */ - public function getAlpha(string $key, string $default = ''): string + public function getAlpha(string $key, string $default = '') { return preg_replace('/[^[:alpha:]]/', '', $this->get($key, $default)); } /** * Returns the alphabetic characters and digits of the parameter value. + * + * @return string */ - public function getAlnum(string $key, string $default = ''): string + public function getAlnum(string $key, string $default = '') { return preg_replace('/[^[:alnum:]]/', '', $this->get($key, $default)); } /** * Returns the digits of the parameter value. + * + * @return string */ - public function getDigits(string $key, string $default = ''): string + public function getDigits(string $key, string $default = '') { // we need to remove - and + because they're allowed in the filter return str_replace(['-', '+'], '', $this->filter($key, $default, \FILTER_SANITIZE_NUMBER_INT)); @@ -127,16 +153,20 @@ public function getDigits(string $key, string $default = ''): string /** * Returns the parameter value converted to integer. + * + * @return int */ - public function getInt(string $key, int $default = 0): int + public function getInt(string $key, int $default = 0) { return (int) $this->get($key, $default); } /** * Returns the parameter value converted to boolean. + * + * @return bool */ - public function getBoolean(string $key, bool $default = false): bool + public function getBoolean(string $key, bool $default = false) { return $this->filter($key, $default, \FILTER_VALIDATE_BOOLEAN); } @@ -144,11 +174,15 @@ public function getBoolean(string $key, bool $default = false): bool /** * Filter key. * - * @param int $filter FILTER_* constant + * @param mixed $default Default = null + * @param int $filter FILTER_* constant + * @param mixed $options Filter options * * @see https://php.net/filter-var + * + * @return mixed */ - public function filter(string $key, mixed $default = null, int $filter = \FILTER_DEFAULT, mixed $options = []): mixed + public function filter(string $key, $default = null, int $filter = \FILTER_DEFAULT, $options = []) { $value = $this->get($key, $default); @@ -163,7 +197,8 @@ public function filter(string $key, mixed $default = null, int $filter = \FILTER } if ((\FILTER_CALLBACK & $filter) && !(($options['options'] ?? null) instanceof \Closure)) { - throw new \InvalidArgumentException(sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null))); + trigger_deprecation('symfony/http-foundation', '5.2', 'Not passing a Closure together with FILTER_CALLBACK to "%s()" is deprecated. Wrap your filter in a closure instead.', __METHOD__); + // throw new \InvalidArgumentException(sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null))); } return filter_var($value, $filter, $options); @@ -174,15 +209,19 @@ public function filter(string $key, mixed $default = null, int $filter = \FILTER * * @return \ArrayIterator<string, mixed> */ - public function getIterator(): \ArrayIterator + #[\ReturnTypeWillChange] + public function getIterator() { return new \ArrayIterator($this->parameters); } /** * Returns the number of parameters. + * + * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return \count($this->parameters); } diff --git a/core/vendor/symfony/http-foundation/RedirectResponse.php b/core/vendor/symfony/http-foundation/RedirectResponse.php index f70bd286d4..2103280c60 100644 --- a/core/vendor/symfony/http-foundation/RedirectResponse.php +++ b/core/vendor/symfony/http-foundation/RedirectResponse.php @@ -47,10 +47,28 @@ public function __construct(string $url, int $status = 302, array $headers = []) } } + /** + * Factory method for chainability. + * + * @param string $url The URL to redirect to + * + * @return static + * + * @deprecated since Symfony 5.1, use __construct() instead. + */ + public static function create($url = '', int $status = 302, array $headers = []) + { + trigger_deprecation('symfony/http-foundation', '5.1', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, static::class); + + return new static($url, $status, $headers); + } + /** * Returns the target URL. + * + * @return string */ - public function getTargetUrl(): string + public function getTargetUrl() { return $this->targetUrl; } @@ -62,7 +80,7 @@ public function getTargetUrl(): string * * @throws \InvalidArgumentException */ - public function setTargetUrl(string $url): static + public function setTargetUrl(string $url) { if ('' === $url) { throw new \InvalidArgumentException('Cannot redirect to an empty URL.'); diff --git a/core/vendor/symfony/http-foundation/Request.php b/core/vendor/symfony/http-foundation/Request.php index 763211e4be..d112b1f183 100644 --- a/core/vendor/symfony/http-foundation/Request.php +++ b/core/vendor/symfony/http-foundation/Request.php @@ -48,6 +48,8 @@ class Request public const HEADER_X_FORWARDED_PORT = 0b010000; public const HEADER_X_FORWARDED_PREFIX = 0b100000; + /** @deprecated since Symfony 5.2, use either "HEADER_X_FORWARDED_FOR | HEADER_X_FORWARDED_HOST | HEADER_X_FORWARDED_PORT | HEADER_X_FORWARDED_PROTO" or "HEADER_X_FORWARDED_AWS_ELB" or "HEADER_X_FORWARDED_TRAEFIK" constants instead. */ + public const HEADER_X_FORWARDED_ALL = 0b1011110; // All "X-Forwarded-*" headers sent by "usual" reverse proxy public const HEADER_X_FORWARDED_AWS_ELB = 0b0011010; // AWS ELB doesn't send X-Forwarded-Host public const HEADER_X_FORWARDED_TRAEFIK = 0b0111110; // All "X-Forwarded-*" headers sent by Traefik reverse proxy @@ -205,12 +207,19 @@ class Request protected static $requestFactory; - private ?string $preferredFormat = null; - private bool $isHostValid = true; - private bool $isForwardedValid = true; - private bool $isSafeContentPreferred; + /** + * @var string|null + */ + private $preferredFormat; + private $isHostValid = true; + private $isForwardedValid = true; + + /** + * @var bool|null + */ + private $isSafeContentPreferred; - private static int $trustedHeaderSet = -1; + private static $trustedHeaderSet = -1; private const FORWARDED_PARAMS = [ self::HEADER_X_FORWARDED_FOR => 'for', @@ -289,8 +298,10 @@ public function initialize(array $query = [], array $request = [], array $attrib /** * Creates a new request with values from PHP's super globals. + * + * @return static */ - public static function createFromGlobals(): static + public static function createFromGlobals() { $request = self::createRequestFromFactory($_GET, $_POST, [], $_COOKIE, $_FILES, $_SERVER); @@ -317,8 +328,10 @@ public static function createFromGlobals(): static * @param array $files The request files ($_FILES) * @param array $server The server parameters ($_SERVER) * @param string|resource|null $content The raw body data + * + * @return static */ - public static function create(string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], $content = null): static + public static function create(string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], $content = null) { $server = array_replace([ 'SERVER_NAME' => 'localhost', @@ -432,8 +445,10 @@ public static function setFactory(?callable $callable) * @param array $cookies The COOKIE parameters * @param array $files The FILES parameters * @param array $server The SERVER parameters + * + * @return static */ - public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null): static + public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) { $dup = clone $this; if (null !== $query) { @@ -494,7 +509,12 @@ public function __clone() $this->headers = clone $this->headers; } - public function __toString(): string + /** + * Returns the request as a string. + * + * @return string + */ + public function __toString() { $content = $this->getContent(); @@ -564,6 +584,9 @@ public function overrideGlobals() */ public static function setTrustedProxies(array $proxies, int $trustedHeaderSet) { + if (self::HEADER_X_FORWARDED_ALL === $trustedHeaderSet) { + trigger_deprecation('symfony/http-foundation', '5.2', 'The "HEADER_X_FORWARDED_ALL" constant is deprecated, use either "HEADER_X_FORWARDED_FOR | HEADER_X_FORWARDED_HOST | HEADER_X_FORWARDED_PORT | HEADER_X_FORWARDED_PROTO" or "HEADER_X_FORWARDED_AWS_ELB" or "HEADER_X_FORWARDED_TRAEFIK" constants instead.'); + } self::$trustedProxies = array_reduce($proxies, function ($proxies, $proxy) { if ('REMOTE_ADDR' !== $proxy) { $proxies[] = $proxy; @@ -578,8 +601,10 @@ public static function setTrustedProxies(array $proxies, int $trustedHeaderSet) /** * Gets the list of trusted proxies. + * + * @return array */ - public static function getTrustedProxies(): array + public static function getTrustedProxies() { return self::$trustedProxies; } @@ -589,7 +614,7 @@ public static function getTrustedProxies(): array * * @return int A bit field of Request::HEADER_* that defines which headers are trusted from your proxies */ - public static function getTrustedHeaderSet(): int + public static function getTrustedHeaderSet() { return self::$trustedHeaderSet; } @@ -612,8 +637,10 @@ public static function setTrustedHosts(array $hostPatterns) /** * Gets the list of trusted host patterns. + * + * @return array */ - public static function getTrustedHosts(): array + public static function getTrustedHosts() { return self::$trustedHostPatterns; } @@ -623,8 +650,10 @@ public static function getTrustedHosts(): array * * It builds a normalized query string, where keys/value pairs are alphabetized, * have consistent escaping and unneeded delimiters are removed. + * + * @return string */ - public static function normalizeQueryString(?string $qs): string + public static function normalizeQueryString(?string $qs) { if ('' === ($qs ?? '')) { return ''; @@ -654,8 +683,10 @@ public static function enableHttpMethodParameterOverride() /** * Checks whether support for the _method request parameter is enabled. + * + * @return bool */ - public static function getHttpMethodParameterOverride(): bool + public static function getHttpMethodParameterOverride() { return self::$httpMethodParameterOverride; } @@ -669,9 +700,13 @@ public static function getHttpMethodParameterOverride(): bool * * Order of precedence: PATH (routing placeholders or custom attributes), GET, POST * - * @internal use explicit input sources instead + * @param mixed $default The default value if the parameter key does not exist + * + * @return mixed + * + * @internal since Symfony 5.4, use explicit input sources instead */ - public function get(string $key, mixed $default = null): mixed + public function get(string $key, $default = null) { if ($this !== $result = $this->attributes->get($key, $this)) { return $result; @@ -690,8 +725,10 @@ public function get(string $key, mixed $default = null): mixed /** * Gets the Session. + * + * @return SessionInterface */ - public function getSession(): SessionInterface + public function getSession() { $session = $this->session; if (!$session instanceof SessionInterface && null !== $session) { @@ -708,8 +745,10 @@ public function getSession(): SessionInterface /** * Whether the request contains a Session which was started in one of the * previous requests. + * + * @return bool */ - public function hasPreviousSession(): bool + public function hasPreviousSession() { // the check for $this->session avoids malicious users trying to fake a session cookie with proper name return $this->hasSession() && $this->cookies->has($this->getSession()->getName()); @@ -723,9 +762,13 @@ public function hasPreviousSession(): bool * is associated with a Session instance. * * @param bool $skipIfUninitialized When true, ignores factories injected by `setSessionFactory` + * + * @return bool */ - public function hasSession(bool $skipIfUninitialized = false): bool + public function hasSession(/* bool $skipIfUninitialized = false */) { + $skipIfUninitialized = \func_num_args() > 0 ? func_get_arg(0) : false; + return null !== $this->session && (!$skipIfUninitialized || $this->session instanceof SessionInterface); } @@ -753,9 +796,11 @@ public function setSessionFactory(callable $factory) * * Use this method carefully; you should use getClientIp() instead. * + * @return array + * * @see getClientIp() */ - public function getClientIps(): array + public function getClientIps() { $ip = $this->server->get('REMOTE_ADDR'); @@ -779,10 +824,12 @@ public function getClientIps(): array * ("Client-Ip" for instance), configure it via the $trustedHeaderSet * argument of the Request::setTrustedProxies() method instead. * + * @return string|null + * * @see getClientIps() * @see https://wikipedia.org/wiki/X-Forwarded-For */ - public function getClientIp(): ?string + public function getClientIp() { $ipAddresses = $this->getClientIps(); @@ -791,8 +838,10 @@ public function getClientIp(): ?string /** * Returns current script name. + * + * @return string */ - public function getScriptName(): string + public function getScriptName() { return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME', '')); } @@ -811,7 +860,7 @@ public function getScriptName(): string * * @return string The raw path (i.e. not urldecoded) */ - public function getPathInfo(): string + public function getPathInfo() { if (null === $this->pathInfo) { $this->pathInfo = $this->preparePathInfo(); @@ -832,7 +881,7 @@ public function getPathInfo(): string * * @return string The raw path (i.e. not urldecoded) */ - public function getBasePath(): string + public function getBasePath() { if (null === $this->basePath) { $this->basePath = $this->prepareBasePath(); @@ -851,7 +900,7 @@ public function getBasePath(): string * * @return string The raw URL (i.e. not urldecoded) */ - public function getBaseUrl(): string + public function getBaseUrl() { $trustedPrefix = ''; @@ -880,8 +929,10 @@ private function getBaseUrlReal(): string /** * Gets the request's scheme. + * + * @return string */ - public function getScheme(): string + public function getScheme() { return $this->isSecure() ? 'https' : 'http'; } @@ -896,7 +947,7 @@ public function getScheme(): string * * @return int|string|null Can be a string if fetched from the server bag */ - public function getPort(): int|string|null + public function getPort() { if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_X_FORWARDED_PORT)) { $host = $host[0]; @@ -921,16 +972,20 @@ public function getPort(): int|string|null /** * Returns the user. + * + * @return string|null */ - public function getUser(): ?string + public function getUser() { return $this->headers->get('PHP_AUTH_USER'); } /** * Returns the password. + * + * @return string|null */ - public function getPassword(): ?string + public function getPassword() { return $this->headers->get('PHP_AUTH_PW'); } @@ -940,7 +995,7 @@ public function getPassword(): ?string * * @return string|null A user name if any and, optionally, scheme-specific information about how to gain authorization to access the server */ - public function getUserInfo(): ?string + public function getUserInfo() { $userinfo = $this->getUser(); @@ -956,8 +1011,10 @@ public function getUserInfo(): ?string * Returns the HTTP host being requested. * * The port name will be appended to the host if it's non-standard. + * + * @return string */ - public function getHttpHost(): string + public function getHttpHost() { $scheme = $this->getScheme(); $port = $this->getPort(); @@ -974,7 +1031,7 @@ public function getHttpHost(): string * * @return string The raw URI (i.e. not URI decoded) */ - public function getRequestUri(): string + public function getRequestUri() { if (null === $this->requestUri) { $this->requestUri = $this->prepareRequestUri(); @@ -988,8 +1045,10 @@ public function getRequestUri(): string * * If the URL was called with basic authentication, the user * and the password are not added to the generated string. + * + * @return string */ - public function getSchemeAndHttpHost(): string + public function getSchemeAndHttpHost() { return $this->getScheme().'://'.$this->getHttpHost(); } @@ -997,9 +1056,11 @@ public function getSchemeAndHttpHost(): string /** * Generates a normalized URI (URL) for the Request. * + * @return string + * * @see getQueryString() */ - public function getUri(): string + public function getUri() { if (null !== $qs = $this->getQueryString()) { $qs = '?'.$qs; @@ -1012,8 +1073,10 @@ public function getUri(): string * Generates a normalized URI for the given path. * * @param string $path A path to use instead of the current one + * + * @return string */ - public function getUriForPath(string $path): string + public function getUriForPath(string $path) { return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path; } @@ -1032,8 +1095,10 @@ public function getUriForPath(string $path): string * - "/a/b/" -> "../" * - "/a/b/c/other" -> "other" * - "/a/x/y" -> "../../x/y" + * + * @return string */ - public function getRelativeUriForPath(string $path): string + public function getRelativeUriForPath(string $path) { // be sure that we are dealing with an absolute path if (!isset($path[0]) || '/' !== $path[0]) { @@ -1074,8 +1139,10 @@ public function getRelativeUriForPath(string $path): string * * It builds a normalized query string, where keys/value pairs are alphabetized * and have consistent escaping. + * + * @return string|null */ - public function getQueryString(): ?string + public function getQueryString() { $qs = static::normalizeQueryString($this->server->get('QUERY_STRING')); @@ -1089,8 +1156,10 @@ public function getQueryString(): ?string * when trusted proxies were set via "setTrustedProxies()". * * The "X-Forwarded-Proto" header must contain the protocol: "https" or "http". + * + * @return bool */ - public function isSecure(): bool + public function isSecure() { if ($this->isFromTrustedProxy() && $proto = $this->getTrustedValues(self::HEADER_X_FORWARDED_PROTO)) { return \in_array(strtolower($proto[0]), ['https', 'on', 'ssl', '1'], true); @@ -1109,9 +1178,11 @@ public function isSecure(): bool * * The "X-Forwarded-Host" header must contain the client host name. * + * @return string + * * @throws SuspiciousOperationException when the host name is invalid or not trusted */ - public function getHost(): string + public function getHost() { if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_X_FORWARDED_HOST)) { $host = $host[0]; @@ -1183,9 +1254,11 @@ public function setMethod(string $method) * * The method is always an uppercased string. * + * @return string + * * @see getRealMethod() */ - public function getMethod(): string + public function getMethod() { if (null !== $this->method) { return $this->method; @@ -1223,17 +1296,21 @@ public function getMethod(): string /** * Gets the "real" request method. * + * @return string + * * @see getMethod() */ - public function getRealMethod(): string + public function getRealMethod() { return strtoupper($this->server->get('REQUEST_METHOD', 'GET')); } /** * Gets the mime type associated with the format. + * + * @return string|null */ - public function getMimeType(string $format): ?string + public function getMimeType(string $format) { if (null === static::$formats) { static::initializeFormats(); @@ -1244,8 +1321,10 @@ public function getMimeType(string $format): ?string /** * Gets the mime types associated with the format. + * + * @return array */ - public static function getMimeTypes(string $format): array + public static function getMimeTypes(string $format) { if (null === static::$formats) { static::initializeFormats(); @@ -1256,8 +1335,10 @@ public static function getMimeTypes(string $format): array /** * Gets the format associated with the mime type. + * + * @return string|null */ - public function getFormat(?string $mimeType): ?string + public function getFormat(?string $mimeType) { $canonicalMimeType = null; if ($mimeType && false !== $pos = strpos($mimeType, ';')) { @@ -1285,7 +1366,7 @@ public function getFormat(?string $mimeType): ?string * * @param string|array $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type) */ - public function setFormat(?string $format, string|array $mimeTypes) + public function setFormat(?string $format, $mimeTypes) { if (null === static::$formats) { static::initializeFormats(); @@ -1304,8 +1385,10 @@ public function setFormat(?string $format, string|array $mimeTypes) * * $default * * @see getPreferredFormat + * + * @return string|null */ - public function getRequestFormat(?string $default = 'html'): ?string + public function getRequestFormat(?string $default = 'html') { if (null === $this->format) { $this->format = $this->attributes->get('_format'); @@ -1324,8 +1407,10 @@ public function setRequestFormat(?string $format) /** * Gets the format associated with the request. + * + * @return string|null */ - public function getContentType(): ?string + public function getContentType() { return $this->getFormat($this->headers->get('CONTENT_TYPE', '')); } @@ -1344,8 +1429,10 @@ public function setDefaultLocale(string $locale) /** * Get the default locale. + * + * @return string */ - public function getDefaultLocale(): string + public function getDefaultLocale() { return $this->defaultLocale; } @@ -1360,8 +1447,10 @@ public function setLocale(string $locale) /** * Get the locale. + * + * @return string */ - public function getLocale(): string + public function getLocale() { return null === $this->locale ? $this->defaultLocale : $this->locale; } @@ -1370,8 +1459,10 @@ public function getLocale(): string * Checks if the request method is of specified type. * * @param string $method Uppercase request method (GET, POST etc) + * + * @return bool */ - public function isMethod(string $method): bool + public function isMethod(string $method) { return $this->getMethod() === strtoupper($method); } @@ -1380,16 +1471,20 @@ public function isMethod(string $method): bool * Checks whether or not the method is safe. * * @see https://tools.ietf.org/html/rfc7231#section-4.2.1 + * + * @return bool */ - public function isMethodSafe(): bool + public function isMethodSafe() { return \in_array($this->getMethod(), ['GET', 'HEAD', 'OPTIONS', 'TRACE']); } /** * Checks whether or not the method is idempotent. + * + * @return bool */ - public function isMethodIdempotent(): bool + public function isMethodIdempotent() { return \in_array($this->getMethod(), ['HEAD', 'GET', 'PUT', 'DELETE', 'TRACE', 'OPTIONS', 'PURGE']); } @@ -1398,8 +1493,10 @@ public function isMethodIdempotent(): bool * Checks whether the method is cacheable or not. * * @see https://tools.ietf.org/html/rfc7231#section-4.2.3 + * + * @return bool */ - public function isMethodCacheable(): bool + public function isMethodCacheable() { return \in_array($this->getMethod(), ['GET', 'HEAD']); } @@ -1412,8 +1509,10 @@ public function isMethodCacheable(): bool * server might be different. This returns the former (from the "Via" header) * if the proxy is trusted (see "setTrustedProxies()"), otherwise it returns * the latter (from the "SERVER_PROTOCOL" server parameter). + * + * @return string|null */ - public function getProtocolVersion(): ?string + public function getProtocolVersion() { if ($this->isFromTrustedProxy()) { preg_match('~^(HTTP/)?([1-9]\.[0-9]) ~', $this->headers->get('Via') ?? '', $matches); @@ -1475,19 +1574,25 @@ public function getContent(bool $asResource = false) * Gets the request body decoded as array, typically from a JSON payload. * * @throws JsonException When the body cannot be decoded to an array + * + * @return array */ - public function toArray(): array + public function toArray() { if ('' === $content = $this->getContent()) { throw new JsonException('Request body is empty.'); } try { - $content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | \JSON_THROW_ON_ERROR); + $content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | (\PHP_VERSION_ID >= 70300 ? \JSON_THROW_ON_ERROR : 0)); } catch (\JsonException $e) { throw new JsonException('Could not decode request body.', $e->getCode(), $e); } + if (\PHP_VERSION_ID < 70300 && \JSON_ERROR_NONE !== json_last_error()) { + throw new JsonException('Could not decode request body: '.json_last_error_msg(), json_last_error()); + } + if (!\is_array($content)) { throw new JsonException(sprintf('JSON content was expected to decode to an array, "%s" returned.', get_debug_type($content))); } @@ -1497,13 +1602,18 @@ public function toArray(): array /** * Gets the Etags. + * + * @return array */ - public function getETags(): array + public function getETags() { return preg_split('/\s*,\s*/', $this->headers->get('If-None-Match', ''), -1, \PREG_SPLIT_NO_EMPTY); } - public function isNoCache(): bool + /** + * @return bool + */ + public function isNoCache() { return $this->headers->hasCacheControlDirective('no-cache') || 'no-cache' == $this->headers->get('Pragma'); } @@ -1535,8 +1645,10 @@ public function getPreferredFormat(?string $default = 'html'): ?string * Returns the preferred language. * * @param string[] $locales An array of ordered available locales + * + * @return string|null */ - public function getPreferredLanguage(array $locales = null): ?string + public function getPreferredLanguage(array $locales = null) { $preferredLanguages = $this->getLanguages(); @@ -1566,8 +1678,10 @@ public function getPreferredLanguage(array $locales = null): ?string /** * Gets a list of languages acceptable by the client browser ordered in the user browser preferences. + * + * @return array */ - public function getLanguages(): array + public function getLanguages() { if (null !== $this->languages) { return $this->languages; @@ -1604,8 +1718,10 @@ public function getLanguages(): array /** * Gets a list of charsets acceptable by the client browser in preferable order. + * + * @return array */ - public function getCharsets(): array + public function getCharsets() { if (null !== $this->charsets) { return $this->charsets; @@ -1616,8 +1732,10 @@ public function getCharsets(): array /** * Gets a list of encodings acceptable by the client browser in preferable order. + * + * @return array */ - public function getEncodings(): array + public function getEncodings() { if (null !== $this->encodings) { return $this->encodings; @@ -1628,8 +1746,10 @@ public function getEncodings(): array /** * Gets a list of content types acceptable by the client browser in preferable order. + * + * @return array */ - public function getAcceptableContentTypes(): array + public function getAcceptableContentTypes() { if (null !== $this->acceptableContentTypes) { return $this->acceptableContentTypes; @@ -1645,8 +1765,10 @@ public function getAcceptableContentTypes(): array * It is known to work with common JavaScript frameworks: * * @see https://wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript + * + * @return bool */ - public function isXmlHttpRequest(): bool + public function isXmlHttpRequest() { return 'XMLHttpRequest' == $this->headers->get('X-Requested-With'); } @@ -1658,7 +1780,7 @@ public function isXmlHttpRequest(): bool */ public function preferSafeContent(): bool { - if (isset($this->isSafeContentPreferred)) { + if (null !== $this->isSafeContentPreferred) { return $this->isSafeContentPreferred; } @@ -1725,8 +1847,10 @@ protected function prepareRequestUri() /** * Prepares the base URL. + * + * @return string */ - protected function prepareBaseUrl(): string + protected function prepareBaseUrl() { $filename = basename($this->server->get('SCRIPT_FILENAME', '')); @@ -1792,8 +1916,10 @@ protected function prepareBaseUrl(): string /** * Prepares the base path. + * + * @return string */ - protected function prepareBasePath(): string + protected function prepareBasePath() { $baseUrl = $this->getBaseUrl(); if (empty($baseUrl)) { @@ -1816,8 +1942,10 @@ protected function prepareBasePath(): string /** * Prepares the path info. + * + * @return string */ - protected function preparePathInfo(): string + protected function preparePathInfo() { if (null === ($requestUri = $this->getRequestUri())) { return '/'; @@ -1896,7 +2024,7 @@ private function getUrlencodedPrefix(string $string, string $prefix): ?string return null; } - private static function createRequestFromFactory(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): static + private static function createRequestFromFactory(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): self { if (self::$requestFactory) { $request = (self::$requestFactory)($query, $request, $attributes, $cookies, $files, $server, $content); @@ -1916,8 +2044,10 @@ private static function createRequestFromFactory(array $query = [], array $reque * * This can be useful to determine whether or not to trust the * contents of a proxy-specific header. + * + * @return bool */ - public function isFromTrustedProxy(): bool + public function isFromTrustedProxy() { return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR', ''), self::$trustedProxies); } diff --git a/core/vendor/symfony/http-foundation/RequestMatcher.php b/core/vendor/symfony/http-foundation/RequestMatcher.php index 91dcdd51cb..f2645f9ae9 100644 --- a/core/vendor/symfony/http-foundation/RequestMatcher.php +++ b/core/vendor/symfony/http-foundation/RequestMatcher.php @@ -18,36 +18,47 @@ */ class RequestMatcher implements RequestMatcherInterface { - private ?string $path = null; - private ?string $host = null; - private ?int $port = null; + /** + * @var string|null + */ + private $path; /** - * @var string[] + * @var string|null */ - private array $methods = []; + private $host; + + /** + * @var int|null + */ + private $port; /** * @var string[] */ - private array $ips = []; + private $methods = []; /** * @var string[] */ - private array $attributes = []; + private $ips = []; + + /** + * @var array + */ + private $attributes = []; /** * @var string[] */ - private array $schemes = []; + private $schemes = []; /** * @param string|string[]|null $methods * @param string|string[]|null $ips * @param string|string[]|null $schemes */ - public function __construct(string $path = null, string $host = null, string|array $methods = null, string|array $ips = null, array $attributes = [], string|array $schemes = null, int $port = null) + public function __construct(string $path = null, string $host = null, $methods = null, $ips = null, array $attributes = [], $schemes = null, int $port = null) { $this->matchPath($path); $this->matchHost($host); @@ -66,7 +77,7 @@ public function __construct(string $path = null, string $host = null, string|arr * * @param string|string[]|null $scheme An HTTP scheme or an array of HTTP schemes */ - public function matchScheme(string|array|null $scheme) + public function matchScheme($scheme) { $this->schemes = null !== $scheme ? array_map('strtolower', (array) $scheme) : []; } @@ -112,7 +123,7 @@ public function matchIp(string $ip) * * @param string|string[]|null $ips A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 */ - public function matchIps(string|array|null $ips) + public function matchIps($ips) { $ips = null !== $ips ? (array) $ips : []; @@ -126,7 +137,7 @@ public function matchIps(string|array|null $ips) * * @param string|string[]|null $method An HTTP method or an array of HTTP methods */ - public function matchMethod(string|array|null $method) + public function matchMethod($method) { $this->methods = null !== $method ? array_map('strtoupper', (array) $method) : []; } @@ -142,7 +153,7 @@ public function matchAttribute(string $key, string $regexp) /** * {@inheritdoc} */ - public function matches(Request $request): bool + public function matches(Request $request) { if ($this->schemes && !\in_array($request->getScheme(), $this->schemes, true)) { return false; diff --git a/core/vendor/symfony/http-foundation/RequestMatcherInterface.php b/core/vendor/symfony/http-foundation/RequestMatcherInterface.php index 6dcc3e0fcc..c2e1478587 100644 --- a/core/vendor/symfony/http-foundation/RequestMatcherInterface.php +++ b/core/vendor/symfony/http-foundation/RequestMatcherInterface.php @@ -20,6 +20,8 @@ interface RequestMatcherInterface { /** * Decides whether the rule(s) implemented by the strategy matches the supplied request. + * + * @return bool */ - public function matches(Request $request): bool; + public function matches(Request $request); } diff --git a/core/vendor/symfony/http-foundation/RequestStack.php b/core/vendor/symfony/http-foundation/RequestStack.php index 6b13fa1e6e..855b51816a 100644 --- a/core/vendor/symfony/http-foundation/RequestStack.php +++ b/core/vendor/symfony/http-foundation/RequestStack.php @@ -24,7 +24,7 @@ class RequestStack /** * @var Request[] */ - private array $requests = []; + private $requests = []; /** * Pushes a Request on the stack. @@ -44,8 +44,10 @@ public function push(Request $request) * * This method should generally not be called directly as the stack * management should be taken care of by the application itself. + * + * @return Request|null */ - public function pop(): ?Request + public function pop() { if (!$this->requests) { return null; @@ -54,7 +56,10 @@ public function pop(): ?Request return array_pop($this->requests); } - public function getCurrentRequest(): ?Request + /** + * @return Request|null + */ + public function getCurrentRequest() { return end($this->requests) ?: null; } @@ -75,6 +80,20 @@ public function getMainRequest(): ?Request return $this->requests[0]; } + /** + * Gets the master request. + * + * @return Request|null + * + * @deprecated since symfony/http-foundation 5.3, use getMainRequest() instead + */ + public function getMasterRequest() + { + trigger_deprecation('symfony/http-foundation', '5.3', '"%s()" is deprecated, use "getMainRequest()" instead.', __METHOD__); + + return $this->getMainRequest(); + } + /** * Returns the parent request of the current. * @@ -83,8 +102,10 @@ public function getMainRequest(): ?Request * like ESI support. * * If current Request is the main request, it returns null. + * + * @return Request|null */ - public function getParentRequest(): ?Request + public function getParentRequest() { $pos = \count($this->requests) - 2; diff --git a/core/vendor/symfony/http-foundation/Response.php b/core/vendor/symfony/http-foundation/Response.php index accacff8e5..265e6ea68f 100644 --- a/core/vendor/symfony/http-foundation/Response.php +++ b/core/vendor/symfony/http-foundation/Response.php @@ -220,6 +220,25 @@ public function __construct(?string $content = '', int $status = 200, array $hea $this->setProtocolVersion('1.0'); } + /** + * Factory method for chainability. + * + * Example: + * + * return Response::create($body, 200) + * ->setSharedMaxAge(300); + * + * @return static + * + * @deprecated since Symfony 5.1, use __construct() instead. + */ + public static function create(?string $content = '', int $status = 200, array $headers = []) + { + trigger_deprecation('symfony/http-foundation', '5.1', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, static::class); + + return new static($content, $status, $headers); + } + /** * Returns the Response as an HTTP string. * @@ -227,9 +246,11 @@ public function __construct(?string $content = '', int $status = 200, array $hea * one that will be sent to the client only if the prepare() method * has been called before. * + * @return string + * * @see prepare() */ - public function __toString(): string + public function __toString() { return sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n". @@ -254,7 +275,7 @@ public function __clone() * * @return $this */ - public function prepare(Request $request): static + public function prepare(Request $request) { $headers = $this->headers; @@ -324,7 +345,7 @@ public function prepare(Request $request): static * * @return $this */ - public function sendHeaders(): static + public function sendHeaders() { // headers have already been sent by the developer if (headers_sent()) { @@ -355,7 +376,7 @@ public function sendHeaders(): static * * @return $this */ - public function sendContent(): static + public function sendContent() { echo $this->content; @@ -367,7 +388,7 @@ public function sendContent(): static * * @return $this */ - public function send(): static + public function send() { $this->sendHeaders(); $this->sendContent(); @@ -388,7 +409,7 @@ public function send(): static * * @return $this */ - public function setContent(?string $content): static + public function setContent(?string $content) { $this->content = $content ?? ''; @@ -397,8 +418,10 @@ public function setContent(?string $content): static /** * Gets the current response content. + * + * @return string|false */ - public function getContent(): string|false + public function getContent() { return $this->content; } @@ -410,7 +433,7 @@ public function getContent(): string|false * * @final */ - public function setProtocolVersion(string $version): static + public function setProtocolVersion(string $version): object { $this->version = $version; @@ -439,7 +462,7 @@ public function getProtocolVersion(): string * * @final */ - public function setStatusCode(int $code, string $text = null): static + public function setStatusCode(int $code, string $text = null): object { $this->statusCode = $code; if ($this->isInvalid()) { @@ -480,7 +503,7 @@ public function getStatusCode(): int * * @final */ - public function setCharset(string $charset): static + public function setCharset(string $charset): object { $this->charset = $charset; @@ -561,7 +584,7 @@ public function isValidateable(): bool * * @final */ - public function setPrivate(): static + public function setPrivate(): object { $this->headers->removeCacheControlDirective('public'); $this->headers->addCacheControlDirective('private'); @@ -578,7 +601,7 @@ public function setPrivate(): static * * @final */ - public function setPublic(): static + public function setPublic(): object { $this->headers->addCacheControlDirective('public'); $this->headers->removeCacheControlDirective('private'); @@ -593,7 +616,7 @@ public function setPublic(): static * * @final */ - public function setImmutable(bool $immutable = true): static + public function setImmutable(bool $immutable = true): object { if ($immutable) { $this->headers->addCacheControlDirective('immutable'); @@ -648,7 +671,7 @@ public function getDate(): ?\DateTimeInterface * * @final */ - public function setDate(\DateTimeInterface $date): static + public function setDate(\DateTimeInterface $date): object { if ($date instanceof \DateTime) { $date = \DateTimeImmutable::createFromMutable($date); @@ -679,7 +702,7 @@ public function getAge(): int * * @return $this */ - public function expire(): static + public function expire() { if ($this->isFresh()) { $this->headers->set('Age', $this->getMaxAge()); @@ -713,7 +736,7 @@ public function getExpires(): ?\DateTimeInterface * * @final */ - public function setExpires(\DateTimeInterface $date = null): static + public function setExpires(\DateTimeInterface $date = null): object { if (null === $date) { $this->headers->remove('Expires'); @@ -766,7 +789,7 @@ public function getMaxAge(): ?int * * @final */ - public function setMaxAge(int $value): static + public function setMaxAge(int $value): object { $this->headers->addCacheControlDirective('max-age', $value); @@ -782,7 +805,7 @@ public function setMaxAge(int $value): static * * @final */ - public function setSharedMaxAge(int $value): static + public function setSharedMaxAge(int $value): object { $this->setPublic(); $this->headers->addCacheControlDirective('s-maxage', $value); @@ -816,7 +839,7 @@ public function getTtl(): ?int * * @final */ - public function setTtl(int $seconds): static + public function setTtl(int $seconds): object { $this->setSharedMaxAge($this->getAge() + $seconds); @@ -832,7 +855,7 @@ public function setTtl(int $seconds): static * * @final */ - public function setClientTtl(int $seconds): static + public function setClientTtl(int $seconds): object { $this->setMaxAge($this->getAge() + $seconds); @@ -860,7 +883,7 @@ public function getLastModified(): ?\DateTimeInterface * * @final */ - public function setLastModified(\DateTimeInterface $date = null): static + public function setLastModified(\DateTimeInterface $date = null): object { if (null === $date) { $this->headers->remove('Last-Modified'); @@ -898,7 +921,7 @@ public function getEtag(): ?string * * @final */ - public function setEtag(string $etag = null, bool $weak = false): static + public function setEtag(string $etag = null, bool $weak = false): object { if (null === $etag) { $this->headers->remove('Etag'); @@ -924,7 +947,7 @@ public function setEtag(string $etag = null, bool $weak = false): static * * @final */ - public function setCache(array $options): static + public function setCache(array $options): object { if ($diff = array_diff(array_keys($options), array_keys(self::HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES))) { throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', $diff))); @@ -987,7 +1010,7 @@ public function setCache(array $options): static * * @final */ - public function setNotModified(): static + public function setNotModified(): object { $this->setStatusCode(304); $this->setContent(null); @@ -1032,13 +1055,14 @@ public function getVary(): array /** * Sets the Vary header. * - * @param bool $replace Whether to replace the actual value or not (true by default) + * @param string|array $headers + * @param bool $replace Whether to replace the actual value or not (true by default) * * @return $this * * @final */ - public function setVary(string|array $headers, bool $replace = true): static + public function setVary($headers, bool $replace = true): object { $this->headers->set('Vary', $headers, $replace); diff --git a/core/vendor/symfony/http-foundation/ResponseHeaderBag.php b/core/vendor/symfony/http-foundation/ResponseHeaderBag.php index 2e2717416f..1df13fa21b 100644 --- a/core/vendor/symfony/http-foundation/ResponseHeaderBag.php +++ b/core/vendor/symfony/http-foundation/ResponseHeaderBag.php @@ -44,8 +44,10 @@ public function __construct(array $headers = []) /** * Returns the headers, with original capitalizations. + * + * @return array */ - public function allPreserveCase(): array + public function allPreserveCase() { $headers = []; foreach ($this->all() as $name => $value) { @@ -86,7 +88,7 @@ public function replace(array $headers = []) /** * {@inheritdoc} */ - public function all(string $key = null): array + public function all(string $key = null) { $headers = parent::all(); @@ -106,7 +108,7 @@ public function all(string $key = null): array /** * {@inheritdoc} */ - public function set(string $key, string|array|null $values, bool $replace = true) + public function set(string $key, $values, bool $replace = true) { $uniqueKey = strtr($key, self::UPPER, self::LOWER); @@ -162,7 +164,7 @@ public function remove(string $key) /** * {@inheritdoc} */ - public function hasCacheControlDirective(string $key): bool + public function hasCacheControlDirective(string $key) { return \array_key_exists($key, $this->computedCacheControl); } @@ -170,7 +172,7 @@ public function hasCacheControlDirective(string $key): bool /** * {@inheritdoc} */ - public function getCacheControlDirective(string $key): bool|string|null + public function getCacheControlDirective(string $key) { return $this->computedCacheControl[$key] ?? null; } @@ -212,7 +214,7 @@ public function removeCookie(string $name, ?string $path = '/', string $domain = * * @throws \InvalidArgumentException When the $format is invalid */ - public function getCookies(string $format = self::COOKIES_FLAT): array + public function getCookies(string $format = self::COOKIES_FLAT) { if (!\in_array($format, [self::COOKIES_FLAT, self::COOKIES_ARRAY])) { throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', [self::COOKIES_FLAT, self::COOKIES_ARRAY]))); @@ -255,8 +257,10 @@ public function makeDisposition(string $disposition, string $filename, string $f * * This considers several other headers and calculates or modifies the * cache-control header to a sensible, conservative value. + * + * @return string */ - protected function computeCacheControlValue(): string + protected function computeCacheControlValue() { if (!$this->cacheControl) { if ($this->has('Last-Modified') || $this->has('Expires')) { diff --git a/core/vendor/symfony/http-foundation/ServerBag.php b/core/vendor/symfony/http-foundation/ServerBag.php index 5b0fc8ac46..25688d5230 100644 --- a/core/vendor/symfony/http-foundation/ServerBag.php +++ b/core/vendor/symfony/http-foundation/ServerBag.php @@ -22,8 +22,10 @@ class ServerBag extends ParameterBag { /** * Gets the HTTP headers. + * + * @return array */ - public function getHeaders(): array + public function getHeaders() { $headers = []; foreach ($this->parameters as $key => $value) { diff --git a/core/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php b/core/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php index 11b884a717..f4f051c7a6 100644 --- a/core/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php +++ b/core/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php @@ -18,8 +18,8 @@ */ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable { - private string $name = 'attributes'; - private string $storageKey; + private $name = 'attributes'; + private $storageKey; protected $attributes = []; @@ -34,7 +34,7 @@ public function __construct(string $storageKey = '_sf2_attributes') /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return $this->name; } @@ -55,7 +55,7 @@ public function initialize(array &$attributes) /** * {@inheritdoc} */ - public function getStorageKey(): string + public function getStorageKey() { return $this->storageKey; } @@ -63,7 +63,7 @@ public function getStorageKey(): string /** * {@inheritdoc} */ - public function has(string $name): bool + public function has(string $name) { return \array_key_exists($name, $this->attributes); } @@ -71,7 +71,7 @@ public function has(string $name): bool /** * {@inheritdoc} */ - public function get(string $name, mixed $default = null): mixed + public function get(string $name, $default = null) { return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default; } @@ -79,7 +79,7 @@ public function get(string $name, mixed $default = null): mixed /** * {@inheritdoc} */ - public function set(string $name, mixed $value) + public function set(string $name, $value) { $this->attributes[$name] = $value; } @@ -87,7 +87,7 @@ public function set(string $name, mixed $value) /** * {@inheritdoc} */ - public function all(): array + public function all() { return $this->attributes; } @@ -106,7 +106,7 @@ public function replace(array $attributes) /** * {@inheritdoc} */ - public function remove(string $name): mixed + public function remove(string $name) { $retval = null; if (\array_key_exists($name, $this->attributes)) { @@ -120,7 +120,7 @@ public function remove(string $name): mixed /** * {@inheritdoc} */ - public function clear(): mixed + public function clear() { $return = $this->attributes; $this->attributes = []; @@ -133,15 +133,19 @@ public function clear(): mixed * * @return \ArrayIterator<string, mixed> */ - public function getIterator(): \ArrayIterator + #[\ReturnTypeWillChange] + public function getIterator() { return new \ArrayIterator($this->attributes); } /** * Returns the number of attributes. + * + * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return \count($this->attributes); } diff --git a/core/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php b/core/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php index 31a946444b..cb50696814 100644 --- a/core/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php +++ b/core/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php @@ -22,25 +22,33 @@ interface AttributeBagInterface extends SessionBagInterface { /** * Checks if an attribute is defined. + * + * @return bool */ - public function has(string $name): bool; + public function has(string $name); /** * Returns an attribute. + * + * @param mixed $default The default value if not found + * + * @return mixed */ - public function get(string $name, mixed $default = null): mixed; + public function get(string $name, $default = null); /** * Sets an attribute. + * + * @param mixed $value */ - public function set(string $name, mixed $value); + public function set(string $name, $value); /** * Returns attributes. * * @return array<string, mixed> */ - public function all(): array; + public function all(); public function replace(array $attributes); @@ -49,5 +57,5 @@ public function replace(array $attributes); * * @return mixed The removed value or null when it does not exist */ - public function remove(string $name): mixed; + public function remove(string $name); } diff --git a/core/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php b/core/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php new file mode 100644 index 0000000000..864b35fb70 --- /dev/null +++ b/core/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php @@ -0,0 +1,161 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Attribute; + +trigger_deprecation('symfony/http-foundation', '5.3', 'The "%s" class is deprecated.', NamespacedAttributeBag::class); + +/** + * This class provides structured storage of session attributes using + * a name spacing character in the key. + * + * @author Drak <drak@zikula.org> + * + * @deprecated since Symfony 5.3 + */ +class NamespacedAttributeBag extends AttributeBag +{ + private $namespaceCharacter; + + /** + * @param string $storageKey Session storage key + * @param string $namespaceCharacter Namespace character to use in keys + */ + public function __construct(string $storageKey = '_sf2_attributes', string $namespaceCharacter = '/') + { + $this->namespaceCharacter = $namespaceCharacter; + parent::__construct($storageKey); + } + + /** + * {@inheritdoc} + */ + public function has(string $name) + { + // reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is + $attributes = $this->resolveAttributePath($name); + $name = $this->resolveKey($name); + + if (null === $attributes) { + return false; + } + + return \array_key_exists($name, $attributes); + } + + /** + * {@inheritdoc} + */ + public function get(string $name, $default = null) + { + // reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is + $attributes = $this->resolveAttributePath($name); + $name = $this->resolveKey($name); + + if (null === $attributes) { + return $default; + } + + return \array_key_exists($name, $attributes) ? $attributes[$name] : $default; + } + + /** + * {@inheritdoc} + */ + public function set(string $name, $value) + { + $attributes = &$this->resolveAttributePath($name, true); + $name = $this->resolveKey($name); + $attributes[$name] = $value; + } + + /** + * {@inheritdoc} + */ + public function remove(string $name) + { + $retval = null; + $attributes = &$this->resolveAttributePath($name); + $name = $this->resolveKey($name); + if (null !== $attributes && \array_key_exists($name, $attributes)) { + $retval = $attributes[$name]; + unset($attributes[$name]); + } + + return $retval; + } + + /** + * Resolves a path in attributes property and returns it as a reference. + * + * This method allows structured namespacing of session attributes. + * + * @param string $name Key name + * @param bool $writeContext Write context, default false + * + * @return array|null + */ + protected function &resolveAttributePath(string $name, bool $writeContext = false) + { + $array = &$this->attributes; + $name = (str_starts_with($name, $this->namespaceCharacter)) ? substr($name, 1) : $name; + + // Check if there is anything to do, else return + if (!$name) { + return $array; + } + + $parts = explode($this->namespaceCharacter, $name); + if (\count($parts) < 2) { + if (!$writeContext) { + return $array; + } + + $array[$parts[0]] = []; + + return $array; + } + + unset($parts[\count($parts) - 1]); + + foreach ($parts as $part) { + if (null !== $array && !\array_key_exists($part, $array)) { + if (!$writeContext) { + $null = null; + + return $null; + } + + $array[$part] = []; + } + + $array = &$array[$part]; + } + + return $array; + } + + /** + * Resolves the key from the name. + * + * This is the last part in a dot separated string. + * + * @return string + */ + protected function resolveKey(string $name) + { + if (false !== $pos = strrpos($name, $this->namespaceCharacter)) { + $name = substr($name, $pos + 1); + } + + return $name; + } +} diff --git a/core/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php b/core/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php index 9fea24f91e..8aab3a1228 100644 --- a/core/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php +++ b/core/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php @@ -18,9 +18,9 @@ */ class AutoExpireFlashBag implements FlashBagInterface { - private string $name = 'flashes'; - private array $flashes = ['display' => [], 'new' => []]; - private string $storageKey; + private $name = 'flashes'; + private $flashes = ['display' => [], 'new' => []]; + private $storageKey; /** * @param string $storageKey The key used to store flashes in the session @@ -33,7 +33,7 @@ public function __construct(string $storageKey = '_symfony_flashes') /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return $this->name; } @@ -60,7 +60,7 @@ public function initialize(array &$flashes) /** * {@inheritdoc} */ - public function add(string $type, mixed $message) + public function add(string $type, $message) { $this->flashes['new'][$type][] = $message; } @@ -68,7 +68,7 @@ public function add(string $type, mixed $message) /** * {@inheritdoc} */ - public function peek(string $type, array $default = []): array + public function peek(string $type, array $default = []) { return $this->has($type) ? $this->flashes['display'][$type] : $default; } @@ -76,7 +76,7 @@ public function peek(string $type, array $default = []): array /** * {@inheritdoc} */ - public function peekAll(): array + public function peekAll() { return \array_key_exists('display', $this->flashes) ? $this->flashes['display'] : []; } @@ -84,7 +84,7 @@ public function peekAll(): array /** * {@inheritdoc} */ - public function get(string $type, array $default = []): array + public function get(string $type, array $default = []) { $return = $default; @@ -103,7 +103,7 @@ public function get(string $type, array $default = []): array /** * {@inheritdoc} */ - public function all(): array + public function all() { $return = $this->flashes['display']; $this->flashes['display'] = []; @@ -122,7 +122,7 @@ public function setAll(array $messages) /** * {@inheritdoc} */ - public function set(string $type, string|array $messages) + public function set(string $type, $messages) { $this->flashes['new'][$type] = (array) $messages; } @@ -130,7 +130,7 @@ public function set(string $type, string|array $messages) /** * {@inheritdoc} */ - public function has(string $type): bool + public function has(string $type) { return \array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type]; } @@ -138,7 +138,7 @@ public function has(string $type): bool /** * {@inheritdoc} */ - public function keys(): array + public function keys() { return array_keys($this->flashes['display']); } @@ -146,7 +146,7 @@ public function keys(): array /** * {@inheritdoc} */ - public function getStorageKey(): string + public function getStorageKey() { return $this->storageKey; } @@ -154,7 +154,7 @@ public function getStorageKey(): string /** * {@inheritdoc} */ - public function clear(): mixed + public function clear() { return $this->all(); } diff --git a/core/vendor/symfony/http-foundation/Session/Flash/FlashBag.php b/core/vendor/symfony/http-foundation/Session/Flash/FlashBag.php index 4fa4644df7..88df7508ac 100644 --- a/core/vendor/symfony/http-foundation/Session/Flash/FlashBag.php +++ b/core/vendor/symfony/http-foundation/Session/Flash/FlashBag.php @@ -18,9 +18,9 @@ */ class FlashBag implements FlashBagInterface { - private string $name = 'flashes'; - private array $flashes = []; - private string $storageKey; + private $name = 'flashes'; + private $flashes = []; + private $storageKey; /** * @param string $storageKey The key used to store flashes in the session @@ -33,7 +33,7 @@ public function __construct(string $storageKey = '_symfony_flashes') /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return $this->name; } @@ -54,7 +54,7 @@ public function initialize(array &$flashes) /** * {@inheritdoc} */ - public function add(string $type, mixed $message) + public function add(string $type, $message) { $this->flashes[$type][] = $message; } @@ -62,7 +62,7 @@ public function add(string $type, mixed $message) /** * {@inheritdoc} */ - public function peek(string $type, array $default = []): array + public function peek(string $type, array $default = []) { return $this->has($type) ? $this->flashes[$type] : $default; } @@ -70,7 +70,7 @@ public function peek(string $type, array $default = []): array /** * {@inheritdoc} */ - public function peekAll(): array + public function peekAll() { return $this->flashes; } @@ -78,7 +78,7 @@ public function peekAll(): array /** * {@inheritdoc} */ - public function get(string $type, array $default = []): array + public function get(string $type, array $default = []) { if (!$this->has($type)) { return $default; @@ -94,7 +94,7 @@ public function get(string $type, array $default = []): array /** * {@inheritdoc} */ - public function all(): array + public function all() { $return = $this->peekAll(); $this->flashes = []; @@ -105,7 +105,7 @@ public function all(): array /** * {@inheritdoc} */ - public function set(string $type, string|array $messages) + public function set(string $type, $messages) { $this->flashes[$type] = (array) $messages; } @@ -121,7 +121,7 @@ public function setAll(array $messages) /** * {@inheritdoc} */ - public function has(string $type): bool + public function has(string $type) { return \array_key_exists($type, $this->flashes) && $this->flashes[$type]; } @@ -129,7 +129,7 @@ public function has(string $type): bool /** * {@inheritdoc} */ - public function keys(): array + public function keys() { return array_keys($this->flashes); } @@ -137,7 +137,7 @@ public function keys(): array /** * {@inheritdoc} */ - public function getStorageKey(): string + public function getStorageKey() { return $this->storageKey; } @@ -145,7 +145,7 @@ public function getStorageKey(): string /** * {@inheritdoc} */ - public function clear(): mixed + public function clear() { return $this->all(); } diff --git a/core/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php b/core/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php index cd10a23f3c..8713e71d0f 100644 --- a/core/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php +++ b/core/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php @@ -22,38 +22,50 @@ interface FlashBagInterface extends SessionBagInterface { /** * Adds a flash message for the given type. + * + * @param mixed $message */ - public function add(string $type, mixed $message); + public function add(string $type, $message); /** * Registers one or more messages for a given type. + * + * @param string|array $messages */ - public function set(string $type, string|array $messages); + public function set(string $type, $messages); /** * Gets flash messages for a given type. * * @param string $type Message category type * @param array $default Default value if $type does not exist + * + * @return array */ - public function peek(string $type, array $default = []): array; + public function peek(string $type, array $default = []); /** * Gets all flash messages. + * + * @return array */ - public function peekAll(): array; + public function peekAll(); /** * Gets and clears flash from the stack. * * @param array $default Default value if $type does not exist + * + * @return array */ - public function get(string $type, array $default = []): array; + public function get(string $type, array $default = []); /** * Gets and clears flashes from the stack. + * + * @return array */ - public function all(): array; + public function all(); /** * Sets all flash messages. @@ -62,11 +74,15 @@ public function setAll(array $messages); /** * Has flash messages for a given type? + * + * @return bool */ - public function has(string $type): bool; + public function has(string $type); /** * Returns a list of all defined types. + * + * @return array */ - public function keys(): array; + public function keys(); } diff --git a/core/vendor/symfony/http-foundation/Session/Session.php b/core/vendor/symfony/http-foundation/Session/Session.php index 3254f1885e..022e3986fe 100644 --- a/core/vendor/symfony/http-foundation/Session/Session.php +++ b/core/vendor/symfony/http-foundation/Session/Session.php @@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface; use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; -use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface; @@ -34,16 +33,16 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable { protected $storage; - private string $flashName; - private string $attributeName; - private array $data = []; - private int $usageIndex = 0; - private ?\Closure $usageReporter; + private $flashName; + private $attributeName; + private $data = []; + private $usageIndex = 0; + private $usageReporter; public function __construct(SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null, callable $usageReporter = null) { $this->storage = $storage ?? new NativeSessionStorage(); - $this->usageReporter = $usageReporter instanceof \Closure || !\is_callable($usageReporter) ? $usageReporter : \Closure::fromCallable($usageReporter); + $this->usageReporter = $usageReporter; $attributes = $attributes ?? new AttributeBag(); $this->attributeName = $attributes->getName(); @@ -57,7 +56,7 @@ public function __construct(SessionStorageInterface $storage = null, AttributeBa /** * {@inheritdoc} */ - public function start(): bool + public function start() { return $this->storage->start(); } @@ -65,7 +64,7 @@ public function start(): bool /** * {@inheritdoc} */ - public function has(string $name): bool + public function has(string $name) { return $this->getAttributeBag()->has($name); } @@ -73,7 +72,7 @@ public function has(string $name): bool /** * {@inheritdoc} */ - public function get(string $name, mixed $default = null): mixed + public function get(string $name, $default = null) { return $this->getAttributeBag()->get($name, $default); } @@ -81,7 +80,7 @@ public function get(string $name, mixed $default = null): mixed /** * {@inheritdoc} */ - public function set(string $name, mixed $value) + public function set(string $name, $value) { $this->getAttributeBag()->set($name, $value); } @@ -89,7 +88,7 @@ public function set(string $name, mixed $value) /** * {@inheritdoc} */ - public function all(): array + public function all() { return $this->getAttributeBag()->all(); } @@ -105,7 +104,7 @@ public function replace(array $attributes) /** * {@inheritdoc} */ - public function remove(string $name): mixed + public function remove(string $name) { return $this->getAttributeBag()->remove($name); } @@ -121,7 +120,7 @@ public function clear() /** * {@inheritdoc} */ - public function isStarted(): bool + public function isStarted() { return $this->storage->isStarted(); } @@ -131,15 +130,19 @@ public function isStarted(): bool * * @return \ArrayIterator<string, mixed> */ - public function getIterator(): \ArrayIterator + #[\ReturnTypeWillChange] + public function getIterator() { return new \ArrayIterator($this->getAttributeBag()->all()); } /** * Returns the number of attributes. + * + * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return \count($this->getAttributeBag()->all()); } @@ -172,7 +175,7 @@ public function isEmpty(): bool /** * {@inheritdoc} */ - public function invalidate(int $lifetime = null): bool + public function invalidate(int $lifetime = null) { $this->storage->clear(); @@ -182,7 +185,7 @@ public function invalidate(int $lifetime = null): bool /** * {@inheritdoc} */ - public function migrate(bool $destroy = false, int $lifetime = null): bool + public function migrate(bool $destroy = false, int $lifetime = null) { return $this->storage->regenerate($destroy, $lifetime); } @@ -198,7 +201,7 @@ public function save() /** * {@inheritdoc} */ - public function getId(): string + public function getId() { return $this->storage->getId(); } @@ -216,7 +219,7 @@ public function setId(string $id) /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return $this->storage->getName(); } @@ -232,7 +235,7 @@ public function setName(string $name) /** * {@inheritdoc} */ - public function getMetadataBag(): MetadataBag + public function getMetadataBag() { ++$this->usageIndex; if ($this->usageReporter && 0 <= $this->usageIndex) { @@ -253,7 +256,7 @@ public function registerBag(SessionBagInterface $bag) /** * {@inheritdoc} */ - public function getBag(string $name): SessionBagInterface + public function getBag(string $name) { $bag = $this->storage->getBag($name); @@ -262,8 +265,10 @@ public function getBag(string $name): SessionBagInterface /** * Gets the flashbag interface. + * + * @return FlashBagInterface */ - public function getFlashBag(): FlashBagInterface + public function getFlashBag() { return $this->getBag($this->flashName); } diff --git a/core/vendor/symfony/http-foundation/Session/SessionBagInterface.php b/core/vendor/symfony/http-foundation/Session/SessionBagInterface.php index 821645d9b8..8e37d06d65 100644 --- a/core/vendor/symfony/http-foundation/Session/SessionBagInterface.php +++ b/core/vendor/symfony/http-foundation/Session/SessionBagInterface.php @@ -20,8 +20,10 @@ interface SessionBagInterface { /** * Gets this bag's name. + * + * @return string */ - public function getName(): string; + public function getName(); /** * Initializes the Bag. @@ -30,13 +32,15 @@ public function initialize(array &$array); /** * Gets the storage key for this bag. + * + * @return string */ - public function getStorageKey(): string; + public function getStorageKey(); /** * Clears out data from bag. * * @return mixed Whatever data was contained */ - public function clear(): mixed; + public function clear(); } diff --git a/core/vendor/symfony/http-foundation/Session/SessionBagProxy.php b/core/vendor/symfony/http-foundation/Session/SessionBagProxy.php index 1d405e3c7f..90aa010c90 100644 --- a/core/vendor/symfony/http-foundation/Session/SessionBagProxy.php +++ b/core/vendor/symfony/http-foundation/Session/SessionBagProxy.php @@ -19,16 +19,16 @@ final class SessionBagProxy implements SessionBagInterface { private $bag; - private array $data; - private ?int $usageIndex; - private ?\Closure $usageReporter; + private $data; + private $usageIndex; + private $usageReporter; public function __construct(SessionBagInterface $bag, array &$data, ?int &$usageIndex, ?callable $usageReporter) { $this->bag = $bag; $this->data = &$data; $this->usageIndex = &$usageIndex; - $this->usageReporter = $usageReporter instanceof \Closure || !\is_callable($usageReporter) ? $usageReporter : \Closure::fromCallable($usageReporter); + $this->usageReporter = $usageReporter; } public function getBag(): SessionBagInterface @@ -88,7 +88,7 @@ public function getStorageKey(): string /** * {@inheritdoc} */ - public function clear(): mixed + public function clear() { return $this->bag->clear(); } diff --git a/core/vendor/symfony/http-foundation/Session/SessionFactory.php b/core/vendor/symfony/http-foundation/Session/SessionFactory.php index ffbd82cc41..04c4b06a04 100644 --- a/core/vendor/symfony/http-foundation/Session/SessionFactory.php +++ b/core/vendor/symfony/http-foundation/Session/SessionFactory.php @@ -24,13 +24,13 @@ class SessionFactory implements SessionFactoryInterface { private $requestStack; private $storageFactory; - private ?\Closure $usageReporter; + private $usageReporter; public function __construct(RequestStack $requestStack, SessionStorageFactoryInterface $storageFactory, callable $usageReporter = null) { $this->requestStack = $requestStack; $this->storageFactory = $storageFactory; - $this->usageReporter = $usageReporter instanceof \Closure || !\is_callable($usageReporter) ? $usageReporter : \Closure::fromCallable($usageReporter); + $this->usageReporter = $usageReporter; } public function createSession(): SessionInterface diff --git a/core/vendor/symfony/http-foundation/Session/SessionInterface.php b/core/vendor/symfony/http-foundation/Session/SessionInterface.php index ae0c9b7d3b..b2f09fd0dc 100644 --- a/core/vendor/symfony/http-foundation/Session/SessionInterface.php +++ b/core/vendor/symfony/http-foundation/Session/SessionInterface.php @@ -23,14 +23,18 @@ interface SessionInterface /** * Starts the session storage. * + * @return bool + * * @throws \RuntimeException if session fails to start */ - public function start(): bool; + public function start(); /** * Returns the session ID. + * + * @return string */ - public function getId(): string; + public function getId(); /** * Sets the session ID. @@ -39,8 +43,10 @@ public function setId(string $id); /** * Returns the session name. + * + * @return string */ - public function getName(): string; + public function getName(); /** * Sets the session name. @@ -57,8 +63,10 @@ public function setName(string $name); * will leave the system settings unchanged, 0 sets the cookie * to expire with browser session. Time is in seconds, and is * not a Unix timestamp. + * + * @return bool */ - public function invalidate(int $lifetime = null): bool; + public function invalidate(int $lifetime = null); /** * Migrates the current session to a new session id while maintaining all @@ -69,8 +77,10 @@ public function invalidate(int $lifetime = null): bool; * will leave the system settings unchanged, 0 sets the cookie * to expire with browser session. Time is in seconds, and is * not a Unix timestamp. + * + * @return bool */ - public function migrate(bool $destroy = false, int $lifetime = null): bool; + public function migrate(bool $destroy = false, int $lifetime = null); /** * Force the session to be saved and closed. @@ -83,23 +93,33 @@ public function save(); /** * Checks if an attribute is defined. + * + * @return bool */ - public function has(string $name): bool; + public function has(string $name); /** * Returns an attribute. + * + * @param mixed $default The default value if not found + * + * @return mixed */ - public function get(string $name, mixed $default = null): mixed; + public function get(string $name, $default = null); /** * Sets an attribute. + * + * @param mixed $value */ - public function set(string $name, mixed $value); + public function set(string $name, $value); /** * Returns attributes. + * + * @return array */ - public function all(): array; + public function all(); /** * Sets attributes. @@ -111,7 +131,7 @@ public function replace(array $attributes); * * @return mixed The removed value or null when it does not exist */ - public function remove(string $name): mixed; + public function remove(string $name); /** * Clears all attributes. @@ -120,8 +140,10 @@ public function clear(); /** * Checks if the session was started. + * + * @return bool */ - public function isStarted(): bool; + public function isStarted(); /** * Registers a SessionBagInterface with the session. @@ -130,11 +152,15 @@ public function registerBag(SessionBagInterface $bag); /** * Gets a bag instance by name. + * + * @return SessionBagInterface */ - public function getBag(string $name): SessionBagInterface; + public function getBag(string $name); /** * Gets session meta. + * + * @return MetadataBag */ - public function getMetadataBag(): MetadataBag; + public function getMetadataBag(); } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php index 2029e3ebcc..bc7b944fc5 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php @@ -22,13 +22,17 @@ */ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface { - private string $sessionName; - private string $prefetchId; - private string $prefetchData; - private ?string $newSessionId = null; - private string $igbinaryEmptyData; - - public function open(string $savePath, string $sessionName): bool + private $sessionName; + private $prefetchId; + private $prefetchData; + private $newSessionId; + private $igbinaryEmptyData; + + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { $this->sessionName = $sessionName; if (!headers_sent() && !ini_get('session.cache_limiter') && '0' !== ini_get('session.cache_limiter')) { @@ -38,26 +42,52 @@ public function open(string $savePath, string $sessionName): bool return true; } - abstract protected function doRead(string $sessionId): string; - - abstract protected function doWrite(string $sessionId, string $data): bool; - - abstract protected function doDestroy(string $sessionId): bool; - - public function validateId(string $sessionId): bool + /** + * @return string + */ + abstract protected function doRead(string $sessionId); + + /** + * @return bool + */ + abstract protected function doWrite(string $sessionId, string $data); + + /** + * @return bool + */ + abstract protected function doDestroy(string $sessionId); + + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function validateId($sessionId) { $this->prefetchData = $this->read($sessionId); $this->prefetchId = $sessionId; + if (\PHP_VERSION_ID < 70317 || (70400 <= \PHP_VERSION_ID && \PHP_VERSION_ID < 70405)) { + // work around https://bugs.php.net/79413 + foreach (debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) { + if (!isset($frame['class']) && isset($frame['function']) && \in_array($frame['function'], ['session_regenerate_id', 'session_create_id'], true)) { + return '' === $this->prefetchData; + } + } + } + return '' !== $this->prefetchData; } - public function read(string $sessionId): string + /** + * @return string + */ + #[\ReturnTypeWillChange] + public function read($sessionId) { - if (isset($this->prefetchId)) { + if (null !== $this->prefetchId) { $prefetchId = $this->prefetchId; $prefetchData = $this->prefetchData; - unset($this->prefetchId, $this->prefetchData); + $this->prefetchId = $this->prefetchData = null; if ($prefetchId === $sessionId || '' === $prefetchData) { $this->newSessionId = '' === $prefetchData ? $sessionId : null; @@ -72,10 +102,16 @@ public function read(string $sessionId): string return $data; } - public function write(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { - // see https://github.com/igbinary/igbinary/issues/146 - $this->igbinaryEmptyData ??= \function_exists('igbinary_serialize') ? igbinary_serialize([]) : ''; + if (null === $this->igbinaryEmptyData) { + // see https://github.com/igbinary/igbinary/issues/146 + $this->igbinaryEmptyData = \function_exists('igbinary_serialize') ? igbinary_serialize([]) : ''; + } if ('' === $data || $this->igbinaryEmptyData === $data) { return $this->destroy($sessionId); } @@ -84,10 +120,14 @@ public function write(string $sessionId, string $data): bool return $this->doWrite($sessionId, $data); } - public function destroy(string $sessionId): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function destroy($sessionId) { if (!headers_sent() && filter_var(ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOLEAN)) { - if (!isset($this->sessionName)) { + if (!$this->sessionName) { throw new \LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', static::class)); } $cookie = SessionUtils::popSessionCookie($this->sessionName, $sessionId); @@ -100,9 +140,13 @@ public function destroy(string $sessionId): bool * started the session). */ if (null === $cookie || isset($_COOKIE[$this->sessionName])) { - $params = session_get_cookie_params(); - unset($params['lifetime']); - setcookie($this->sessionName, '', $params); + if (\PHP_VERSION_ID < 70300) { + setcookie($this->sessionName, '', 0, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), filter_var(ini_get('session.cookie_secure'), \FILTER_VALIDATE_BOOLEAN), filter_var(ini_get('session.cookie_httponly'), \FILTER_VALIDATE_BOOLEAN)); + } else { + $params = session_get_cookie_params(); + unset($params['lifetime']); + setcookie($this->sessionName, '', $params); + } } } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php index 377d1e090c..c321c8c932 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php @@ -27,32 +27,56 @@ public function __construct(AbstractSessionHandler $handler, MarshallerInterface $this->marshaller = $marshaller; } - public function open(string $savePath, string $name): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function open($savePath, $name) { return $this->handler->open($savePath, $name); } - public function close(): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function close() { return $this->handler->close(); } - public function destroy(string $sessionId): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function destroy($sessionId) { return $this->handler->destroy($sessionId); } - public function gc(int $maxlifetime): int|false + /** + * @return int|false + */ + #[\ReturnTypeWillChange] + public function gc($maxlifetime) { return $this->handler->gc($maxlifetime); } - public function read(string $sessionId): string + /** + * @return string + */ + #[\ReturnTypeWillChange] + public function read($sessionId) { return $this->marshaller->unmarshall($this->handler->read($sessionId)); } - public function write(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { $failed = []; $marshalledData = $this->marshaller->marshall(['data' => $data], $failed); @@ -64,12 +88,20 @@ public function write(string $sessionId, string $data): bool return $this->handler->write($sessionId, $marshalledData['data']); } - public function validateId(string $sessionId): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function validateId($sessionId) { return $this->handler->validateId($sessionId); } - public function updateTimestamp(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function updateTimestamp($sessionId, $data) { return $this->handler->updateTimestamp($sessionId, $data); } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php index f5ef11daab..a5a78eb957 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php @@ -24,14 +24,14 @@ class MemcachedSessionHandler extends AbstractSessionHandler private $memcached; /** - * Time to live in seconds. + * @var int Time to live in seconds */ - private ?int $ttl; + private $ttl; /** - * Key prefix for shared environments. + * @var string Key prefix for shared environments */ - private string $prefix; + private $prefix; /** * Constructor. @@ -54,7 +54,11 @@ public function __construct(\Memcached $memcached, array $options = []) $this->prefix = $options['prefix'] ?? 'sf2s'; } - public function close(): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function close() { return $this->memcached->quit(); } @@ -62,12 +66,16 @@ public function close(): bool /** * {@inheritdoc} */ - protected function doRead(string $sessionId): string + protected function doRead(string $sessionId) { return $this->memcached->get($this->prefix.$sessionId) ?: ''; } - public function updateTimestamp(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function updateTimestamp($sessionId, $data) { $this->memcached->touch($this->prefix.$sessionId, time() + (int) ($this->ttl ?? ini_get('session.gc_maxlifetime'))); @@ -77,7 +85,7 @@ public function updateTimestamp(string $sessionId, string $data): bool /** * {@inheritdoc} */ - protected function doWrite(string $sessionId, string $data): bool + protected function doWrite(string $sessionId, string $data) { return $this->memcached->set($this->prefix.$sessionId, $data, time() + (int) ($this->ttl ?? ini_get('session.gc_maxlifetime'))); } @@ -85,14 +93,18 @@ protected function doWrite(string $sessionId, string $data): bool /** * {@inheritdoc} */ - protected function doDestroy(string $sessionId): bool + protected function doDestroy(string $sessionId) { $result = $this->memcached->delete($this->prefix.$sessionId); return $result || \Memcached::RES_NOTFOUND == $this->memcached->getResultCode(); } - public function gc(int $maxlifetime): int|false + /** + * @return int|false + */ + #[\ReturnTypeWillChange] + public function gc($maxlifetime) { // not required here because memcached will auto expire the records anyhow. return 0; @@ -100,8 +112,10 @@ public function gc(int $maxlifetime): int|false /** * Return a Memcached instance. + * + * @return \Memcached */ - protected function getMemcached(): \Memcached + protected function getMemcached() { return $this->memcached; } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php index 1d42552368..bf27ca6cc5 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php @@ -25,12 +25,12 @@ class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdat /** * @var \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface */ - private \SessionHandlerInterface $currentHandler; + private $currentHandler; /** * @var \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface */ - private \SessionHandlerInterface $writeOnlyHandler; + private $writeOnlyHandler; public function __construct(\SessionHandlerInterface $currentHandler, \SessionHandlerInterface $writeOnlyHandler) { @@ -45,7 +45,11 @@ public function __construct(\SessionHandlerInterface $currentHandler, \SessionHa $this->writeOnlyHandler = $writeOnlyHandler; } - public function close(): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function close() { $result = $this->currentHandler->close(); $this->writeOnlyHandler->close(); @@ -53,7 +57,11 @@ public function close(): bool return $result; } - public function destroy(string $sessionId): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function destroy($sessionId) { $result = $this->currentHandler->destroy($sessionId); $this->writeOnlyHandler->destroy($sessionId); @@ -61,7 +69,11 @@ public function destroy(string $sessionId): bool return $result; } - public function gc(int $maxlifetime): int|false + /** + * @return int|false + */ + #[\ReturnTypeWillChange] + public function gc($maxlifetime) { $result = $this->currentHandler->gc($maxlifetime); $this->writeOnlyHandler->gc($maxlifetime); @@ -69,7 +81,11 @@ public function gc(int $maxlifetime): int|false return $result; } - public function open(string $savePath, string $sessionName): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { $result = $this->currentHandler->open($savePath, $sessionName); $this->writeOnlyHandler->open($savePath, $sessionName); @@ -77,13 +93,21 @@ public function open(string $savePath, string $sessionName): bool return $result; } - public function read(string $sessionId): string + /** + * @return string + */ + #[\ReturnTypeWillChange] + public function read($sessionId) { // No reading from new handler until switch-over return $this->currentHandler->read($sessionId); } - public function write(string $sessionId, string $sessionData): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function write($sessionId, $sessionData) { $result = $this->currentHandler->write($sessionId, $sessionData); $this->writeOnlyHandler->write($sessionId, $sessionData); @@ -91,13 +115,21 @@ public function write(string $sessionId, string $sessionData): bool return $result; } - public function validateId(string $sessionId): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function validateId($sessionId) { // No reading from new handler until switch-over return $this->currentHandler->validateId($sessionId); } - public function updateTimestamp(string $sessionId, string $sessionData): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function updateTimestamp($sessionId, $sessionData) { $result = $this->currentHandler->updateTimestamp($sessionId, $sessionData); $this->writeOnlyHandler->updateTimestamp($sessionId, $sessionData); diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php index b370e80028..8384e79ddf 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -27,8 +27,16 @@ class MongoDbSessionHandler extends AbstractSessionHandler { private $mongo; + + /** + * @var Collection + */ private $collection; - private array $options; + + /** + * @var array + */ + private $options; /** * Constructor. @@ -76,7 +84,11 @@ public function __construct(Client $mongo, array $options) ], $options); } - public function close(): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function close() { return true; } @@ -84,7 +96,7 @@ public function close(): bool /** * {@inheritdoc} */ - protected function doDestroy(string $sessionId): bool + protected function doDestroy(string $sessionId) { $this->getCollection()->deleteOne([ $this->options['id_field'] => $sessionId, @@ -93,7 +105,11 @@ protected function doDestroy(string $sessionId): bool return true; } - public function gc(int $maxlifetime): int|false + /** + * @return int|false + */ + #[\ReturnTypeWillChange] + public function gc($maxlifetime) { return $this->getCollection()->deleteMany([ $this->options['expiry_field'] => ['$lt' => new UTCDateTime()], @@ -103,7 +119,7 @@ public function gc(int $maxlifetime): int|false /** * {@inheritdoc} */ - protected function doWrite(string $sessionId, string $data): bool + protected function doWrite(string $sessionId, string $data) { $expiry = new UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000); @@ -122,7 +138,11 @@ protected function doWrite(string $sessionId, string $data): bool return true; } - public function updateTimestamp(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function updateTimestamp($sessionId, $data) { $expiry = new UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000); @@ -140,7 +160,7 @@ public function updateTimestamp(string $sessionId, string $data): bool /** * {@inheritdoc} */ - protected function doRead(string $sessionId): string + protected function doRead(string $sessionId) { $dbData = $this->getCollection()->findOne([ $this->options['id_field'] => $sessionId, @@ -156,10 +176,17 @@ protected function doRead(string $sessionId): string private function getCollection(): Collection { - return $this->collection ??= $this->mongo->selectCollection($this->options['database'], $this->options['collection']); + if (null === $this->collection) { + $this->collection = $this->mongo->selectCollection($this->options['database'], $this->options['collection']); + } + + return $this->collection; } - protected function getMongo(): Client + /** + * @return Client + */ + protected function getMongo() { return $this->mongo; } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php index fb2d363b67..4331dbe502 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php @@ -18,12 +18,20 @@ */ class NullSessionHandler extends AbstractSessionHandler { - public function close(): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function close() { return true; } - public function validateId(string $sessionId): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function validateId($sessionId) { return true; } @@ -31,12 +39,16 @@ public function validateId(string $sessionId): bool /** * {@inheritdoc} */ - protected function doRead(string $sessionId): string + protected function doRead(string $sessionId) { return ''; } - public function updateTimestamp(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function updateTimestamp($sessionId, $data) { return true; } @@ -44,7 +56,7 @@ public function updateTimestamp(string $sessionId, string $data): bool /** * {@inheritdoc} */ - protected function doWrite(string $sessionId, string $data): bool + protected function doWrite(string $sessionId, string $data) { return true; } @@ -52,12 +64,16 @@ protected function doWrite(string $sessionId, string $data): bool /** * {@inheritdoc} */ - protected function doDestroy(string $sessionId): bool + protected function doDestroy(string $sessionId) { return true; } - public function gc(int $maxlifetime): int|false + /** + * @return int|false + */ + #[\ReturnTypeWillChange] + public function gc($maxlifetime) { return 0; } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php index 6f42ec97bd..067bfcb36c 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php @@ -65,61 +65,105 @@ class PdoSessionHandler extends AbstractSessionHandler */ public const LOCK_TRANSACTIONAL = 2; + private const MAX_LIFETIME = 315576000; + + /** + * @var \PDO|null PDO instance or null when not connected yet + */ private $pdo; /** * DSN string or null for session.save_path or false when lazy connection disabled. + * + * @var string|false|null + */ + private $dsn = false; + + /** + * @var string|null + */ + private $driver; + + /** + * @var string + */ + private $table = 'sessions'; + + /** + * @var string + */ + private $idCol = 'sess_id'; + + /** + * @var string + */ + private $dataCol = 'sess_data'; + + /** + * @var string */ - private string|false|null $dsn = false; + private $lifetimeCol = 'sess_lifetime'; - private string $driver; - private string $table = 'sessions'; - private string $idCol = 'sess_id'; - private string $dataCol = 'sess_data'; - private string $lifetimeCol = 'sess_lifetime'; - private string $timeCol = 'sess_time'; + /** + * @var string + */ + private $timeCol = 'sess_time'; /** * Username when lazy-connect. + * + * @var string */ - private string $username = ''; + private $username = ''; /** * Password when lazy-connect. + * + * @var string */ - private string $password = ''; + private $password = ''; /** * Connection options when lazy-connect. + * + * @var array */ - private array $connectionOptions = []; + private $connectionOptions = []; /** * The strategy for locking, see constants. + * + * @var int */ - private int $lockMode = self::LOCK_TRANSACTIONAL; + private $lockMode = self::LOCK_TRANSACTIONAL; /** * It's an array to support multiple reads before closing which is manual, non-standard usage. * * @var \PDOStatement[] An array of statements to release advisory locks */ - private array $unlockStatements = []; + private $unlockStatements = []; /** * True when the current session exists but expired according to session.gc_maxlifetime. + * + * @var bool */ - private bool $sessionExpired = false; + private $sessionExpired = false; /** * Whether a transaction is active. + * + * @var bool */ - private bool $inTransaction = false; + private $inTransaction = false; /** * Whether gc() has been called. + * + * @var bool */ - private bool $gcCalled = false; + private $gcCalled = false; /** * You can either pass an existing database connection as PDO instance or @@ -142,7 +186,7 @@ class PdoSessionHandler extends AbstractSessionHandler * * @throws \InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION */ - public function __construct(\PDO|string $pdoOrDsn = null, array $options = []) + public function __construct($pdoOrDsn = null, array $options = []) { if ($pdoOrDsn instanceof \PDO) { if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) { @@ -223,24 +267,34 @@ public function createTable() * Returns true when the current session exists but expired according to session.gc_maxlifetime. * * Can be used to distinguish between a new session and one that expired due to inactivity. + * + * @return bool */ - public function isSessionExpired(): bool + public function isSessionExpired() { return $this->sessionExpired; } - public function open(string $savePath, string $sessionName): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { $this->sessionExpired = false; - if (!isset($this->pdo)) { + if (null === $this->pdo) { $this->connect($this->dsn ?: $savePath); } return parent::open($savePath, $sessionName); } - public function read(string $sessionId): string + /** + * @return string + */ + #[\ReturnTypeWillChange] + public function read($sessionId) { try { return parent::read($sessionId); @@ -251,7 +305,11 @@ public function read(string $sessionId): string } } - public function gc(int $maxlifetime): int|false + /** + * @return int|false + */ + #[\ReturnTypeWillChange] + public function gc($maxlifetime) { // We delay gc() to close() so that it is executed outside the transactional and blocking read-write process. // This way, pruning expired sessions does not block them from being started while the current session is used. @@ -263,7 +321,7 @@ public function gc(int $maxlifetime): int|false /** * {@inheritdoc} */ - protected function doDestroy(string $sessionId): bool + protected function doDestroy(string $sessionId) { // delete the record associated with this id $sql = "DELETE FROM $this->table WHERE $this->idCol = :id"; @@ -284,7 +342,7 @@ protected function doDestroy(string $sessionId): bool /** * {@inheritdoc} */ - protected function doWrite(string $sessionId, string $data): bool + protected function doWrite(string $sessionId, string $data) { $maxlifetime = (int) ini_get('session.gc_maxlifetime'); @@ -327,7 +385,11 @@ protected function doWrite(string $sessionId, string $data): bool return true; } - public function updateTimestamp(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function updateTimestamp($sessionId, $data) { $expiry = time() + (int) ini_get('session.gc_maxlifetime'); @@ -348,7 +410,11 @@ public function updateTimestamp(string $sessionId, string $data): bool return true; } - public function close(): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function close() { $this->commit(); @@ -360,14 +426,27 @@ public function close(): bool $this->gcCalled = false; // delete the session records that have expired - $sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time"; + $sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time AND $this->lifetimeCol > :min"; $stmt = $this->pdo->prepare($sql); $stmt->bindValue(':time', time(), \PDO::PARAM_INT); + $stmt->bindValue(':min', self::MAX_LIFETIME, \PDO::PARAM_INT); + $stmt->execute(); + // to be removed in 6.0 + if ('mysql' === $this->driver) { + $legacySql = "DELETE FROM $this->table WHERE $this->lifetimeCol <= :min AND $this->lifetimeCol + $this->timeCol < :time"; + } else { + $legacySql = "DELETE FROM $this->table WHERE $this->lifetimeCol <= :min AND $this->lifetimeCol < :time - $this->timeCol"; + } + + $stmt = $this->pdo->prepare($legacySql); + $stmt->bindValue(':time', time(), \PDO::PARAM_INT); + $stmt->bindValue(':min', self::MAX_LIFETIME, \PDO::PARAM_INT); $stmt->execute(); } if (false !== $this->dsn) { - unset($this->pdo, $this->driver); // only close lazy-connection + $this->pdo = null; // only close lazy-connection + $this->driver = null; } return true; @@ -570,8 +649,10 @@ private function rollback(): void * * We need to make sure we do not return session data that is already considered garbage according * to the session.gc_maxlifetime setting because gc() is called after read() and only sometimes. + * + * @return string */ - protected function doRead(string $sessionId): string + protected function doRead(string $sessionId) { if (self::LOCK_ADVISORY === $this->lockMode) { $this->unlockStatements[] = $this->doAdvisoryLock($sessionId); @@ -588,6 +669,9 @@ protected function doRead(string $sessionId): string if ($sessionRows) { $expiry = (int) $sessionRows[0][1]; + if ($expiry <= self::MAX_LIFETIME) { + $expiry += $sessionRows[0][2]; + } if ($expiry < time()) { $this->sessionExpired = true; @@ -720,13 +804,14 @@ private function getSelectSql(): string if (self::LOCK_TRANSACTIONAL === $this->lockMode) { $this->beginTransaction(); + // selecting the time column should be removed in 6.0 switch ($this->driver) { case 'mysql': case 'oci': case 'pgsql': - return "SELECT $this->dataCol, $this->lifetimeCol FROM $this->table WHERE $this->idCol = :id FOR UPDATE"; + return "SELECT $this->dataCol, $this->lifetimeCol, $this->timeCol FROM $this->table WHERE $this->idCol = :id FOR UPDATE"; case 'sqlsrv': - return "SELECT $this->dataCol, $this->lifetimeCol FROM $this->table WITH (UPDLOCK, ROWLOCK) WHERE $this->idCol = :id"; + return "SELECT $this->dataCol, $this->lifetimeCol, $this->timeCol FROM $this->table WITH (UPDLOCK, ROWLOCK) WHERE $this->idCol = :id"; case 'sqlite': // we already locked when starting transaction break; @@ -735,7 +820,7 @@ private function getSelectSql(): string } } - return "SELECT $this->dataCol, $this->lifetimeCol FROM $this->table WHERE $this->idCol = :id"; + return "SELECT $this->dataCol, $this->lifetimeCol, $this->timeCol FROM $this->table WHERE $this->idCol = :id"; } /** @@ -844,10 +929,12 @@ private function getMergeStatement(string $sessionId, string $data, int $maxlife /** * Return a PDO instance. + * + * @return \PDO */ - protected function getConnection(): \PDO + protected function getConnection() { - if (!isset($this->pdo)) { + if (null === $this->pdo) { $this->connect($this->dsn ?: ini_get('session.save_path')); } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php index db9c189d2c..5cc2e345d8 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php @@ -26,24 +26,37 @@ class RedisSessionHandler extends AbstractSessionHandler private $redis; /** - * Key prefix for shared environments. + * @var string Key prefix for shared environments */ - private string $prefix; + private $prefix; /** - * Time to live in seconds. + * @var int Time to live in seconds */ - private ?int $ttl; + private $ttl; /** * List of available options: * * prefix: The prefix to use for the keys in order to avoid collision on the Redis server * * ttl: The time to live in seconds. * + * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|RedisProxy|RedisClusterProxy $redis + * * @throws \InvalidArgumentException When unsupported client or options are passed */ - public function __construct(\Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|RedisProxy|RedisClusterProxy $redis, array $options = []) + public function __construct($redis, array $options = []) { + if ( + !$redis instanceof \Redis && + !$redis instanceof \RedisArray && + !$redis instanceof \RedisCluster && + !$redis instanceof \Predis\ClientInterface && + !$redis instanceof RedisProxy && + !$redis instanceof RedisClusterProxy + ) { + throw new \InvalidArgumentException(sprintf('"%s()" expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, "%s" given.', __METHOD__, get_debug_type($redis))); + } + if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) { throw new \InvalidArgumentException(sprintf('The following options are not supported "%s".', implode(', ', $diff))); } @@ -101,13 +114,23 @@ public function close(): bool return true; } - public function gc(int $maxlifetime): int|false + /** + * {@inheritdoc} + * + * @return int|false + */ + #[\ReturnTypeWillChange] + public function gc($maxlifetime) { return 0; } - public function updateTimestamp(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function updateTimestamp($sessionId, $data) { - return $this->redis->expire($this->prefix.$sessionId, (int) ($this->ttl ?? ini_get('session.gc_maxlifetime'))); + return (bool) $this->redis->expire($this->prefix.$sessionId, (int) ($this->ttl ?? ini_get('session.gc_maxlifetime'))); } } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php index 19ff94c81c..f3f7b201d9 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php @@ -21,8 +21,15 @@ */ class SessionHandlerFactory { - public static function createHandler(object|string $connection): AbstractSessionHandler + /** + * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|RedisProxy|RedisClusterProxy|\Memcached|\PDO|string $connection Connection or DSN + */ + public static function createHandler($connection): AbstractSessionHandler { + if (!\is_string($connection) && !\is_object($connection)) { + throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a string or a connection object, "%s" given.', __METHOD__, get_debug_type($connection))); + } + if ($options = \is_string($connection) ? parse_url($connection) : false) { parse_str($options['query'] ?? '', $options); } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php index 730f100913..0461e997e2 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php @@ -18,8 +18,8 @@ */ class StrictSessionHandler extends AbstractSessionHandler { - private \SessionHandlerInterface $handler; - private bool $doDestroy; + private $handler; + private $doDestroy; public function __construct(\SessionHandlerInterface $handler) { @@ -30,7 +30,11 @@ public function __construct(\SessionHandlerInterface $handler) $this->handler = $handler; } - public function open(string $savePath, string $sessionName): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { parent::open($savePath, $sessionName); @@ -40,12 +44,16 @@ public function open(string $savePath, string $sessionName): bool /** * {@inheritdoc} */ - protected function doRead(string $sessionId): string + protected function doRead(string $sessionId) { return $this->handler->read($sessionId); } - public function updateTimestamp(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function updateTimestamp($sessionId, $data) { return $this->write($sessionId, $data); } @@ -53,12 +61,16 @@ public function updateTimestamp(string $sessionId, string $data): bool /** * {@inheritdoc} */ - protected function doWrite(string $sessionId, string $data): bool + protected function doWrite(string $sessionId, string $data) { return $this->handler->write($sessionId, $data); } - public function destroy(string $sessionId): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function destroy($sessionId) { $this->doDestroy = true; $destroyed = parent::destroy($sessionId); @@ -69,19 +81,27 @@ public function destroy(string $sessionId): bool /** * {@inheritdoc} */ - protected function doDestroy(string $sessionId): bool + protected function doDestroy(string $sessionId) { $this->doDestroy = false; return $this->handler->destroy($sessionId); } - public function close(): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function close() { return $this->handler->close(); } - public function gc(int $maxlifetime): int|false + /** + * @return int|false + */ + #[\ReturnTypeWillChange] + public function gc($maxlifetime) { return $this->handler->gc($maxlifetime); } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php b/core/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php index 61d225f11b..1bfce5520d 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php @@ -26,8 +26,15 @@ class MetadataBag implements SessionBagInterface public const UPDATED = 'u'; public const LIFETIME = 'l'; - private string $name = '__metadata'; - private string $storageKey; + /** + * @var string + */ + private $name = '__metadata'; + + /** + * @var string + */ + private $storageKey; /** * @var array @@ -36,10 +43,15 @@ class MetadataBag implements SessionBagInterface /** * Unix timestamp. + * + * @var int */ - private int $lastUsed; + private $lastUsed; - private int $updateThreshold; + /** + * @var int + */ + private $updateThreshold; /** * @param string $storageKey The key used to store bag in the session @@ -72,8 +84,10 @@ public function initialize(array &$array) /** * Gets the lifetime that the session cookie was set with. + * + * @return int */ - public function getLifetime(): int + public function getLifetime() { return $this->meta[self::LIFETIME]; } @@ -94,7 +108,7 @@ public function stampNew(int $lifetime = null) /** * {@inheritdoc} */ - public function getStorageKey(): string + public function getStorageKey() { return $this->storageKey; } @@ -104,7 +118,7 @@ public function getStorageKey(): string * * @return int Unix timestamp */ - public function getCreated(): int + public function getCreated() { return $this->meta[self::CREATED]; } @@ -114,7 +128,7 @@ public function getCreated(): int * * @return int Unix timestamp */ - public function getLastUsed(): int + public function getLastUsed() { return $this->lastUsed; } @@ -122,7 +136,7 @@ public function getLastUsed(): int /** * {@inheritdoc} */ - public function clear(): mixed + public function clear() { // nothing to do return null; @@ -131,7 +145,7 @@ public function clear(): mixed /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return $this->name; } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php b/core/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php index 8495f8ff5f..c5c2bb0731 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php @@ -76,7 +76,7 @@ public function setSessionData(array $array) /** * {@inheritdoc} */ - public function start(): bool + public function start() { if ($this->started) { return true; @@ -94,7 +94,7 @@ public function start(): bool /** * {@inheritdoc} */ - public function regenerate(bool $destroy = false, int $lifetime = null): bool + public function regenerate(bool $destroy = false, int $lifetime = null) { if (!$this->started) { $this->start(); @@ -109,7 +109,7 @@ public function regenerate(bool $destroy = false, int $lifetime = null): bool /** * {@inheritdoc} */ - public function getId(): string + public function getId() { return $this->id; } @@ -129,7 +129,7 @@ public function setId(string $id) /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return $this->name; } @@ -183,7 +183,7 @@ public function registerBag(SessionBagInterface $bag) /** * {@inheritdoc} */ - public function getBag(string $name): SessionBagInterface + public function getBag(string $name) { if (!isset($this->bags[$name])) { throw new \InvalidArgumentException(sprintf('The SessionBagInterface "%s" is not registered.', $name)); @@ -199,7 +199,7 @@ public function getBag(string $name): SessionBagInterface /** * {@inheritdoc} */ - public function isStarted(): bool + public function isStarted() { return $this->started; } @@ -215,8 +215,10 @@ public function setMetadataBag(MetadataBag $bag = null) /** * Gets the MetadataBag. + * + * @return MetadataBag */ - public function getMetadataBag(): MetadataBag + public function getMetadataBag() { return $this->metadataBag; } @@ -226,8 +228,10 @@ public function getMetadataBag(): MetadataBag * * This doesn't need to be particularly cryptographically secure since this is just * a mock. + * + * @return string */ - protected function generateId(): string + protected function generateId() { return hash('sha256', uniqid('ss_mock_', true)); } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php b/core/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php index 4e0e0e52f0..a1b7a31f29 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php @@ -24,7 +24,7 @@ */ class MockFileSessionStorage extends MockArraySessionStorage { - private string $savePath; + private $savePath; /** * @param string|null $savePath Path of directory to save session files @@ -47,7 +47,7 @@ public function __construct(string $savePath = null, string $name = 'MOCKSESSID' /** * {@inheritdoc} */ - public function start(): bool + public function start() { if ($this->started) { return true; @@ -67,7 +67,7 @@ public function start(): bool /** * {@inheritdoc} */ - public function regenerate(bool $destroy = false, int $lifetime = null): bool + public function regenerate(bool $destroy = false, int $lifetime = null) { if (!$this->started) { $this->start(); diff --git a/core/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php b/core/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php index c354d12aef..d0da1e1692 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php @@ -21,8 +21,8 @@ class_exists(MockFileSessionStorage::class); */ class MockFileSessionStorageFactory implements SessionStorageFactoryInterface { - private ?string $savePath; - private string $name; + private $savePath; + private $name; private $metaBag; /** diff --git a/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php index 09b33d5b18..02467da9e5 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php @@ -12,6 +12,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage; use Symfony\Component\HttpFoundation\Session\SessionBagInterface; +use Symfony\Component\HttpFoundation\Session\SessionUtils; use Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler; use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy; @@ -53,6 +54,11 @@ class NativeSessionStorage implements SessionStorageInterface */ protected $metadataBag; + /** + * @var string|null + */ + private $emulateSameSite; + /** * Depending on how you want the storage driver to behave you probably * want to override this constructor entirely. @@ -88,8 +94,10 @@ class NativeSessionStorage implements SessionStorageInterface * sid_bits_per_character, "5" * trans_sid_hosts, $_SERVER['HTTP_HOST'] * trans_sid_tags, "a=href,area=href,frame=src,form=" + * + * @param AbstractProxy|\SessionHandlerInterface|null $handler */ - public function __construct(array $options = [], AbstractProxy|\SessionHandlerInterface $handler = null, MetadataBag $metaBag = null) + public function __construct(array $options = [], $handler = null, MetadataBag $metaBag = null) { if (!\extension_loaded('session')) { throw new \LogicException('PHP extension "session" is required.'); @@ -112,8 +120,10 @@ public function __construct(array $options = [], AbstractProxy|\SessionHandlerIn /** * Gets the save handler instance. + * + * @return AbstractProxy|\SessionHandlerInterface */ - public function getSaveHandler(): AbstractProxy|\SessionHandlerInterface + public function getSaveHandler() { return $this->saveHandler; } @@ -121,7 +131,7 @@ public function getSaveHandler(): AbstractProxy|\SessionHandlerInterface /** * {@inheritdoc} */ - public function start(): bool + public function start() { if ($this->started) { return true; @@ -140,6 +150,13 @@ public function start(): bool throw new \RuntimeException('Failed to start the session.'); } + if (null !== $this->emulateSameSite) { + $originalCookie = SessionUtils::popSessionCookie(session_name(), session_id()); + if (null !== $originalCookie) { + header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite), false); + } + } + $this->loadSession(); return true; @@ -148,7 +165,7 @@ public function start(): bool /** * {@inheritdoc} */ - public function getId(): string + public function getId() { return $this->saveHandler->getId(); } @@ -164,7 +181,7 @@ public function setId(string $id) /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return $this->saveHandler->getName(); } @@ -180,7 +197,7 @@ public function setName(string $name) /** * {@inheritdoc} */ - public function regenerate(bool $destroy = false, int $lifetime = null): bool + public function regenerate(bool $destroy = false, int $lifetime = null) { // Cannot regenerate the session ID for non-active sessions. if (\PHP_SESSION_ACTIVE !== session_status()) { @@ -201,7 +218,16 @@ public function regenerate(bool $destroy = false, int $lifetime = null): bool $this->metadataBag->stampNew(); } - return session_regenerate_id($destroy); + $isRegenerated = session_regenerate_id($destroy); + + if (null !== $this->emulateSameSite) { + $originalCookie = SessionUtils::popSessionCookie(session_name(), session_id()); + if (null !== $originalCookie) { + header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite), false); + } + } + + return $isRegenerated; } /** @@ -278,7 +304,7 @@ public function registerBag(SessionBagInterface $bag) /** * {@inheritdoc} */ - public function getBag(string $name): SessionBagInterface + public function getBag(string $name) { if (!isset($this->bags[$name])) { throw new \InvalidArgumentException(sprintf('The SessionBagInterface "%s" is not registered.', $name)); @@ -304,8 +330,10 @@ public function setMetadataBag(MetadataBag $metaBag = null) /** * Gets the MetadataBag. + * + * @return MetadataBag */ - public function getMetadataBag(): MetadataBag + public function getMetadataBag() { return $this->metadataBag; } @@ -313,7 +341,7 @@ public function getMetadataBag(): MetadataBag /** * {@inheritdoc} */ - public function isStarted(): bool + public function isStarted() { return $this->started; } @@ -340,16 +368,31 @@ public function setOptions(array $options) 'gc_divisor', 'gc_maxlifetime', 'gc_probability', 'lazy_write', 'name', 'referer_check', 'serialize_handler', 'use_strict_mode', 'use_cookies', - 'use_only_cookies', 'use_trans_sid', + 'use_only_cookies', 'use_trans_sid', 'upload_progress.enabled', + 'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name', + 'upload_progress.freq', 'upload_progress.min_freq', 'url_rewriter.tags', 'sid_length', 'sid_bits_per_character', 'trans_sid_hosts', 'trans_sid_tags', ]); foreach ($options as $key => $value) { if (isset($validOptions[$key])) { + if (str_starts_with($key, 'upload_progress.')) { + trigger_deprecation('symfony/http-foundation', '5.4', 'Support for the "%s" session option is deprecated. The settings prefixed with "session.upload_progress." can not be changed at runtime.', $key); + continue; + } + if ('url_rewriter.tags' === $key) { + trigger_deprecation('symfony/http-foundation', '5.4', 'Support for the "%s" session option is deprecated. Use "trans_sid_tags" instead.', $key); + } + if ('cookie_samesite' === $key && \PHP_VERSION_ID < 70300) { + // PHP < 7.3 does not support same_site cookies. We will emulate it in + // the start() method instead. + $this->emulateSameSite = $value; + continue; + } if ('cookie_secure' === $key && 'auto' === $value) { continue; } - ini_set('session.'.$key, $value); + ini_set('url_rewriter.tags' !== $key ? 'session.'.$key : $key, $value); } } } @@ -370,9 +413,11 @@ public function setOptions(array $options) * @see https://php.net/sessionhandlerinterface * @see https://php.net/sessionhandler * + * @param AbstractProxy|\SessionHandlerInterface|null $saveHandler + * * @throws \InvalidArgumentException */ - public function setSaveHandler(AbstractProxy|\SessionHandlerInterface $saveHandler = null) + public function setSaveHandler($saveHandler = null) { if (!$saveHandler instanceof AbstractProxy && !$saveHandler instanceof \SessionHandlerInterface && diff --git a/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php b/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php index ea6c7de1e0..a7d7411ff3 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpFoundation\Session\Storage; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; // Help opcache.preload discover always-needed symbols class_exists(NativeSessionStorage::class); @@ -22,15 +21,15 @@ class_exists(NativeSessionStorage::class); */ class NativeSessionStorageFactory implements SessionStorageFactoryInterface { - private array $options; + private $options; private $handler; private $metaBag; - private bool $secure; + private $secure; /** * @see NativeSessionStorage constructor. */ - public function __construct(array $options = [], AbstractProxy|\SessionHandlerInterface $handler = null, MetadataBag $metaBag = null, bool $secure = false) + public function __construct(array $options = [], $handler = null, MetadataBag $metaBag = null, bool $secure = false) { $this->options = $options; $this->handler = $handler; diff --git a/core/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php b/core/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php index 276ed318a7..72dbef1346 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php @@ -20,7 +20,10 @@ */ class PhpBridgeSessionStorage extends NativeSessionStorage { - public function __construct(AbstractProxy|\SessionHandlerInterface $handler = null, MetadataBag $metaBag = null) + /** + * @param AbstractProxy|\SessionHandlerInterface|null $handler + */ + public function __construct($handler = null, MetadataBag $metaBag = null) { if (!\extension_loaded('session')) { throw new \LogicException('PHP extension "session" is required.'); @@ -33,7 +36,7 @@ public function __construct(AbstractProxy|\SessionHandlerInterface $handler = nu /** * {@inheritdoc} */ - public function start(): bool + public function start() { if ($this->started) { return true; diff --git a/core/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php b/core/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php index cce1ec6c33..173ef71dea 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpFoundation\Session\Storage; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; // Help opcache.preload discover always-needed symbols class_exists(PhpBridgeSessionStorage::class); @@ -24,9 +23,12 @@ class PhpBridgeSessionStorageFactory implements SessionStorageFactoryInterface { private $handler; private $metaBag; - private bool $secure; + private $secure; - public function __construct(AbstractProxy|\SessionHandlerInterface $handler = null, MetadataBag $metaBag = null, bool $secure = false) + /** + * @see PhpBridgeSessionStorage constructor. + */ + public function __construct($handler = null, MetadataBag $metaBag = null, bool $secure = false) { $this->handler = $handler; $this->metaBag = $metaBag; diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php b/core/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php index 1845ee2c9e..edd04dff80 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php @@ -30,40 +30,50 @@ abstract class AbstractProxy /** * Gets the session.save_handler name. + * + * @return string|null */ - public function getSaveHandlerName(): ?string + public function getSaveHandlerName() { return $this->saveHandlerName; } /** * Is this proxy handler and instance of \SessionHandlerInterface. + * + * @return bool */ - public function isSessionHandlerInterface(): bool + public function isSessionHandlerInterface() { return $this instanceof \SessionHandlerInterface; } /** * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. + * + * @return bool */ - public function isWrapper(): bool + public function isWrapper() { return $this->wrapper; } /** * Has a session started? + * + * @return bool */ - public function isActive(): bool + public function isActive() { return \PHP_SESSION_ACTIVE === session_status(); } /** * Gets the session ID. + * + * @return string */ - public function getId(): string + public function getId() { return session_id(); } @@ -84,8 +94,10 @@ public function setId(string $id) /** * Gets the session name. + * + * @return string */ - public function getName(): string + public function getName() { return session_name(); } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php b/core/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php index bca51153e3..9b0cdeb7fe 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php @@ -25,49 +25,84 @@ public function __construct(\SessionHandlerInterface $handler) $this->saveHandlerName = $this->wrapper ? ini_get('session.save_handler') : 'user'; } - public function getHandler(): \SessionHandlerInterface + /** + * @return \SessionHandlerInterface + */ + public function getHandler() { return $this->handler; } // \SessionHandlerInterface - public function open(string $savePath, string $sessionName): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function open($savePath, $sessionName) { return $this->handler->open($savePath, $sessionName); } - public function close(): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function close() { return $this->handler->close(); } - public function read(string $sessionId): string|false + /** + * @return string|false + */ + #[\ReturnTypeWillChange] + public function read($sessionId) { return $this->handler->read($sessionId); } - public function write(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function write($sessionId, $data) { return $this->handler->write($sessionId, $data); } - public function destroy(string $sessionId): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function destroy($sessionId) { return $this->handler->destroy($sessionId); } - public function gc(int $maxlifetime): int|false + /** + * @return int|false + */ + #[\ReturnTypeWillChange] + public function gc($maxlifetime) { return $this->handler->gc($maxlifetime); } - public function validateId(string $sessionId): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function validateId($sessionId) { return !$this->handler instanceof \SessionUpdateTimestampHandlerInterface || $this->handler->validateId($sessionId); } - public function updateTimestamp(string $sessionId, string $data): bool + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function updateTimestamp($sessionId, $data) { return $this->handler instanceof \SessionUpdateTimestampHandlerInterface ? $this->handler->updateTimestamp($sessionId, $data) : $this->write($sessionId, $data); } diff --git a/core/vendor/symfony/http-foundation/Session/Storage/ServiceSessionFactory.php b/core/vendor/symfony/http-foundation/Session/Storage/ServiceSessionFactory.php new file mode 100644 index 0000000000..d17c60aeba --- /dev/null +++ b/core/vendor/symfony/http-foundation/Session/Storage/ServiceSessionFactory.php @@ -0,0 +1,38 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Request; + +/** + * @author Jérémy Derussé <jeremy@derusse.com> + * + * @internal to be removed in Symfony 6 + */ +final class ServiceSessionFactory implements SessionStorageFactoryInterface +{ + private $storage; + + public function __construct(SessionStorageInterface $storage) + { + $this->storage = $storage; + } + + public function createStorage(?Request $request): SessionStorageInterface + { + if ($this->storage instanceof NativeSessionStorage && $request && $request->isSecure()) { + $this->storage->setOptions(['cookie_secure' => true]); + } + + return $this->storage; + } +} diff --git a/core/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php b/core/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php index 36839e69f8..b7f66e7c73 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php @@ -24,19 +24,25 @@ interface SessionStorageInterface /** * Starts the session. * + * @return bool + * * @throws \RuntimeException if something goes wrong starting the session */ - public function start(): bool; + public function start(); /** * Checks if the session is started. + * + * @return bool */ - public function isStarted(): bool; + public function isStarted(); /** * Returns the session ID. + * + * @return string */ - public function getId(): string; + public function getId(); /** * Sets the session ID. @@ -45,8 +51,10 @@ public function setId(string $id); /** * Returns the session name. + * + * @return string */ - public function getName(): string; + public function getName(); /** * Sets the session name. @@ -78,9 +86,11 @@ public function setName(string $name); * to expire with browser session. Time is in seconds, and is * not a Unix timestamp. * + * @return bool + * * @throws \RuntimeException If an error occurs while regenerating this storage */ - public function regenerate(bool $destroy = false, int $lifetime = null): bool; + public function regenerate(bool $destroy = false, int $lifetime = null); /** * Force the session to be saved and closed. @@ -103,14 +113,19 @@ public function clear(); /** * Gets a SessionBagInterface by name. * + * @return SessionBagInterface + * * @throws \InvalidArgumentException If the bag does not exist */ - public function getBag(string $name): SessionBagInterface; + public function getBag(string $name); /** * Registers a SessionBagInterface for use. */ public function registerBag(SessionBagInterface $bag); - public function getMetadataBag(): MetadataBag; + /** + * @return MetadataBag + */ + public function getMetadataBag(); } diff --git a/core/vendor/symfony/http-foundation/StreamedResponse.php b/core/vendor/symfony/http-foundation/StreamedResponse.php index 4a6fbe1568..676cd66875 100644 --- a/core/vendor/symfony/http-foundation/StreamedResponse.php +++ b/core/vendor/symfony/http-foundation/StreamedResponse.php @@ -28,7 +28,7 @@ class StreamedResponse extends Response { protected $callback; protected $streamed; - private bool $headersSent; + private $headersSent; public function __construct(callable $callback = null, int $status = 200, array $headers = []) { @@ -41,12 +41,28 @@ public function __construct(callable $callback = null, int $status = 200, array $this->headersSent = false; } + /** + * Factory method for chainability. + * + * @param callable|null $callback A valid PHP callback or null to set it later + * + * @return static + * + * @deprecated since Symfony 5.1, use __construct() instead. + */ + public static function create($callback = null, int $status = 200, array $headers = []) + { + trigger_deprecation('symfony/http-foundation', '5.1', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, static::class); + + return new static($callback, $status, $headers); + } + /** * Sets the PHP callback associated with this Response. * * @return $this */ - public function setCallback(callable $callback): static + public function setCallback(callable $callback) { $this->callback = $callback; @@ -60,7 +76,7 @@ public function setCallback(callable $callback): static * * @return $this */ - public function sendHeaders(): static + public function sendHeaders() { if ($this->headersSent) { return $this; @@ -78,7 +94,7 @@ public function sendHeaders(): static * * @return $this */ - public function sendContent(): static + public function sendContent() { if ($this->streamed) { return $this; @@ -102,7 +118,7 @@ public function sendContent(): static * * @return $this */ - public function setContent(?string $content): static + public function setContent(?string $content) { if (null !== $content) { throw new \LogicException('The content cannot be set on a StreamedResponse instance.'); @@ -116,7 +132,7 @@ public function setContent(?string $content): static /** * {@inheritdoc} */ - public function getContent(): string|false + public function getContent() { return false; } diff --git a/core/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php b/core/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php index 534c1d1388..cb216ea12a 100644 --- a/core/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php +++ b/core/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php @@ -16,8 +16,8 @@ final class RequestAttributeValueSame extends Constraint { - private string $name; - private string $value; + private $name; + private $value; public function __construct(string $name, string $value) { diff --git a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php index db1e733dce..554e1a1602 100644 --- a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php +++ b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php @@ -17,10 +17,10 @@ final class ResponseCookieValueSame extends Constraint { - private string $name; - private string $value; - private string $path; - private ?string $domain; + private $name; + private $value; + private $path; + private $domain; public function __construct(string $name, string $value, string $path = '/', string $domain = null) { diff --git a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php index cb9699c325..f73aedfa11 100644 --- a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php +++ b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php @@ -23,7 +23,7 @@ final class ResponseFormatSame extends Constraint { private $request; - private ?string $format; + private $format; public function __construct(Request $request, ?string $format) { diff --git a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php index 47a091b08e..eae9e271bc 100644 --- a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php +++ b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php @@ -17,9 +17,9 @@ final class ResponseHasCookie extends Constraint { - private string $name; - private string $path; - private ?string $domain; + private $name; + private $path; + private $domain; public function __construct(string $name, string $path = '/', string $domain = null) { diff --git a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php index 1e028976ef..68ad8273fd 100644 --- a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php +++ b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php @@ -16,7 +16,7 @@ final class ResponseHasHeader extends Constraint { - private string $headerName; + private $headerName; public function __construct(string $headerName) { diff --git a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php index dc96bec809..a27d0c73fd 100644 --- a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php +++ b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php @@ -16,8 +16,8 @@ final class ResponseHeaderSame extends Constraint { - private string $headerName; - private string $expectedValue; + private $headerName; + private $expectedValue; public function __construct(string $headerName, string $expectedValue) { diff --git a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php index 8d2ce1228a..72bb000b85 100644 --- a/core/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php +++ b/core/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php @@ -16,7 +16,7 @@ final class ResponseStatusCodeSame extends Constraint { - private int $statusCode; + private $statusCode; public function __construct(int $statusCode) { diff --git a/core/vendor/symfony/http-foundation/composer.json b/core/vendor/symfony/http-foundation/composer.json index 9f5cccc65a..d54bbfd160 100644 --- a/core/vendor/symfony/http-foundation/composer.json +++ b/core/vendor/symfony/http-foundation/composer.json @@ -16,15 +16,16 @@ } ], "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.1" + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "predis/predis": "~1.0", - "symfony/cache": "^5.4|^6.0", - "symfony/mime": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0" + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0" }, "suggest" : { "symfony/mime": "To use the file extension guesser" diff --git a/core/vendor/symfony/http-kernel/Attribute/ArgumentInterface.php b/core/vendor/symfony/http-kernel/Attribute/ArgumentInterface.php new file mode 100644 index 0000000000..78769f1ac0 --- /dev/null +++ b/core/vendor/symfony/http-kernel/Attribute/ArgumentInterface.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Attribute; + +trigger_deprecation('symfony/http-kernel', '5.3', 'The "%s" interface is deprecated.', ArgumentInterface::class); + +/** + * Marker interface for controller argument attributes. + * + * @deprecated since Symfony 5.3 + */ +interface ArgumentInterface +{ +} diff --git a/core/vendor/symfony/http-kernel/Bundle/Bundle.php b/core/vendor/symfony/http-kernel/Bundle/Bundle.php index 5ce7f28d41..54a1d10b90 100644 --- a/core/vendor/symfony/http-kernel/Bundle/Bundle.php +++ b/core/vendor/symfony/http-kernel/Bundle/Bundle.php @@ -29,7 +29,7 @@ abstract class Bundle implements BundleInterface protected $name; protected $extension; protected $path; - private string $namespace; + private $namespace; /** * {@inheritdoc} @@ -58,9 +58,11 @@ public function build(ContainerBuilder $container) /** * Returns the bundle's container extension. * + * @return ExtensionInterface|null + * * @throws \LogicException */ - public function getContainerExtension(): ?ExtensionInterface + public function getContainerExtension() { if (null === $this->extension) { $extension = $this->createContainerExtension(); @@ -90,9 +92,9 @@ public function getContainerExtension(): ?ExtensionInterface /** * {@inheritdoc} */ - public function getNamespace(): string + public function getNamespace() { - if (!isset($this->namespace)) { + if (null === $this->namespace) { $this->parseClassName(); } @@ -102,7 +104,7 @@ public function getNamespace(): string /** * {@inheritdoc} */ - public function getPath(): string + public function getPath() { if (null === $this->path) { $reflected = new \ReflectionObject($this); @@ -130,8 +132,10 @@ public function registerCommands(Application $application) /** * Returns the bundle's container extension class. + * + * @return string */ - protected function getContainerExtensionClass(): string + protected function getContainerExtensionClass() { $basename = preg_replace('/Bundle$/', '', $this->getName()); @@ -140,8 +144,10 @@ protected function getContainerExtensionClass(): string /** * Creates the bundle's container extension. + * + * @return ExtensionInterface|null */ - protected function createContainerExtension(): ?ExtensionInterface + protected function createContainerExtension() { return class_exists($class = $this->getContainerExtensionClass()) ? new $class() : null; } diff --git a/core/vendor/symfony/http-kernel/Bundle/BundleInterface.php b/core/vendor/symfony/http-kernel/Bundle/BundleInterface.php index 5490632552..fdc13e0c87 100644 --- a/core/vendor/symfony/http-kernel/Bundle/BundleInterface.php +++ b/core/vendor/symfony/http-kernel/Bundle/BundleInterface.php @@ -41,23 +41,31 @@ public function build(ContainerBuilder $container); /** * Returns the container extension that should be implicitly loaded. + * + * @return ExtensionInterface|null */ - public function getContainerExtension(): ?ExtensionInterface; + public function getContainerExtension(); /** * Returns the bundle name (the class short name). + * + * @return string */ - public function getName(): string; + public function getName(); /** * Gets the Bundle namespace. + * + * @return string */ - public function getNamespace(): string; + public function getNamespace(); /** * Gets the Bundle directory path. * * The path should always be returned as a Unix path (with /). + * + * @return string */ - public function getPath(): string; + public function getPath(); } diff --git a/core/vendor/symfony/http-kernel/CHANGELOG.md b/core/vendor/symfony/http-kernel/CHANGELOG.md index 945557d762..129201e3c3 100644 --- a/core/vendor/symfony/http-kernel/CHANGELOG.md +++ b/core/vendor/symfony/http-kernel/CHANGELOG.md @@ -1,15 +1,6 @@ CHANGELOG ========= -6.0 ---- - - * Remove `ArgumentInterface` - * Remove `ArgumentMetadata::getAttribute()`, use `getAttributes()` instead - * Remove support for returning a `ContainerBuilder` from `KernelInterface::registerContainerConfiguration()` - * Remove `KernelEvent::isMasterRequest()`, use `isMainRequest()` instead - * Remove support for `service:action` syntax to reference controllers, use `serviceOrFqcn::method` instead - 5.4 --- diff --git a/core/vendor/symfony/http-kernel/CacheClearer/ChainCacheClearer.php b/core/vendor/symfony/http-kernel/CacheClearer/ChainCacheClearer.php index 61e776c33a..a875d899d0 100644 --- a/core/vendor/symfony/http-kernel/CacheClearer/ChainCacheClearer.php +++ b/core/vendor/symfony/http-kernel/CacheClearer/ChainCacheClearer.php @@ -20,7 +20,7 @@ */ class ChainCacheClearer implements CacheClearerInterface { - private iterable $clearers; + private $clearers; /** * @param iterable<mixed, CacheClearerInterface> $clearers diff --git a/core/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php b/core/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php index 8578940f4b..a074060e44 100644 --- a/core/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php +++ b/core/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php @@ -18,7 +18,7 @@ */ class Psr6CacheClearer implements CacheClearerInterface { - private array $pools = []; + private $pools = []; /** * @param array<string, CacheItemPoolInterface> $pools @@ -28,15 +28,20 @@ public function __construct(array $pools = []) $this->pools = $pools; } - public function hasPool(string $name): bool + /** + * @return bool + */ + public function hasPool(string $name) { return isset($this->pools[$name]); } /** + * @return CacheItemPoolInterface + * * @throws \InvalidArgumentException If the cache pool with the given name does not exist */ - public function getPool(string $name): CacheItemPoolInterface + public function getPool(string $name) { if (!$this->hasPool($name)) { throw new \InvalidArgumentException(sprintf('Cache pool not found: "%s".', $name)); @@ -46,9 +51,11 @@ public function getPool(string $name): CacheItemPoolInterface } /** + * @return bool + * * @throws \InvalidArgumentException If the cache pool with the given name does not exist */ - public function clearPool(string $name): bool + public function clearPool(string $name) { if (!isset($this->pools[$name])) { throw new \InvalidArgumentException(sprintf('Cache pool not found: "%s".', $name)); diff --git a/core/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php b/core/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php index a3ff54b8d9..67f9ed50b4 100644 --- a/core/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php +++ b/core/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php @@ -20,11 +20,11 @@ */ class CacheWarmerAggregate implements CacheWarmerInterface { - private iterable $warmers; - private bool $debug; - private ?string $deprecationLogsFilepath; - private bool $optionalsEnabled = false; - private bool $onlyOptionalsEnabled = false; + private $warmers; + private $debug; + private $deprecationLogsFilepath; + private $optionalsEnabled = false; + private $onlyOptionalsEnabled = false; /** * @param iterable<mixed, CacheWarmerInterface> $warmers diff --git a/core/vendor/symfony/http-kernel/Config/FileLocator.php b/core/vendor/symfony/http-kernel/Config/FileLocator.php index 60923387af..6eca98635c 100644 --- a/core/vendor/symfony/http-kernel/Config/FileLocator.php +++ b/core/vendor/symfony/http-kernel/Config/FileLocator.php @@ -33,7 +33,7 @@ public function __construct(KernelInterface $kernel) /** * {@inheritdoc} */ - public function locate(string $file, string $currentPath = null, bool $first = true): string|array + public function locate(string $file, string $currentPath = null, bool $first = true) { if (isset($file[0]) && '@' === $file[0]) { $resource = $this->kernel->locateResource($file); diff --git a/core/vendor/symfony/http-kernel/Controller/ArgumentResolver.php b/core/vendor/symfony/http-kernel/Controller/ArgumentResolver.php index e712c727d0..a54140b7e5 100644 --- a/core/vendor/symfony/http-kernel/Controller/ArgumentResolver.php +++ b/core/vendor/symfony/http-kernel/Controller/ArgumentResolver.php @@ -28,7 +28,7 @@ final class ArgumentResolver implements ArgumentResolverInterface { private $argumentMetadataFactory; - private iterable $argumentValueResolvers; + private $argumentValueResolvers; /** * @param iterable<mixed, ArgumentValueResolverInterface> $argumentValueResolvers diff --git a/core/vendor/symfony/http-kernel/Controller/ArgumentResolverInterface.php b/core/vendor/symfony/http-kernel/Controller/ArgumentResolverInterface.php index e2acde680e..30e4783e89 100644 --- a/core/vendor/symfony/http-kernel/Controller/ArgumentResolverInterface.php +++ b/core/vendor/symfony/http-kernel/Controller/ArgumentResolverInterface.php @@ -24,7 +24,9 @@ interface ArgumentResolverInterface /** * Returns the arguments to pass to the controller. * + * @return array + * * @throws \RuntimeException When no value could be provided for a required argument */ - public function getArguments(Request $request, callable $controller): array; + public function getArguments(Request $request, callable $controller); } diff --git a/core/vendor/symfony/http-kernel/Controller/ArgumentValueResolverInterface.php b/core/vendor/symfony/http-kernel/Controller/ArgumentValueResolverInterface.php index 3570bebf39..1317707b1d 100644 --- a/core/vendor/symfony/http-kernel/Controller/ArgumentValueResolverInterface.php +++ b/core/vendor/symfony/http-kernel/Controller/ArgumentValueResolverInterface.php @@ -23,11 +23,15 @@ interface ArgumentValueResolverInterface { /** * Whether this resolver can resolve the value for the given ArgumentMetadata. + * + * @return bool */ - public function supports(Request $request, ArgumentMetadata $argument): bool; + public function supports(Request $request, ArgumentMetadata $argument); /** * Returns the possible value(s). + * + * @return iterable */ - public function resolve(Request $request, ArgumentMetadata $argument): iterable; + public function resolve(Request $request, ArgumentMetadata $argument); } diff --git a/core/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php b/core/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php index 1a0605de18..3b9468465c 100644 --- a/core/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php +++ b/core/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php @@ -32,10 +32,20 @@ public function __construct(ContainerInterface $container, LoggerInterface $logg parent::__construct($logger); } + protected function createController(string $controller) + { + if (1 === substr_count($controller, ':')) { + $controller = str_replace(':', '::', $controller); + trigger_deprecation('symfony/http-kernel', '5.1', 'Referencing controllers with a single colon is deprecated. Use "%s" instead.', $controller); + } + + return parent::createController($controller); + } + /** * {@inheritdoc} */ - protected function instantiateController(string $class): object + protected function instantiateController(string $class) { $class = ltrim($class, '\\'); diff --git a/core/vendor/symfony/http-kernel/Controller/ControllerResolver.php b/core/vendor/symfony/http-kernel/Controller/ControllerResolver.php index d40f449530..8abbadd48b 100644 --- a/core/vendor/symfony/http-kernel/Controller/ControllerResolver.php +++ b/core/vendor/symfony/http-kernel/Controller/ControllerResolver.php @@ -33,7 +33,7 @@ public function __construct(LoggerInterface $logger = null) /** * {@inheritdoc} */ - public function getController(Request $request): callable|false + public function getController(Request $request) { if (!$controller = $request->attributes->get('_controller')) { if (null !== $this->logger) { @@ -48,8 +48,15 @@ public function getController(Request $request): callable|false try { $controller[0] = $this->instantiateController($controller[0]); } catch (\Error|\LogicException $e) { - if (\is_callable($controller)) { - return $controller; + try { + // We cannot just check is_callable but have to use reflection because a non-static method + // can still be called statically in PHP but we don't want that. This is deprecated in PHP 7, so we + // could simplify this with PHP 8. + if ((new \ReflectionMethod($controller[0], $controller[1]))->isStatic()) { + return $controller; + } + } catch (\ReflectionException $reflectionException) { + throw $e; } throw $e; @@ -91,9 +98,11 @@ public function getController(Request $request): callable|false /** * Returns a callable for the given controller. * + * @return callable + * * @throws \InvalidArgumentException When the controller cannot be created */ - protected function createController(string $controller): callable + protected function createController(string $controller) { if (!str_contains($controller, '::')) { $controller = $this->instantiateController($controller); @@ -130,13 +139,15 @@ protected function createController(string $controller): callable /** * Returns an instantiated controller. + * + * @return object */ - protected function instantiateController(string $class): object + protected function instantiateController(string $class) { return new $class(); } - private function getControllerError(mixed $callable): string + private function getControllerError($callable): string { if (\is_string($callable)) { if (str_contains($callable, '::')) { diff --git a/core/vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php b/core/vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php index 6cfe6c35c5..8b70a88f63 100644 --- a/core/vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php +++ b/core/vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php @@ -37,5 +37,5 @@ interface ControllerResolverInterface * * @throws \LogicException If a controller was found based on the request but it is not callable */ - public function getController(Request $request): callable|false; + public function getController(Request $request); } diff --git a/core/vendor/symfony/http-kernel/Controller/ErrorController.php b/core/vendor/symfony/http-kernel/Controller/ErrorController.php index e039c38401..b6c440103f 100644 --- a/core/vendor/symfony/http-kernel/Controller/ErrorController.php +++ b/core/vendor/symfony/http-kernel/Controller/ErrorController.php @@ -26,10 +26,10 @@ class ErrorController { private $kernel; - private string|object|array|null $controller; + private $controller; private $errorRenderer; - public function __construct(HttpKernelInterface $kernel, string|object|array|null $controller, ErrorRendererInterface $errorRenderer) + public function __construct(HttpKernelInterface $kernel, $controller, ErrorRendererInterface $errorRenderer) { $this->kernel = $kernel; $this->controller = $controller; diff --git a/core/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php b/core/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php index bc8092075e..e22cf082c4 100644 --- a/core/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php +++ b/core/vendor/symfony/http-kernel/Controller/TraceableArgumentResolver.php @@ -31,7 +31,7 @@ public function __construct(ArgumentResolverInterface $resolver, Stopwatch $stop /** * {@inheritdoc} */ - public function getArguments(Request $request, callable $controller): array + public function getArguments(Request $request, callable $controller) { $e = $this->stopwatch->start('controller.get_arguments'); diff --git a/core/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php b/core/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php index 017226e3fe..bf6b6aa1f2 100644 --- a/core/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php +++ b/core/vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php @@ -31,7 +31,7 @@ public function __construct(ControllerResolverInterface $resolver, Stopwatch $st /** * {@inheritdoc} */ - public function getController(Request $request): callable|false + public function getController(Request $request) { $e = $this->stopwatch->start('controller.get_callable'); diff --git a/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadata.php b/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadata.php index 06a30db8af..1a9ebc0c3a 100644 --- a/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadata.php +++ b/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadata.php @@ -11,6 +11,8 @@ namespace Symfony\Component\HttpKernel\ControllerMetadata; +use Symfony\Component\HttpKernel\Attribute\ArgumentInterface; + /** * Responsible for storing metadata of an argument. * @@ -20,18 +22,18 @@ class ArgumentMetadata { public const IS_INSTANCEOF = 2; - private string $name; - private ?string $type; - private bool $isVariadic; - private bool $hasDefaultValue; - private mixed $defaultValue; - private bool $isNullable; - private array $attributes; + private $name; + private $type; + private $isVariadic; + private $hasDefaultValue; + private $defaultValue; + private $isNullable; + private $attributes; /** * @param object[] $attributes */ - public function __construct(string $name, ?string $type, bool $isVariadic, bool $hasDefaultValue, mixed $defaultValue, bool $isNullable = false, array $attributes = []) + public function __construct(string $name, ?string $type, bool $isVariadic, bool $hasDefaultValue, $defaultValue, bool $isNullable = false, $attributes = []) { $this->name = $name; $this->type = $type; @@ -39,13 +41,21 @@ public function __construct(string $name, ?string $type, bool $isVariadic, bool $this->hasDefaultValue = $hasDefaultValue; $this->defaultValue = $defaultValue; $this->isNullable = $isNullable || null === $type || ($hasDefaultValue && null === $defaultValue); + + if (null === $attributes || $attributes instanceof ArgumentInterface) { + trigger_deprecation('symfony/http-kernel', '5.3', 'The "%s" constructor expects an array of PHP attributes as last argument, %s given.', __CLASS__, get_debug_type($attributes)); + $attributes = $attributes ? [$attributes] : []; + } + $this->attributes = $attributes; } /** * Returns the name as given in PHP, $foo would yield "foo". + * + * @return string */ - public function getName(): string + public function getName() { return $this->name; } @@ -54,16 +64,20 @@ public function getName(): string * Returns the type of the argument. * * The type is the PHP class in 5.5+ and additionally the basic type in PHP 7.0+. + * + * @return string|null */ - public function getType(): ?string + public function getType() { return $this->type; } /** * Returns whether the argument is defined as "...$variadic". + * + * @return bool */ - public function isVariadic(): bool + public function isVariadic() { return $this->isVariadic; } @@ -72,16 +86,20 @@ public function isVariadic(): bool * Returns whether the argument has a default value. * * Implies whether an argument is optional. + * + * @return bool */ - public function hasDefaultValue(): bool + public function hasDefaultValue() { return $this->hasDefaultValue; } /** * Returns whether the argument accepts null values. + * + * @return bool */ - public function isNullable(): bool + public function isNullable() { return $this->isNullable; } @@ -90,8 +108,10 @@ public function isNullable(): bool * Returns the default value of the argument. * * @throws \LogicException if no default value is present; {@see self::hasDefaultValue()} + * + * @return mixed */ - public function getDefaultValue(): mixed + public function getDefaultValue() { if (!$this->hasDefaultValue) { throw new \LogicException(sprintf('Argument $%s does not have a default value. Use "%s::hasDefaultValue()" to avoid this exception.', $this->name, __CLASS__)); @@ -100,6 +120,20 @@ public function getDefaultValue(): mixed return $this->defaultValue; } + /** + * Returns the attribute (if any) that was set on the argument. + */ + public function getAttribute(): ?ArgumentInterface + { + trigger_deprecation('symfony/http-kernel', '5.3', 'Method "%s()" is deprecated, use "getAttributes()" instead.', __METHOD__); + + if (!$this->attributes) { + return null; + } + + return $this->attributes[0] instanceof ArgumentInterface ? $this->attributes[0] : null; + } + /** * @return object[] */ diff --git a/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactory.php b/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactory.php index f8dd0f5dcc..0af1d90715 100644 --- a/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactory.php +++ b/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactory.php @@ -21,7 +21,7 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface /** * {@inheritdoc} */ - public function createArgumentMetadata(string|object|array $controller): array + public function createArgumentMetadata($controller): array { $arguments = []; @@ -35,9 +35,11 @@ public function createArgumentMetadata(string|object|array $controller): array foreach ($reflection->getParameters() as $param) { $attributes = []; - foreach ($param->getAttributes() as $reflectionAttribute) { - if (class_exists($reflectionAttribute->getName())) { - $attributes[] = $reflectionAttribute->newInstance(); + if (\PHP_VERSION_ID >= 80000) { + foreach ($param->getAttributes() as $reflectionAttribute) { + if (class_exists($reflectionAttribute->getName())) { + $attributes[] = $reflectionAttribute->newInstance(); + } } } diff --git a/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactoryInterface.php b/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactoryInterface.php index b94ce4e83f..a34befc22d 100644 --- a/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactoryInterface.php +++ b/core/vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadataFactoryInterface.php @@ -19,7 +19,9 @@ interface ArgumentMetadataFactoryInterface { /** + * @param string|object|array $controller The controller to resolve the arguments for + * * @return ArgumentMetadata[] */ - public function createArgumentMetadata(string|object|array $controller): array; + public function createArgumentMetadata($controller); } diff --git a/core/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php index 359bffed16..d0f2c7c253 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php @@ -24,6 +24,9 @@ */ class ConfigDataCollector extends DataCollector implements LateDataCollectorInterface { + /** + * @var KernelInterface + */ private $kernel; /** @@ -105,8 +108,9 @@ public function getSymfonyVersion(): string } /** - * Returns the state of the current Symfony release - * as one of: unknown, dev, stable, eom, eol. + * Returns the state of the current Symfony release. + * + * @return string One of: unknown, dev, stable, eom, eol */ public function getSymfonyState(): string { @@ -122,6 +126,9 @@ public function getSymfonyMinorVersion(): string return $this->data['symfony_minor_version']; } + /** + * Returns if the current Symfony version is a Long-Term Support one. + */ public function isSymfonyLts(): bool { return $this->data['symfony_lts']; @@ -161,6 +168,9 @@ public function getPhpVersionExtra(): ?string return $this->data['php_version_extra'] ?? null; } + /** + * @return int The PHP architecture as number of bits (e.g. 32 or 64) + */ public function getPhpArchitecture(): int { return $this->data['php_architecture']; @@ -189,7 +199,7 @@ public function getEnv(): string * * @return bool|string true if debug is enabled, false otherwise or a string if no kernel was set */ - public function isDebug(): bool|string + public function isDebug() { return $this->data['debug']; } @@ -239,6 +249,11 @@ public function getName(): string return 'config'; } + /** + * Tries to retrieve information about the current Symfony version. + * + * @return string One of: dev, stable, eom, eol + */ private function determineSymfonyState(): string { $now = new \DateTime(); diff --git a/core/vendor/symfony/http-kernel/DataCollector/DataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/DataCollector.php index 1289cf0ea9..ccaf66da04 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/DataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/DataCollector.php @@ -13,6 +13,7 @@ use Symfony\Component\VarDumper\Caster\CutStub; use Symfony\Component\VarDumper\Caster\ReflectionCaster; +use Symfony\Component\VarDumper\Cloner\ClonerInterface; use Symfony\Component\VarDumper\Cloner\Data; use Symfony\Component\VarDumper\Cloner\Stub; use Symfony\Component\VarDumper\Cloner\VarCloner; @@ -32,6 +33,9 @@ abstract class DataCollector implements DataCollectorInterface */ protected $data = []; + /** + * @var ClonerInterface + */ private $cloner; /** @@ -39,13 +43,17 @@ abstract class DataCollector implements DataCollectorInterface * * This array can be displayed in the template using * the VarDumper component. + * + * @param mixed $var + * + * @return Data */ - protected function cloneVar(mixed $var): Data + protected function cloneVar($var) { if ($var instanceof Data) { return $var; } - if (!isset($this->cloner)) { + if (null === $this->cloner) { $this->cloner = new VarCloner(); $this->cloner->setMaxItems(-1); $this->cloner->addCasters($this->getCasters()); @@ -76,7 +84,10 @@ protected function getCasters() return $casters; } - public function __sleep(): array + /** + * @return array + */ + public function __sleep() { return ['data']; } @@ -95,7 +106,7 @@ final protected function serialize() /** * @internal to prevent implementing \Serializable */ - final protected function unserialize(string $data) + final protected function unserialize($data) { } } diff --git a/core/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php index 4577af65b2..8e052d9d52 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php @@ -31,19 +31,23 @@ */ class DumpDataCollector extends DataCollector implements DataDumperInterface { - private $stopwatch = null; - private string|FileLinkFormatter|false $fileLinkFormat; - private int $dataCount = 0; - private bool $isCollected = true; - private int $clonesCount = 0; - private int $clonesIndex = 0; - private array $rootRefs; - private string $charset; + private $stopwatch; + private $fileLinkFormat; + private $dataCount = 0; + private $isCollected = true; + private $clonesCount = 0; + private $clonesIndex = 0; + private $rootRefs; + private $charset; private $requestStack; private $dumper; - private mixed $sourceContextProvider; + private $sourceContextProvider; - public function __construct(Stopwatch $stopwatch = null, string|FileLinkFormatter $fileLinkFormat = null, string $charset = null, RequestStack $requestStack = null, DataDumperInterface|Connection $dumper = null) + /** + * @param string|FileLinkFormatter|null $fileLinkFormat + * @param DataDumperInterface|Connection|null $dumper + */ + public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null, string $charset = null, RequestStack $requestStack = null, $dumper = null) { $this->stopwatch = $stopwatch; $this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); diff --git a/core/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php index 20c8670bbc..a813553364 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php @@ -22,15 +22,13 @@ /** * @author Fabien Potencier <fabien@symfony.com> * - * @see TraceableEventDispatcher - * * @final */ class EventDataCollector extends DataCollector implements LateDataCollectorInterface { - private $dispatcher; + protected $dispatcher; private $requestStack; - private $currentRequest = null; + private $currentRequest; public function __construct(EventDispatcherInterface $dispatcher = null, RequestStack $requestStack = null) { @@ -72,6 +70,8 @@ public function lateCollect() } /** + * @param array $listeners An array of called listeners + * * @see TraceableEventDispatcher */ public function setCalledListeners(array $listeners) @@ -81,8 +81,10 @@ public function setCalledListeners(array $listeners) /** * @see TraceableEventDispatcher + * + * @return array|Data */ - public function getCalledListeners(): array|Data + public function getCalledListeners() { return $this->data['called_listeners']; } @@ -97,8 +99,10 @@ public function setNotCalledListeners(array $listeners) /** * @see TraceableEventDispatcher + * + * @return array|Data */ - public function getNotCalledListeners(): array|Data + public function getNotCalledListeners() { return $this->data['not_called_listeners']; } @@ -115,8 +119,10 @@ public function setOrphanedEvents(array $events) /** * @see TraceableEventDispatcher + * + * @return array|Data */ - public function getOrphanedEvents(): array|Data + public function getOrphanedEvents() { return $this->data['orphaned_events']; } diff --git a/core/vendor/symfony/http-kernel/DataCollector/ExceptionDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/ExceptionDataCollector.php index 382e2dc40d..14bbbb364b 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/ExceptionDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/ExceptionDataCollector.php @@ -47,7 +47,10 @@ public function hasException(): bool return isset($this->data['exception']); } - public function getException(): \Exception|FlattenException + /** + * @return \Exception|FlattenException + */ + public function getException() { return $this->data['exception']; } diff --git a/core/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php index 68fc3420bd..e5172247c4 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php @@ -25,14 +25,14 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInterface { private $logger; - private ?string $containerPathPrefix; - private $currentRequest = null; + private $containerPathPrefix; + private $currentRequest; private $requestStack; - private ?array $processedLogs = null; + private $processedLogs; public function __construct(object $logger = null, string $containerPathPrefix = null, RequestStack $requestStack = null) { - if ($logger instanceof DebugLoggerInterface) { + if (null !== $logger && $logger instanceof DebugLoggerInterface) { $this->logger = $logger; } @@ -53,7 +53,7 @@ public function collect(Request $request, Response $response, \Throwable $except */ public function reset() { - if (isset($this->logger)) { + if ($this->logger instanceof DebugLoggerInterface) { $this->logger->clear(); } $this->data = []; @@ -64,7 +64,7 @@ public function reset() */ public function lateCollect() { - if (isset($this->logger)) { + if (null !== $this->logger) { $containerDeprecationLogs = $this->getContainerDeprecationLogs(); $this->data = $this->computeErrorsCount($containerDeprecationLogs); // get compiler logs later (only when they are needed) to improve performance diff --git a/core/vendor/symfony/http-kernel/DataCollector/MemoryDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/MemoryDataCollector.php index 392fb82884..4b64a57311 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/MemoryDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/MemoryDataCollector.php @@ -58,7 +58,10 @@ public function getMemory(): int return $this->data['memory']; } - public function getMemoryLimit(): int|float + /** + * @return int|float + */ + public function getMemoryLimit() { return $this->data['memory_limit']; } @@ -76,7 +79,10 @@ public function getName(): string return 'memory'; } - private function convertToBytes(string $memoryLimit): int|float + /** + * @return int|float + */ + private function convertToBytes(string $memoryLimit) { if ('-1' === $memoryLimit) { return -1; diff --git a/core/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php index 00647dd139..523f5c957f 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php @@ -34,8 +34,8 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter /** * @var \SplObjectStorage<Request, callable> */ - private \SplObjectStorage $controllers; - private array $sessionUsages = []; + private $controllers; + private $sessionUsages = []; private $requestStack; public function __construct(RequestStack $requestStack = null) @@ -346,7 +346,7 @@ public function getRouteParams(): array * @return array|string|Data The controller as a string or array of data * with keys 'class', 'method', 'file' and 'line' */ - public function getController(): array|string|Data + public function getController() { return $this->data['controller']; } @@ -357,7 +357,7 @@ public function getController(): array|string|Data * @return array|Data|false A legacy array of data from the previous redirection response * or false otherwise */ - public function getRedirect(): array|Data|false + public function getRedirect() { return $this->data['redirect'] ?? false; } @@ -431,9 +431,11 @@ public function collectSessionUsage(): void } /** + * @param string|object|array|null $controller The controller to parse + * * @return array|string An array of controller data or a simple string */ - private function parseController(array|object|string|null $controller): array|string + private function parseController($controller) { if (\is_string($controller) && str_contains($controller, '::')) { $controller = explode('::', $controller); diff --git a/core/vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php index 7cecceeaf8..372ede0378 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php @@ -61,7 +61,7 @@ public function reset() ]; } - protected function guessRoute(Request $request, string|object|array $controller) + protected function guessRoute(Request $request, $controller) { return 'n/a'; } @@ -77,17 +77,23 @@ public function onKernelController(ControllerEvent $event) /** * @return bool Whether this request will result in a redirect */ - public function getRedirect(): bool + public function getRedirect() { return $this->data['redirect']; } - public function getTargetUrl(): ?string + /** + * @return string|null + */ + public function getTargetUrl() { return $this->data['url']; } - public function getTargetRoute(): ?string + /** + * @return string|null + */ + public function getTargetRoute() { return $this->data['route']; } @@ -95,7 +101,7 @@ public function getTargetRoute(): ?string /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'router'; } diff --git a/core/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php b/core/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php index 09416069bd..0e3df040f7 100644 --- a/core/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php +++ b/core/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php @@ -34,15 +34,15 @@ class FileLinkFormatter 'vscode' => 'vscode://file/%f:%l', ]; - private array|false $fileLinkFormat; - private $requestStack = null; - private ?string $baseDir = null; - private \Closure|string|null $urlFormat; + private $fileLinkFormat; + private $requestStack; + private $baseDir; + private $urlFormat; /** * @param string|\Closure $urlFormat the URL format, or a closure that returns it on-demand */ - public function __construct(string $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, string|\Closure $urlFormat = null) + public function __construct(string $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, $urlFormat = null) { $fileLinkFormat = (self::FORMATS[$fileLinkFormat] ?? $fileLinkFormat) ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); if ($fileLinkFormat && !\is_array($fileLinkFormat)) { @@ -94,7 +94,7 @@ public static function generateUrlFormat(UrlGeneratorInterface $router, string $ } } - private function getFileLinkFormat(): array|false + private function getFileLinkFormat() { if ($this->fileLinkFormat) { return $this->fileLinkFormat; @@ -111,6 +111,6 @@ private function getFileLinkFormat(): array|false } } - return false; + return null; } } diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/ControllerArgumentValueResolverPass.php b/core/vendor/symfony/http-kernel/DependencyInjection/ControllerArgumentValueResolverPass.php index 281a778295..d925ed6b0e 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/ControllerArgumentValueResolverPass.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/ControllerArgumentValueResolverPass.php @@ -28,25 +28,40 @@ class ControllerArgumentValueResolverPass implements CompilerPassInterface { use PriorityTaggedServiceTrait; + private $argumentResolverService; + private $argumentValueResolverTag; + private $traceableResolverStopwatch; + + public function __construct(string $argumentResolverService = 'argument_resolver', string $argumentValueResolverTag = 'controller.argument_value_resolver', string $traceableResolverStopwatch = 'debug.stopwatch') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->argumentResolverService = $argumentResolverService; + $this->argumentValueResolverTag = $argumentValueResolverTag; + $this->traceableResolverStopwatch = $traceableResolverStopwatch; + } + public function process(ContainerBuilder $container) { - if (!$container->hasDefinition('argument_resolver')) { + if (!$container->hasDefinition($this->argumentResolverService)) { return; } - $resolvers = $this->findAndSortTaggedServices('controller.argument_value_resolver', $container); + $resolvers = $this->findAndSortTaggedServices($this->argumentValueResolverTag, $container); - if ($container->getParameter('kernel.debug') && class_exists(Stopwatch::class) && $container->has('debug.stopwatch')) { + if ($container->getParameter('kernel.debug') && class_exists(Stopwatch::class) && $container->has($this->traceableResolverStopwatch)) { foreach ($resolvers as $resolverReference) { $id = (string) $resolverReference; $container->register("debug.$id", TraceableValueResolver::class) ->setDecoratedService($id) - ->setArguments([new Reference("debug.$id.inner"), new Reference('debug.stopwatch')]); + ->setArguments([new Reference("debug.$id.inner"), new Reference($this->traceableResolverStopwatch)]); } } $container - ->getDefinition('argument_resolver') + ->getDefinition($this->argumentResolverService) ->replaceArgument(1, new IteratorArgument($resolvers)) ; } diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/Extension.php b/core/vendor/symfony/http-kernel/DependencyInjection/Extension.php index c8d546e9d9..4090fd822f 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/Extension.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/Extension.php @@ -20,12 +20,14 @@ */ abstract class Extension extends BaseExtension { - private array $annotatedClasses = []; + private $annotatedClasses = []; /** * Gets the annotated classes to cache. + * + * @return array */ - public function getAnnotatedClassesToCompile(): array + public function getAnnotatedClassesToCompile() { return $this->annotatedClasses; } diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php b/core/vendor/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php index ced62ae380..f26baeca9d 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php @@ -25,15 +25,28 @@ */ class FragmentRendererPass implements CompilerPassInterface { + private $handlerService; + private $rendererTag; + + public function __construct(string $handlerService = 'fragment.handler', string $rendererTag = 'kernel.fragment_renderer') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->handlerService = $handlerService; + $this->rendererTag = $rendererTag; + } + public function process(ContainerBuilder $container) { - if (!$container->hasDefinition('fragment.handler')) { + if (!$container->hasDefinition($this->handlerService)) { return; } - $definition = $container->getDefinition('fragment.handler'); + $definition = $container->getDefinition($this->handlerService); $renderers = []; - foreach ($container->findTaggedServiceIds('kernel.fragment_renderer', true) as $id => $tags) { + foreach ($container->findTaggedServiceIds($this->rendererTag, true) as $id => $tags) { $def = $container->getDefinition($id); $class = $container->getParameterBag()->resolveValue($def->getClass()); diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php b/core/vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php index 9a06a5f587..f253287045 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php @@ -13,7 +13,6 @@ use Psr\Container\ContainerInterface; use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpKernel\Controller\ControllerReference; use Symfony\Component\HttpKernel\Fragment\FragmentHandler; /** @@ -28,7 +27,7 @@ class LazyLoadingFragmentHandler extends FragmentHandler /** * @var array<string, bool> */ - private array $initialized = []; + private $initialized = []; public function __construct(ContainerInterface $container, RequestStack $requestStack, bool $debug = false) { @@ -40,7 +39,7 @@ public function __construct(ContainerInterface $container, RequestStack $request /** * {@inheritdoc} */ - public function render(string|ControllerReference $uri, string $renderer = 'inline', array $options = []): ?string + public function render($uri, string $renderer = 'inline', array $options = []) { if (!isset($this->initialized[$renderer]) && $this->container->has($renderer)) { $this->addRenderer($this->container->get($renderer)); diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php b/core/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php index c0bc6eccf2..5f0f0d8dee 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php @@ -21,7 +21,7 @@ */ class MergeExtensionConfigurationPass extends BaseMergeExtensionConfigurationPass { - private array $extensions; + private $extensions; /** * @param string[] $extensions diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php b/core/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php index d11e6e658a..4f5796f512 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php @@ -33,9 +33,26 @@ */ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface { + private $resolverServiceId; + private $controllerTag; + private $controllerLocator; + private $notTaggedControllerResolverServiceId; + + public function __construct(string $resolverServiceId = 'argument_resolver.service', string $controllerTag = 'controller.service_arguments', string $controllerLocator = 'argument_resolver.controller_locator', string $notTaggedControllerResolverServiceId = 'argument_resolver.not_tagged_controller') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->resolverServiceId = $resolverServiceId; + $this->controllerTag = $controllerTag; + $this->controllerLocator = $controllerLocator; + $this->notTaggedControllerResolverServiceId = $notTaggedControllerResolverServiceId; + } + public function process(ContainerBuilder $container) { - if (!$container->hasDefinition('argument_resolver.service') && !$container->hasDefinition('argument_resolver.not_tagged_controller')) { + if (false === $container->hasDefinition($this->resolverServiceId) && false === $container->hasDefinition($this->notTaggedControllerResolverServiceId)) { return; } @@ -49,7 +66,7 @@ public function process(ContainerBuilder $container) } } - foreach ($container->findTaggedServiceIds('controller.service_arguments', true) as $id => $tags) { + foreach ($container->findTaggedServiceIds($this->controllerTag, true) as $id => $tags) { $def = $container->getDefinition($id); $def->setPublic(true); $class = $def->getClass(); @@ -89,11 +106,11 @@ public function process(ContainerBuilder $container) } foreach (['action', 'argument', 'id'] as $k) { if (!isset($attributes[$k][0])) { - throw new InvalidArgumentException(sprintf('Missing "%s" attribute on tag "controller.service_arguments" %s for service "%s".', $k, json_encode($attributes, \JSON_UNESCAPED_UNICODE), $id)); + throw new InvalidArgumentException(sprintf('Missing "%s" attribute on tag "%s" %s for service "%s".', $k, $this->controllerTag, json_encode($attributes, \JSON_UNESCAPED_UNICODE), $id)); } } if (!isset($methods[$action = strtolower($attributes['action'])])) { - throw new InvalidArgumentException(sprintf('Invalid "action" attribute on tag "controller.service_arguments" for service "%s": no public "%s()" method found on class "%s".', $id, $attributes['action'], $class)); + throw new InvalidArgumentException(sprintf('Invalid "action" attribute on tag "%s" for service "%s": no public "%s()" method found on class "%s".', $this->controllerTag, $id, $attributes['action'], $class)); } [$r, $parameters] = $methods[$action]; $found = false; @@ -109,7 +126,7 @@ public function process(ContainerBuilder $container) } if (!$found) { - throw new InvalidArgumentException(sprintf('Invalid "controller.service_arguments" tag for service "%s": method "%s()" has no "%s" argument on class "%s".', $id, $r->name, $attributes['argument'], $class)); + throw new InvalidArgumentException(sprintf('Invalid "%s" tag for service "%s": method "%s()" has no "%s" argument on class "%s".', $this->controllerTag, $id, $r->name, $attributes['argument'], $class)); } } @@ -128,7 +145,7 @@ public function process(ContainerBuilder $container) if ('?' !== $target[0]) { $invalidBehavior = ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE; } elseif ('' === $target = (string) substr($target, 1)) { - throw new InvalidArgumentException(sprintf('A "controller.service_arguments" tag must have non-empty "id" attributes for service "%s".', $id)); + throw new InvalidArgumentException(sprintf('A "%s" tag must have non-empty "id" attributes for service "%s".', $this->controllerTag, $id)); } elseif ($p->allowsNull() && !$p->isOptional()) { $invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE; } @@ -191,16 +208,16 @@ public function process(ContainerBuilder $container) $controllerLocatorRef = ServiceLocatorTagPass::register($container, $controllers); - if ($container->hasDefinition('argument_resolver.service')) { - $container->getDefinition('argument_resolver.service') + if ($container->hasDefinition($this->resolverServiceId)) { + $container->getDefinition($this->resolverServiceId) ->replaceArgument(0, $controllerLocatorRef); } - if ($container->hasDefinition('argument_resolver.not_tagged_controller')) { - $container->getDefinition('argument_resolver.not_tagged_controller') + if ($container->hasDefinition($this->notTaggedControllerResolverServiceId)) { + $container->getDefinition($this->notTaggedControllerResolverServiceId) ->replaceArgument(0, $controllerLocatorRef); } - $container->setAlias('argument_resolver.controller_locator', (string) $controllerLocatorRef); + $container->setAlias($this->controllerLocator, (string) $controllerLocatorRef); } } diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/RegisterLocaleAwareServicesPass.php b/core/vendor/symfony/http-kernel/DependencyInjection/RegisterLocaleAwareServicesPass.php index 2141a510d6..f0b801b8d6 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/RegisterLocaleAwareServicesPass.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/RegisterLocaleAwareServicesPass.php @@ -23,26 +23,39 @@ */ class RegisterLocaleAwareServicesPass implements CompilerPassInterface { + private $listenerServiceId; + private $localeAwareTag; + + public function __construct(string $listenerServiceId = 'locale_aware_listener', string $localeAwareTag = 'kernel.locale_aware') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->listenerServiceId = $listenerServiceId; + $this->localeAwareTag = $localeAwareTag; + } + public function process(ContainerBuilder $container) { - if (!$container->hasDefinition('locale_aware_listener')) { + if (!$container->hasDefinition($this->listenerServiceId)) { return; } $services = []; - foreach ($container->findTaggedServiceIds('kernel.locale_aware') as $id => $tags) { + foreach ($container->findTaggedServiceIds($this->localeAwareTag) as $id => $tags) { $services[] = new Reference($id); } if (!$services) { - $container->removeDefinition('locale_aware_listener'); + $container->removeDefinition($this->listenerServiceId); return; } $container - ->getDefinition('locale_aware_listener') + ->getDefinition($this->listenerServiceId) ->setArgument(0, new IteratorArgument($services)) ; } diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php b/core/vendor/symfony/http-kernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php index cbc92355d6..2d077a0cb5 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php @@ -21,9 +21,20 @@ */ class RemoveEmptyControllerArgumentLocatorsPass implements CompilerPassInterface { + private $controllerLocator; + + public function __construct(string $controllerLocator = 'argument_resolver.controller_locator') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->controllerLocator = $controllerLocator; + } + public function process(ContainerBuilder $container) { - $controllerLocator = $container->findDefinition('argument_resolver.controller_locator'); + $controllerLocator = $container->findDefinition($this->controllerLocator); $controllers = $controllerLocator->getArgument(0); foreach ($controllers as $controller => $argumentRef) { diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/ResettableServicePass.php b/core/vendor/symfony/http-kernel/DependencyInjection/ResettableServicePass.php index bca6f2baf8..2e4cd69270 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/ResettableServicePass.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/ResettableServicePass.php @@ -23,6 +23,17 @@ */ class ResettableServicePass implements CompilerPassInterface { + private $tagName; + + public function __construct(string $tagName = 'kernel.reset') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->tagName = $tagName; + } + /** * {@inheritdoc} */ @@ -34,12 +45,12 @@ public function process(ContainerBuilder $container) $services = $methods = []; - foreach ($container->findTaggedServiceIds('kernel.reset', true) as $id => $tags) { + foreach ($container->findTaggedServiceIds($this->tagName, true) as $id => $tags) { $services[$id] = new Reference($id, ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE); foreach ($tags as $attributes) { if (!isset($attributes['method'])) { - throw new RuntimeException(sprintf('Tag "kernel.reset" requires the "method" attribute to be set on service "%s".', $id)); + throw new RuntimeException(sprintf('Tag "%s" requires the "method" attribute to be set.', $this->tagName)); } if (!isset($methods[$id])) { diff --git a/core/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php b/core/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php index e7be3b88e7..0063deca36 100644 --- a/core/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php +++ b/core/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php @@ -23,8 +23,8 @@ */ class ServicesResetter implements ResetInterface { - private \Traversable $resettableServices; - private array $resetMethods; + private $resettableServices; + private $resetMethods; /** * @param \Traversable<string, object> $resettableServices diff --git a/core/vendor/symfony/http-kernel/Event/ControllerArgumentsEvent.php b/core/vendor/symfony/http-kernel/Event/ControllerArgumentsEvent.php index 824a3325a3..d075ee90bd 100644 --- a/core/vendor/symfony/http-kernel/Event/ControllerArgumentsEvent.php +++ b/core/vendor/symfony/http-kernel/Event/ControllerArgumentsEvent.php @@ -29,7 +29,7 @@ final class ControllerArgumentsEvent extends KernelEvent { private $controller; - private array $arguments; + private $arguments; public function __construct(HttpKernelInterface $kernel, callable $controller, array $arguments, Request $request, ?int $requestType) { diff --git a/core/vendor/symfony/http-kernel/Event/ControllerEvent.php b/core/vendor/symfony/http-kernel/Event/ControllerEvent.php index 7b6ae3ee65..da88800e20 100644 --- a/core/vendor/symfony/http-kernel/Event/ControllerEvent.php +++ b/core/vendor/symfony/http-kernel/Event/ControllerEvent.php @@ -27,7 +27,7 @@ */ final class ControllerEvent extends KernelEvent { - private string|array|object $controller; + private $controller; public function __construct(HttpKernelInterface $kernel, callable $controller, Request $request, ?int $requestType) { diff --git a/core/vendor/symfony/http-kernel/Event/ExceptionEvent.php b/core/vendor/symfony/http-kernel/Event/ExceptionEvent.php index 8bc25f9c37..a18fbd31f4 100644 --- a/core/vendor/symfony/http-kernel/Event/ExceptionEvent.php +++ b/core/vendor/symfony/http-kernel/Event/ExceptionEvent.php @@ -29,8 +29,12 @@ */ final class ExceptionEvent extends RequestEvent { - private \Throwable $throwable; - private bool $allowCustomResponseCode = false; + private $throwable; + + /** + * @var bool + */ + private $allowCustomResponseCode = false; public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, \Throwable $e) { diff --git a/core/vendor/symfony/http-kernel/Event/KernelEvent.php b/core/vendor/symfony/http-kernel/Event/KernelEvent.php index 2f9fe33905..d9d425e114 100644 --- a/core/vendor/symfony/http-kernel/Event/KernelEvent.php +++ b/core/vendor/symfony/http-kernel/Event/KernelEvent.php @@ -24,7 +24,7 @@ class KernelEvent extends Event { private $kernel; private $request; - private ?int $requestType; + private $requestType; /** * @param int $requestType The request type the kernel is currently processing; one of @@ -39,16 +39,20 @@ public function __construct(HttpKernelInterface $kernel, Request $request, ?int /** * Returns the kernel in which this event was thrown. + * + * @return HttpKernelInterface */ - public function getKernel(): HttpKernelInterface + public function getKernel() { return $this->kernel; } /** * Returns the request the kernel is currently processing. + * + * @return Request */ - public function getRequest(): Request + public function getRequest() { return $this->request; } @@ -59,7 +63,7 @@ public function getRequest(): Request * @return int One of HttpKernelInterface::MAIN_REQUEST and * HttpKernelInterface::SUB_REQUEST */ - public function getRequestType(): int + public function getRequestType() { return $this->requestType; } @@ -71,4 +75,18 @@ public function isMainRequest(): bool { return HttpKernelInterface::MAIN_REQUEST === $this->requestType; } + + /** + * Checks if this is a master request. + * + * @return bool + * + * @deprecated since symfony/http-kernel 5.3, use isMainRequest() instead + */ + public function isMasterRequest() + { + trigger_deprecation('symfony/http-kernel', '5.3', '"%s()" is deprecated, use "isMainRequest()" instead.', __METHOD__); + + return $this->isMainRequest(); + } } diff --git a/core/vendor/symfony/http-kernel/Event/RequestEvent.php b/core/vendor/symfony/http-kernel/Event/RequestEvent.php index 8e2616f63e..30ffcdcbde 100644 --- a/core/vendor/symfony/http-kernel/Event/RequestEvent.php +++ b/core/vendor/symfony/http-kernel/Event/RequestEvent.php @@ -24,12 +24,14 @@ */ class RequestEvent extends KernelEvent { - private $response = null; + private $response; /** * Returns the response object. + * + * @return Response|null */ - public function getResponse(): ?Response + public function getResponse() { return $this->response; } @@ -46,8 +48,10 @@ public function setResponse(Response $response) /** * Returns whether a response was set. + * + * @return bool */ - public function hasResponse(): bool + public function hasResponse() { return null !== $this->response; } diff --git a/core/vendor/symfony/http-kernel/Event/ViewEvent.php b/core/vendor/symfony/http-kernel/Event/ViewEvent.php index d42e497a5c..88211da417 100644 --- a/core/vendor/symfony/http-kernel/Event/ViewEvent.php +++ b/core/vendor/symfony/http-kernel/Event/ViewEvent.php @@ -25,21 +25,36 @@ */ final class ViewEvent extends RequestEvent { - private mixed $controllerResult; - - public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, mixed $controllerResult) + /** + * The return value of the controller. + * + * @var mixed + */ + private $controllerResult; + + public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, $controllerResult) { parent::__construct($kernel, $request, $requestType); $this->controllerResult = $controllerResult; } - public function getControllerResult(): mixed + /** + * Returns the return value of the controller. + * + * @return mixed + */ + public function getControllerResult() { return $this->controllerResult; } - public function setControllerResult(mixed $controllerResult): void + /** + * Assigns the return value of the controller. + * + * @param mixed $controllerResult The controller return value + */ + public function setControllerResult($controllerResult): void { $this->controllerResult = $controllerResult; } diff --git a/core/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php b/core/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php index 05f25959fd..7c0c1aee3a 100644 --- a/core/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionUtils; +use Symfony\Component\HttpKernel\Event\FinishRequestEvent; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\Exception\UnexpectedSessionUsageException; @@ -43,7 +44,8 @@ abstract class AbstractSessionListener implements EventSubscriberInterface, Rese public const NO_AUTO_CACHE_CONTROL_HEADER = 'Symfony-Session-NoAutoCacheControl'; protected $container; - private bool $debug; + private $sessionUsageStack = []; + private $debug; /** * @var array<string, mixed> @@ -86,6 +88,9 @@ public function onKernelRequest(RequestEvent $event) return $sess; }); } + + $session = $this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null; + $this->sessionUsageStack[] = $session instanceof Session ? $session->getUsageIndex() : 0; } public function onKernelResponse(ResponseEvent $event) @@ -98,10 +103,10 @@ public function onKernelResponse(ResponseEvent $event) $autoCacheControl = !$response->headers->has(self::NO_AUTO_CACHE_CONTROL_HEADER); // Always remove the internal header if present $response->headers->remove(self::NO_AUTO_CACHE_CONTROL_HEADER); - if (!$event->getRequest()->hasSession(true)) { + + if (!$session = $this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : $event->getRequest()->getSession()) { return; } - $session = $event->getRequest()->getSession(); if ($session->isStarted()) { /* @@ -149,7 +154,7 @@ public function onKernelResponse(ResponseEvent $event) $request = $event->getRequest(); $requestSessionCookieId = $request->cookies->get($sessionName); - $isSessionEmpty = ($session instanceof Session ? $session->isEmpty() : empty($session->all())) && empty($_SESSION); // checking $_SESSION to keep compatibility with native sessions + $isSessionEmpty = $session->isEmpty() && empty($_SESSION); // checking $_SESSION to keep compatibility with native sessions if ($requestSessionCookieId && $isSessionEmpty) { $response->headers->clearCookie( $sessionName, @@ -182,7 +187,7 @@ public function onKernelResponse(ResponseEvent $event) } } - if ($session instanceof Session ? 0 === $session->getUsageIndex() : !$session->isStarted()) { + if ($session instanceof Session ? $session->getUsageIndex() === end($this->sessionUsageStack) : !$session->isStarted()) { return; } @@ -207,6 +212,13 @@ public function onKernelResponse(ResponseEvent $event) } } + public function onFinishRequest(FinishRequestEvent $event) + { + if ($event->isMainRequest()) { + array_pop($this->sessionUsageStack); + } + } + public function onSessionUsage(): void { if (!$this->debug) { @@ -231,7 +243,7 @@ public function onSessionUsage(): void return; } - if (!$session = $requestStack->getCurrentRequest()->getSession()) { + if (!$session = $this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : $requestStack->getCurrentRequest()->getSession()) { return; } @@ -248,6 +260,7 @@ public static function getSubscribedEvents(): array KernelEvents::REQUEST => ['onKernelRequest', 128], // low priority to come after regular response listeners, but higher than StreamedResponseListener KernelEvents::RESPONSE => ['onKernelResponse', -1000], + KernelEvents::FINISH_REQUEST => ['onFinishRequest'], ]; } @@ -267,8 +280,10 @@ public function reset(): void /** * Gets the session object. + * + * @return SessionInterface|null */ - abstract protected function getSession(): ?SessionInterface; + abstract protected function getSession(); private function getSessionOptions(array $sessionOptions): array { diff --git a/core/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php b/core/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php new file mode 100644 index 0000000000..157d50a199 --- /dev/null +++ b/core/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php @@ -0,0 +1,122 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\Cookie; +use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Session\SessionInterface; +use Symfony\Component\HttpKernel\Event\RequestEvent; +use Symfony\Component\HttpKernel\Event\ResponseEvent; +use Symfony\Component\HttpKernel\KernelEvents; + +/** + * TestSessionListener. + * + * Saves session in test environment. + * + * @author Bulat Shakirzyanov <mallluhuct@gmail.com> + * @author Fabien Potencier <fabien@symfony.com> + * + * @internal + * + * @deprecated the TestSessionListener use the default SessionListener instead + */ +abstract class AbstractTestSessionListener implements EventSubscriberInterface +{ + private $sessionId; + private $sessionOptions; + + public function __construct(array $sessionOptions = []) + { + $this->sessionOptions = $sessionOptions; + + trigger_deprecation('symfony/http-kernel', '5.4', 'The %s is deprecated use the %s instead.', __CLASS__, AbstractSessionListener::class); + } + + public function onKernelRequest(RequestEvent $event) + { + if (!$event->isMainRequest()) { + return; + } + + // bootstrap the session + if ($event->getRequest()->hasSession()) { + $session = $event->getRequest()->getSession(); + } elseif (!$session = $this->getSession()) { + return; + } + + $cookies = $event->getRequest()->cookies; + + if ($cookies->has($session->getName())) { + $this->sessionId = $cookies->get($session->getName()); + $session->setId($this->sessionId); + } + } + + /** + * Checks if session was initialized and saves if current request is the main request + * Runs on 'kernel.response' in test environment. + */ + public function onKernelResponse(ResponseEvent $event) + { + if (!$event->isMainRequest()) { + return; + } + + $request = $event->getRequest(); + if (!$request->hasSession()) { + return; + } + + $session = $request->getSession(); + if ($wasStarted = $session->isStarted()) { + $session->save(); + } + + if ($session instanceof Session ? !$session->isEmpty() || (null !== $this->sessionId && $session->getId() !== $this->sessionId) : $wasStarted) { + $params = session_get_cookie_params() + ['samesite' => null]; + foreach ($this->sessionOptions as $k => $v) { + if (str_starts_with($k, 'cookie_')) { + $params[substr($k, 7)] = $v; + } + } + + foreach ($event->getResponse()->headers->getCookies() as $cookie) { + if ($session->getName() === $cookie->getName() && $params['path'] === $cookie->getPath() && $params['domain'] == $cookie->getDomain()) { + return; + } + } + + $event->getResponse()->headers->setCookie(new Cookie($session->getName(), $session->getId(), 0 === $params['lifetime'] ? 0 : time() + $params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly'], false, $params['samesite'] ?: null)); + $this->sessionId = $session->getId(); + } + } + + public static function getSubscribedEvents(): array + { + return [ + KernelEvents::REQUEST => ['onKernelRequest', 127], // AFTER SessionListener + KernelEvents::RESPONSE => ['onKernelResponse', -128], + ]; + } + + /** + * Gets the session object. + * + * @deprecated since Symfony 5.4, will be removed in 6.0. + * + * @return SessionInterface|null + */ + abstract protected function getSession(); +} diff --git a/core/vendor/symfony/http-kernel/EventListener/AddRequestFormatsListener.php b/core/vendor/symfony/http-kernel/EventListener/AddRequestFormatsListener.php index 7e1932e4f1..9e896adb31 100644 --- a/core/vendor/symfony/http-kernel/EventListener/AddRequestFormatsListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/AddRequestFormatsListener.php @@ -24,7 +24,7 @@ */ class AddRequestFormatsListener implements EventSubscriberInterface { - private array $formats; + protected $formats; public function __construct(array $formats) { diff --git a/core/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php b/core/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php index 600edacde2..efe3960b5f 100644 --- a/core/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php @@ -27,20 +27,20 @@ * * @final * - * @internal + * @internal since Symfony 5.3 */ class DebugHandlersListener implements EventSubscriberInterface { - private string|object|null $earlyHandler; - private ?\Closure $exceptionHandler; + private $earlyHandler; + private $exceptionHandler; private $logger; private $deprecationLogger; - private array|int|null $levels; - private ?int $throwAt; - private bool $scream; - private bool $scope; - private bool $firstCall = true; - private bool $hasTerminatedWithException = false; + private $levels; + private $throwAt; + private $scream; + private $scope; + private $firstCall = true; + private $hasTerminatedWithException; /** * @param callable|null $exceptionHandler A handler that must support \Throwable instances that will be called on Exception @@ -49,13 +49,19 @@ class DebugHandlersListener implements EventSubscriberInterface * @param bool $scream Enables/disables screaming mode, where even silenced errors are logged * @param bool $scope Enables/disables scoping mode */ - public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, array|int|null $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, bool $scope = true, LoggerInterface $deprecationLogger = null) + public function __construct(callable $exceptionHandler = null, LoggerInterface $logger = null, $levels = \E_ALL, ?int $throwAt = \E_ALL, bool $scream = true, $scope = true, $deprecationLogger = null, $fileLinkFormat = null) { + if (!\is_bool($scope)) { + trigger_deprecation('symfony/http-kernel', '5.4', 'Passing a $fileLinkFormat is deprecated.'); + $scope = $deprecationLogger; + $deprecationLogger = $fileLinkFormat; + } + $handler = set_exception_handler('var_dump'); $this->earlyHandler = \is_array($handler) ? $handler[0] : null; restore_exception_handler(); - $this->exceptionHandler = null === $exceptionHandler || $exceptionHandler instanceof \Closure ? $exceptionHandler : \Closure::fromCallable($exceptionHandler); + $this->exceptionHandler = $exceptionHandler; $this->logger = $logger; $this->levels = $levels ?? \E_ALL; $this->throwAt = \is_int($throwAt) ? $throwAt : (null === $throwAt ? null : ($throwAt ? \E_ALL : null)); diff --git a/core/vendor/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php b/core/vendor/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php index ca60878baf..6607e49e99 100644 --- a/core/vendor/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php @@ -34,7 +34,7 @@ public function onResponse(ResponseEvent $event): void /** * {@inheritdoc} */ - public static function getSubscribedEvents(): array + public static function getSubscribedEvents() { return [ KernelEvents::RESPONSE => ['onResponse', -255], diff --git a/core/vendor/symfony/http-kernel/EventListener/DumpListener.php b/core/vendor/symfony/http-kernel/EventListener/DumpListener.php index 3a3eff28fc..30908a4f45 100644 --- a/core/vendor/symfony/http-kernel/EventListener/DumpListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/DumpListener.php @@ -51,7 +51,7 @@ public function configure() }); } - public static function getSubscribedEvents(): array + public static function getSubscribedEvents() { if (!class_exists(ConsoleEvents::class)) { return []; diff --git a/core/vendor/symfony/http-kernel/EventListener/ErrorListener.php b/core/vendor/symfony/http-kernel/EventListener/ErrorListener.php index 8bac8afe26..9dc3871c25 100644 --- a/core/vendor/symfony/http-kernel/EventListener/ErrorListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/ErrorListener.php @@ -35,7 +35,7 @@ class ErrorListener implements EventSubscriberInterface protected $debug; protected $exceptionsMapping; - public function __construct(string|object|array $controller, LoggerInterface $logger = null, bool $debug = false, array $exceptionsMapping = []) + public function __construct($controller, LoggerInterface $logger = null, bool $debug = false, array $exceptionsMapping = []) { $this->controller = $controller; $this->logger = $logger; diff --git a/core/vendor/symfony/http-kernel/EventListener/FragmentListener.php b/core/vendor/symfony/http-kernel/EventListener/FragmentListener.php index 2f0861b2f3..c01d9ad491 100644 --- a/core/vendor/symfony/http-kernel/EventListener/FragmentListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/FragmentListener.php @@ -34,7 +34,7 @@ class FragmentListener implements EventSubscriberInterface { private $signer; - private string $fragmentPath; + private $fragmentPath; /** * @param string $fragmentPath The path that triggers this listener diff --git a/core/vendor/symfony/http-kernel/EventListener/LocaleAwareListener.php b/core/vendor/symfony/http-kernel/EventListener/LocaleAwareListener.php index ebfa63acde..a126f06ecb 100644 --- a/core/vendor/symfony/http-kernel/EventListener/LocaleAwareListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/LocaleAwareListener.php @@ -25,7 +25,7 @@ */ class LocaleAwareListener implements EventSubscriberInterface { - private iterable $localeAwareServices; + private $localeAwareServices; private $requestStack; /** @@ -55,7 +55,7 @@ public function onKernelFinishRequest(FinishRequestEvent $event): void $this->setLocale($parentRequest->getLocale(), $parentRequest->getDefaultLocale()); } - public static function getSubscribedEvents(): array + public static function getSubscribedEvents() { return [ // must be registered after the Locale listener diff --git a/core/vendor/symfony/http-kernel/EventListener/LocaleListener.php b/core/vendor/symfony/http-kernel/EventListener/LocaleListener.php index 9d027cd5f8..f19e13649e 100644 --- a/core/vendor/symfony/http-kernel/EventListener/LocaleListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/LocaleListener.php @@ -30,10 +30,10 @@ class LocaleListener implements EventSubscriberInterface { private $router; - private string $defaultLocale; + private $defaultLocale; private $requestStack; - private bool $useAcceptLanguageHeader; - private array $enabledLocales; + private $useAcceptLanguageHeader; + private $enabledLocales; public function __construct(RequestStack $requestStack, string $defaultLocale = 'en', RequestContextAwareInterface $router = null, bool $useAcceptLanguageHeader = false, array $enabledLocales = []) { diff --git a/core/vendor/symfony/http-kernel/EventListener/ProfilerListener.php b/core/vendor/symfony/http-kernel/EventListener/ProfilerListener.php index 1aa7a50ea7..85525249c9 100644 --- a/core/vendor/symfony/http-kernel/EventListener/ProfilerListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/ProfilerListener.php @@ -31,17 +31,17 @@ */ class ProfilerListener implements EventSubscriberInterface { - private $profiler; - private $matcher; - private bool $onlyException; - private bool $onlyMainRequests; - private ?\Throwable $exception = null; + protected $profiler; + protected $matcher; + protected $onlyException; + protected $onlyMainRequests; + protected $exception; /** @var \SplObjectStorage<Request, Profile> */ - private \SplObjectStorage $profiles; - private $requestStack; - private ?string $collectParameter; + protected $profiles; + protected $requestStack; + protected $collectParameter; /** @var \SplObjectStorage<Request, Request|null> */ - private \SplObjectStorage $parents; + protected $parents; /** * @param bool $onlyException True if the profiler only collects data when an exception occurs, false otherwise diff --git a/core/vendor/symfony/http-kernel/EventListener/ResponseListener.php b/core/vendor/symfony/http-kernel/EventListener/ResponseListener.php index 435fd31d1b..a4090159bb 100644 --- a/core/vendor/symfony/http-kernel/EventListener/ResponseListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/ResponseListener.php @@ -24,8 +24,8 @@ */ class ResponseListener implements EventSubscriberInterface { - private string $charset; - private bool $addContentLanguageHeader; + private $charset; + private $addContentLanguageHeader; public function __construct(string $charset, bool $addContentLanguageHeader = false) { diff --git a/core/vendor/symfony/http-kernel/EventListener/RouterListener.php b/core/vendor/symfony/http-kernel/EventListener/RouterListener.php index 834b81ae7e..7c4da98928 100644 --- a/core/vendor/symfony/http-kernel/EventListener/RouterListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/RouterListener.php @@ -46,16 +46,21 @@ class RouterListener implements EventSubscriberInterface private $context; private $logger; private $requestStack; - private ?string $projectDir; - private bool $debug; + private $projectDir; + private $debug; /** - * @param RequestContext|null $context The RequestContext (can be null when $matcher implements RequestContextAwareInterface) + * @param UrlMatcherInterface|RequestMatcherInterface $matcher The Url or Request matcher + * @param RequestContext|null $context The RequestContext (can be null when $matcher implements RequestContextAwareInterface) * * @throws \InvalidArgumentException */ - public function __construct(UrlMatcherInterface|RequestMatcherInterface $matcher, RequestStack $requestStack, RequestContext $context = null, LoggerInterface $logger = null, string $projectDir = null, bool $debug = true) + public function __construct($matcher, RequestStack $requestStack, RequestContext $context = null, LoggerInterface $logger = null, string $projectDir = null, bool $debug = true) { + if (!$matcher instanceof UrlMatcherInterface && !$matcher instanceof RequestMatcherInterface) { + throw new \InvalidArgumentException('Matcher must either implement UrlMatcherInterface or RequestMatcherInterface.'); + } + if (null === $context && !$matcher instanceof RequestContextAwareInterface) { throw new \InvalidArgumentException('You must either pass a RequestContext or the matcher must implement RequestContextAwareInterface.'); } diff --git a/core/vendor/symfony/http-kernel/EventListener/SessionListener.php b/core/vendor/symfony/http-kernel/EventListener/SessionListener.php index ec23a2e988..61887fde68 100644 --- a/core/vendor/symfony/http-kernel/EventListener/SessionListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/SessionListener.php @@ -12,18 +12,45 @@ namespace Symfony\Component\HttpKernel\EventListener; use Symfony\Component\HttpFoundation\Session\SessionInterface; +use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; +use Symfony\Component\HttpKernel\Event\RequestEvent; /** * Sets the session in the request. * + * When the passed container contains a "session_storage" entry which + * holds a NativeSessionStorage instance, the "cookie_secure" option + * will be set to true whenever the current main request is secure. + * * @author Fabien Potencier <fabien@symfony.com> * * @final */ class SessionListener extends AbstractSessionListener { + public function onKernelRequest(RequestEvent $event) + { + parent::onKernelRequest($event); + + if (!$event->isMainRequest() || (!$this->container->has('session') && !$this->container->has('session_factory'))) { + return; + } + + if ($this->container->has('session_storage') + && ($storage = $this->container->get('session_storage')) instanceof NativeSessionStorage + && ($mainRequest = $this->container->get('request_stack')->getMainRequest()) + && $mainRequest->isSecure() + ) { + $storage->setOptions(['cookie_secure' => true]); + } + } + protected function getSession(): ?SessionInterface { + if ($this->container->has('session')) { + return $this->container->get('session'); + } + if ($this->container->has('session_factory')) { return $this->container->get('session_factory')->createSession(); } diff --git a/core/vendor/symfony/http-kernel/EventListener/TestSessionListener.php b/core/vendor/symfony/http-kernel/EventListener/TestSessionListener.php new file mode 100644 index 0000000000..c5308269c4 --- /dev/null +++ b/core/vendor/symfony/http-kernel/EventListener/TestSessionListener.php @@ -0,0 +1,49 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\EventListener; + +use Psr\Container\ContainerInterface; +use Symfony\Component\HttpFoundation\Session\SessionInterface; + +/** + * Sets the session in the request. + * + * @author Fabien Potencier <fabien@symfony.com> + * + * @final + * + * @deprecated the TestSessionListener use the default SessionListener instead + */ +class TestSessionListener extends AbstractTestSessionListener +{ + private $container; + + public function __construct(ContainerInterface $container, array $sessionOptions = []) + { + $this->container = $container; + parent::__construct($sessionOptions); + } + + /** + * @deprecated since Symfony 5.4, will be removed in 6.0. + */ + protected function getSession(): ?SessionInterface + { + trigger_deprecation('symfony/http-kernel', '5.4', '"%s" is deprecated and will be removed in 6.0, inject a session in the request instead.', __METHOD__); + + if ($this->container->has('session')) { + return $this->container->get('session'); + } + + return null; + } +} diff --git a/core/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php b/core/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php index 78e8fe37d6..58680a3278 100644 --- a/core/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/AccessDeniedHttpException.php @@ -17,8 +17,19 @@ */ class AccessDeniedHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(403, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/BadRequestHttpException.php b/core/vendor/symfony/http-kernel/Exception/BadRequestHttpException.php index c920fbd0d6..f530f7db49 100644 --- a/core/vendor/symfony/http-kernel/Exception/BadRequestHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/BadRequestHttpException.php @@ -16,8 +16,19 @@ */ class BadRequestHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(400, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/ConflictHttpException.php b/core/vendor/symfony/http-kernel/Exception/ConflictHttpException.php index a5a6f8405c..79c36041c3 100644 --- a/core/vendor/symfony/http-kernel/Exception/ConflictHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/ConflictHttpException.php @@ -16,8 +16,19 @@ */ class ConflictHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(409, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/GoneHttpException.php b/core/vendor/symfony/http-kernel/Exception/GoneHttpException.php index 2893f05cbc..9ea65057b3 100644 --- a/core/vendor/symfony/http-kernel/Exception/GoneHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/GoneHttpException.php @@ -16,8 +16,19 @@ */ class GoneHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(410, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/HttpException.php b/core/vendor/symfony/http-kernel/Exception/HttpException.php index 418271065a..249fe366d5 100644 --- a/core/vendor/symfony/http-kernel/Exception/HttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/HttpException.php @@ -18,27 +18,43 @@ */ class HttpException extends \RuntimeException implements HttpExceptionInterface { - private int $statusCode; - private array $headers; + private $statusCode; + private $headers; - public function __construct(int $statusCode, string $message = '', \Throwable $previous = null, array $headers = [], int $code = 0) + public function __construct(int $statusCode, ?string $message = '', \Throwable $previous = null, array $headers = [], ?int $code = 0) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + if (null === $code) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__); + + $code = 0; + } + $this->statusCode = $statusCode; $this->headers = $headers; parent::__construct($message, $code, $previous); } - public function getStatusCode(): int + public function getStatusCode() { return $this->statusCode; } - public function getHeaders(): array + public function getHeaders() { return $this->headers; } + /** + * Set response headers. + * + * @param array $headers Response headers + */ public function setHeaders(array $headers) { $this->headers = $headers; diff --git a/core/vendor/symfony/http-kernel/Exception/HttpExceptionInterface.php b/core/vendor/symfony/http-kernel/Exception/HttpExceptionInterface.php index 7eb0cbdad4..4ae050945c 100644 --- a/core/vendor/symfony/http-kernel/Exception/HttpExceptionInterface.php +++ b/core/vendor/symfony/http-kernel/Exception/HttpExceptionInterface.php @@ -20,11 +20,15 @@ interface HttpExceptionInterface extends \Throwable { /** * Returns the status code. + * + * @return int */ - public function getStatusCode(): int; + public function getStatusCode(); /** * Returns response headers. + * + * @return array */ - public function getHeaders(): array; + public function getHeaders(); } diff --git a/core/vendor/symfony/http-kernel/Exception/LengthRequiredHttpException.php b/core/vendor/symfony/http-kernel/Exception/LengthRequiredHttpException.php index a3dd8b3cd7..fcac137852 100644 --- a/core/vendor/symfony/http-kernel/Exception/LengthRequiredHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/LengthRequiredHttpException.php @@ -16,8 +16,19 @@ */ class LengthRequiredHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(411, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/MethodNotAllowedHttpException.php b/core/vendor/symfony/http-kernel/Exception/MethodNotAllowedHttpException.php index cfbaf5cb02..37576bcacb 100644 --- a/core/vendor/symfony/http-kernel/Exception/MethodNotAllowedHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/MethodNotAllowedHttpException.php @@ -17,10 +17,24 @@ class MethodNotAllowedHttpException extends HttpException { /** - * @param string[] $allow An array of allowed methods + * @param string[] $allow An array of allowed methods + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int|null $code The internal exception code */ - public function __construct(array $allow, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + public function __construct(array $allow, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + if (null === $code) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__); + + $code = 0; + } + $headers['Allow'] = strtoupper(implode(', ', $allow)); parent::__construct(405, $message, $previous, $headers, $code); diff --git a/core/vendor/symfony/http-kernel/Exception/NotAcceptableHttpException.php b/core/vendor/symfony/http-kernel/Exception/NotAcceptableHttpException.php index ec2bb596fc..5a422406ba 100644 --- a/core/vendor/symfony/http-kernel/Exception/NotAcceptableHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/NotAcceptableHttpException.php @@ -16,8 +16,19 @@ */ class NotAcceptableHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(406, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/NotFoundHttpException.php b/core/vendor/symfony/http-kernel/Exception/NotFoundHttpException.php index 0e78fcc155..a475113c5f 100644 --- a/core/vendor/symfony/http-kernel/Exception/NotFoundHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/NotFoundHttpException.php @@ -16,8 +16,19 @@ */ class NotFoundHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(404, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/PreconditionFailedHttpException.php b/core/vendor/symfony/http-kernel/Exception/PreconditionFailedHttpException.php index 4431f89d03..e23740a28d 100644 --- a/core/vendor/symfony/http-kernel/Exception/PreconditionFailedHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/PreconditionFailedHttpException.php @@ -16,8 +16,19 @@ */ class PreconditionFailedHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(412, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/PreconditionRequiredHttpException.php b/core/vendor/symfony/http-kernel/Exception/PreconditionRequiredHttpException.php index f75afd3706..5c31fae822 100644 --- a/core/vendor/symfony/http-kernel/Exception/PreconditionRequiredHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/PreconditionRequiredHttpException.php @@ -18,8 +18,19 @@ */ class PreconditionRequiredHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(428, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/ServiceUnavailableHttpException.php b/core/vendor/symfony/http-kernel/Exception/ServiceUnavailableHttpException.php index d4862bd109..d5681bbeb3 100644 --- a/core/vendor/symfony/http-kernel/Exception/ServiceUnavailableHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/ServiceUnavailableHttpException.php @@ -18,9 +18,23 @@ class ServiceUnavailableHttpException extends HttpException { /** * @param int|string|null $retryAfter The number of seconds or HTTP-date after which the request may be retried + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int|null $code The internal exception code */ - public function __construct(int|string $retryAfter = null, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + public function __construct($retryAfter = null, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + if (null === $code) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__); + + $code = 0; + } + if ($retryAfter) { $headers['Retry-After'] = $retryAfter; } diff --git a/core/vendor/symfony/http-kernel/Exception/TooManyRequestsHttpException.php b/core/vendor/symfony/http-kernel/Exception/TooManyRequestsHttpException.php index b71fb2508f..fd74402b5d 100644 --- a/core/vendor/symfony/http-kernel/Exception/TooManyRequestsHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/TooManyRequestsHttpException.php @@ -20,9 +20,23 @@ class TooManyRequestsHttpException extends HttpException { /** * @param int|string|null $retryAfter The number of seconds or HTTP-date after which the request may be retried + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int|null $code The internal exception code */ - public function __construct(int|string $retryAfter = null, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + public function __construct($retryAfter = null, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + if (null === $code) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__); + + $code = 0; + } + if ($retryAfter) { $headers['Retry-After'] = $retryAfter; } diff --git a/core/vendor/symfony/http-kernel/Exception/UnauthorizedHttpException.php b/core/vendor/symfony/http-kernel/Exception/UnauthorizedHttpException.php index c866861281..aeb9713a3d 100644 --- a/core/vendor/symfony/http-kernel/Exception/UnauthorizedHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/UnauthorizedHttpException.php @@ -17,10 +17,24 @@ class UnauthorizedHttpException extends HttpException { /** - * @param string $challenge WWW-Authenticate challenge string + * @param string $challenge WWW-Authenticate challenge string + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int|null $code The internal exception code */ - public function __construct(string $challenge, string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + public function __construct(string $challenge, ?string $message = '', \Throwable $previous = null, ?int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + if (null === $code) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__); + + $code = 0; + } + $headers['WWW-Authenticate'] = $challenge; parent::__construct(401, $message, $previous, $headers, $code); diff --git a/core/vendor/symfony/http-kernel/Exception/UnprocessableEntityHttpException.php b/core/vendor/symfony/http-kernel/Exception/UnprocessableEntityHttpException.php index d58af6c2b6..7b828b1d92 100644 --- a/core/vendor/symfony/http-kernel/Exception/UnprocessableEntityHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/UnprocessableEntityHttpException.php @@ -16,8 +16,19 @@ */ class UnprocessableEntityHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(422, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Exception/UnsupportedMediaTypeHttpException.php b/core/vendor/symfony/http-kernel/Exception/UnsupportedMediaTypeHttpException.php index 3060f1f918..7908423f42 100644 --- a/core/vendor/symfony/http-kernel/Exception/UnsupportedMediaTypeHttpException.php +++ b/core/vendor/symfony/http-kernel/Exception/UnsupportedMediaTypeHttpException.php @@ -16,8 +16,19 @@ */ class UnsupportedMediaTypeHttpException extends HttpException { - public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) + /** + * @param string|null $message The internal exception message + * @param \Throwable|null $previous The previous exception + * @param int $code The internal exception code + */ + public function __construct(?string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []) { + if (null === $message) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + parent::__construct(415, $message, $previous, $headers, $code); } } diff --git a/core/vendor/symfony/http-kernel/Fragment/AbstractSurrogateFragmentRenderer.php b/core/vendor/symfony/http-kernel/Fragment/AbstractSurrogateFragmentRenderer.php index f23ea7db1e..d051ad8b5f 100644 --- a/core/vendor/symfony/http-kernel/Fragment/AbstractSurrogateFragmentRenderer.php +++ b/core/vendor/symfony/http-kernel/Fragment/AbstractSurrogateFragmentRenderer.php @@ -57,7 +57,7 @@ public function __construct(SurrogateInterface $surrogate = null, FragmentRender * * @see Symfony\Component\HttpKernel\HttpCache\SurrogateInterface */ - public function render(string|ControllerReference $uri, Request $request, array $options = []): Response + public function render($uri, Request $request, array $options = []) { if (!$this->surrogate || !$this->surrogate->hasSurrogateCapability($request)) { if ($uri instanceof ControllerReference && $this->containsNonScalars($uri->attributes)) { diff --git a/core/vendor/symfony/http-kernel/Fragment/EsiFragmentRenderer.php b/core/vendor/symfony/http-kernel/Fragment/EsiFragmentRenderer.php index 76f74a8436..a4570e3beb 100644 --- a/core/vendor/symfony/http-kernel/Fragment/EsiFragmentRenderer.php +++ b/core/vendor/symfony/http-kernel/Fragment/EsiFragmentRenderer.php @@ -21,7 +21,7 @@ class EsiFragmentRenderer extends AbstractSurrogateFragmentRenderer /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'esi'; } diff --git a/core/vendor/symfony/http-kernel/Fragment/FragmentHandler.php b/core/vendor/symfony/http-kernel/Fragment/FragmentHandler.php index 5883376b0d..1ecaaef1aa 100644 --- a/core/vendor/symfony/http-kernel/Fragment/FragmentHandler.php +++ b/core/vendor/symfony/http-kernel/Fragment/FragmentHandler.php @@ -29,8 +29,8 @@ */ class FragmentHandler { - private bool $debug; - private array $renderers = []; + private $debug; + private $renderers = []; private $requestStack; /** @@ -61,10 +61,14 @@ public function addRenderer(FragmentRendererInterface $renderer) * * * ignore_errors: true to return an empty string in case of an error * + * @param string|ControllerReference $uri A URI as a string or a ControllerReference instance + * + * @return string|null + * * @throws \InvalidArgumentException when the renderer does not exist * @throws \LogicException when no main request is being handled */ - public function render(string|ControllerReference $uri, string $renderer = 'inline', array $options = []): ?string + public function render($uri, string $renderer = 'inline', array $options = []) { if (!isset($options['ignore_errors'])) { $options['ignore_errors'] = !$this->debug; @@ -91,7 +95,7 @@ public function render(string|ControllerReference $uri, string $renderer = 'inli * * @throws \RuntimeException when the Response is not successful */ - protected function deliver(Response $response): ?string + protected function deliver(Response $response) { if (!$response->isSuccessful()) { $responseStatusCode = $response->getStatusCode(); diff --git a/core/vendor/symfony/http-kernel/Fragment/FragmentRendererInterface.php b/core/vendor/symfony/http-kernel/Fragment/FragmentRendererInterface.php index a61f2e64ea..568b1781a9 100644 --- a/core/vendor/symfony/http-kernel/Fragment/FragmentRendererInterface.php +++ b/core/vendor/symfony/http-kernel/Fragment/FragmentRendererInterface.php @@ -24,11 +24,17 @@ interface FragmentRendererInterface { /** * Renders a URI and returns the Response content. + * + * @param string|ControllerReference $uri A URI as a string or a ControllerReference instance + * + * @return Response */ - public function render(string|ControllerReference $uri, Request $request, array $options = []): Response; + public function render($uri, Request $request, array $options = []); /** * Gets the name of the strategy. + * + * @return string */ - public function getName(): string; + public function getName(); } diff --git a/core/vendor/symfony/http-kernel/Fragment/FragmentUriGenerator.php b/core/vendor/symfony/http-kernel/Fragment/FragmentUriGenerator.php index 81aeba2772..dabe3048ff 100644 --- a/core/vendor/symfony/http-kernel/Fragment/FragmentUriGenerator.php +++ b/core/vendor/symfony/http-kernel/Fragment/FragmentUriGenerator.php @@ -24,7 +24,7 @@ */ final class FragmentUriGenerator implements FragmentUriGeneratorInterface { - private string $fragmentPath; + private $fragmentPath; private $signer; private $requestStack; diff --git a/core/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php b/core/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php index fd66ed63f0..446ce2d9df 100644 --- a/core/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php +++ b/core/vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php @@ -24,10 +24,10 @@ */ class HIncludeFragmentRenderer extends RoutableFragmentRenderer { - private ?string $globalDefaultTemplate; + private $globalDefaultTemplate; private $signer; private $twig; - private string $charset; + private $charset; /** * @param string $globalDefaultTemplate The global default content (it can be a template name or the content) @@ -42,8 +42,10 @@ public function __construct(Environment $twig = null, UriSigner $signer = null, /** * Checks if a templating engine has been set. + * + * @return bool */ - public function hasTemplating(): bool + public function hasTemplating() { return null !== $this->twig; } @@ -57,7 +59,7 @@ public function hasTemplating(): bool * * id: An optional hx:include tag id attribute * * attributes: An optional array of hx:include tag attributes */ - public function render(string|ControllerReference $uri, Request $request, array $options = []): Response + public function render($uri, Request $request, array $options = []) { if ($uri instanceof ControllerReference) { $uri = (new FragmentUriGenerator($this->fragmentPath, $this->signer))->generate($uri, $request); @@ -95,7 +97,7 @@ public function render(string|ControllerReference $uri, Request $request, array /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'hinclude'; } diff --git a/core/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php b/core/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php index 4749bbe115..ea45fdcb3f 100644 --- a/core/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php +++ b/core/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php @@ -43,7 +43,7 @@ public function __construct(HttpKernelInterface $kernel, EventDispatcherInterfac * * * alt: an alternative URI to render in case of an error */ - public function render(string|ControllerReference $uri, Request $request, array $options = []): Response + public function render($uri, Request $request, array $options = []) { $reference = null; if ($uri instanceof ControllerReference) { @@ -138,7 +138,7 @@ protected function createSubRequest(string $uri, Request $request) /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'inline'; } diff --git a/core/vendor/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php b/core/vendor/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php index 416b670417..e922ffb64d 100644 --- a/core/vendor/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php +++ b/core/vendor/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php @@ -42,8 +42,10 @@ public function setFragmentPath(string $path) * * @param bool $absolute Whether to generate an absolute URL or not * @param bool $strict Whether to allow non-scalar attributes or not + * + * @return string */ - protected function generateFragmentUri(ControllerReference $reference, Request $request, bool $absolute = false, bool $strict = true): string + protected function generateFragmentUri(ControllerReference $reference, Request $request, bool $absolute = false, bool $strict = true) { return (new FragmentUriGenerator($this->fragmentPath))->generate($reference, $request, $absolute, $strict, false); } diff --git a/core/vendor/symfony/http-kernel/Fragment/SsiFragmentRenderer.php b/core/vendor/symfony/http-kernel/Fragment/SsiFragmentRenderer.php index 1f19dcfd36..45e7122f05 100644 --- a/core/vendor/symfony/http-kernel/Fragment/SsiFragmentRenderer.php +++ b/core/vendor/symfony/http-kernel/Fragment/SsiFragmentRenderer.php @@ -21,7 +21,7 @@ class SsiFragmentRenderer extends AbstractSurrogateFragmentRenderer /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'ssi'; } diff --git a/core/vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php b/core/vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php index f3bf65f5d8..3384805874 100644 --- a/core/vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php +++ b/core/vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php @@ -40,8 +40,10 @@ public function __construct(array $contentTypes = ['text/html', 'text/xml', 'app /** * Returns a new cache strategy instance. + * + * @return ResponseCacheStrategyInterface */ - public function createCacheStrategy(): ResponseCacheStrategyInterface + public function createCacheStrategy() { return new ResponseCacheStrategy(); } @@ -49,7 +51,7 @@ public function createCacheStrategy(): ResponseCacheStrategyInterface /** * {@inheritdoc} */ - public function hasSurrogateCapability(Request $request): bool + public function hasSurrogateCapability(Request $request) { if (null === $value = $request->headers->get('Surrogate-Capability')) { return false; @@ -72,7 +74,7 @@ public function addSurrogateCapability(Request $request) /** * {@inheritdoc} */ - public function needsParsing(Response $response): bool + public function needsParsing(Response $response) { if (!$control = $response->headers->get('Surrogate-Control')) { return false; @@ -86,7 +88,7 @@ public function needsParsing(Response $response): bool /** * {@inheritdoc} */ - public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors): string + public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors) { $subRequest = Request::create($uri, Request::METHOD_GET, [], $cache->getRequest()->cookies->all(), [], $cache->getRequest()->server->all()); diff --git a/core/vendor/symfony/http-kernel/HttpCache/Esi.php b/core/vendor/symfony/http-kernel/HttpCache/Esi.php index 1ab423812e..cd6a00a10d 100644 --- a/core/vendor/symfony/http-kernel/HttpCache/Esi.php +++ b/core/vendor/symfony/http-kernel/HttpCache/Esi.php @@ -27,7 +27,7 @@ */ class Esi extends AbstractSurrogate { - public function getName(): string + public function getName() { return 'esi'; } @@ -45,7 +45,7 @@ public function addSurrogateControl(Response $response) /** * {@inheritdoc} */ - public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = ''): string + public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = '') { $html = sprintf('', $uri, @@ -63,7 +63,7 @@ public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreEr /** * {@inheritdoc} */ - public function process(Request $request, Response $response): Response + public function process(Request $request, Response $response) { $type = $response->headers->get('Content-Type'); if (empty($type)) { diff --git a/core/vendor/symfony/http-kernel/HttpCache/HttpCache.php b/core/vendor/symfony/http-kernel/HttpCache/HttpCache.php index eeec55593f..bf93171fab 100644 --- a/core/vendor/symfony/http-kernel/HttpCache/HttpCache.php +++ b/core/vendor/symfony/http-kernel/HttpCache/HttpCache.php @@ -33,9 +33,9 @@ class HttpCache implements HttpKernelInterface, TerminableInterface private $store; private $request; private $surrogate; - private $surrogateCacheStrategy = null; - private array $options = []; - private array $traces = []; + private $surrogateCacheStrategy; + private $options = []; + private $traces = []; /** * Constructor. @@ -107,16 +107,20 @@ public function __construct(HttpKernelInterface $kernel, StoreInterface $store, /** * Gets the current store. + * + * @return StoreInterface */ - public function getStore(): StoreInterface + public function getStore() { return $this->store; } /** * Returns an array of events that took place during processing of the last request. + * + * @return array */ - public function getTraces(): array + public function getTraces() { return $this->traces; } @@ -140,8 +144,10 @@ private function addTraces(Response $response) /** * Returns a log message for the events of the last request processing. + * + * @return string */ - public function getLog(): string + public function getLog() { $log = []; foreach ($this->traces as $request => $traces) { @@ -153,16 +159,20 @@ public function getLog(): string /** * Gets the Request instance associated with the main request. + * + * @return Request */ - public function getRequest(): Request + public function getRequest() { return $this->request; } /** * Gets the Kernel instance. + * + * @return HttpKernelInterface */ - public function getKernel(): HttpKernelInterface + public function getKernel() { return $this->kernel; } @@ -170,9 +180,11 @@ public function getKernel(): HttpKernelInterface /** * Gets the Surrogate instance. * + * @return SurrogateInterface + * * @throws \LogicException */ - public function getSurrogate(): SurrogateInterface + public function getSurrogate() { return $this->surrogate; } @@ -180,7 +192,7 @@ public function getSurrogate(): SurrogateInterface /** * {@inheritdoc} */ - public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response + public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true) { // FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism if (HttpKernelInterface::MAIN_REQUEST === $type) { @@ -247,8 +259,10 @@ public function terminate(Request $request, Response $response) * Forwards the Request to the backend without storing the Response in the cache. * * @param bool $catch Whether to process exceptions + * + * @return Response */ - protected function pass(Request $request, bool $catch = false): Response + protected function pass(Request $request, bool $catch = false) { $this->record($request, 'pass'); @@ -260,11 +274,13 @@ protected function pass(Request $request, bool $catch = false): Response * * @param bool $catch Whether to process exceptions * + * @return Response + * * @throws \Exception * * @see RFC2616 13.10 */ - protected function invalidate(Request $request, bool $catch = false): Response + protected function invalidate(Request $request, bool $catch = false) { $response = $this->pass($request, $catch); @@ -306,9 +322,11 @@ protected function invalidate(Request $request, bool $catch = false): Response * * @param bool $catch Whether to process exceptions * + * @return Response + * * @throws \Exception */ - protected function lookup(Request $request, bool $catch = false): Response + protected function lookup(Request $request, bool $catch = false) { try { $entry = $this->store->lookup($request); @@ -352,8 +370,10 @@ protected function lookup(Request $request, bool $catch = false): Response * GET request with the backend. * * @param bool $catch Whether to process exceptions + * + * @return Response */ - protected function validate(Request $request, Response $entry, bool $catch = false): Response + protected function validate(Request $request, Response $entry, bool $catch = false) { $subRequest = clone $request; @@ -413,8 +433,10 @@ protected function validate(Request $request, Response $entry, bool $catch = fal * stores it in the cache if is cacheable. * * @param bool $catch Whether to process exceptions + * + * @return Response */ - protected function fetch(Request $request, bool $catch = false): Response + protected function fetch(Request $request, bool $catch = false) { $subRequest = clone $request; @@ -517,8 +539,10 @@ protected function forward(Request $request, bool $catch = false, Response $entr /** * Checks whether the cache entry is "fresh enough" to satisfy the Request. + * + * @return bool */ - protected function isFreshEnough(Request $request, Response $entry): bool + protected function isFreshEnough(Request $request, Response $entry) { if (!$entry->isFresh()) { return $this->lock($request, $entry); @@ -536,7 +560,7 @@ protected function isFreshEnough(Request $request, Response $entry): bool * * @return bool true if the cache entry can be returned even if it is staled, false otherwise */ - protected function lock(Request $request, Response $entry): bool + protected function lock(Request $request, Response $entry) { // try to acquire a lock to call the backend $lock = $this->store->lock($request); diff --git a/core/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php b/core/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php index 9f136061ad..cf8682257e 100644 --- a/core/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php +++ b/core/vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php @@ -34,10 +34,10 @@ class ResponseCacheStrategy implements ResponseCacheStrategyInterface */ private const INHERIT_DIRECTIVES = ['public', 'immutable']; - private int $embeddedResponses = 0; - private bool $isNotCacheableResponseEmbedded = false; - private int $age = 0; - private array $flagDirectives = [ + private $embeddedResponses = 0; + private $isNotCacheableResponseEmbedded = false; + private $age = 0; + private $flagDirectives = [ 'no-cache' => null, 'no-store' => null, 'no-transform' => null, @@ -47,7 +47,7 @@ class ResponseCacheStrategy implements ResponseCacheStrategyInterface 'private' => null, 'immutable' => null, ]; - private array $ageDirectives = [ + private $ageDirectives = [ 'max-age' => null, 's-maxage' => null, 'expires' => null, diff --git a/core/vendor/symfony/http-kernel/HttpCache/Ssi.php b/core/vendor/symfony/http-kernel/HttpCache/Ssi.php index 48907c2715..f114e05cfb 100644 --- a/core/vendor/symfony/http-kernel/HttpCache/Ssi.php +++ b/core/vendor/symfony/http-kernel/HttpCache/Ssi.php @@ -24,7 +24,7 @@ class Ssi extends AbstractSurrogate /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'ssi'; } @@ -42,7 +42,7 @@ public function addSurrogateControl(Response $response) /** * {@inheritdoc} */ - public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = ''): string + public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = '') { return sprintf('<!--#include virtual="%s" -->', $uri); } @@ -50,7 +50,7 @@ public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreEr /** * {@inheritdoc} */ - public function process(Request $request, Response $response): Response + public function process(Request $request, Response $response) { $type = $response->headers->get('Content-Type'); if (empty($type)) { diff --git a/core/vendor/symfony/http-kernel/HttpCache/Store.php b/core/vendor/symfony/http-kernel/HttpCache/Store.php index c3c662c11d..c777391385 100644 --- a/core/vendor/symfony/http-kernel/HttpCache/Store.php +++ b/core/vendor/symfony/http-kernel/HttpCache/Store.php @@ -26,9 +26,9 @@ class Store implements StoreInterface { protected $root; /** @var \SplObjectStorage<Request, string> */ - private \SplObjectStorage $keyCache; + private $keyCache; /** @var array<string, resource> */ - private array $locks = []; + private $locks = []; /** * @throws \RuntimeException @@ -61,7 +61,7 @@ public function cleanup() * * @return bool|string true if the lock is acquired, the path to the current lock otherwise */ - public function lock(Request $request): bool|string + public function lock(Request $request) { $key = $this->getCacheKey($request); @@ -88,7 +88,7 @@ public function lock(Request $request): bool|string * * @return bool False if the lock file does not exist or cannot be unlocked, true otherwise */ - public function unlock(Request $request): bool + public function unlock(Request $request) { $key = $this->getCacheKey($request); @@ -103,7 +103,7 @@ public function unlock(Request $request): bool return false; } - public function isLocked(Request $request): bool + public function isLocked(Request $request) { $key = $this->getCacheKey($request); @@ -125,8 +125,10 @@ public function isLocked(Request $request): bool /** * Locates a cached Response for the Request provided. + * + * @return Response|null */ - public function lookup(Request $request): ?Response + public function lookup(Request $request) { $key = $this->getCacheKey($request); @@ -165,9 +167,11 @@ public function lookup(Request $request): ?Response * Existing entries are read and any that match the response are removed. This * method calls write with the new list of cache entries. * + * @return string + * * @throws \RuntimeException */ - public function write(Request $request, Response $response): string + public function write(Request $request, Response $response) { $key = $this->getCacheKey($request); $storedEnv = $this->persistRequest($request); @@ -223,8 +227,10 @@ public function write(Request $request, Response $response): string /** * Returns content digest for $response. + * + * @return string */ - protected function generateContentDigest(Response $response): string + protected function generateContentDigest(Response $response) { return 'en'.hash('sha256', $response->getContent()); } @@ -303,7 +309,7 @@ private function getMetadata(string $key): array * * @return bool true if the URL exists with either HTTP or HTTPS scheme and has been purged, false otherwise */ - public function purge(string $url): bool + public function purge(string $url) { $http = preg_replace('#^https:#', 'http:', $url); $https = preg_replace('#^http:#', 'https:', $url); @@ -412,8 +418,10 @@ public function getPath(string $key) * If the same URI can have more than one representation, based on some * headers, use a Vary header to indicate them, and each representation will * be stored independently under the same cache key. + * + * @return string */ - protected function generateCacheKey(Request $request): string + protected function generateCacheKey(Request $request) { return 'md'.hash('sha256', $request->getUri()); } diff --git a/core/vendor/symfony/http-kernel/HttpCache/StoreInterface.php b/core/vendor/symfony/http-kernel/HttpCache/StoreInterface.php index 0cf8921cd1..3d07ef3fc3 100644 --- a/core/vendor/symfony/http-kernel/HttpCache/StoreInterface.php +++ b/core/vendor/symfony/http-kernel/HttpCache/StoreInterface.php @@ -26,8 +26,10 @@ interface StoreInterface { /** * Locates a cached Response for the Request provided. + * + * @return Response|null */ - public function lookup(Request $request): ?Response; + public function lookup(Request $request); /** * Writes a cache entry to the store for the given Request and Response. @@ -37,7 +39,7 @@ public function lookup(Request $request): ?Response; * * @return string The key under which the response is stored */ - public function write(Request $request, Response $response): string; + public function write(Request $request, Response $response); /** * Invalidates all cache entries that match the request. @@ -49,28 +51,28 @@ public function invalidate(Request $request); * * @return bool|string true if the lock is acquired, the path to the current lock otherwise */ - public function lock(Request $request): bool|string; + public function lock(Request $request); /** * Releases the lock for the given Request. * * @return bool False if the lock file does not exist or cannot be unlocked, true otherwise */ - public function unlock(Request $request): bool; + public function unlock(Request $request); /** * Returns whether or not a lock exists. * * @return bool true if lock exists, false otherwise */ - public function isLocked(Request $request): bool; + public function isLocked(Request $request); /** * Purges data for the given URL. * * @return bool true if the URL exists and has been purged, false otherwise */ - public function purge(string $url): bool; + public function purge(string $url); /** * Cleanups storage. diff --git a/core/vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php b/core/vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php index f9b9930b75..3f3c74a97a 100644 --- a/core/vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php +++ b/core/vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php @@ -18,18 +18,24 @@ interface SurrogateInterface { /** * Returns surrogate name. + * + * @return string */ - public function getName(): string; + public function getName(); /** * Returns a new cache strategy instance. + * + * @return ResponseCacheStrategyInterface */ - public function createCacheStrategy(): ResponseCacheStrategyInterface; + public function createCacheStrategy(); /** * Checks that at least one surrogate has Surrogate capability. + * + * @return bool */ - public function hasSurrogateCapability(Request $request): bool; + public function hasSurrogateCapability(Request $request); /** * Adds Surrogate-capability to the given Request. @@ -45,29 +51,37 @@ public function addSurrogateControl(Response $response); /** * Checks that the Response needs to be parsed for Surrogate tags. + * + * @return bool */ - public function needsParsing(Response $response): bool; + public function needsParsing(Response $response); /** * Renders a Surrogate tag. * * @param string $alt An alternate URI * @param string $comment A comment to add as an esi:include tag + * + * @return string */ - public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = ''): string; + public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = ''); /** * Replaces a Response Surrogate tags with the included resource content. + * + * @return Response */ - public function process(Request $request, Response $response): Response; + public function process(Request $request, Response $response); /** * Handles a Surrogate from the cache. * * @param string $alt An alternative URI * + * @return string + * * @throws \RuntimeException * @throws \Exception */ - public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors): string; + public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors); } diff --git a/core/vendor/symfony/http-kernel/HttpKernel.php b/core/vendor/symfony/http-kernel/HttpKernel.php index 684409a9b8..e10e683383 100644 --- a/core/vendor/symfony/http-kernel/HttpKernel.php +++ b/core/vendor/symfony/http-kernel/HttpKernel.php @@ -66,7 +66,7 @@ public function __construct(EventDispatcherInterface $dispatcher, ControllerReso /** * {@inheritdoc} */ - public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response + public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true) { $request->headers->set('X-Php-Ob-Level', (string) ob_get_level()); @@ -245,7 +245,7 @@ private function handleThrowable(\Throwable $e, Request $request, int $type): Re /** * Returns a human-readable string for the specified variable. */ - private function varToString(mixed $var): string + private function varToString($var): string { if (\is_object($var)) { return sprintf('an object of type %s', \get_class($var)); diff --git a/core/vendor/symfony/http-kernel/HttpKernelBrowser.php b/core/vendor/symfony/http-kernel/HttpKernelBrowser.php index fc70d8970d..643134f1bb 100644 --- a/core/vendor/symfony/http-kernel/HttpKernelBrowser.php +++ b/core/vendor/symfony/http-kernel/HttpKernelBrowser.php @@ -31,7 +31,7 @@ class HttpKernelBrowser extends AbstractBrowser { protected $kernel; - private bool $catchExceptions = true; + private $catchExceptions = true; /** * @param array $server The server parameters (equivalent of $_SERVER) @@ -129,8 +129,10 @@ protected function getHandleScript() /** * {@inheritdoc} + * + * @return Request */ - protected function filterRequest(DomRequest $request): Request + protected function filterRequest(DomRequest $request) { $httpRequest = Request::create($request->getUri(), $request->getMethod(), $request->getParameters(), $request->getCookies(), $request->getFiles(), $server = $request->getServer(), $request->getContent()); if (!isset($server['HTTP_ACCEPT'])) { @@ -154,8 +156,10 @@ protected function filterRequest(DomRequest $request): Request * an invalid UploadedFile is returned with an error set to UPLOAD_ERR_INI_SIZE. * * @see UploadedFile + * + * @return array */ - protected function filterFiles(array $files): array + protected function filterFiles(array $files) { $filtered = []; foreach ($files as $key => $value) { @@ -189,8 +193,10 @@ protected function filterFiles(array $files): array * {@inheritdoc} * * @param Response $response + * + * @return DomResponse */ - protected function filterResponse(object $response): DomResponse + protected function filterResponse(object $response) { // this is needed to support StreamedResponse ob_start(); diff --git a/core/vendor/symfony/http-kernel/HttpKernelInterface.php b/core/vendor/symfony/http-kernel/HttpKernelInterface.php index f6c017a4c5..0449240e7e 100644 --- a/core/vendor/symfony/http-kernel/HttpKernelInterface.php +++ b/core/vendor/symfony/http-kernel/HttpKernelInterface.php @@ -40,7 +40,9 @@ interface HttpKernelInterface * (one of HttpKernelInterface::MAIN_REQUEST or HttpKernelInterface::SUB_REQUEST) * @param bool $catch Whether to catch exceptions or not * + * @return Response + * * @throws \Exception When an Exception occurs during processing */ - public function handle(Request $request, int $type = self::MAIN_REQUEST, bool $catch = true): Response; + public function handle(Request $request, int $type = self::MAIN_REQUEST, bool $catch = true); } diff --git a/core/vendor/symfony/http-kernel/Kernel.php b/core/vendor/symfony/http-kernel/Kernel.php index 6f3c9cdf41..8bef7c4348 100644 --- a/core/vendor/symfony/http-kernel/Kernel.php +++ b/core/vendor/symfony/http-kernel/Kernel.php @@ -68,25 +68,25 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl protected $booted = false; protected $startTime; - private string $projectDir; - private ?string $warmupDir = null; - private int $requestStackSize = 0; - private bool $resetServices = false; + private $projectDir; + private $warmupDir; + private $requestStackSize = 0; + private $resetServices = false; /** * @var array<string, bool> */ - private static array $freshCache = []; + private static $freshCache = []; - public const VERSION = '6.0.4'; - public const VERSION_ID = 60004; - public const MAJOR_VERSION = 6; - public const MINOR_VERSION = 0; + public const VERSION = '5.4.4'; + public const VERSION_ID = 50404; + public const MAJOR_VERSION = 5; + public const MINOR_VERSION = 4; public const RELEASE_VERSION = 4; public const EXTRA_VERSION = ''; - public const END_OF_MAINTENANCE = '07/2022'; - public const END_OF_LIFE = '07/2022'; + public const END_OF_MAINTENANCE = '11/2024'; + public const END_OF_LIFE = '11/2025'; public function __construct(string $environment, bool $debug) { @@ -184,7 +184,7 @@ public function shutdown() /** * {@inheritdoc} */ - public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response + public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true) { if (!$this->booted) { $container = $this->container ?? $this->preBoot(); @@ -207,8 +207,10 @@ public function handle(Request $request, int $type = HttpKernelInterface::MAIN_R /** * Gets an HTTP kernel from the container. + * + * @return HttpKernelInterface */ - protected function getHttpKernel(): HttpKernelInterface + protected function getHttpKernel() { return $this->container->get('http_kernel'); } @@ -216,7 +218,7 @@ protected function getHttpKernel(): HttpKernelInterface /** * {@inheritdoc} */ - public function getBundles(): array + public function getBundles() { return $this->bundles; } @@ -224,7 +226,7 @@ public function getBundles(): array /** * {@inheritdoc} */ - public function getBundle(string $name): BundleInterface + public function getBundle(string $name) { if (!isset($this->bundles[$name])) { throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the "registerBundles()" method of your "%s.php" file?', $name, get_debug_type($this))); @@ -236,7 +238,7 @@ public function getBundle(string $name): BundleInterface /** * {@inheritdoc} */ - public function locateResource(string $name): string + public function locateResource(string $name) { if ('@' !== $name[0]) { throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name)); @@ -263,7 +265,7 @@ public function locateResource(string $name): string /** * {@inheritdoc} */ - public function getEnvironment(): string + public function getEnvironment() { return $this->environment; } @@ -271,17 +273,19 @@ public function getEnvironment(): string /** * {@inheritdoc} */ - public function isDebug(): bool + public function isDebug() { return $this->debug; } /** * Gets the application root dir (path of the project's composer file). + * + * @return string */ - public function getProjectDir(): string + public function getProjectDir() { - if (!isset($this->projectDir)) { + if (null === $this->projectDir) { $r = new \ReflectionObject($this); if (!is_file($dir = $r->getFileName())) { @@ -304,7 +308,7 @@ public function getProjectDir(): string /** * {@inheritdoc} */ - public function getContainer(): ContainerInterface + public function getContainer() { if (!$this->container) { throw new \LogicException('Cannot retrieve the container from a non-booted kernel.'); @@ -324,7 +328,7 @@ public function setAnnotatedClassCache(array $annotatedClasses) /** * {@inheritdoc} */ - public function getStartTime(): float + public function getStartTime() { return $this->debug && null !== $this->startTime ? $this->startTime : -\INF; } @@ -332,7 +336,7 @@ public function getStartTime(): float /** * {@inheritdoc} */ - public function getCacheDir(): string + public function getCacheDir() { return $this->getProjectDir().'/var/cache/'.$this->environment; } @@ -349,7 +353,7 @@ public function getBuildDir(): string /** * {@inheritdoc} */ - public function getLogDir(): string + public function getLogDir() { return $this->getProjectDir().'/var/log'; } @@ -357,7 +361,7 @@ public function getLogDir(): string /** * {@inheritdoc} */ - public function getCharset(): string + public function getCharset() { return 'UTF-8'; } @@ -401,8 +405,10 @@ protected function build(ContainerBuilder $container) * Gets the container class. * * @throws \InvalidArgumentException If the generated classname is invalid + * + * @return string */ - protected function getContainerClass(): string + protected function getContainerClass() { $class = static::class; $class = str_contains($class, "@anonymous\0") ? get_parent_class($class).str_replace('.', '_', ContainerBuilder::hash($class)) : $class; @@ -419,8 +425,10 @@ protected function getContainerClass(): string * Gets the container's base class. * * All names except Container must be fully qualified. + * + * @return string */ - protected function getContainerBaseClass(): string + protected function getContainerBaseClass() { return 'Container'; } @@ -586,8 +594,10 @@ protected function initializeContainer() /** * Returns the kernel parameters. + * + * @return array */ - protected function getKernelParameters(): array + protected function getKernelParameters() { $bundles = []; $bundlesMetadata = []; @@ -618,9 +628,11 @@ protected function getKernelParameters(): array /** * Builds the service container. * + * @return ContainerBuilder + * * @throws \RuntimeException */ - protected function buildContainer(): ContainerBuilder + protected function buildContainer() { foreach (['cache' => $this->getCacheDir(), 'build' => $this->warmupDir ?: $this->getBuildDir(), 'logs' => $this->getLogDir()] as $name => $dir) { if (!is_dir($dir)) { @@ -635,7 +647,11 @@ protected function buildContainer(): ContainerBuilder $container = $this->getContainerBuilder(); $container->addObjectResource($this); $this->prepareContainer($container); - $this->registerContainerConfiguration($this->getContainerLoader($container)); + + if (null !== $cont = $this->registerContainerConfiguration($this->getContainerLoader($container))) { + trigger_deprecation('symfony/http-kernel', '5.3', 'Returning a ContainerBuilder from "%s::registerContainerConfiguration()" is deprecated.', get_debug_type($this)); + $container->merge($cont); + } $container->addCompilerPass(new AddAnnotatedClassesToCachePass($this)); @@ -674,8 +690,10 @@ protected function prepareContainer(ContainerBuilder $container) /** * Gets a new ContainerBuilder instance used to build the service container. + * + * @return ContainerBuilder */ - protected function getContainerBuilder(): ContainerBuilder + protected function getContainerBuilder() { $container = new ContainerBuilder(); $container->getParameterBag()->add($this->getKernelParameters()); @@ -736,8 +754,10 @@ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container /** * Returns a loader for the container. + * + * @return DelegatingLoader */ - protected function getContainerLoader(ContainerInterface $container): DelegatingLoader + protected function getContainerLoader(ContainerInterface $container) { $env = $this->getEnvironment(); $locator = new FileLocator($this); @@ -786,8 +806,10 @@ private function preBoot(): ContainerInterface * * We don't use the PHP php_strip_whitespace() function * as we want the content to be readable and well-formatted. + * + * @return string */ - public static function stripComments(string $source): string + public static function stripComments(string $source) { if (!\function_exists('token_get_all')) { return $source; @@ -842,7 +864,10 @@ public static function stripComments(string $source): string return $output; } - public function __sleep(): array + /** + * @return array + */ + public function __sleep() { return ['environment', 'debug']; } diff --git a/core/vendor/symfony/http-kernel/KernelInterface.php b/core/vendor/symfony/http-kernel/KernelInterface.php index 0959febf14..41135a6d80 100644 --- a/core/vendor/symfony/http-kernel/KernelInterface.php +++ b/core/vendor/symfony/http-kernel/KernelInterface.php @@ -20,6 +20,10 @@ * * It manages an environment made of application kernel and bundles. * + * @method string getBuildDir() Returns the build directory - not implementing it is deprecated since Symfony 5.2. + * This directory should be used to store build artifacts, and can be read-only at runtime. + * Caches written at runtime should be stored in the "cache directory" ({@see KernelInterface::getCacheDir()}). + * * @author Fabien Potencier <fabien@symfony.com> */ interface KernelInterface extends HttpKernelInterface @@ -29,7 +33,7 @@ interface KernelInterface extends HttpKernelInterface * * @return iterable<mixed, BundleInterface> */ - public function registerBundles(): iterable; + public function registerBundles(); /** * Loads the container configuration. @@ -53,14 +57,16 @@ public function shutdown(); * * @return array<string, BundleInterface> */ - public function getBundles(): array; + public function getBundles(); /** * Returns a bundle. * + * @return BundleInterface + * * @throws \InvalidArgumentException when the bundle is not enabled */ - public function getBundle(string $name): BundleInterface; + public function getBundle(string $name); /** * Returns the file path for a given bundle resource. @@ -74,35 +80,47 @@ public function getBundle(string $name): BundleInterface; * where BundleName is the name of the bundle * and the remaining part is the relative path in the bundle. * + * @return string + * * @throws \InvalidArgumentException if the file cannot be found or the name is not valid * @throws \RuntimeException if the name contains invalid/unsafe characters */ - public function locateResource(string $name): string; + public function locateResource(string $name); /** * Gets the environment. + * + * @return string */ - public function getEnvironment(): string; + public function getEnvironment(); /** * Checks if debug mode is enabled. + * + * @return bool */ - public function isDebug(): bool; + public function isDebug(); /** * Gets the project dir (path of the project's composer file). + * + * @return string */ - public function getProjectDir(): string; + public function getProjectDir(); /** * Gets the current container. + * + * @return ContainerInterface */ - public function getContainer(): ContainerInterface; + public function getContainer(); /** * Gets the request start time (not available if debug is disabled). + * + * @return float */ - public function getStartTime(): float; + public function getStartTime(); /** * Gets the cache directory. @@ -110,24 +128,22 @@ public function getStartTime(): float; * Since Symfony 5.2, the cache directory should be used for caches that are written at runtime. * For caches and artifacts that can be warmed at compile-time and deployed as read-only, * use the new "build directory" returned by the {@see getBuildDir()} method. - */ - public function getCacheDir(): string; - - /** - * Returns the build directory. * - * This directory should be used to store build artifacts, and can be read-only at runtime. - * Caches written at runtime should be stored in the "cache directory" ({@see KernelInterface::getCacheDir()}). + * @return string */ - public function getBuildDir(): string; + public function getCacheDir(); /** * Gets the log directory. + * + * @return string */ - public function getLogDir(): string; + public function getLogDir(); /** * Gets the charset of the application. + * + * @return string */ - public function getCharset(): string; + public function getCharset(); } diff --git a/core/vendor/symfony/http-kernel/Log/Logger.php b/core/vendor/symfony/http-kernel/Log/Logger.php index 0ce18cd6e1..378fbd5397 100644 --- a/core/vendor/symfony/http-kernel/Log/Logger.php +++ b/core/vendor/symfony/http-kernel/Log/Logger.php @@ -33,8 +33,8 @@ class Logger extends AbstractLogger LogLevel::EMERGENCY => 7, ]; - private int $minLevelIndex; - private \Closure $formatter; + private $minLevelIndex; + private $formatter; /** @var resource|null */ private $handle; @@ -62,7 +62,7 @@ public function __construct(string $minLevel = null, $output = null, callable $f } $this->minLevelIndex = self::LEVELS[$minLevel]; - $this->formatter = $formatter instanceof \Closure ? $formatter : \Closure::fromCallable($formatter ?? [$this, 'format']); + $this->formatter = $formatter ?: [$this, 'format']; if ($output && false === $this->handle = \is_resource($output) ? $output : @fopen($output, 'a')) { throw new InvalidArgumentException(sprintf('Unable to open "%s".', $output)); } @@ -70,8 +70,10 @@ public function __construct(string $minLevel = null, $output = null, callable $f /** * {@inheritdoc} + * + * @return void */ - public function log($level, $message, array $context = []): void + public function log($level, $message, array $context = []) { if (!isset(self::LEVELS[$level])) { throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); @@ -94,7 +96,7 @@ private function format(string $level, string $message, array $context, bool $pr if (str_contains($message, '{')) { $replacements = []; foreach ($context as $key => $val) { - if (null === $val || is_scalar($val) || $val instanceof \Stringable) { + if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { $replacements["{{$key}}"] = $val; } elseif ($val instanceof \DateTimeInterface) { $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); diff --git a/core/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php b/core/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php index 062e8d738c..1387a8c2d9 100644 --- a/core/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php +++ b/core/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php @@ -20,8 +20,10 @@ class FileProfilerStorage implements ProfilerStorageInterface { /** * Folder where profiler data are stored. + * + * @var string */ - private string $folder; + private $folder; /** * Constructs the file storage using a "dsn-like" path. @@ -197,8 +199,10 @@ public function write(Profile $profile): bool /** * Gets filename to store data, associated to the token. + * + * @return string */ - protected function getFilename(string $token): string + protected function getFilename(string $token) { // Uses 4 last characters, because first are mostly the same. $folderA = substr($token, -2, 2); @@ -209,8 +213,10 @@ protected function getFilename(string $token): string /** * Gets the index filename. + * + * @return string */ - protected function getIndexFilename(): string + protected function getIndexFilename() { return $this->folder.'/index.csv'; } @@ -221,8 +227,10 @@ protected function getIndexFilename(): string * This function automatically skips the empty lines and do not include the line return in result value. * * @param resource $file The file resource, with the pointer placed at the end of the line to read + * + * @return mixed */ - protected function readLineFromFile($file): mixed + protected function readLineFromFile($file) { $line = ''; $position = ftell($file); diff --git a/core/vendor/symfony/http-kernel/Profiler/Profile.php b/core/vendor/symfony/http-kernel/Profiler/Profile.php index 355a82c3b7..a622403e1b 100644 --- a/core/vendor/symfony/http-kernel/Profiler/Profile.php +++ b/core/vendor/symfony/http-kernel/Profiler/Profile.php @@ -20,24 +20,28 @@ */ class Profile { - private string $token; + private $token; /** * @var DataCollectorInterface[] */ - private array $collectors = []; + private $collectors = []; - private ?string $ip = null; - private ?string $method = null; - private ?string $url = null; - private ?int $time = null; - private ?int $statusCode = null; - private ?self $parent = null; + private $ip; + private $method; + private $url; + private $time; + private $statusCode; + + /** + * @var Profile + */ + private $parent; /** * @var Profile[] */ - private array $children = []; + private $children = []; public function __construct(string $token) { @@ -51,8 +55,10 @@ public function setToken(string $token) /** * Gets the token. + * + * @return string */ - public function getToken(): string + public function getToken() { return $this->token; } @@ -67,24 +73,30 @@ public function setParent(self $parent) /** * Returns the parent profile. + * + * @return self|null */ - public function getParent(): ?self + public function getParent() { return $this->parent; } /** * Returns the parent token. + * + * @return string|null */ - public function getParentToken(): ?string + public function getParentToken() { return $this->parent ? $this->parent->getToken() : null; } /** * Returns the IP. + * + * @return string|null */ - public function getIp(): ?string + public function getIp() { return $this->ip; } @@ -96,8 +108,10 @@ public function setIp(?string $ip) /** * Returns the request method. + * + * @return string|null */ - public function getMethod(): ?string + public function getMethod() { return $this->method; } @@ -109,8 +123,10 @@ public function setMethod(string $method) /** * Returns the URL. + * + * @return string|null */ - public function getUrl(): ?string + public function getUrl() { return $this->url; } @@ -120,7 +136,10 @@ public function setUrl(?string $url) $this->url = $url; } - public function getTime(): int + /** + * @return int + */ + public function getTime() { return $this->time ?? 0; } @@ -135,7 +154,10 @@ public function setStatusCode(int $statusCode) $this->statusCode = $statusCode; } - public function getStatusCode(): ?int + /** + * @return int|null + */ + public function getStatusCode() { return $this->statusCode; } @@ -145,7 +167,7 @@ public function getStatusCode(): ?int * * @return self[] */ - public function getChildren(): array + public function getChildren() { return $this->children; } @@ -186,9 +208,11 @@ public function getChildByToken(string $token): ?self /** * Gets a Collector by name. * + * @return DataCollectorInterface + * * @throws \InvalidArgumentException if the collector does not exist */ - public function getCollector(string $name): DataCollectorInterface + public function getCollector(string $name) { if (!isset($this->collectors[$name])) { throw new \InvalidArgumentException(sprintf('Collector "%s" does not exist.', $name)); @@ -202,7 +226,7 @@ public function getCollector(string $name): DataCollectorInterface * * @return DataCollectorInterface[] */ - public function getCollectors(): array + public function getCollectors() { return $this->collectors; } @@ -228,12 +252,18 @@ public function addCollector(DataCollectorInterface $collector) $this->collectors[$collector->getName()] = $collector; } - public function hasCollector(string $name): bool + /** + * @return bool + */ + public function hasCollector(string $name) { return isset($this->collectors[$name]); } - public function __sleep(): array + /** + * @return array + */ + public function __sleep() { return ['token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode']; } diff --git a/core/vendor/symfony/http-kernel/Profiler/Profiler.php b/core/vendor/symfony/http-kernel/Profiler/Profiler.php index 680b877faf..25e126f731 100644 --- a/core/vendor/symfony/http-kernel/Profiler/Profiler.php +++ b/core/vendor/symfony/http-kernel/Profiler/Profiler.php @@ -31,11 +31,11 @@ class Profiler implements ResetInterface /** * @var DataCollectorInterface[] */ - private array $collectors = []; + private $collectors = []; private $logger; - private bool $initiallyEnabled = true; - private bool $enabled = true; + private $initiallyEnabled = true; + private $enabled = true; public function __construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null, bool $enable = true) { @@ -62,8 +62,10 @@ public function enable() /** * Loads the Profile for the given Response. + * + * @return Profile|null */ - public function loadProfileFromResponse(Response $response): ?Profile + public function loadProfileFromResponse(Response $response) { if (!$token = $response->headers->get('X-Debug-Token')) { return null; @@ -74,16 +76,20 @@ public function loadProfileFromResponse(Response $response): ?Profile /** * Loads the Profile for the given token. + * + * @return Profile|null */ - public function loadProfile(string $token): ?Profile + public function loadProfile(string $token) { return $this->storage->read($token); } /** * Saves a Profile. + * + * @return bool */ - public function saveProfile(Profile $profile): bool + public function saveProfile(Profile $profile) { // late collect foreach ($profile->getCollectors() as $collector) { @@ -114,17 +120,21 @@ public function purge() * @param string|null $start The start date to search from * @param string|null $end The end date to search to * + * @return array + * * @see https://php.net/datetime.formats for the supported date/time formats */ - public function find(?string $ip, ?string $url, ?string $limit, ?string $method, ?string $start, ?string $end, string $statusCode = null): array + public function find(?string $ip, ?string $url, ?string $limit, ?string $method, ?string $start, ?string $end, string $statusCode = null) { return $this->storage->find($ip, $url, $limit, $method, $this->getTimestamp($start), $this->getTimestamp($end), $statusCode); } /** * Collects data for the given Response. + * + * @return Profile|null */ - public function collect(Request $request, Response $response, \Throwable $exception = null): ?Profile + public function collect(Request $request, Response $response, \Throwable $exception = null) { if (false === $this->enabled) { return null; @@ -167,8 +177,10 @@ public function reset() /** * Gets the Collectors associated with this profiler. + * + * @return array */ - public function all(): array + public function all() { return $this->collectors; } @@ -198,8 +210,10 @@ public function add(DataCollectorInterface $collector) * Returns true if a Collector for the given name exists. * * @param string $name A collector name + * + * @return bool */ - public function has(string $name): bool + public function has(string $name) { return isset($this->collectors[$name]); } @@ -209,9 +223,11 @@ public function has(string $name): bool * * @param string $name A collector name * + * @return DataCollectorInterface + * * @throws \InvalidArgumentException if the collector does not exist */ - public function get(string $name): DataCollectorInterface + public function get(string $name) { if (!isset($this->collectors[$name])) { throw new \InvalidArgumentException(sprintf('Collector "%s" does not exist.', $name)); diff --git a/core/vendor/symfony/http-kernel/UriSigner.php b/core/vendor/symfony/http-kernel/UriSigner.php index 6db882cb38..38931ce170 100644 --- a/core/vendor/symfony/http-kernel/UriSigner.php +++ b/core/vendor/symfony/http-kernel/UriSigner.php @@ -20,8 +20,8 @@ */ class UriSigner { - private string $secret; - private string $parameter; + private $secret; + private $parameter; /** * @param string $secret A secret @@ -38,8 +38,10 @@ public function __construct(string $secret, string $parameter = '_hash') * * The given URI is signed by adding the query string parameter * which value depends on the URI and the secret. + * + * @return string */ - public function sign(string $uri): string + public function sign(string $uri) { $url = parse_url($uri); if (isset($url['query'])) { @@ -56,8 +58,10 @@ public function sign(string $uri): string /** * Checks that a URI contains the correct hash. + * + * @return bool */ - public function check(string $uri): bool + public function check(string $uri) { $url = parse_url($uri); if (isset($url['query'])) { diff --git a/core/vendor/symfony/http-kernel/composer.json b/core/vendor/symfony/http-kernel/composer.json index e28f858562..09682db49d 100644 --- a/core/vendor/symfony/http-kernel/composer.json +++ b/core/vendor/symfony/http-kernel/composer.json @@ -16,48 +16,51 @@ } ], "require": { - "php": ">=8.0.2", - "symfony/error-handler": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^5.0|^6.0", + "symfony/http-foundation": "^5.3.7|^6.0", "symfony/polyfill-ctype": "^1.8", - "psr/log": "^1|^2|^3" + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "psr/log": "^1|^2" }, "require-dev": { "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/dom-crawler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", + "symfony/config": "^5.0|^6.0", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/css-selector": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.3|^6.0", + "symfony/dom-crawler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^5.4|^6.0", - "symfony/routing": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0", - "symfony/translation": "^5.4|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/routing": "^4.4|^5.0|^6.0", + "symfony/stopwatch": "^4.4|^5.0|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", "symfony/translation-contracts": "^1.1|^2|^3", "psr/cache": "^1.0|^2.0|^3.0", "twig/twig": "^2.13|^3.0.4" }, "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "psr/log-implementation": "1.0|2.0" }, "conflict": { "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.4", - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/form": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/doctrine-bridge": "<5.4", - "symfony/http-client": "<5.4", - "symfony/mailer": "<5.4", - "symfony/messenger": "<5.4", - "symfony/translation": "<5.4", - "symfony/twig-bridge": "<5.4", - "symfony/validator": "<5.4", + "symfony/cache": "<5.0", + "symfony/config": "<5.0", + "symfony/console": "<4.4", + "symfony/form": "<5.0", + "symfony/dependency-injection": "<5.3", + "symfony/doctrine-bridge": "<5.0", + "symfony/http-client": "<5.0", + "symfony/mailer": "<5.0", + "symfony/messenger": "<5.0", + "symfony/translation": "<5.0", + "symfony/twig-bridge": "<5.0", + "symfony/validator": "<5.0", "twig/twig": "<2.13" }, "suggest": { diff --git a/core/vendor/symfony/mime/Address.php b/core/vendor/symfony/mime/Address.php index c3b7e16edf..ae83efd73e 100644 --- a/core/vendor/symfony/mime/Address.php +++ b/core/vendor/symfony/mime/Address.php @@ -33,11 +33,11 @@ final class Address */ private const FROM_STRING_PATTERN = '~(?<displayName>[^<]*)<(?<addrSpec>.*)>[^>]*~'; - private static EmailValidator $validator; - private static IdnAddressEncoder $encoder; + private static $validator; + private static $encoder; - private string $address; - private string $name; + private $address; + private $name; public function __construct(string $address, string $name = '') { @@ -45,7 +45,9 @@ public function __construct(string $address, string $name = '') throw new LogicException(sprintf('The "%s" class cannot be used as it needs "%s"; try running "composer require egulias/email-validator".', __CLASS__, EmailValidator::class)); } - self::$validator ??= new EmailValidator(); + if (null === self::$validator) { + self::$validator = new EmailValidator(); + } $this->address = trim($address); $this->name = trim(str_replace(["\n", "\r"], '', $name)); @@ -67,7 +69,9 @@ public function getName(): string public function getEncodedAddress(): string { - self::$encoder ??= new IdnAddressEncoder(); + if (null === self::$encoder) { + self::$encoder = new IdnAddressEncoder(); + } return self::$encoder->encodeString($this->address); } @@ -86,12 +90,19 @@ public function getEncodedName(): string return sprintf('"%s"', preg_replace('/"/u', '\"', $this->getName())); } - public static function create(self|string $address): self + /** + * @param Address|string $address + */ + public static function create($address): self { if ($address instanceof self) { return $address; } + if (!\is_string($address)) { + throw new InvalidArgumentException(sprintf('An address can be an instance of Address or a string ("%s" given).', get_debug_type($address))); + } + if (false === strpos($address, '<')) { return new self($address); } @@ -117,4 +128,22 @@ public static function createArray(array $addresses): array return $addrs; } + + /** + * @deprecated since Symfony 5.2, use "create()" instead. + */ + public static function fromString(string $string): self + { + trigger_deprecation('symfony/mime', '5.2', '"%s()" is deprecated, use "%s::create()" instead.', __METHOD__, __CLASS__); + + if (!str_contains($string, '<')) { + return new self($string, ''); + } + + if (!preg_match(self::FROM_STRING_PATTERN, $string, $matches)) { + throw new InvalidArgumentException(sprintf('Could not parse "%s" to a "%s" instance.', $string, self::class)); + } + + return new self($matches['addrSpec'], trim($matches['displayName'], ' \'"')); + } } diff --git a/core/vendor/symfony/mime/CHANGELOG.md b/core/vendor/symfony/mime/CHANGELOG.md index b076e4e867..f272346c97 100644 --- a/core/vendor/symfony/mime/CHANGELOG.md +++ b/core/vendor/symfony/mime/CHANGELOG.md @@ -1,12 +1,6 @@ CHANGELOG ========= -6.0 ---- - - * Remove `Address::fromString()`, use `Address::create()` instead - * Remove `Serializable` interface from `RawMessage` - 5.2.0 ----- diff --git a/core/vendor/symfony/mime/CharacterStream.php b/core/vendor/symfony/mime/CharacterStream.php index e1b64b50fa..9d0a9c6618 100644 --- a/core/vendor/symfony/mime/CharacterStream.php +++ b/core/vendor/symfony/mime/CharacterStream.php @@ -55,12 +55,12 @@ final class CharacterStream "\xf8" => 5, "\xf9" => 5, "\xfa" => 5, "\xfb" => 5, "\xfc" => 6, "\xfd" => 6, "\xfe" => 0, "\xff" => 0, ]; - private string $data = ''; - private int $dataSize = 0; - private array $map = []; - private int $charCount = 0; - private int $currentPos = 0; - private int $fixedWidth = 0; + private $data = ''; + private $dataSize = 0; + private $map = []; + private $charCount = 0; + private $currentPos = 0; + private $fixedWidth = 0; /** * @param resource|string $input diff --git a/core/vendor/symfony/mime/Crypto/DkimOptions.php b/core/vendor/symfony/mime/Crypto/DkimOptions.php index cf57c50e99..4c51d66158 100644 --- a/core/vendor/symfony/mime/Crypto/DkimOptions.php +++ b/core/vendor/symfony/mime/Crypto/DkimOptions.php @@ -18,7 +18,7 @@ */ final class DkimOptions { - private array $options = []; + private $options = []; public function toArray(): array { @@ -28,7 +28,7 @@ public function toArray(): array /** * @return $this */ - public function algorithm(int $algo): static + public function algorithm(int $algo): self { $this->options['algorithm'] = $algo; @@ -38,7 +38,7 @@ public function algorithm(int $algo): static /** * @return $this */ - public function signatureExpirationDelay(int $show): static + public function signatureExpirationDelay(int $show): self { $this->options['signature_expiration_delay'] = $show; @@ -48,7 +48,7 @@ public function signatureExpirationDelay(int $show): static /** * @return $this */ - public function bodyMaxLength(int $max): static + public function bodyMaxLength(int $max): self { $this->options['body_max_length'] = $max; @@ -58,7 +58,7 @@ public function bodyMaxLength(int $max): static /** * @return $this */ - public function bodyShowLength(bool $show): static + public function bodyShowLength(bool $show): self { $this->options['body_show_length'] = $show; @@ -68,7 +68,7 @@ public function bodyShowLength(bool $show): static /** * @return $this */ - public function headerCanon(string $canon): static + public function headerCanon(string $canon): self { $this->options['header_canon'] = $canon; @@ -78,7 +78,7 @@ public function headerCanon(string $canon): static /** * @return $this */ - public function bodyCanon(string $canon): static + public function bodyCanon(string $canon): self { $this->options['body_canon'] = $canon; @@ -88,7 +88,7 @@ public function bodyCanon(string $canon): static /** * @return $this */ - public function headersToIgnore(array $headers): static + public function headersToIgnore(array $headers): self { $this->options['headers_to_ignore'] = $headers; diff --git a/core/vendor/symfony/mime/Crypto/DkimSigner.php b/core/vendor/symfony/mime/Crypto/DkimSigner.php index ce07747dfd..f0f7091ed4 100644 --- a/core/vendor/symfony/mime/Crypto/DkimSigner.php +++ b/core/vendor/symfony/mime/Crypto/DkimSigner.php @@ -31,9 +31,9 @@ final class DkimSigner public const ALGO_ED25519 = 'ed25519-sha256'; // RFC 8463 private $key; - private string $domainName; - private string $selector; - private array $defaultOptions; + private $domainName; + private $selector; + private $defaultOptions; /** * @param string $pk The private key as a string or the path to the file containing the private key, should be prefixed with file:// (in PEM format) @@ -44,7 +44,10 @@ public function __construct(string $pk, string $domainName, string $selector, ar if (!\extension_loaded('openssl')) { throw new \LogicException('PHP extension "openssl" is required to use DKIM.'); } - $this->key = openssl_pkey_get_private($pk, $passphrase) ?: throw new InvalidArgumentException('Unable to load DKIM private key: '.openssl_error_string()); + if (!$this->key = openssl_pkey_get_private($pk, $passphrase)) { + throw new InvalidArgumentException('Unable to load DKIM private key: '.openssl_error_string()); + } + $this->domainName = $domainName; $this->selector = $selector; $this->defaultOptions = $defaultOptions + [ diff --git a/core/vendor/symfony/mime/Crypto/SMimeEncrypter.php b/core/vendor/symfony/mime/Crypto/SMimeEncrypter.php index 0ccf2cd5ef..9081860d80 100644 --- a/core/vendor/symfony/mime/Crypto/SMimeEncrypter.php +++ b/core/vendor/symfony/mime/Crypto/SMimeEncrypter.php @@ -19,14 +19,14 @@ */ final class SMimeEncrypter extends SMime { - private string|array $certs; - private int $cipher; + private $certs; + private $cipher; /** * @param string|string[] $certificate The path (or array of paths) of the file(s) containing the X.509 certificate(s) * @param int|null $cipher A set of algorithms used to encrypt the message. Must be one of these PHP constants: https://www.php.net/manual/en/openssl.ciphers.php */ - public function __construct(string|array $certificate, int $cipher = null) + public function __construct($certificate, int $cipher = null) { if (!\extension_loaded('openssl')) { throw new \LogicException('PHP extension "openssl" is required to use SMime.'); diff --git a/core/vendor/symfony/mime/Crypto/SMimeSigner.php b/core/vendor/symfony/mime/Crypto/SMimeSigner.php index 79a61a2772..5b94a454e8 100644 --- a/core/vendor/symfony/mime/Crypto/SMimeSigner.php +++ b/core/vendor/symfony/mime/Crypto/SMimeSigner.php @@ -19,10 +19,10 @@ */ final class SMimeSigner extends SMime { - private string $signCertificate; - private string|array $signPrivateKey; - private int $signOptions; - private ?string $extraCerts; + private $signCertificate; + private $signPrivateKey; + private $signOptions; + private $extraCerts; /** * @param string $certificate The path of the file containing the signing certificate (in PEM format) diff --git a/core/vendor/symfony/mime/DependencyInjection/AddMimeTypeGuesserPass.php b/core/vendor/symfony/mime/DependencyInjection/AddMimeTypeGuesserPass.php index 5b2e66b5c2..00eef94ee8 100644 --- a/core/vendor/symfony/mime/DependencyInjection/AddMimeTypeGuesserPass.php +++ b/core/vendor/symfony/mime/DependencyInjection/AddMimeTypeGuesserPass.php @@ -22,14 +22,27 @@ */ class AddMimeTypeGuesserPass implements CompilerPassInterface { + private $mimeTypesService; + private $mimeTypeGuesserTag; + + public function __construct(string $mimeTypesService = 'mime_types', string $mimeTypeGuesserTag = 'mime.mime_type_guesser') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/mime', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->mimeTypesService = $mimeTypesService; + $this->mimeTypeGuesserTag = $mimeTypeGuesserTag; + } + /** * {@inheritdoc} */ public function process(ContainerBuilder $container) { - if ($container->has('mime_types')) { - $definition = $container->findDefinition('mime_types'); - foreach ($container->findTaggedServiceIds('mime.mime_type_guesser', true) as $id => $attributes) { + if ($container->has($this->mimeTypesService)) { + $definition = $container->findDefinition($this->mimeTypesService); + foreach ($container->findTaggedServiceIds($this->mimeTypeGuesserTag, true) as $id => $attributes) { $definition->addMethodCall('registerGuesser', [new Reference($id)]); } } diff --git a/core/vendor/symfony/mime/Email.php b/core/vendor/symfony/mime/Email.php index 788e4f3512..44efe7b310 100644 --- a/core/vendor/symfony/mime/Email.php +++ b/core/vendor/symfony/mime/Email.php @@ -38,25 +38,16 @@ class Email extends Message self::PRIORITY_LOWEST => 'Lowest', ]; - /** - * @var resource|string|null - */ private $text; - - private ?string $textCharset = null; - - /** - * @var resource|string|null - */ + private $textCharset; private $html; - - private ?string $htmlCharset = null; - private array $attachments = []; + private $htmlCharset; + private $attachments = []; /** * @return $this */ - public function subject(string $subject): static + public function subject(string $subject) { return $this->setHeaderBody('Text', 'Subject', $subject); } @@ -69,7 +60,7 @@ public function getSubject(): ?string /** * @return $this */ - public function date(\DateTimeInterface $dateTime): static + public function date(\DateTimeInterface $dateTime) { return $this->setHeaderBody('Date', 'Date', $dateTime); } @@ -80,9 +71,11 @@ public function getDate(): ?\DateTimeImmutable } /** + * @param Address|string $address + * * @return $this */ - public function returnPath(Address|string $address): static + public function returnPath($address) { return $this->setHeaderBody('Path', 'Return-Path', Address::create($address)); } @@ -93,9 +86,11 @@ public function getReturnPath(): ?Address } /** + * @param Address|string $address + * * @return $this */ - public function sender(Address|string $address): static + public function sender($address) { return $this->setHeaderBody('Mailbox', 'Sender', Address::create($address)); } @@ -106,17 +101,21 @@ public function getSender(): ?Address } /** + * @param Address|string ...$addresses + * * @return $this */ - public function addFrom(Address|string ...$addresses): static + public function addFrom(...$addresses) { return $this->addListAddressHeaderBody('From', $addresses); } /** + * @param Address|string ...$addresses + * * @return $this */ - public function from(Address|string ...$addresses): static + public function from(...$addresses) { return $this->setListAddressHeaderBody('From', $addresses); } @@ -130,17 +129,21 @@ public function getFrom(): array } /** + * @param Address|string ...$addresses + * * @return $this */ - public function addReplyTo(Address|string ...$addresses): static + public function addReplyTo(...$addresses) { return $this->addListAddressHeaderBody('Reply-To', $addresses); } /** + * @param Address|string ...$addresses + * * @return $this */ - public function replyTo(Address|string ...$addresses): static + public function replyTo(...$addresses) { return $this->setListAddressHeaderBody('Reply-To', $addresses); } @@ -154,17 +157,21 @@ public function getReplyTo(): array } /** + * @param Address|string ...$addresses + * * @return $this */ - public function addTo(Address|string ...$addresses): static + public function addTo(...$addresses) { return $this->addListAddressHeaderBody('To', $addresses); } /** + * @param Address|string ...$addresses + * * @return $this */ - public function to(Address|string ...$addresses): static + public function to(...$addresses) { return $this->setListAddressHeaderBody('To', $addresses); } @@ -178,17 +185,21 @@ public function getTo(): array } /** + * @param Address|string ...$addresses + * * @return $this */ - public function addCc(Address|string ...$addresses): static + public function addCc(...$addresses) { return $this->addListAddressHeaderBody('Cc', $addresses); } /** + * @param Address|string ...$addresses + * * @return $this */ - public function cc(Address|string ...$addresses): static + public function cc(...$addresses) { return $this->setListAddressHeaderBody('Cc', $addresses); } @@ -202,17 +213,21 @@ public function getCc(): array } /** + * @param Address|string ...$addresses + * * @return $this */ - public function addBcc(Address|string ...$addresses): static + public function addBcc(...$addresses) { return $this->addListAddressHeaderBody('Bcc', $addresses); } /** + * @param Address|string ...$addresses + * * @return $this */ - public function bcc(Address|string ...$addresses): static + public function bcc(...$addresses) { return $this->setListAddressHeaderBody('Bcc', $addresses); } @@ -232,7 +247,7 @@ public function getBcc(): array * * @return $this */ - public function priority(int $priority): static + public function priority(int $priority) { if ($priority > 5) { $priority = 5; @@ -261,7 +276,7 @@ public function getPriority(): int * * @return $this */ - public function text($body, string $charset = 'utf-8'): static + public function text($body, string $charset = 'utf-8') { $this->text = $body; $this->textCharset = $charset; @@ -287,7 +302,7 @@ public function getTextCharset(): ?string * * @return $this */ - public function html($body, string $charset = 'utf-8'): static + public function html($body, string $charset = 'utf-8') { $this->html = $body; $this->htmlCharset = $charset; @@ -313,7 +328,7 @@ public function getHtmlCharset(): ?string * * @return $this */ - public function attach($body, string $name = null, string $contentType = null): static + public function attach($body, string $name = null, string $contentType = null) { $this->attachments[] = ['body' => $body, 'name' => $name, 'content-type' => $contentType, 'inline' => false]; @@ -323,7 +338,7 @@ public function attach($body, string $name = null, string $contentType = null): /** * @return $this */ - public function attachFromPath(string $path, string $name = null, string $contentType = null): static + public function attachFromPath(string $path, string $name = null, string $contentType = null) { $this->attachments[] = ['path' => $path, 'name' => $name, 'content-type' => $contentType, 'inline' => false]; @@ -335,7 +350,7 @@ public function attachFromPath(string $path, string $name = null, string $conten * * @return $this */ - public function embed($body, string $name = null, string $contentType = null): static + public function embed($body, string $name = null, string $contentType = null) { $this->attachments[] = ['body' => $body, 'name' => $name, 'content-type' => $contentType, 'inline' => true]; @@ -345,7 +360,7 @@ public function embed($body, string $name = null, string $contentType = null): s /** * @return $this */ - public function embedFromPath(string $path, string $name = null, string $contentType = null): static + public function embedFromPath(string $path, string $name = null, string $contentType = null) { $this->attachments[] = ['path' => $path, 'name' => $name, 'content-type' => $contentType, 'inline' => true]; @@ -355,7 +370,7 @@ public function embedFromPath(string $path, string $name = null, string $content /** * @return $this */ - public function attachPart(DataPart $part): static + public function attachPart(DataPart $part) { $this->attachments[] = ['part' => $part]; @@ -503,7 +518,7 @@ private function createDataPart(array $attachment): DataPart /** * @return $this */ - private function setHeaderBody(string $type, string $name, $body): static + private function setHeaderBody(string $type, string $name, $body): object { $this->getHeaders()->setHeaderBody($type, $name, $body); @@ -523,7 +538,7 @@ private function addListAddressHeaderBody(string $name, array $addresses) /** * @return $this */ - private function setListAddressHeaderBody(string $name, array $addresses): static + private function setListAddressHeaderBody(string $name, array $addresses) { $addresses = Address::createArray($addresses); $headers = $this->getHeaders(); diff --git a/core/vendor/symfony/mime/Encoder/QpEncoder.php b/core/vendor/symfony/mime/Encoder/QpEncoder.php index 0b4bcf538d..b861af2322 100644 --- a/core/vendor/symfony/mime/Encoder/QpEncoder.php +++ b/core/vendor/symfony/mime/Encoder/QpEncoder.php @@ -76,7 +76,7 @@ class QpEncoder implements EncoderInterface 255 => '=FF', ]; - private static array $safeMapShare = []; + private static $safeMapShare = []; /** * A map of non-encoded ascii characters. @@ -85,7 +85,7 @@ class QpEncoder implements EncoderInterface * * @internal */ - protected array $safeMap = []; + protected $safeMap = []; public function __construct() { diff --git a/core/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php b/core/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php index 5d6bee847c..3acf4d455e 100644 --- a/core/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php +++ b/core/vendor/symfony/mime/FileBinaryMimeTypeGuesser.php @@ -21,7 +21,7 @@ */ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface { - private string $cmd; + private $cmd; /** * The $cmd pattern must contain a "%s" string that will be replaced diff --git a/core/vendor/symfony/mime/FileinfoMimeTypeGuesser.php b/core/vendor/symfony/mime/FileinfoMimeTypeGuesser.php index c40a8196dd..c6c7559af1 100644 --- a/core/vendor/symfony/mime/FileinfoMimeTypeGuesser.php +++ b/core/vendor/symfony/mime/FileinfoMimeTypeGuesser.php @@ -21,7 +21,7 @@ */ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface { - private ?string $magicFile; + private $magicFile; /** * @param string $magicFile A magic file to use with the finfo instance diff --git a/core/vendor/symfony/mime/Header/AbstractHeader.php b/core/vendor/symfony/mime/Header/AbstractHeader.php index ededf24f57..b82eb53ec6 100644 --- a/core/vendor/symfony/mime/Header/AbstractHeader.php +++ b/core/vendor/symfony/mime/Header/AbstractHeader.php @@ -22,12 +22,12 @@ abstract class AbstractHeader implements HeaderInterface { public const PHRASE_PATTERN = '(?:(?:(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?[a-zA-Z0-9!#\$%&\'\*\+\-\/=\?\^_`\{\}\|~]+(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?)|(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?"((?:(?:[ \t]*(?:\r\n))?[ \t])?(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21\x23-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])))*(?:(?:[ \t]*(?:\r\n))?[ \t])?"(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?))+?)'; - private static QpMimeHeaderEncoder $encoder; + private static $encoder; - private string $name; - private int $lineLength = 76; - private ?string $lang = null; - private string $charset = 'utf-8'; + private $name; + private $lineLength = 76; + private $lang; + private $charset = 'utf-8'; public function __construct(string $name) { @@ -183,7 +183,9 @@ protected function getEncodableWordTokens(string $string): array */ protected function getTokenAsEncodedWord(string $token, int $firstLineOffset = 0): string { - self::$encoder ??= new QpMimeHeaderEncoder(); + if (null === self::$encoder) { + self::$encoder = new QpMimeHeaderEncoder(); + } // Adjust $firstLineOffset to account for space needed for syntax $charsetDecl = $this->charset; diff --git a/core/vendor/symfony/mime/Header/DateHeader.php b/core/vendor/symfony/mime/Header/DateHeader.php index b07dfedeb2..a7385d4ce2 100644 --- a/core/vendor/symfony/mime/Header/DateHeader.php +++ b/core/vendor/symfony/mime/Header/DateHeader.php @@ -18,7 +18,7 @@ */ final class DateHeader extends AbstractHeader { - private \DateTimeImmutable $dateTime; + private $dateTime; public function __construct(string $name, \DateTimeInterface $date) { @@ -30,7 +30,7 @@ public function __construct(string $name, \DateTimeInterface $date) /** * @param \DateTimeInterface $body */ - public function setBody(mixed $body) + public function setBody($body) { $this->setDateTime($body); } diff --git a/core/vendor/symfony/mime/Header/HeaderInterface.php b/core/vendor/symfony/mime/Header/HeaderInterface.php index 092fc238a3..4546947c78 100644 --- a/core/vendor/symfony/mime/Header/HeaderInterface.php +++ b/core/vendor/symfony/mime/Header/HeaderInterface.php @@ -22,15 +22,19 @@ interface HeaderInterface * Sets the body. * * The type depends on the Header concrete class. + * + * @param mixed $body */ - public function setBody(mixed $body); + public function setBody($body); /** * Gets the body. * * The return type depends on the Header concrete class. + * + * @return mixed */ - public function getBody(): mixed; + public function getBody(); public function setCharset(string $charset); diff --git a/core/vendor/symfony/mime/Header/Headers.php b/core/vendor/symfony/mime/Header/Headers.php index 115928155e..8db912520a 100644 --- a/core/vendor/symfony/mime/Header/Headers.php +++ b/core/vendor/symfony/mime/Header/Headers.php @@ -42,8 +42,8 @@ final class Headers /** * @var HeaderInterface[][] */ - private array $headers = []; - private int $lineLength = 76; + private $headers = []; + private $lineLength = 76; public function __construct(HeaderInterface ...$headers) { @@ -79,31 +79,37 @@ public function getMaxLineLength(): int * * @return $this */ - public function addMailboxListHeader(string $name, array $addresses): static + public function addMailboxListHeader(string $name, array $addresses): self { return $this->add(new MailboxListHeader($name, Address::createArray($addresses))); } /** + * @param Address|string $address + * * @return $this */ - public function addMailboxHeader(string $name, Address|string $address): static + public function addMailboxHeader(string $name, $address): self { return $this->add(new MailboxHeader($name, Address::create($address))); } /** + * @param string|array $ids + * * @return $this */ - public function addIdHeader(string $name, string|array $ids): static + public function addIdHeader(string $name, $ids): self { return $this->add(new IdentificationHeader($name, $ids)); } /** + * @param Address|string $path + * * @return $this */ - public function addPathHeader(string $name, Address|string $path): static + public function addPathHeader(string $name, $path): self { return $this->add(new PathHeader($name, $path instanceof Address ? $path : new Address($path))); } @@ -111,7 +117,7 @@ public function addPathHeader(string $name, Address|string $path): static /** * @return $this */ - public function addDateHeader(string $name, \DateTimeInterface $dateTime): static + public function addDateHeader(string $name, \DateTimeInterface $dateTime): self { return $this->add(new DateHeader($name, $dateTime)); } @@ -119,7 +125,7 @@ public function addDateHeader(string $name, \DateTimeInterface $dateTime): stati /** * @return $this */ - public function addTextHeader(string $name, string $value): static + public function addTextHeader(string $name, string $value): self { return $this->add(new UnstructuredHeader($name, $value)); } @@ -127,7 +133,7 @@ public function addTextHeader(string $name, string $value): static /** * @return $this */ - public function addParameterizedHeader(string $name, string $value, array $params = []): static + public function addParameterizedHeader(string $name, string $value, array $params = []): self { return $this->add(new ParameterizedHeader($name, $value, $params)); } @@ -135,7 +141,7 @@ public function addParameterizedHeader(string $name, string $value, array $param /** * @return $this */ - public function addHeader(string $name, mixed $argument, array $more = []): static + public function addHeader(string $name, $argument, array $more = []): self { $parts = explode('\\', self::HEADER_CLASS_MAP[strtolower($name)] ?? UnstructuredHeader::class); $method = 'add'.ucfirst(array_pop($parts)); @@ -156,7 +162,7 @@ public function has(string $name): bool /** * @return $this */ - public function add(HeaderInterface $header): static + public function add(HeaderInterface $header): self { self::checkHeaderClass($header); @@ -248,6 +254,9 @@ public function toArray(): array return $arr; } + /** + * @internal + */ public function getHeaderBody(string $name) { return $this->has($name) ? $this->get($name)->getBody() : null; @@ -256,7 +265,7 @@ public function getHeaderBody(string $name) /** * @internal */ - public function setHeaderBody(string $type, string $name, mixed $body): void + public function setHeaderBody(string $type, string $name, $body): void { if ($this->has($name)) { $this->get($name)->setBody($body); diff --git a/core/vendor/symfony/mime/Header/IdentificationHeader.php b/core/vendor/symfony/mime/Header/IdentificationHeader.php index 40fd7c36d6..8a94574e5c 100644 --- a/core/vendor/symfony/mime/Header/IdentificationHeader.php +++ b/core/vendor/symfony/mime/Header/IdentificationHeader.php @@ -21,10 +21,13 @@ */ final class IdentificationHeader extends AbstractHeader { - private array $ids = []; - private array $idsAsAddresses = []; + private $ids = []; + private $idsAsAddresses = []; - public function __construct(string $name, string|array $ids) + /** + * @param string|array $ids + */ + public function __construct(string $name, $ids) { parent::__construct($name); @@ -32,11 +35,11 @@ public function __construct(string $name, string|array $ids) } /** - * @param string|string[] $body a string ID or an array of IDs + * @param string|array $body a string ID or an array of IDs * * @throws RfcComplianceException */ - public function setBody(mixed $body) + public function setBody($body) { $this->setId($body); } @@ -49,11 +52,11 @@ public function getBody(): array /** * Set the ID used in the value of this header. * - * @param string|string[] $id + * @param string|array $id * * @throws RfcComplianceException */ - public function setId(string|array $id) + public function setId($id) { $this->setIds(\is_array($id) ? $id : [$id]); } diff --git a/core/vendor/symfony/mime/Header/MailboxHeader.php b/core/vendor/symfony/mime/Header/MailboxHeader.php index 877e72e358..b58c8252fd 100644 --- a/core/vendor/symfony/mime/Header/MailboxHeader.php +++ b/core/vendor/symfony/mime/Header/MailboxHeader.php @@ -35,7 +35,7 @@ public function __construct(string $name, Address $address) * * @throws RfcComplianceException */ - public function setBody(mixed $body) + public function setBody($body) { $this->setAddress($body); } diff --git a/core/vendor/symfony/mime/Header/MailboxListHeader.php b/core/vendor/symfony/mime/Header/MailboxListHeader.php index e6e6ce195d..1d00fdb12c 100644 --- a/core/vendor/symfony/mime/Header/MailboxListHeader.php +++ b/core/vendor/symfony/mime/Header/MailboxListHeader.php @@ -21,7 +21,7 @@ */ final class MailboxListHeader extends AbstractHeader { - private array $addresses = []; + private $addresses = []; /** * @param Address[] $addresses @@ -38,7 +38,7 @@ public function __construct(string $name, array $addresses) * * @throws RfcComplianceException */ - public function setBody(mixed $body) + public function setBody($body) { $this->setAddresses($body); } diff --git a/core/vendor/symfony/mime/Header/ParameterizedHeader.php b/core/vendor/symfony/mime/Header/ParameterizedHeader.php index ac5ccc58e9..e5d4238b47 100644 --- a/core/vendor/symfony/mime/Header/ParameterizedHeader.php +++ b/core/vendor/symfony/mime/Header/ParameterizedHeader.php @@ -25,8 +25,8 @@ final class ParameterizedHeader extends UnstructuredHeader */ public const TOKEN_REGEX = '(?:[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7E]+)'; - private $encoder = null; - private array $parameters = []; + private $encoder; + private $parameters = []; public function __construct(string $name, string $value, array $parameters = []) { diff --git a/core/vendor/symfony/mime/Header/PathHeader.php b/core/vendor/symfony/mime/Header/PathHeader.php index af267bb102..5101ad0f9f 100644 --- a/core/vendor/symfony/mime/Header/PathHeader.php +++ b/core/vendor/symfony/mime/Header/PathHeader.php @@ -35,7 +35,7 @@ public function __construct(string $name, Address $address) * * @throws RfcComplianceException */ - public function setBody(mixed $body) + public function setBody($body) { $this->setAddress($body); } diff --git a/core/vendor/symfony/mime/Header/UnstructuredHeader.php b/core/vendor/symfony/mime/Header/UnstructuredHeader.php index 668b0be7f0..2085ddfde1 100644 --- a/core/vendor/symfony/mime/Header/UnstructuredHeader.php +++ b/core/vendor/symfony/mime/Header/UnstructuredHeader.php @@ -18,7 +18,7 @@ */ class UnstructuredHeader extends AbstractHeader { - private string $value; + private $value; public function __construct(string $name, string $value) { @@ -30,12 +30,15 @@ public function __construct(string $name, string $value) /** * @param string $body */ - public function setBody(mixed $body) + public function setBody($body) { $this->setValue($body); } - public function getBody(): string + /** + * @return string + */ + public function getBody() { return $this->getValue(); } diff --git a/core/vendor/symfony/mime/Message.php b/core/vendor/symfony/mime/Message.php index a60d0f5273..651ffd4529 100644 --- a/core/vendor/symfony/mime/Message.php +++ b/core/vendor/symfony/mime/Message.php @@ -42,7 +42,7 @@ public function __clone() /** * @return $this */ - public function setBody(AbstractPart $body = null): static + public function setBody(AbstractPart $body = null) { $this->body = $body; @@ -57,7 +57,7 @@ public function getBody(): ?AbstractPart /** * @return $this */ - public function setHeaders(Headers $headers): static + public function setHeaders(Headers $headers) { $this->headers = $headers; diff --git a/core/vendor/symfony/mime/MimeTypes.php b/core/vendor/symfony/mime/MimeTypes.php index 77cdcc23c9..bdea994b52 100644 --- a/core/vendor/symfony/mime/MimeTypes.php +++ b/core/vendor/symfony/mime/MimeTypes.php @@ -36,14 +36,14 @@ */ final class MimeTypes implements MimeTypesInterface { - private array $extensions = []; - private array $mimeTypes = []; + private $extensions = []; + private $mimeTypes = []; /** * @var MimeTypeGuesserInterface[] */ - private array $guessers = []; - private static MimeTypes $default; + private $guessers = []; + private static $default; public function __construct(array $map = []) { diff --git a/core/vendor/symfony/mime/Part/DataPart.php b/core/vendor/symfony/mime/Part/DataPart.php index b6002b0dfe..75bcb64a9a 100644 --- a/core/vendor/symfony/mime/Part/DataPart.php +++ b/core/vendor/symfony/mime/Part/DataPart.php @@ -77,7 +77,7 @@ public static function fromPath(string $path, string $name = null, string $conte /** * @return $this */ - public function asInline(): static + public function asInline() { return $this->setDisposition('inline'); } @@ -134,7 +134,10 @@ public function __destruct() } } - public function __sleep(): array + /** + * @return array + */ + public function __sleep() { // converts the body to a string parent::__sleep(); diff --git a/core/vendor/symfony/mime/Part/Multipart/FormDataPart.php b/core/vendor/symfony/mime/Part/Multipart/FormDataPart.php index 5f473ed25b..ff6df818f4 100644 --- a/core/vendor/symfony/mime/Part/Multipart/FormDataPart.php +++ b/core/vendor/symfony/mime/Part/Multipart/FormDataPart.php @@ -83,7 +83,7 @@ private function prepareFields(array $fields): array return $values; } - private function preparePart(string $name, string|TextPart $value): TextPart + private function preparePart(string $name, $value): TextPart { if (\is_string($value)) { return $this->configurePart($name, new TextPart($value, 'utf-8', 'plain', '8bit')); diff --git a/core/vendor/symfony/mime/Part/SMimePart.php b/core/vendor/symfony/mime/Part/SMimePart.php index 29e9dd19eb..cb619c2938 100644 --- a/core/vendor/symfony/mime/Part/SMimePart.php +++ b/core/vendor/symfony/mime/Part/SMimePart.php @@ -26,12 +26,19 @@ class SMimePart extends AbstractPart private $subtype; private $parameters; - public function __construct(iterable|string $body, string $type, string $subtype, array $parameters) + /** + * @param iterable|string $body + */ + public function __construct($body, string $type, string $subtype, array $parameters) { unset($this->_headers); parent::__construct(); + if (!\is_string($body) && !is_iterable($body)) { + throw new \TypeError(sprintf('The body of "%s" must be a string or a iterable (got "%s").', self::class, get_debug_type($body))); + } + $this->body = $body; $this->type = $type; $this->subtype = $subtype; diff --git a/core/vendor/symfony/mime/Part/TextPart.php b/core/vendor/symfony/mime/Part/TextPart.php index 75e9f9c2da..4afb6560ae 100644 --- a/core/vendor/symfony/mime/Part/TextPart.php +++ b/core/vendor/symfony/mime/Part/TextPart.php @@ -82,7 +82,7 @@ public function getMediaSubtype(): string * * @return $this */ - public function setDisposition(string $disposition): static + public function setDisposition(string $disposition) { $this->disposition = $disposition; @@ -94,7 +94,7 @@ public function setDisposition(string $disposition): static * * @return $this */ - public function setName(string $name): static + public function setName(string $name) { $this->name = $name; @@ -189,7 +189,10 @@ private function chooseEncoding(): string return 'quoted-printable'; } - public function __sleep(): array + /** + * @return array + */ + public function __sleep() { // convert resources to strings for serialization if (null !== $this->seekable) { diff --git a/core/vendor/symfony/mime/RawMessage.php b/core/vendor/symfony/mime/RawMessage.php index ed051aab65..d2a311daeb 100644 --- a/core/vendor/symfony/mime/RawMessage.php +++ b/core/vendor/symfony/mime/RawMessage.php @@ -16,11 +16,14 @@ /** * @author Fabien Potencier <fabien@symfony.com> */ -class RawMessage +class RawMessage implements \Serializable { private $message; - public function __construct(iterable|string $message) + /** + * @param iterable|string $message + */ + public function __construct($message) { $this->message = $message; } @@ -60,6 +63,22 @@ public function ensureValidity() { } + /** + * @internal + */ + final public function serialize(): string + { + return serialize($this->__serialize()); + } + + /** + * @internal + */ + final public function unserialize($serialized) + { + $this->__unserialize(unserialize($serialized)); + } + public function __serialize(): array { return [$this->toString()]; diff --git a/core/vendor/symfony/mime/Test/Constraint/EmailAddressContains.php b/core/vendor/symfony/mime/Test/Constraint/EmailAddressContains.php index e32e3d9513..827e141472 100644 --- a/core/vendor/symfony/mime/Test/Constraint/EmailAddressContains.php +++ b/core/vendor/symfony/mime/Test/Constraint/EmailAddressContains.php @@ -18,8 +18,8 @@ final class EmailAddressContains extends Constraint { - private string $headerName; - private string $expectedValue; + private $headerName; + private $expectedValue; public function __construct(string $headerName, string $expectedValue) { diff --git a/core/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php b/core/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php index a0ee81ddd7..c0adbe3a0c 100644 --- a/core/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php +++ b/core/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php @@ -17,8 +17,8 @@ final class EmailAttachmentCount extends Constraint { - private int $expectedValue; - private ?string $transport; + private $expectedValue; + private $transport; public function __construct(int $expectedValue, string $transport = null) { diff --git a/core/vendor/symfony/mime/Test/Constraint/EmailHasHeader.php b/core/vendor/symfony/mime/Test/Constraint/EmailHasHeader.php index ef4a28585b..a29f835fce 100644 --- a/core/vendor/symfony/mime/Test/Constraint/EmailHasHeader.php +++ b/core/vendor/symfony/mime/Test/Constraint/EmailHasHeader.php @@ -16,7 +16,7 @@ final class EmailHasHeader extends Constraint { - private string $headerName; + private $headerName; public function __construct(string $headerName) { diff --git a/core/vendor/symfony/mime/Test/Constraint/EmailHeaderSame.php b/core/vendor/symfony/mime/Test/Constraint/EmailHeaderSame.php index 45cf2253cc..74bdc63c79 100644 --- a/core/vendor/symfony/mime/Test/Constraint/EmailHeaderSame.php +++ b/core/vendor/symfony/mime/Test/Constraint/EmailHeaderSame.php @@ -17,8 +17,8 @@ final class EmailHeaderSame extends Constraint { - private string $headerName; - private string $expectedValue; + private $headerName; + private $expectedValue; public function __construct(string $headerName, string $expectedValue) { diff --git a/core/vendor/symfony/mime/Test/Constraint/EmailHtmlBodyContains.php b/core/vendor/symfony/mime/Test/Constraint/EmailHtmlBodyContains.php index 67ab85eb69..3c61376e1a 100644 --- a/core/vendor/symfony/mime/Test/Constraint/EmailHtmlBodyContains.php +++ b/core/vendor/symfony/mime/Test/Constraint/EmailHtmlBodyContains.php @@ -17,7 +17,7 @@ final class EmailHtmlBodyContains extends Constraint { - private string $expectedText; + private $expectedText; public function __construct(string $expectedText) { diff --git a/core/vendor/symfony/mime/Test/Constraint/EmailTextBodyContains.php b/core/vendor/symfony/mime/Test/Constraint/EmailTextBodyContains.php index f31655fd0f..063d96306b 100644 --- a/core/vendor/symfony/mime/Test/Constraint/EmailTextBodyContains.php +++ b/core/vendor/symfony/mime/Test/Constraint/EmailTextBodyContains.php @@ -17,7 +17,7 @@ final class EmailTextBodyContains extends Constraint { - private string $expectedText; + private $expectedText; public function __construct(string $expectedText) { diff --git a/core/vendor/symfony/mime/composer.json b/core/vendor/symfony/mime/composer.json index f80f034120..cd04969b9a 100644 --- a/core/vendor/symfony/mime/composer.json +++ b/core/vendor/symfony/mime/composer.json @@ -16,23 +16,25 @@ } ], "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0" + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/property-access": "^4.4|^5.1|^6.0", + "symfony/property-info": "^4.4|^5.1|^6.0", + "symfony/serializer": "^5.2|^6.0" }, "conflict": { "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<5.4" + "symfony/mailer": "<4.4" }, "autoload": { "psr-4": { "Symfony\\Component\\Mime\\": "" }, diff --git a/core/vendor/illuminate/conditionable/LICENSE.md b/core/vendor/symfony/polyfill-php73/LICENSE similarity index 83% rename from core/vendor/illuminate/conditionable/LICENSE.md rename to core/vendor/symfony/polyfill-php73/LICENSE index 79810c848f..3f853aaf35 100644 --- a/core/vendor/illuminate/conditionable/LICENSE.md +++ b/core/vendor/symfony/polyfill-php73/LICENSE @@ -1,16 +1,14 @@ -The MIT License (MIT) - -Copyright (c) Taylor Otwell +Copyright (c) 2018-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/core/vendor/symfony/polyfill-php73/Php73.php b/core/vendor/symfony/polyfill-php73/Php73.php new file mode 100644 index 0000000000..65c35a6a11 --- /dev/null +++ b/core/vendor/symfony/polyfill-php73/Php73.php @@ -0,0 +1,43 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php73; + +/** + * @author Gabriel Caruso <carusogabriel34@gmail.com> + * @author Ion Bazan <ion.bazan@gmail.com> + * + * @internal + */ +final class Php73 +{ + public static $startAt = 1533462603; + + /** + * @param bool $asNum + * + * @return array|float|int + */ + public static function hrtime($asNum = false) + { + $ns = microtime(false); + $s = substr($ns, 11) - self::$startAt; + $ns = 1E9 * (float) $ns; + + if ($asNum) { + $ns += $s * 1E9; + + return \PHP_INT_SIZE === 4 ? $ns : (int) $ns; + } + + return [$s, (int) $ns]; + } +} diff --git a/core/vendor/symfony/polyfill-php73/README.md b/core/vendor/symfony/polyfill-php73/README.md new file mode 100644 index 0000000000..b3ebbce511 --- /dev/null +++ b/core/vendor/symfony/polyfill-php73/README.md @@ -0,0 +1,18 @@ +Symfony Polyfill / Php73 +======================== + +This component provides functions added to PHP 7.3 core: + +- [`array_key_first`](https://php.net/array_key_first) +- [`array_key_last`](https://php.net/array_key_last) +- [`hrtime`](https://php.net/function.hrtime) +- [`is_countable`](https://php.net/is_countable) +- [`JsonException`](https://php.net/JsonException) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/core/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/core/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php new file mode 100644 index 0000000000..f06d6c2694 --- /dev/null +++ b/core/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php @@ -0,0 +1,16 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 70300) { + class JsonException extends Exception + { + } +} diff --git a/core/vendor/symfony/polyfill-php73/bootstrap.php b/core/vendor/symfony/polyfill-php73/bootstrap.php new file mode 100644 index 0000000000..d6b2153823 --- /dev/null +++ b/core/vendor/symfony/polyfill-php73/bootstrap.php @@ -0,0 +1,31 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php73 as p; + +if (\PHP_VERSION_ID >= 70300) { + return; +} + +if (!function_exists('is_countable')) { + function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; } +} +if (!function_exists('hrtime')) { + require_once __DIR__.'/Php73.php'; + p\Php73::$startAt = (int) microtime(true); + function hrtime($as_number = false) { return p\Php73::hrtime($as_number); } +} +if (!function_exists('array_key_first')) { + function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } } +} +if (!function_exists('array_key_last')) { + function array_key_last(array $array) { return key(array_slice($array, -1, 1, true)); } +} diff --git a/core/vendor/symfony/polyfill-php73/composer.json b/core/vendor/symfony/polyfill-php73/composer.json new file mode 100644 index 0000000000..a7fe478752 --- /dev/null +++ b/core/vendor/symfony/polyfill-php73/composer.json @@ -0,0 +1,36 @@ +{ + "name": "symfony/polyfill-php73", + "type": "library", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php73\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/core/vendor/symfony/process/ExecutableFinder.php b/core/vendor/symfony/process/ExecutableFinder.php index 2fe558be95..5914b4cd22 100644 --- a/core/vendor/symfony/process/ExecutableFinder.php +++ b/core/vendor/symfony/process/ExecutableFinder.php @@ -43,8 +43,10 @@ public function addSuffix(string $suffix) * @param string $name The executable name (without the extension) * @param string|null $default The default to return if no executable is found * @param array $extraDirs Additional dirs to check into + * + * @return string|null */ - public function find(string $name, string $default = null, array $extraDirs = []): ?string + public function find(string $name, string $default = null, array $extraDirs = []) { if (ini_get('open_basedir')) { $searchPath = array_merge(explode(\PATH_SEPARATOR, ini_get('open_basedir')), $extraDirs); diff --git a/core/vendor/symfony/process/InputStream.php b/core/vendor/symfony/process/InputStream.php index b8682baeb8..240665f32a 100644 --- a/core/vendor/symfony/process/InputStream.php +++ b/core/vendor/symfony/process/InputStream.php @@ -41,7 +41,7 @@ public function onEmpty(callable $onEmpty = null) * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, * stream resource or \Traversable */ - public function write(mixed $input) + public function write($input) { if (null === $input) { return; @@ -68,7 +68,11 @@ public function isClosed() return !$this->open; } - public function getIterator(): \Traversable + /** + * @return \Traversable<int, string> + */ + #[\ReturnTypeWillChange] + public function getIterator() { $this->open = true; diff --git a/core/vendor/symfony/process/PhpExecutableFinder.php b/core/vendor/symfony/process/PhpExecutableFinder.php index 1881adaf94..ec24f911ba 100644 --- a/core/vendor/symfony/process/PhpExecutableFinder.php +++ b/core/vendor/symfony/process/PhpExecutableFinder.php @@ -28,8 +28,10 @@ public function __construct() /** * Finds The PHP executable. + * + * @return string|false */ - public function find(bool $includeArgs = true): string|false + public function find(bool $includeArgs = true) { if ($php = getenv('PHP_BINARY')) { if (!is_executable($php)) { @@ -82,8 +84,10 @@ public function find(bool $includeArgs = true): string|false /** * Finds the PHP executable arguments. + * + * @return array */ - public function findArguments(): array + public function findArguments() { $arguments = []; if ('phpdbg' === \PHP_SAPI) { diff --git a/core/vendor/symfony/process/PhpProcess.php b/core/vendor/symfony/process/PhpProcess.php index cb749f9bbb..2bc338e5e2 100644 --- a/core/vendor/symfony/process/PhpProcess.php +++ b/core/vendor/symfony/process/PhpProcess.php @@ -53,7 +53,7 @@ public function __construct(string $script, string $cwd = null, array $env = nul /** * {@inheritdoc} */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static + public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) { throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); } diff --git a/core/vendor/symfony/process/Pipes/AbstractPipes.php b/core/vendor/symfony/process/Pipes/AbstractPipes.php index 0e7e5b6716..0105100562 100644 --- a/core/vendor/symfony/process/Pipes/AbstractPipes.php +++ b/core/vendor/symfony/process/Pipes/AbstractPipes.php @@ -20,7 +20,7 @@ */ abstract class AbstractPipes implements PipesInterface { - public array $pipes = []; + public $pipes = []; private $inputBuffer = ''; private $input; @@ -30,7 +30,7 @@ abstract class AbstractPipes implements PipesInterface /** * @param resource|string|int|float|bool|\Iterator|null $input */ - public function __construct(mixed $input) + public function __construct($input) { if (\is_resource($input) || $input instanceof \Iterator) { $this->input = $input; diff --git a/core/vendor/symfony/process/Pipes/UnixPipes.php b/core/vendor/symfony/process/Pipes/UnixPipes.php index 063aa6ad6a..5a0e9d47fe 100644 --- a/core/vendor/symfony/process/Pipes/UnixPipes.php +++ b/core/vendor/symfony/process/Pipes/UnixPipes.php @@ -26,7 +26,7 @@ class UnixPipes extends AbstractPipes private $ptyMode; private $haveReadSupport; - public function __construct(?bool $ttyMode, bool $ptyMode, mixed $input, bool $haveReadSupport) + public function __construct(?bool $ttyMode, bool $ptyMode, $input, bool $haveReadSupport) { $this->ttyMode = $ttyMode; $this->ptyMode = $ptyMode; diff --git a/core/vendor/symfony/process/Pipes/WindowsPipes.php b/core/vendor/symfony/process/Pipes/WindowsPipes.php index e68ed95126..bca84f574d 100644 --- a/core/vendor/symfony/process/Pipes/WindowsPipes.php +++ b/core/vendor/symfony/process/Pipes/WindowsPipes.php @@ -35,7 +35,7 @@ class WindowsPipes extends AbstractPipes ]; private $haveReadSupport; - public function __construct(mixed $input, bool $haveReadSupport) + public function __construct($input, bool $haveReadSupport) { $this->haveReadSupport = $haveReadSupport; diff --git a/core/vendor/symfony/process/Process.php b/core/vendor/symfony/process/Process.php index 5cba8304cc..4db379fa8d 100644 --- a/core/vendor/symfony/process/Process.php +++ b/core/vendor/symfony/process/Process.php @@ -140,7 +140,7 @@ class Process implements \IteratorAggregate * * @throws LogicException When proc_open is not installed */ - public function __construct(array $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60) + public function __construct(array $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) { if (!\function_exists('proc_open')) { throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.'); @@ -185,9 +185,11 @@ public function __construct(array $command, string $cwd = null, array $env = nul * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input * @param int|float|null $timeout The timeout in seconds or null to disable * + * @return static + * * @throws LogicException When proc_open is not installed */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static + public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) { $process = new static([], $cwd, $env, $input, $timeout); $process->commandline = $command; @@ -195,7 +197,10 @@ public static function fromShellCommandline(string $command, string $cwd = null, return $process; } - public function __sleep(): array + /** + * @return array + */ + public function __sleep() { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } @@ -261,7 +266,7 @@ public function run(callable $callback = null, array $env = []): int * * @final */ - public function mustRun(callable $callback = null, array $env = []): static + public function mustRun(callable $callback = null, array $env = []): self { if (0 !== $this->run($callback, $env)) { throw new ProcessFailedException($this); @@ -371,6 +376,8 @@ public function start(callable $callback = null, array $env = []) * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * + * @return static + * * @throws RuntimeException When process can't be launched * @throws RuntimeException When process is already running * @@ -378,7 +385,7 @@ public function start(callable $callback = null, array $env = []) * * @final */ - public function restart(callable $callback = null, array $env = []): static + public function restart(callable $callback = null, array $env = []): self { if ($this->isRunning()) { throw new RuntimeException('Process is already running.'); @@ -405,7 +412,7 @@ public function restart(callable $callback = null, array $env = []): static * @throws ProcessSignaledException When process stopped after receiving signal * @throws LogicException When process is not yet started */ - public function wait(callable $callback = null): int + public function wait(callable $callback = null) { $this->requireProcessIsStarted(__FUNCTION__); @@ -488,7 +495,7 @@ public function waitUntil(callable $callback): bool * * @return int|null The process id if running, null otherwise */ - public function getPid(): ?int + public function getPid() { return $this->isRunning() ? $this->processInformation['pid'] : null; } @@ -504,7 +511,7 @@ public function getPid(): ?int * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed * @throws RuntimeException In case of failure */ - public function signal(int $signal): static + public function signal(int $signal) { $this->doSignal($signal, true); @@ -519,7 +526,7 @@ public function signal(int $signal): static * @throws RuntimeException In case the process is already running * @throws LogicException if an idle timeout is set */ - public function disableOutput(): static + public function disableOutput() { if ($this->isRunning()) { throw new RuntimeException('Disabling output while the process is running is not possible.'); @@ -540,7 +547,7 @@ public function disableOutput(): static * * @throws RuntimeException In case the process is already running */ - public function enableOutput(): static + public function enableOutput() { if ($this->isRunning()) { throw new RuntimeException('Enabling output while the process is running is not possible.'); @@ -553,8 +560,10 @@ public function enableOutput(): static /** * Returns true in case the output is disabled, false otherwise. + * + * @return bool */ - public function isOutputDisabled(): bool + public function isOutputDisabled() { return $this->outputDisabled; } @@ -562,10 +571,12 @@ public function isOutputDisabled(): bool /** * Returns the current output of the process (STDOUT). * + * @return string + * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started */ - public function getOutput(): string + public function getOutput() { $this->readPipesForOutput(__FUNCTION__); @@ -582,10 +593,12 @@ public function getOutput(): string * In comparison with the getOutput method which always return the whole * output, this one returns the new output since the last call. * + * @return string + * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started */ - public function getIncrementalOutput(): string + public function getIncrementalOutput() { $this->readPipesForOutput(__FUNCTION__); @@ -606,8 +619,11 @@ public function getIncrementalOutput(): string * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started + * + * @return \Generator<string, string> */ - public function getIterator(int $flags = 0): \Generator + #[\ReturnTypeWillChange] + public function getIterator(int $flags = 0) { $this->readPipesForOutput(__FUNCTION__, false); @@ -659,7 +675,7 @@ public function getIterator(int $flags = 0): \Generator * * @return $this */ - public function clearOutput(): static + public function clearOutput() { ftruncate($this->stdout, 0); fseek($this->stdout, 0); @@ -671,10 +687,12 @@ public function clearOutput(): static /** * Returns the current error output of the process (STDERR). * + * @return string + * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started */ - public function getErrorOutput(): string + public function getErrorOutput() { $this->readPipesForOutput(__FUNCTION__); @@ -692,10 +710,12 @@ public function getErrorOutput(): string * whole error output, this one returns the new error output since the last * call. * + * @return string + * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started */ - public function getIncrementalErrorOutput(): string + public function getIncrementalErrorOutput() { $this->readPipesForOutput(__FUNCTION__); @@ -714,7 +734,7 @@ public function getIncrementalErrorOutput(): string * * @return $this */ - public function clearErrorOutput(): static + public function clearErrorOutput() { ftruncate($this->stderr, 0); fseek($this->stderr, 0); @@ -728,7 +748,7 @@ public function clearErrorOutput(): static * * @return int|null The exit status code, null if the Process is not terminated */ - public function getExitCode(): ?int + public function getExitCode() { $this->updateStatus(false); @@ -746,7 +766,7 @@ public function getExitCode(): ?int * @see http://tldp.org/LDP/abs/html/exitcodes.html * @see http://en.wikipedia.org/wiki/Unix_signal */ - public function getExitCodeText(): ?string + public function getExitCodeText() { if (null === $exitcode = $this->getExitCode()) { return null; @@ -757,8 +777,10 @@ public function getExitCodeText(): ?string /** * Checks if the process ended successfully. + * + * @return bool */ - public function isSuccessful(): bool + public function isSuccessful() { return 0 === $this->getExitCode(); } @@ -768,9 +790,11 @@ public function isSuccessful(): bool * * It always returns false on Windows. * + * @return bool + * * @throws LogicException In case the process is not terminated */ - public function hasBeenSignaled(): bool + public function hasBeenSignaled() { $this->requireProcessIsTerminated(__FUNCTION__); @@ -782,10 +806,12 @@ public function hasBeenSignaled(): bool * * It is only meaningful if hasBeenSignaled() returns true. * + * @return int + * * @throws RuntimeException In case --enable-sigchild is activated * @throws LogicException In case the process is not terminated */ - public function getTermSignal(): int + public function getTermSignal() { $this->requireProcessIsTerminated(__FUNCTION__); @@ -801,9 +827,11 @@ public function getTermSignal(): int * * It always returns false on Windows. * + * @return bool + * * @throws LogicException In case the process is not terminated */ - public function hasBeenStopped(): bool + public function hasBeenStopped() { $this->requireProcessIsTerminated(__FUNCTION__); @@ -815,9 +843,11 @@ public function hasBeenStopped(): bool * * It is only meaningful if hasBeenStopped() returns true. * + * @return int + * * @throws LogicException In case the process is not terminated */ - public function getStopSignal(): int + public function getStopSignal() { $this->requireProcessIsTerminated(__FUNCTION__); @@ -826,8 +856,10 @@ public function getStopSignal(): int /** * Checks if the process is currently running. + * + * @return bool */ - public function isRunning(): bool + public function isRunning() { if (self::STATUS_STARTED !== $this->status) { return false; @@ -840,16 +872,20 @@ public function isRunning(): bool /** * Checks if the process has been started with no regard to the current state. + * + * @return bool */ - public function isStarted(): bool + public function isStarted() { return self::STATUS_READY != $this->status; } /** * Checks if the process is terminated. + * + * @return bool */ - public function isTerminated(): bool + public function isTerminated() { $this->updateStatus(false); @@ -860,8 +896,10 @@ public function isTerminated(): bool * Gets the process status. * * The status is one of: ready, started, terminated. + * + * @return string */ - public function getStatus(): string + public function getStatus() { $this->updateStatus(false); @@ -876,7 +914,7 @@ public function getStatus(): string * * @return int|null The exit-code of the process or null if it's not running */ - public function stop(float $timeout = 10, int $signal = null): ?int + public function stop(float $timeout = 10, int $signal = null) { $timeoutMicro = microtime(true) + $timeout; if ($this->isRunning()) { @@ -943,24 +981,30 @@ public function getLastOutputTime(): ?float /** * Gets the command line to be executed. + * + * @return string */ - public function getCommandLine(): string + public function getCommandLine() { return \is_array($this->commandline) ? implode(' ', array_map([$this, 'escapeArgument'], $this->commandline)) : $this->commandline; } /** * Gets the process timeout in seconds (max. runtime). + * + * @return float|null */ - public function getTimeout(): ?float + public function getTimeout() { return $this->timeout; } /** * Gets the process idle timeout in seconds (max. time since last output). + * + * @return float|null */ - public function getIdleTimeout(): ?float + public function getIdleTimeout() { return $this->idleTimeout; } @@ -974,7 +1018,7 @@ public function getIdleTimeout(): ?float * * @throws InvalidArgumentException if the timeout is negative */ - public function setTimeout(?float $timeout): static + public function setTimeout(?float $timeout) { $this->timeout = $this->validateTimeout($timeout); @@ -991,7 +1035,7 @@ public function setTimeout(?float $timeout): static * @throws LogicException if the output is disabled * @throws InvalidArgumentException if the timeout is negative */ - public function setIdleTimeout(?float $timeout): static + public function setIdleTimeout(?float $timeout) { if (null !== $timeout && $this->outputDisabled) { throw new LogicException('Idle timeout cannot be set while the output is disabled.'); @@ -1009,7 +1053,7 @@ public function setIdleTimeout(?float $timeout): static * * @throws RuntimeException In case the TTY mode is not supported */ - public function setTty(bool $tty): static + public function setTty(bool $tty) { if ('\\' === \DIRECTORY_SEPARATOR && $tty) { throw new RuntimeException('TTY mode is not supported on Windows platform.'); @@ -1026,8 +1070,10 @@ public function setTty(bool $tty): static /** * Checks if the TTY mode is enabled. + * + * @return bool */ - public function isTty(): bool + public function isTty() { return $this->tty; } @@ -1037,7 +1083,7 @@ public function isTty(): bool * * @return $this */ - public function setPty(bool $bool): static + public function setPty(bool $bool) { $this->pty = $bool; @@ -1046,16 +1092,20 @@ public function setPty(bool $bool): static /** * Returns PTY state. + * + * @return bool */ - public function isPty(): bool + public function isPty() { return $this->pty; } /** * Gets the working directory. + * + * @return string|null */ - public function getWorkingDirectory(): ?string + public function getWorkingDirectory() { if (null === $this->cwd) { // getcwd() will return false if any one of the parent directories does not have @@ -1071,7 +1121,7 @@ public function getWorkingDirectory(): ?string * * @return $this */ - public function setWorkingDirectory(string $cwd): static + public function setWorkingDirectory(string $cwd) { $this->cwd = $cwd; @@ -1080,8 +1130,10 @@ public function setWorkingDirectory(string $cwd): static /** * Gets the environment variables. + * + * @return array */ - public function getEnv(): array + public function getEnv() { return $this->env; } @@ -1093,7 +1145,7 @@ public function getEnv(): array * * @return $this */ - public function setEnv(array $env): static + public function setEnv(array $env) { $this->env = $env; @@ -1121,7 +1173,7 @@ public function getInput() * * @throws LogicException In case the process is running */ - public function setInput(mixed $input): static + public function setInput($input) { if ($this->isRunning()) { throw new LogicException('Input cannot be set while the process is running.'); @@ -1213,8 +1265,10 @@ public static function isTtySupported(): bool /** * Returns whether PTY is supported on the current operating system. + * + * @return bool */ - public static function isPtySupported(): bool + public static function isPtySupported() { static $result; @@ -1253,8 +1307,10 @@ private function getDescriptors(): array * the user callback (if present) with the received output. * * @param callable|null $callback The user defined PHP callback + * + * @return \Closure */ - protected function buildCallback(callable $callback = null): \Closure + protected function buildCallback(callable $callback = null) { if ($this->outputDisabled) { return function ($type, $data) use ($callback): bool { @@ -1302,8 +1358,10 @@ protected function updateStatus(bool $blocking) /** * Returns whether PHP has been compiled with the '--enable-sigchild' option or not. + * + * @return bool */ - protected function isSigchildEnabled(): bool + protected function isSigchildEnabled() { if (null !== self::$sigchild) { return self::$sigchild; diff --git a/core/vendor/symfony/process/ProcessUtils.php b/core/vendor/symfony/process/ProcessUtils.php index 6fedd34de4..6cc7a610bc 100644 --- a/core/vendor/symfony/process/ProcessUtils.php +++ b/core/vendor/symfony/process/ProcessUtils.php @@ -35,9 +35,11 @@ private function __construct() * @param string $caller The name of method call that validates the input * @param mixed $input The input to validate * + * @return mixed + * * @throws InvalidArgumentException In case the input is not valid */ - public static function validateInput(string $caller, mixed $input): mixed + public static function validateInput(string $caller, $input) { if (null !== $input) { if (\is_resource($input)) { diff --git a/core/vendor/symfony/process/composer.json b/core/vendor/symfony/process/composer.json index 9f1aa8cf00..1669eba576 100644 --- a/core/vendor/symfony/process/composer.json +++ b/core/vendor/symfony/process/composer.json @@ -16,7 +16,8 @@ } ], "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" }, diff --git a/core/vendor/symfony/routing/Alias.php b/core/vendor/symfony/routing/Alias.php index 7627f12ca3..f3e1d5a853 100644 --- a/core/vendor/symfony/routing/Alias.php +++ b/core/vendor/symfony/routing/Alias.php @@ -15,15 +15,18 @@ class Alias { - private string $id; - private array $deprecation = []; + private $id; + private $deprecation = []; public function __construct(string $id) { $this->id = $id; } - public function withId(string $id): static + /** + * @return static + */ + public function withId(string $id): self { $new = clone $this; @@ -53,7 +56,7 @@ public function getId(): string * * @throws InvalidArgumentException when the message template is invalid */ - public function setDeprecated(string $package, string $version, string $message): static + public function setDeprecated(string $package, string $version, string $message): self { if ('' !== $message) { if (preg_match('#[\r\n]|\*/#', $message)) { diff --git a/core/vendor/symfony/routing/Annotation/Route.php b/core/vendor/symfony/routing/Annotation/Route.php index 1d97be37c1..81563df202 100644 --- a/core/vendor/symfony/routing/Annotation/Route.php +++ b/core/vendor/symfony/routing/Annotation/Route.php @@ -24,55 +24,129 @@ #[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)] class Route { - private ?string $path = null; - private array $localizedPaths = []; - private array $methods; - private array $schemes; + private $path; + private $localizedPaths = []; + private $name; + private $requirements = []; + private $options = []; + private $defaults = []; + private $host; + private $methods = []; + private $schemes = []; + private $condition; + private $priority; + private $env; /** - * @param string[] $requirements - * @param string[]|string $methods - * @param string[]|string $schemes + * @param array|string $data data array managed by the Doctrine Annotations library or the path + * @param array|string|null $path + * @param string[] $requirements + * @param string[]|string $methods + * @param string[]|string $schemes + * + * @throws \BadMethodCallException */ public function __construct( - string|array $path = null, - private ?string $name = null, - private array $requirements = [], - private array $options = [], - private array $defaults = [], - private ?string $host = null, - array|string $methods = [], - array|string $schemes = [], - private ?string $condition = null, - private ?int $priority = null, + $data = [], + $path = null, + string $name = null, + array $requirements = [], + array $options = [], + array $defaults = [], + string $host = null, + $methods = [], + $schemes = [], + string $condition = null, + int $priority = null, string $locale = null, string $format = null, bool $utf8 = null, bool $stateless = null, - private ?string $env = null + string $env = null ) { - if (\is_array($path)) { - $this->localizedPaths = $path; - } else { - $this->path = $path; + if (\is_string($data)) { + $data = ['path' => $data]; + } elseif (!\is_array($data)) { + throw new \TypeError(sprintf('"%s": Argument $data is expected to be a string or array, got "%s".', __METHOD__, get_debug_type($data))); + } elseif ([] !== $data) { + $deprecation = false; + foreach ($data as $key => $val) { + if (\in_array($key, ['path', 'name', 'requirements', 'options', 'defaults', 'host', 'methods', 'schemes', 'condition', 'priority', 'locale', 'format', 'utf8', 'stateless', 'env', 'value'])) { + $deprecation = true; + } + } + + if ($deprecation) { + trigger_deprecation('symfony/routing', '5.3', 'Passing an array as first argument to "%s" is deprecated. Use named arguments instead.', __METHOD__); + } else { + $localizedPaths = $data; + $data = ['path' => $localizedPaths]; + } + } + if (null !== $path && !\is_string($path) && !\is_array($path)) { + throw new \TypeError(sprintf('"%s": Argument $path is expected to be a string, array or null, got "%s".', __METHOD__, get_debug_type($path))); + } + + $data['path'] = $data['path'] ?? $path; + $data['name'] = $data['name'] ?? $name; + $data['requirements'] = $data['requirements'] ?? $requirements; + $data['options'] = $data['options'] ?? $options; + $data['defaults'] = $data['defaults'] ?? $defaults; + $data['host'] = $data['host'] ?? $host; + $data['methods'] = $data['methods'] ?? $methods; + $data['schemes'] = $data['schemes'] ?? $schemes; + $data['condition'] = $data['condition'] ?? $condition; + $data['priority'] = $data['priority'] ?? $priority; + $data['locale'] = $data['locale'] ?? $locale; + $data['format'] = $data['format'] ?? $format; + $data['utf8'] = $data['utf8'] ?? $utf8; + $data['stateless'] = $data['stateless'] ?? $stateless; + $data['env'] = $data['env'] ?? $env; + + $data = array_filter($data, static function ($value): bool { + return null !== $value; + }); + + if (isset($data['localized_paths'])) { + throw new \BadMethodCallException(sprintf('Unknown property "localized_paths" on annotation "%s".', static::class)); + } + + if (isset($data['value'])) { + $data[\is_array($data['value']) ? 'localized_paths' : 'path'] = $data['value']; + unset($data['value']); + } + + if (isset($data['path']) && \is_array($data['path'])) { + $data['localized_paths'] = $data['path']; + unset($data['path']); + } + + if (isset($data['locale'])) { + $data['defaults']['_locale'] = $data['locale']; + unset($data['locale']); } - $this->setMethods($methods); - $this->setSchemes($schemes); - if (null !== $locale) { - $this->defaults['_locale'] = $locale; + if (isset($data['format'])) { + $data['defaults']['_format'] = $data['format']; + unset($data['format']); } - if (null !== $format) { - $this->defaults['_format'] = $format; + if (isset($data['utf8'])) { + $data['options']['utf8'] = filter_var($data['utf8'], \FILTER_VALIDATE_BOOLEAN) ?: false; + unset($data['utf8']); } - if (null !== $utf8) { - $this->options['utf8'] = $utf8; + if (isset($data['stateless'])) { + $data['defaults']['_stateless'] = filter_var($data['stateless'], \FILTER_VALIDATE_BOOLEAN) ?: false; + unset($data['stateless']); } - if (null !== $stateless) { - $this->defaults['_stateless'] = $stateless; + foreach ($data as $key => $value) { + $method = 'set'.str_replace('_', '', $key); + if (!method_exists($this, $method)) { + throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, static::class)); + } + $this->$method($value); } } @@ -146,9 +220,9 @@ public function getDefaults() return $this->defaults; } - public function setSchemes(array|string $schemes) + public function setSchemes($schemes) { - $this->schemes = (array) $schemes; + $this->schemes = \is_array($schemes) ? $schemes : [$schemes]; } public function getSchemes() @@ -156,9 +230,9 @@ public function getSchemes() return $this->schemes; } - public function setMethods(array|string $methods) + public function setMethods($methods) { - $this->methods = (array) $methods; + $this->methods = \is_array($methods) ? $methods : [$methods]; } public function getMethods() diff --git a/core/vendor/symfony/routing/CompiledRoute.php b/core/vendor/symfony/routing/CompiledRoute.php index 745120a6df..1449cdb92e 100644 --- a/core/vendor/symfony/routing/CompiledRoute.php +++ b/core/vendor/symfony/routing/CompiledRoute.php @@ -18,14 +18,14 @@ */ class CompiledRoute implements \Serializable { - private array $variables; - private array $tokens; - private string $staticPrefix; - private string $regex; - private array $pathVariables; - private array $hostVariables; - private ?string $hostRegex; - private array $hostTokens; + private $variables; + private $tokens; + private $staticPrefix; + private $regex; + private $pathVariables; + private $hostVariables; + private $hostRegex; + private $hostTokens; /** * @param string $staticPrefix The static prefix of the compiled route @@ -68,7 +68,7 @@ public function __serialize(): array */ final public function serialize(): string { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); + return serialize($this->__serialize()); } public function __unserialize(array $data): void @@ -86,71 +86,87 @@ public function __unserialize(array $data): void /** * @internal */ - final public function unserialize(string $serialized) + final public function unserialize($serialized) { $this->__unserialize(unserialize($serialized, ['allowed_classes' => false])); } /** * Returns the static prefix. + * + * @return string */ - public function getStaticPrefix(): string + public function getStaticPrefix() { return $this->staticPrefix; } /** * Returns the regex. + * + * @return string */ - public function getRegex(): string + public function getRegex() { return $this->regex; } /** * Returns the host regex. + * + * @return string|null */ - public function getHostRegex(): ?string + public function getHostRegex() { return $this->hostRegex; } /** * Returns the tokens. + * + * @return array */ - public function getTokens(): array + public function getTokens() { return $this->tokens; } /** * Returns the host tokens. + * + * @return array */ - public function getHostTokens(): array + public function getHostTokens() { return $this->hostTokens; } /** * Returns the variables. + * + * @return array */ - public function getVariables(): array + public function getVariables() { return $this->variables; } /** * Returns the path variables. + * + * @return array */ - public function getPathVariables(): array + public function getPathVariables() { return $this->pathVariables; } /** * Returns the host variables. + * + * @return array */ - public function getHostVariables(): array + public function getHostVariables() { return $this->hostVariables; } diff --git a/core/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php b/core/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php index a538d83983..0e9b9c8931 100644 --- a/core/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php +++ b/core/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php @@ -25,15 +25,28 @@ class RoutingResolverPass implements CompilerPassInterface { use PriorityTaggedServiceTrait; + private $resolverServiceId; + private $loaderTag; + + public function __construct(string $resolverServiceId = 'routing.resolver', string $loaderTag = 'routing.loader') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/routing', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->resolverServiceId = $resolverServiceId; + $this->loaderTag = $loaderTag; + } + public function process(ContainerBuilder $container) { - if (false === $container->hasDefinition('routing.resolver')) { + if (false === $container->hasDefinition($this->resolverServiceId)) { return; } - $definition = $container->getDefinition('routing.resolver'); + $definition = $container->getDefinition($this->resolverServiceId); - foreach ($this->findAndSortTaggedServices('routing.loader', $container) as $id) { + foreach ($this->findAndSortTaggedServices($this->loaderTag, $container) as $id) { $definition->addMethodCall('addLoader', [new Reference($id)]); } } diff --git a/core/vendor/symfony/routing/Exception/MethodNotAllowedException.php b/core/vendor/symfony/routing/Exception/MethodNotAllowedException.php index 0e4381bb6d..27cf2125e2 100644 --- a/core/vendor/symfony/routing/Exception/MethodNotAllowedException.php +++ b/core/vendor/symfony/routing/Exception/MethodNotAllowedException.php @@ -25,8 +25,14 @@ class MethodNotAllowedException extends \RuntimeException implements ExceptionIn /** * @param string[] $allowedMethods */ - public function __construct(array $allowedMethods, string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(array $allowedMethods, ?string $message = '', int $code = 0, \Throwable $previous = null) { + if (null === $message) { + trigger_deprecation('symfony/routing', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__); + + $message = ''; + } + $this->allowedMethods = array_map('strtoupper', $allowedMethods); parent::__construct($message, $code, $previous); @@ -37,7 +43,7 @@ public function __construct(array $allowedMethods, string $message = '', int $co * * @return string[] */ - public function getAllowedMethods(): array + public function getAllowedMethods() { return $this->allowedMethods; } diff --git a/core/vendor/symfony/routing/Generator/CompiledUrlGenerator.php b/core/vendor/symfony/routing/Generator/CompiledUrlGenerator.php index 2a3d5fd2d5..8cbbf8f702 100644 --- a/core/vendor/symfony/routing/Generator/CompiledUrlGenerator.php +++ b/core/vendor/symfony/routing/Generator/CompiledUrlGenerator.php @@ -20,8 +20,8 @@ */ class CompiledUrlGenerator extends UrlGenerator { - private array $compiledRoutes = []; - private ?string $defaultLocale; + private $compiledRoutes = []; + private $defaultLocale; public function __construct(array $compiledRoutes, RequestContext $context, LoggerInterface $logger = null, string $defaultLocale = null) { @@ -31,7 +31,7 @@ public function __construct(array $compiledRoutes, RequestContext $context, Logg $this->defaultLocale = $defaultLocale; } - public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string + public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH) { $locale = $parameters['_locale'] ?? $this->context->getParameter('_locale') diff --git a/core/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.php b/core/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.php index 2c99c913a3..568f7f7753 100644 --- a/core/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.php +++ b/core/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.php @@ -46,6 +46,8 @@ public function setStrictRequirements(?bool $enabled); /** * Returns whether to throw an exception on incorrect parameters. * Null means the requirements check is deactivated completely. + * + * @return bool|null */ - public function isStrictRequirements(): ?bool; + public function isStrictRequirements(); } diff --git a/core/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php b/core/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php index 7ac5a2abcd..9c6740b61e 100644 --- a/core/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php +++ b/core/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php @@ -91,7 +91,7 @@ public function getCompiledAliases(): array /** * {@inheritdoc} */ - public function dump(array $options = []): string + public function dump(array $options = []) { return <<<EOF <?php diff --git a/core/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php b/core/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php index e15a985df0..659c5ba1c8 100644 --- a/core/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php +++ b/core/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php @@ -30,7 +30,7 @@ public function __construct(RouteCollection $routes) /** * {@inheritdoc} */ - public function getRoutes(): RouteCollection + public function getRoutes() { return $this->routes; } diff --git a/core/vendor/symfony/routing/Generator/Dumper/GeneratorDumperInterface.php b/core/vendor/symfony/routing/Generator/Dumper/GeneratorDumperInterface.php index d3294ce261..d4a248a5be 100644 --- a/core/vendor/symfony/routing/Generator/Dumper/GeneratorDumperInterface.php +++ b/core/vendor/symfony/routing/Generator/Dumper/GeneratorDumperInterface.php @@ -23,11 +23,15 @@ interface GeneratorDumperInterface /** * Dumps a set of routes to a string representation of executable code * that can then be used to generate a URL of such a route. + * + * @return string */ - public function dump(array $options = []): string; + public function dump(array $options = []); /** * Gets the routes to dump. + * + * @return RouteCollection */ - public function getRoutes(): RouteCollection; + public function getRoutes(); } diff --git a/core/vendor/symfony/routing/Generator/UrlGenerator.php b/core/vendor/symfony/routing/Generator/UrlGenerator.php index 3009b4c606..acf3ead4fc 100644 --- a/core/vendor/symfony/routing/Generator/UrlGenerator.php +++ b/core/vendor/symfony/routing/Generator/UrlGenerator.php @@ -51,7 +51,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt protected $logger; - private ?string $defaultLocale; + private $defaultLocale; /** * This array defines the characters (besides alphanumeric ones) that will not be percent-encoded in the path segment of the generated URL. @@ -101,7 +101,7 @@ public function setContext(RequestContext $context) /** * {@inheritdoc} */ - public function getContext(): RequestContext + public function getContext() { return $this->context; } @@ -117,7 +117,7 @@ public function setStrictRequirements(?bool $enabled) /** * {@inheritdoc} */ - public function isStrictRequirements(): ?bool + public function isStrictRequirements() { return $this->strictRequirements; } @@ -125,7 +125,7 @@ public function isStrictRequirements(): ?bool /** * {@inheritdoc} */ - public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string + public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH) { $route = null; $locale = $parameters['_locale'] @@ -165,8 +165,10 @@ public function generate(string $name, array $parameters = [], int $referenceTyp * @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route * @throws InvalidParameterException When a parameter value for a placeholder is not correct because * it does not match the requirement + * + * @return string */ - protected function doGenerate(array $variables, array $defaults, array $requirements, array $tokens, array $parameters, string $name, int $referenceType, array $hostTokens, array $requiredSchemes = []): string + protected function doGenerate(array $variables, array $defaults, array $requirements, array $tokens, array $parameters, string $name, int $referenceType, array $hostTokens, array $requiredSchemes = []) { $variables = array_flip($variables); $mergedParams = array_replace($defaults, $this->context->getParameters(), $parameters); @@ -340,8 +342,10 @@ protected function doGenerate(array $variables, array $defaults, array $requirem * * @param string $basePath The base path * @param string $targetPath The target path + * + * @return string */ - public static function getRelativePath(string $basePath, string $targetPath): string + public static function getRelativePath(string $basePath, string $targetPath) { if ($basePath === $targetPath) { return ''; diff --git a/core/vendor/symfony/routing/Generator/UrlGeneratorInterface.php b/core/vendor/symfony/routing/Generator/UrlGeneratorInterface.php index 51210b4b7a..c6d5005f9a 100644 --- a/core/vendor/symfony/routing/Generator/UrlGeneratorInterface.php +++ b/core/vendor/symfony/routing/Generator/UrlGeneratorInterface.php @@ -71,10 +71,12 @@ interface UrlGeneratorInterface extends RequestContextAwareInterface * * The special parameter _fragment will be used as the document fragment suffixed to the final URL. * + * @return string + * * @throws RouteNotFoundException If the named route doesn't exist * @throws MissingMandatoryParametersException When some parameters are missing that are mandatory for the route * @throws InvalidParameterException When a parameter value for a placeholder is not correct because * it does not match the requirement */ - public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string; + public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH); } diff --git a/core/vendor/symfony/routing/Loader/AnnotationClassLoader.php b/core/vendor/symfony/routing/Loader/AnnotationClassLoader.php index 2dd0e5efbf..ad5af5c942 100644 --- a/core/vendor/symfony/routing/Loader/AnnotationClassLoader.php +++ b/core/vendor/symfony/routing/Loader/AnnotationClassLoader.php @@ -102,9 +102,13 @@ public function setRouteAnnotationClass(string $class) /** * Loads from annotations from a class. * + * @param string $class A class name + * + * @return RouteCollection + * * @throws \InvalidArgumentException When route can't be parsed */ - public function load(mixed $class, string $type = null): RouteCollection + public function load($class, string $type = null) { if (!class_exists($class)) { throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); @@ -235,7 +239,7 @@ protected function addRoute(RouteCollection $collection, object $annot, array $g /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { return \is_string($resource) && preg_match('/^(?:\\\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)+$/', $resource) && (!$type || 'annotation' === $type); } @@ -250,7 +254,7 @@ public function setResolver(LoaderResolverInterface $resolver) /** * {@inheritdoc} */ - public function getResolver(): LoaderResolverInterface + public function getResolver() { } @@ -276,7 +280,7 @@ protected function getGlobals(\ReflectionClass $class) $globals = $this->resetGlobals(); $annot = null; - if ($attribute = $class->getAttributes($this->routeAnnotationClass, \ReflectionAttribute::IS_INSTANCEOF)[0] ?? null) { + if (\PHP_VERSION_ID >= 80000 && ($attribute = $class->getAttributes($this->routeAnnotationClass, \ReflectionAttribute::IS_INSTANCEOF)[0] ?? null)) { $annot = $attribute->newInstance(); } if (!$annot && $this->reader) { @@ -367,8 +371,10 @@ abstract protected function configureRoute(Route $route, \ReflectionClass $class */ private function getAnnotations(object $reflection): iterable { - foreach ($reflection->getAttributes($this->routeAnnotationClass, \ReflectionAttribute::IS_INSTANCEOF) as $attribute) { - yield $attribute->newInstance(); + if (\PHP_VERSION_ID >= 80000) { + foreach ($reflection->getAttributes($this->routeAnnotationClass, \ReflectionAttribute::IS_INSTANCEOF) as $attribute) { + yield $attribute->newInstance(); + } } if (!$this->reader) { diff --git a/core/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php b/core/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php index c1ca8faff5..ae825a39f7 100644 --- a/core/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php +++ b/core/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php @@ -23,9 +23,16 @@ class AnnotationDirectoryLoader extends AnnotationFileLoader { /** + * Loads from annotations from a directory. + * + * @param string $path A directory path + * @param string|null $type The resource type + * + * @return RouteCollection + * * @throws \InvalidArgumentException When the directory does not exist or its routes cannot be parsed */ - public function load(mixed $path, string $type = null): RouteCollection + public function load($path, string $type = null) { if (!is_dir($dir = $this->locator->locate($path))) { return parent::supports($path, $type) ? parent::load($path, $type) : new RouteCollection(); @@ -67,7 +74,7 @@ function (\SplFileInfo $current) { /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { if ('annotation' === $type) { return true; diff --git a/core/vendor/symfony/routing/Loader/AnnotationFileLoader.php b/core/vendor/symfony/routing/Loader/AnnotationFileLoader.php index ce24df1563..27af66ee69 100644 --- a/core/vendor/symfony/routing/Loader/AnnotationFileLoader.php +++ b/core/vendor/symfony/routing/Loader/AnnotationFileLoader.php @@ -40,9 +40,14 @@ public function __construct(FileLocatorInterface $locator, AnnotationClassLoader /** * Loads from annotations from a file. * + * @param string $file A PHP file path + * @param string|null $type The resource type + * + * @return RouteCollection|null + * * @throws \InvalidArgumentException When the file does not exist or its routes cannot be parsed */ - public function load(mixed $file, string $type = null): ?RouteCollection + public function load($file, string $type = null) { $path = $this->locator->locate($file); @@ -65,15 +70,17 @@ public function load(mixed $file, string $type = null): ?RouteCollection /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { return \is_string($resource) && 'php' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || 'annotation' === $type); } /** * Returns the full class name for the first class in the file. + * + * @return string|false */ - protected function findClass(string $file): string|false + protected function findClass(string $file) { $class = false; $namespace = false; diff --git a/core/vendor/symfony/routing/Loader/ClosureLoader.php b/core/vendor/symfony/routing/Loader/ClosureLoader.php index e0d6440266..42f950f50f 100644 --- a/core/vendor/symfony/routing/Loader/ClosureLoader.php +++ b/core/vendor/symfony/routing/Loader/ClosureLoader.php @@ -25,8 +25,13 @@ class ClosureLoader extends Loader { /** * Loads a Closure. + * + * @param \Closure $closure A Closure + * @param string|null $type The resource type + * + * @return RouteCollection */ - public function load(mixed $closure, string $type = null): RouteCollection + public function load($closure, string $type = null) { return $closure($this->env); } @@ -34,7 +39,7 @@ public function load(mixed $closure, string $type = null): RouteCollection /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { return $resource instanceof \Closure && (!$type || 'closure' === $type); } diff --git a/core/vendor/symfony/routing/Loader/Configurator/AliasConfigurator.php b/core/vendor/symfony/routing/Loader/Configurator/AliasConfigurator.php index 2d85b99af4..4b2206e68e 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/AliasConfigurator.php +++ b/core/vendor/symfony/routing/Loader/Configurator/AliasConfigurator.php @@ -34,7 +34,7 @@ public function __construct(Alias $alias) * * @throws InvalidArgumentException when the message template is invalid */ - public function deprecate(string $package, string $version, string $message): static + public function deprecate(string $package, string $version, string $message): self { $this->alias->setDeprecated($package, $version, $message); diff --git a/core/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php b/core/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php index 87b2af0ed5..09274ccdc7 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php +++ b/core/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php @@ -25,8 +25,8 @@ class CollectionConfigurator private $parent; private $parentConfigurator; - private ?array $parentPrefixes; - private string|array|null $host = null; + private $parentPrefixes; + private $host; public function __construct(RouteCollection $parent, string $name, self $parentConfigurator = null, array $parentPrefixes = null) { @@ -38,7 +38,10 @@ public function __construct(RouteCollection $parent, string $name, self $parentC $this->parentPrefixes = $parentPrefixes; } - public function __sleep(): array + /** + * @return array + */ + public function __sleep() { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } @@ -75,7 +78,7 @@ final public function collection(string $name = ''): self * * @return $this */ - final public function prefix(string|array $prefix): static + final public function prefix($prefix): self { if (\is_array($prefix)) { if (null === $this->parentPrefixes) { @@ -108,7 +111,7 @@ final public function prefix(string|array $prefix): static * * @return $this */ - final public function host(string|array $host): static + final public function host($host): self { $this->host = $host; diff --git a/core/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php b/core/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php index ee8eb6c016..32f3efe3a9 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php +++ b/core/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php @@ -30,7 +30,10 @@ public function __construct(RouteCollection $parent, RouteCollection $route) $this->route = $route; } - public function __sleep(): array + /** + * @return array + */ + public function __sleep() { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } @@ -52,7 +55,7 @@ public function __destruct() * * @return $this */ - final public function prefix(string|array $prefix, bool $trailingSlashOnRoot = true): static + final public function prefix($prefix, bool $trailingSlashOnRoot = true): self { $this->addPrefix($this->route, $prefix, $trailingSlashOnRoot); @@ -64,7 +67,7 @@ final public function prefix(string|array $prefix, bool $trailingSlashOnRoot = t * * @return $this */ - final public function namePrefix(string $namePrefix): static + final public function namePrefix(string $namePrefix): self { $this->route->addNamePrefix($namePrefix); @@ -78,7 +81,7 @@ final public function namePrefix(string $namePrefix): static * * @return $this */ - final public function host(string|array $host): static + final public function host($host): self { $this->addHost($this->route, $host); diff --git a/core/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php b/core/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php index 9407cc8ee7..bb6ce267a7 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php +++ b/core/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php @@ -40,7 +40,7 @@ public function __construct(RouteCollection $collection, RouteCollection $route, * * @return $this */ - final public function host(string|array $host): static + final public function host($host): self { $this->addHost($this->route, $host); diff --git a/core/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php b/core/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php index 282c716b0f..4687bf6817 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php +++ b/core/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php @@ -22,9 +22,9 @@ class RoutingConfigurator use Traits\AddTrait; private $loader; - private string $path; - private string $file; - private ?string $env; + private $path; + private $file; + private $env; public function __construct(RouteCollection $collection, PhpFileLoader $loader, string $path, string $file, string $env = null) { @@ -38,7 +38,7 @@ public function __construct(RouteCollection $collection, PhpFileLoader $loader, /** * @param string|string[]|null $exclude Glob patterns to exclude from the import */ - final public function import(string|array $resource, string $type = null, bool $ignoreErrors = false, string|array $exclude = null): ImportConfigurator + final public function import($resource, string $type = null, bool $ignoreErrors = false, $exclude = null): ImportConfigurator { $this->loader->setCurrentDir(\dirname($this->path)); @@ -68,7 +68,10 @@ final public function env(): ?string return $this->env; } - final public function withPath(string $path): static + /** + * @return static + */ + final public function withPath(string $path): self { $clone = clone $this; $clone->path = $clone->file = $path; diff --git a/core/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php b/core/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php index 5698df5daa..92b1bd0ea5 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php +++ b/core/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php @@ -35,7 +35,7 @@ trait AddTrait * * @param string|array $path the path, or the localized paths of the route */ - public function add(string $name, string|array $path): RouteConfigurator + public function add(string $name, $path): RouteConfigurator { $parentConfigurator = $this instanceof CollectionConfigurator ? $this : ($this instanceof RouteConfigurator ? $this->parentConfigurator : null); $route = $this->createLocalizedRoute($this->collection, $name, $path, $this->name, $this->prefixes); @@ -53,7 +53,7 @@ public function alias(string $name, string $alias): AliasConfigurator * * @param string|array $path the path, or the localized paths of the route */ - public function __invoke(string $name, string|array $path): RouteConfigurator + public function __invoke(string $name, $path): RouteConfigurator { return $this->add($name, $path); } diff --git a/core/vendor/symfony/routing/Loader/Configurator/Traits/HostTrait.php b/core/vendor/symfony/routing/Loader/Configurator/Traits/HostTrait.php index edf53d3cfd..54ae6566a9 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/Traits/HostTrait.php +++ b/core/vendor/symfony/routing/Loader/Configurator/Traits/HostTrait.php @@ -18,7 +18,7 @@ */ trait HostTrait { - final protected function addHost(RouteCollection $routes, string|array $hosts) + final protected function addHost(RouteCollection $routes, $hosts) { if (!$hosts || !\is_array($hosts)) { $routes->setHost($hosts ?: ''); diff --git a/core/vendor/symfony/routing/Loader/Configurator/Traits/LocalizedRouteTrait.php b/core/vendor/symfony/routing/Loader/Configurator/Traits/LocalizedRouteTrait.php index c7c40e9801..4734a4eac0 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/Traits/LocalizedRouteTrait.php +++ b/core/vendor/symfony/routing/Loader/Configurator/Traits/LocalizedRouteTrait.php @@ -27,7 +27,7 @@ trait LocalizedRouteTrait * * @param string|array $path the path, or the localized paths of the route */ - final protected function createLocalizedRoute(RouteCollection $collection, string $name, string|array $path, string $namePrefix = '', array $prefixes = null): RouteCollection + final protected function createLocalizedRoute(RouteCollection $collection, string $name, $path, string $namePrefix = '', array $prefixes = null): RouteCollection { $paths = []; diff --git a/core/vendor/symfony/routing/Loader/Configurator/Traits/PrefixTrait.php b/core/vendor/symfony/routing/Loader/Configurator/Traits/PrefixTrait.php index b95dbdd43f..27053bcaf5 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/Traits/PrefixTrait.php +++ b/core/vendor/symfony/routing/Loader/Configurator/Traits/PrefixTrait.php @@ -21,7 +21,7 @@ */ trait PrefixTrait { - final protected function addPrefix(RouteCollection $routes, string|array $prefix, bool $trailingSlashOnRoot) + final protected function addPrefix(RouteCollection $routes, $prefix, bool $trailingSlashOnRoot) { if (\is_array($prefix)) { foreach ($prefix as $locale => $localePrefix) { diff --git a/core/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php b/core/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php index 16dc43d0a3..ac05d10e5f 100644 --- a/core/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php +++ b/core/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php @@ -26,7 +26,7 @@ trait RouteTrait * * @return $this */ - final public function defaults(array $defaults): static + final public function defaults(array $defaults): self { $this->route->addDefaults($defaults); @@ -38,7 +38,7 @@ final public function defaults(array $defaults): static * * @return $this */ - final public function requirements(array $requirements): static + final public function requirements(array $requirements): self { $this->route->addRequirements($requirements); @@ -50,7 +50,7 @@ final public function requirements(array $requirements): static * * @return $this */ - final public function options(array $options): static + final public function options(array $options): self { $this->route->addOptions($options); @@ -62,7 +62,7 @@ final public function options(array $options): static * * @return $this */ - final public function utf8(bool $utf8 = true): static + final public function utf8(bool $utf8 = true): self { $this->route->addOptions(['utf8' => $utf8]); @@ -74,7 +74,7 @@ final public function utf8(bool $utf8 = true): static * * @return $this */ - final public function condition(string $condition): static + final public function condition(string $condition): self { $this->route->setCondition($condition); @@ -86,7 +86,7 @@ final public function condition(string $condition): static * * @return $this */ - final public function host(string $pattern): static + final public function host(string $pattern): self { $this->route->setHost($pattern); @@ -101,7 +101,7 @@ final public function host(string $pattern): static * * @return $this */ - final public function schemes(array $schemes): static + final public function schemes(array $schemes): self { $this->route->setSchemes($schemes); @@ -116,7 +116,7 @@ final public function schemes(array $schemes): static * * @return $this */ - final public function methods(array $methods): static + final public function methods(array $methods): self { $this->route->setMethods($methods); @@ -130,7 +130,7 @@ final public function methods(array $methods): static * * @return $this */ - final public function controller(callable|string|array $controller): static + final public function controller($controller): self { $this->route->addDefaults(['_controller' => $controller]); @@ -142,7 +142,7 @@ final public function controller(callable|string|array $controller): static * * @return $this */ - final public function locale(string $locale): static + final public function locale(string $locale): self { $this->route->addDefaults(['_locale' => $locale]); @@ -154,7 +154,7 @@ final public function locale(string $locale): static * * @return $this */ - final public function format(string $format): static + final public function format(string $format): self { $this->route->addDefaults(['_format' => $format]); @@ -166,7 +166,7 @@ final public function format(string $format): static * * @return $this */ - final public function stateless(bool $stateless = true): static + final public function stateless(bool $stateless = true): self { $this->route->addDefaults(['_stateless' => $stateless]); diff --git a/core/vendor/symfony/routing/Loader/ContainerLoader.php b/core/vendor/symfony/routing/Loader/ContainerLoader.php index 2476ec1e2f..d8730aec61 100644 --- a/core/vendor/symfony/routing/Loader/ContainerLoader.php +++ b/core/vendor/symfony/routing/Loader/ContainerLoader.php @@ -31,7 +31,7 @@ public function __construct(ContainerInterface $container, string $env = null) /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { return 'service' === $type && \is_string($resource); } @@ -39,7 +39,7 @@ public function supports(mixed $resource, string $type = null): bool /** * {@inheritdoc} */ - protected function getObject(string $id): object + protected function getObject(string $id) { return $this->container->get($id); } diff --git a/core/vendor/symfony/routing/Loader/DirectoryLoader.php b/core/vendor/symfony/routing/Loader/DirectoryLoader.php index 4ccbb7b889..c0f3491774 100644 --- a/core/vendor/symfony/routing/Loader/DirectoryLoader.php +++ b/core/vendor/symfony/routing/Loader/DirectoryLoader.php @@ -20,7 +20,7 @@ class DirectoryLoader extends FileLoader /** * {@inheritdoc} */ - public function load(mixed $file, string $type = null): mixed + public function load($file, string $type = null) { $path = $this->locator->locate($file); @@ -49,7 +49,7 @@ public function load(mixed $file, string $type = null): mixed /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { // only when type is forced to directory, not to conflict with AnnotationLoader diff --git a/core/vendor/symfony/routing/Loader/GlobFileLoader.php b/core/vendor/symfony/routing/Loader/GlobFileLoader.php index 3cf49ccff7..780fb15dc7 100644 --- a/core/vendor/symfony/routing/Loader/GlobFileLoader.php +++ b/core/vendor/symfony/routing/Loader/GlobFileLoader.php @@ -24,7 +24,7 @@ class GlobFileLoader extends FileLoader /** * {@inheritdoc} */ - public function load(mixed $resource, string $type = null): mixed + public function load($resource, string $type = null) { $collection = new RouteCollection(); @@ -40,7 +40,7 @@ public function load(mixed $resource, string $type = null): mixed /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { return 'glob' === $type; } diff --git a/core/vendor/symfony/routing/Loader/ObjectLoader.php b/core/vendor/symfony/routing/Loader/ObjectLoader.php index 4132f209a7..062453908c 100644 --- a/core/vendor/symfony/routing/Loader/ObjectLoader.php +++ b/core/vendor/symfony/routing/Loader/ObjectLoader.php @@ -27,13 +27,20 @@ abstract class ObjectLoader extends Loader * * For example, if your application uses a service container, * the $id may be a service id. + * + * @return object */ - abstract protected function getObject(string $id): object; + abstract protected function getObject(string $id); /** * Calls the object method that will load the routes. + * + * @param string $resource object_id::method + * @param string|null $type The resource type + * + * @return RouteCollection */ - public function load(mixed $resource, string $type = null): RouteCollection + public function load($resource, string $type = null) { if (!preg_match('/^[^\:]+(?:::(?:[^\:]+))?$/', $resource)) { throw new \InvalidArgumentException(sprintf('Invalid resource "%s" passed to the %s route loader: use the format "object_id::method" or "object_id" if your object class has an "__invoke" method.', $resource, \is_string($type) ? '"'.$type.'"' : 'object')); diff --git a/core/vendor/symfony/routing/Loader/PhpFileLoader.php b/core/vendor/symfony/routing/Loader/PhpFileLoader.php index 8a4d642527..39ac812734 100644 --- a/core/vendor/symfony/routing/Loader/PhpFileLoader.php +++ b/core/vendor/symfony/routing/Loader/PhpFileLoader.php @@ -29,8 +29,13 @@ class PhpFileLoader extends FileLoader { /** * Loads a PHP file. + * + * @param string $file A PHP file path + * @param string|null $type The resource type + * + * @return RouteCollection */ - public function load(mixed $file, string $type = null): RouteCollection + public function load($file, string $type = null) { $path = $this->locator->locate($file); $this->setCurrentDir(\dirname($path)); @@ -57,7 +62,7 @@ public function load(mixed $file, string $type = null): RouteCollection /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { return \is_string($resource) && 'php' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || 'php' === $type); } diff --git a/core/vendor/symfony/routing/Loader/XmlFileLoader.php b/core/vendor/symfony/routing/Loader/XmlFileLoader.php index 7b398985d9..9f502dfc83 100644 --- a/core/vendor/symfony/routing/Loader/XmlFileLoader.php +++ b/core/vendor/symfony/routing/Loader/XmlFileLoader.php @@ -35,10 +35,17 @@ class XmlFileLoader extends FileLoader public const SCHEME_PATH = '/schema/routing/routing-1.0.xsd'; /** + * Loads an XML file. + * + * @param string $file An XML file path + * @param string|null $type The resource type + * + * @return RouteCollection + * * @throws \InvalidArgumentException when the file cannot be loaded or when the XML cannot be * parsed because it does not validate against the scheme */ - public function load(mixed $file, string $type = null): RouteCollection + public function load($file, string $type = null) { $path = $this->locator->locate($file); @@ -95,7 +102,7 @@ protected function parseNode(RouteCollection $collection, \DOMElement $node, str /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { return \is_string($resource) && 'xml' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || 'xml' === $type); } @@ -222,11 +229,13 @@ protected function parseImport(RouteCollection $collection, \DOMElement $node, s } /** + * @return \DOMDocument + * * @throws \InvalidArgumentException When loading of XML file fails because of syntax errors * or when the XML structure is not as expected by the scheme - * see validate() */ - protected function loadFile(string $file): \DOMDocument + protected function loadFile(string $file) { return XmlUtils::loadFile($file, __DIR__.static::SCHEME_PATH); } @@ -321,8 +330,10 @@ private function parseConfigs(\DOMElement $node, string $path): array /** * Parses the "default" elements. + * + * @return array|bool|float|int|string|null */ - private function parseDefaultsConfig(\DOMElement $element, string $path): array|bool|float|int|string|null + private function parseDefaultsConfig(\DOMElement $element, string $path) { if ($this->isElementValueNull($element)) { return null; @@ -352,9 +363,11 @@ private function parseDefaultsConfig(\DOMElement $element, string $path): array| /** * Recursively parses the value of a "default" element. * + * @return array|bool|float|int|string|null + * * @throws \InvalidArgumentException when the XML is invalid */ - private function parseDefaultNode(\DOMElement $node, string $path): array|bool|float|int|string|null + private function parseDefaultNode(\DOMElement $node, string $path) { if ($this->isElementValueNull($node)) { return null; diff --git a/core/vendor/symfony/routing/Loader/YamlFileLoader.php b/core/vendor/symfony/routing/Loader/YamlFileLoader.php index 9d0461039c..ae98a314e8 100644 --- a/core/vendor/symfony/routing/Loader/YamlFileLoader.php +++ b/core/vendor/symfony/routing/Loader/YamlFileLoader.php @@ -39,9 +39,16 @@ class YamlFileLoader extends FileLoader private $yamlParser; /** + * Loads a Yaml file. + * + * @param string $file A Yaml file path + * @param string|null $type The resource type + * + * @return RouteCollection + * * @throws \InvalidArgumentException When a route can't be parsed because YAML is invalid */ - public function load(mixed $file, string $type = null): RouteCollection + public function load($file, string $type = null) { $path = $this->locator->locate($file); @@ -53,7 +60,9 @@ public function load(mixed $file, string $type = null): RouteCollection throw new \InvalidArgumentException(sprintf('File "%s" not found.', $path)); } - $this->yamlParser ??= new YamlParser(); + if (null === $this->yamlParser) { + $this->yamlParser = new YamlParser(); + } try { $parsedConfig = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT); @@ -108,7 +117,7 @@ public function load(mixed $file, string $type = null): RouteCollection /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports($resource, string $type = null) { return \is_string($resource) && \in_array(pathinfo($resource, \PATHINFO_EXTENSION), ['yml', 'yaml'], true) && (!$type || 'yaml' === $type); } @@ -241,10 +250,16 @@ protected function parseImport(RouteCollection $collection, array $config, strin } /** + * Validates the route configuration. + * + * @param array $config A resource config + * @param string $name The config key + * @param string $path The loaded file path + * * @throws \InvalidArgumentException If one of the provided config keys is not supported, * something is missing or the combination is nonsense */ - protected function validate(mixed $config, string $name, string $path) + protected function validate($config, string $name, string $path) { if (!\is_array($config)) { throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path)); diff --git a/core/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherDumper.php b/core/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherDumper.php index 8796fad5d2..123130ed40 100644 --- a/core/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherDumper.php +++ b/core/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherDumper.php @@ -27,17 +27,17 @@ class CompiledUrlMatcherDumper extends MatcherDumper { private $expressionLanguage; - private ?\Exception $signalingException = null; + private $signalingException; /** * @var ExpressionFunctionProviderInterface[] */ - private array $expressionLanguageProviders = []; + private $expressionLanguageProviders = []; /** * {@inheritdoc} */ - public function dump(array $options = []): string + public function dump(array $options = []) { return <<<EOF <?php @@ -416,7 +416,7 @@ private function compileStaticPrefixCollection(StaticPrefixCollection $tree, \st /** * Compiles a single Route to PHP code used to match it against the path info. */ - private function compileRoute(Route $route, string $name, string|array|null $vars, bool $hasTrailingSlash, bool $hasTrailingVar, array &$conditions): array + private function compileRoute(Route $route, string $name, $vars, bool $hasTrailingSlash, bool $hasTrailingVar, array &$conditions): array { $defaults = $route->getDefaults(); @@ -445,7 +445,7 @@ private function compileRoute(Route $route, string $name, string|array|null $var private function getExpressionLanguage(): ExpressionLanguage { - if (!isset($this->expressionLanguage)) { + if (null === $this->expressionLanguage) { if (!class_exists(ExpressionLanguage::class)) { throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'); } @@ -463,7 +463,7 @@ private function indent(string $code, int $level = 1): string /** * @internal */ - public static function export(mixed $value): string + public static function export($value): string { if (null === $value) { return 'null'; diff --git a/core/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php b/core/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php index 8b3bf53fef..bdb7ba3d04 100644 --- a/core/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php +++ b/core/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php @@ -26,10 +26,10 @@ */ trait CompiledUrlMatcherTrait { - private bool $matchHost = false; - private array $staticRoutes = []; - private array $regexpList = []; - private array $dynamicRoutes = []; + private $matchHost = false; + private $staticRoutes = []; + private $regexpList = []; + private $dynamicRoutes = []; /** * @var callable|null diff --git a/core/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php b/core/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php index fa1e6244c2..ea51ab4063 100644 --- a/core/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php +++ b/core/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php @@ -30,7 +30,7 @@ public function __construct(RouteCollection $routes) /** * {@inheritdoc} */ - public function getRoutes(): RouteCollection + public function getRoutes() { return $this->routes; } diff --git a/core/vendor/symfony/routing/Matcher/Dumper/MatcherDumperInterface.php b/core/vendor/symfony/routing/Matcher/Dumper/MatcherDumperInterface.php index 92cc4db2aa..8e33802d36 100644 --- a/core/vendor/symfony/routing/Matcher/Dumper/MatcherDumperInterface.php +++ b/core/vendor/symfony/routing/Matcher/Dumper/MatcherDumperInterface.php @@ -23,11 +23,15 @@ interface MatcherDumperInterface /** * Dumps a set of routes to a string representation of executable code * that can then be used to match a request against these routes. + * + * @return string */ - public function dump(array $options = []): string; + public function dump(array $options = []); /** * Gets the routes to dump. + * + * @return RouteCollection */ - public function getRoutes(): RouteCollection; + public function getRoutes(); } diff --git a/core/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php b/core/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php index 4036071149..97bd692a5e 100644 --- a/core/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php +++ b/core/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php @@ -23,22 +23,22 @@ */ class StaticPrefixCollection { - private string $prefix; + private $prefix; /** * @var string[] */ - private array $staticPrefixes = []; + private $staticPrefixes = []; /** * @var string[] */ - private array $prefixes = []; + private $prefixes = []; /** * @var array[]|self[] */ - private array $items = []; + private $items = []; public function __construct(string $prefix = '/') { @@ -60,8 +60,10 @@ public function getRoutes(): array /** * Adds a route to a group. + * + * @param array|self $route */ - public function addRoute(string $prefix, array|StaticPrefixCollection $route) + public function addRoute(string $prefix, $route) { [$prefix, $staticPrefix] = $this->getCommonPrefix($prefix, $prefix); diff --git a/core/vendor/symfony/routing/Matcher/ExpressionLanguageProvider.php b/core/vendor/symfony/routing/Matcher/ExpressionLanguageProvider.php index c9703d236f..96bb7babf2 100644 --- a/core/vendor/symfony/routing/Matcher/ExpressionLanguageProvider.php +++ b/core/vendor/symfony/routing/Matcher/ExpressionLanguageProvider.php @@ -32,7 +32,7 @@ public function __construct(ServiceProviderInterface $functions) /** * {@inheritdoc} */ - public function getFunctions(): array + public function getFunctions() { $functions = []; diff --git a/core/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php b/core/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php index 439c69eeb3..3cd7c81a6c 100644 --- a/core/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php +++ b/core/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php @@ -22,7 +22,7 @@ abstract class RedirectableUrlMatcher extends UrlMatcher implements Redirectable /** * {@inheritdoc} */ - public function match(string $pathinfo): array + public function match(string $pathinfo) { try { return parent::match($pathinfo); diff --git a/core/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php b/core/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php index cd7e8c2c1a..d07f420933 100644 --- a/core/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php +++ b/core/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php @@ -24,6 +24,8 @@ interface RedirectableUrlMatcherInterface * @param string $path The path info to redirect to * @param string $route The route name that matched * @param string|null $scheme The URL scheme (null to keep the current one) + * + * @return array */ - public function redirect(string $path, string $route, string $scheme = null): array; + public function redirect(string $path, string $route, string $scheme = null); } diff --git a/core/vendor/symfony/routing/Matcher/RequestMatcherInterface.php b/core/vendor/symfony/routing/Matcher/RequestMatcherInterface.php index febba95bdd..c05016e82b 100644 --- a/core/vendor/symfony/routing/Matcher/RequestMatcherInterface.php +++ b/core/vendor/symfony/routing/Matcher/RequestMatcherInterface.php @@ -29,9 +29,11 @@ interface RequestMatcherInterface * If the matcher cannot find information, it must throw one of the exceptions documented * below. * + * @return array + * * @throws NoConfigurationException If no routing configuration could be found * @throws ResourceNotFoundException If no matching resource could be found * @throws MethodNotAllowedException If a matching resource was found but the request method is not allowed */ - public function matchRequest(Request $request): array; + public function matchRequest(Request $request); } diff --git a/core/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php b/core/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php index af6678c3f0..9e8c4c42df 100644 --- a/core/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php +++ b/core/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php @@ -50,7 +50,7 @@ public function getTracesForRequest(Request $request) return $traces; } - protected function matchCollection(string $pathinfo, RouteCollection $routes): array + protected function matchCollection(string $pathinfo, RouteCollection $routes) { // HEAD and GET are equivalent as per RFC if ('HEAD' === $method = $this->context->getMethod()) { diff --git a/core/vendor/symfony/routing/Matcher/UrlMatcher.php b/core/vendor/symfony/routing/Matcher/UrlMatcher.php index 55113cdd8e..f076a2f5e7 100644 --- a/core/vendor/symfony/routing/Matcher/UrlMatcher.php +++ b/core/vendor/symfony/routing/Matcher/UrlMatcher.php @@ -45,7 +45,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface * * @internal */ - protected array $allowSchemes = []; + protected $allowSchemes = []; protected $routes; protected $request; @@ -73,7 +73,7 @@ public function setContext(RequestContext $context) /** * {@inheritdoc} */ - public function getContext(): RequestContext + public function getContext() { return $this->context; } @@ -81,7 +81,7 @@ public function getContext(): RequestContext /** * {@inheritdoc} */ - public function match(string $pathinfo): array + public function match(string $pathinfo) { $this->allow = $this->allowSchemes = []; @@ -99,7 +99,7 @@ public function match(string $pathinfo): array /** * {@inheritdoc} */ - public function matchRequest(Request $request): array + public function matchRequest(Request $request) { $this->request = $request; @@ -120,11 +120,13 @@ public function addExpressionLanguageProvider(ExpressionFunctionProviderInterfac * * @param string $pathinfo The path info to be parsed * + * @return array + * * @throws NoConfigurationException If no routing configuration could be found * @throws ResourceNotFoundException If the resource could not be found * @throws MethodNotAllowedException If the resource was found but the request method is not allowed */ - protected function matchCollection(string $pathinfo, RouteCollection $routes): array + protected function matchCollection(string $pathinfo, RouteCollection $routes) { // HEAD and GET are equivalent as per RFC if ('HEAD' === $method = $this->context->getMethod()) { @@ -202,8 +204,10 @@ protected function matchCollection(string $pathinfo, RouteCollection $routes): a * As this method requires the Route object, it is not available * in matchers that do not have access to the matched Route instance * (like the PHP and Apache matcher dumpers). + * + * @return array */ - protected function getAttributes(Route $route, string $name, array $attributes): array + protected function getAttributes(Route $route, string $name, array $attributes) { $defaults = $route->getDefaults(); if (isset($defaults['_canonical_route'])) { @@ -220,7 +224,7 @@ protected function getAttributes(Route $route, string $name, array $attributes): * * @return array The first element represents the status, the second contains additional information */ - protected function handleRouteRequirements(string $pathinfo, string $name, Route $route): array + protected function handleRouteRequirements(string $pathinfo, string $name, Route $route) { // expression condition if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), ['context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)])) { @@ -232,8 +236,10 @@ protected function handleRouteRequirements(string $pathinfo, string $name, Route /** * Get merged default parameters. + * + * @return array */ - protected function mergeDefaults(array $params, array $defaults): array + protected function mergeDefaults(array $params, array $defaults) { foreach ($params as $key => $value) { if (!\is_int($key) && null !== $value) { diff --git a/core/vendor/symfony/routing/Matcher/UrlMatcherInterface.php b/core/vendor/symfony/routing/Matcher/UrlMatcherInterface.php index 68a3737fbb..0a5be97448 100644 --- a/core/vendor/symfony/routing/Matcher/UrlMatcherInterface.php +++ b/core/vendor/symfony/routing/Matcher/UrlMatcherInterface.php @@ -31,9 +31,11 @@ interface UrlMatcherInterface extends RequestContextAwareInterface * * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded) * + * @return array + * * @throws NoConfigurationException If no routing configuration could be found * @throws ResourceNotFoundException If the resource could not be found * @throws MethodNotAllowedException If the resource was found but the request method is not allowed */ - public function match(string $pathinfo): array; + public function match(string $pathinfo); } diff --git a/core/vendor/symfony/routing/RequestContext.php b/core/vendor/symfony/routing/RequestContext.php index 3ced6550a1..8994b266e6 100644 --- a/core/vendor/symfony/routing/RequestContext.php +++ b/core/vendor/symfony/routing/RequestContext.php @@ -23,15 +23,15 @@ */ class RequestContext { - private string $baseUrl; - private string $pathInfo; - private string $method; - private string $host; - private string $scheme; - private int $httpPort; - private int $httpsPort; - private string $queryString; - private array $parameters = []; + private $baseUrl; + private $pathInfo; + private $method; + private $host; + private $scheme; + private $httpPort; + private $httpsPort; + private $queryString; + private $parameters = []; public function __construct(string $baseUrl = '', string $method = 'GET', string $host = 'localhost', string $scheme = 'http', int $httpPort = 80, int $httpsPort = 443, string $path = '/', string $queryString = '') { @@ -67,7 +67,7 @@ public static function fromUri(string $uri, string $host = 'localhost', string $ * * @return $this */ - public function fromRequest(Request $request): static + public function fromRequest(Request $request) { $this->setBaseUrl($request->getBaseUrl()); $this->setPathInfo($request->getPathInfo()); @@ -83,8 +83,10 @@ public function fromRequest(Request $request): static /** * Gets the base URL. + * + * @return string */ - public function getBaseUrl(): string + public function getBaseUrl() { return $this->baseUrl; } @@ -94,7 +96,7 @@ public function getBaseUrl(): string * * @return $this */ - public function setBaseUrl(string $baseUrl): static + public function setBaseUrl(string $baseUrl) { $this->baseUrl = $baseUrl; @@ -103,8 +105,10 @@ public function setBaseUrl(string $baseUrl): static /** * Gets the path info. + * + * @return string */ - public function getPathInfo(): string + public function getPathInfo() { return $this->pathInfo; } @@ -114,7 +118,7 @@ public function getPathInfo(): string * * @return $this */ - public function setPathInfo(string $pathInfo): static + public function setPathInfo(string $pathInfo) { $this->pathInfo = $pathInfo; @@ -125,8 +129,10 @@ public function setPathInfo(string $pathInfo): static * Gets the HTTP method. * * The method is always an uppercased string. + * + * @return string */ - public function getMethod(): string + public function getMethod() { return $this->method; } @@ -136,7 +142,7 @@ public function getMethod(): string * * @return $this */ - public function setMethod(string $method): static + public function setMethod(string $method) { $this->method = strtoupper($method); @@ -147,8 +153,10 @@ public function setMethod(string $method): static * Gets the HTTP host. * * The host is always lowercased because it must be treated case-insensitive. + * + * @return string */ - public function getHost(): string + public function getHost() { return $this->host; } @@ -158,7 +166,7 @@ public function getHost(): string * * @return $this */ - public function setHost(string $host): static + public function setHost(string $host) { $this->host = strtolower($host); @@ -167,8 +175,10 @@ public function setHost(string $host): static /** * Gets the HTTP scheme. + * + * @return string */ - public function getScheme(): string + public function getScheme() { return $this->scheme; } @@ -178,7 +188,7 @@ public function getScheme(): string * * @return $this */ - public function setScheme(string $scheme): static + public function setScheme(string $scheme) { $this->scheme = strtolower($scheme); @@ -187,8 +197,10 @@ public function setScheme(string $scheme): static /** * Gets the HTTP port. + * + * @return int */ - public function getHttpPort(): int + public function getHttpPort() { return $this->httpPort; } @@ -198,7 +210,7 @@ public function getHttpPort(): int * * @return $this */ - public function setHttpPort(int $httpPort): static + public function setHttpPort(int $httpPort) { $this->httpPort = $httpPort; @@ -207,8 +219,10 @@ public function setHttpPort(int $httpPort): static /** * Gets the HTTPS port. + * + * @return int */ - public function getHttpsPort(): int + public function getHttpsPort() { return $this->httpsPort; } @@ -218,7 +232,7 @@ public function getHttpsPort(): int * * @return $this */ - public function setHttpsPort(int $httpsPort): static + public function setHttpsPort(int $httpsPort) { $this->httpsPort = $httpsPort; @@ -227,8 +241,10 @@ public function setHttpsPort(int $httpsPort): static /** * Gets the query string without the "?". + * + * @return string */ - public function getQueryString(): string + public function getQueryString() { return $this->queryString; } @@ -238,7 +254,7 @@ public function getQueryString(): string * * @return $this */ - public function setQueryString(?string $queryString): static + public function setQueryString(?string $queryString) { // string cast to be fault-tolerant, accepting null $this->queryString = (string) $queryString; @@ -248,8 +264,10 @@ public function setQueryString(?string $queryString): static /** * Returns the parameters. + * + * @return array */ - public function getParameters(): array + public function getParameters() { return $this->parameters; } @@ -261,7 +279,7 @@ public function getParameters(): array * * @return $this */ - public function setParameters(array $parameters): static + public function setParameters(array $parameters) { $this->parameters = $parameters; @@ -270,16 +288,20 @@ public function setParameters(array $parameters): static /** * Gets a parameter value. + * + * @return mixed */ - public function getParameter(string $name): mixed + public function getParameter(string $name) { return $this->parameters[$name] ?? null; } /** * Checks if a parameter value is set for the given parameter. + * + * @return bool */ - public function hasParameter(string $name): bool + public function hasParameter(string $name) { return \array_key_exists($name, $this->parameters); } @@ -287,9 +309,11 @@ public function hasParameter(string $name): bool /** * Sets a parameter value. * + * @param mixed $parameter The parameter value + * * @return $this */ - public function setParameter(string $name, mixed $parameter): static + public function setParameter(string $name, $parameter) { $this->parameters[$name] = $parameter; diff --git a/core/vendor/symfony/routing/RequestContextAwareInterface.php b/core/vendor/symfony/routing/RequestContextAwareInterface.php index 9ab31f6dfe..270a2b0849 100644 --- a/core/vendor/symfony/routing/RequestContextAwareInterface.php +++ b/core/vendor/symfony/routing/RequestContextAwareInterface.php @@ -20,6 +20,8 @@ public function setContext(RequestContext $context); /** * Gets the request context. + * + * @return RequestContext */ - public function getContext(): RequestContext; + public function getContext(); } diff --git a/core/vendor/symfony/routing/Route.php b/core/vendor/symfony/routing/Route.php index b2691333c9..c67bd2de53 100644 --- a/core/vendor/symfony/routing/Route.php +++ b/core/vendor/symfony/routing/Route.php @@ -19,15 +19,19 @@ */ class Route implements \Serializable { - private string $path = '/'; - private string $host = ''; - private array $schemes = []; - private array $methods = []; - private array $defaults = []; - private array $requirements = []; - private array $options = []; - private string $condition = ''; - private $compiled = null; + private $path = '/'; + private $host = ''; + private $schemes = []; + private $methods = []; + private $defaults = []; + private $requirements = []; + private $options = []; + private $condition = ''; + + /** + * @var CompiledRoute|null + */ + private $compiled; /** * Constructor. @@ -46,7 +50,7 @@ class Route implements \Serializable * @param string|string[] $methods A required HTTP method or an array of restricted methods * @param string|null $condition A condition that should evaluate to true for the route to match */ - public function __construct(string $path, array $defaults = [], array $requirements = [], array $options = [], ?string $host = '', string|array $schemes = [], string|array $methods = [], ?string $condition = '') + public function __construct(string $path, array $defaults = [], array $requirements = [], array $options = [], ?string $host = '', $schemes = [], $methods = [], ?string $condition = '') { $this->setPath($path); $this->addDefaults($defaults); @@ -78,7 +82,7 @@ public function __serialize(): array */ final public function serialize(): string { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); + return serialize($this->__serialize()); } public function __unserialize(array $data): void @@ -102,12 +106,15 @@ public function __unserialize(array $data): void /** * @internal */ - final public function unserialize(string $serialized) + final public function unserialize($serialized) { $this->__unserialize(unserialize($serialized)); } - public function getPath(): string + /** + * @return string + */ + public function getPath() { return $this->path; } @@ -115,7 +122,7 @@ public function getPath(): string /** * @return $this */ - public function setPath(string $pattern): static + public function setPath(string $pattern) { $pattern = $this->extractInlineDefaultsAndRequirements($pattern); @@ -127,7 +134,10 @@ public function setPath(string $pattern): static return $this; } - public function getHost(): string + /** + * @return string + */ + public function getHost() { return $this->host; } @@ -135,7 +145,7 @@ public function getHost(): string /** * @return $this */ - public function setHost(?string $pattern): static + public function setHost(?string $pattern) { $this->host = $this->extractInlineDefaultsAndRequirements((string) $pattern); $this->compiled = null; @@ -149,7 +159,7 @@ public function setHost(?string $pattern): static * * @return string[] */ - public function getSchemes(): array + public function getSchemes() { return $this->schemes; } @@ -162,7 +172,7 @@ public function getSchemes(): array * * @return $this */ - public function setSchemes(string|array $schemes): static + public function setSchemes($schemes) { $this->schemes = array_map('strtolower', (array) $schemes); $this->compiled = null; @@ -172,8 +182,10 @@ public function setSchemes(string|array $schemes): static /** * Checks if a scheme requirement has been set. + * + * @return bool */ - public function hasScheme(string $scheme): bool + public function hasScheme(string $scheme) { return \in_array(strtolower($scheme), $this->schemes, true); } @@ -184,7 +196,7 @@ public function hasScheme(string $scheme): bool * * @return string[] */ - public function getMethods(): array + public function getMethods() { return $this->methods; } @@ -197,7 +209,7 @@ public function getMethods(): array * * @return $this */ - public function setMethods(string|array $methods): static + public function setMethods($methods) { $this->methods = array_map('strtoupper', (array) $methods); $this->compiled = null; @@ -205,7 +217,10 @@ public function setMethods(string|array $methods): static return $this; } - public function getOptions(): array + /** + * @return array + */ + public function getOptions() { return $this->options; } @@ -213,7 +228,7 @@ public function getOptions(): array /** * @return $this */ - public function setOptions(array $options): static + public function setOptions(array $options) { $this->options = [ 'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler', @@ -225,7 +240,7 @@ public function setOptions(array $options): static /** * @return $this */ - public function addOptions(array $options): static + public function addOptions(array $options) { foreach ($options as $name => $option) { $this->options[$name] = $option; @@ -238,9 +253,11 @@ public function addOptions(array $options): static /** * Sets an option value. * + * @param mixed $value The option value + * * @return $this */ - public function setOption(string $name, mixed $value): static + public function setOption(string $name, $value) { $this->options[$name] = $value; $this->compiled = null; @@ -250,18 +267,26 @@ public function setOption(string $name, mixed $value): static /** * Returns the option value or null when not found. + * + * @return mixed */ - public function getOption(string $name): mixed + public function getOption(string $name) { return $this->options[$name] ?? null; } - public function hasOption(string $name): bool + /** + * @return bool + */ + public function hasOption(string $name) { return \array_key_exists($name, $this->options); } - public function getDefaults(): array + /** + * @return array + */ + public function getDefaults() { return $this->defaults; } @@ -269,7 +294,7 @@ public function getDefaults(): array /** * @return $this */ - public function setDefaults(array $defaults): static + public function setDefaults(array $defaults) { $this->defaults = []; @@ -279,7 +304,7 @@ public function setDefaults(array $defaults): static /** * @return $this */ - public function addDefaults(array $defaults): static + public function addDefaults(array $defaults) { if (isset($defaults['_locale']) && $this->isLocalized()) { unset($defaults['_locale']); @@ -293,20 +318,30 @@ public function addDefaults(array $defaults): static return $this; } - public function getDefault(string $name): mixed + /** + * @return mixed + */ + public function getDefault(string $name) { return $this->defaults[$name] ?? null; } - public function hasDefault(string $name): bool + /** + * @return bool + */ + public function hasDefault(string $name) { return \array_key_exists($name, $this->defaults); } /** + * Sets a default value. + * + * @param mixed $default The default value + * * @return $this */ - public function setDefault(string $name, mixed $default): static + public function setDefault(string $name, $default) { if ('_locale' === $name && $this->isLocalized()) { return $this; @@ -318,7 +353,10 @@ public function setDefault(string $name, mixed $default): static return $this; } - public function getRequirements(): array + /** + * @return array + */ + public function getRequirements() { return $this->requirements; } @@ -326,7 +364,7 @@ public function getRequirements(): array /** * @return $this */ - public function setRequirements(array $requirements): static + public function setRequirements(array $requirements) { $this->requirements = []; @@ -336,7 +374,7 @@ public function setRequirements(array $requirements): static /** * @return $this */ - public function addRequirements(array $requirements): static + public function addRequirements(array $requirements) { if (isset($requirements['_locale']) && $this->isLocalized()) { unset($requirements['_locale']); @@ -350,12 +388,18 @@ public function addRequirements(array $requirements): static return $this; } - public function getRequirement(string $key): ?string + /** + * @return string|null + */ + public function getRequirement(string $key) { return $this->requirements[$key] ?? null; } - public function hasRequirement(string $key): bool + /** + * @return bool + */ + public function hasRequirement(string $key) { return \array_key_exists($key, $this->requirements); } @@ -363,7 +407,7 @@ public function hasRequirement(string $key): bool /** * @return $this */ - public function setRequirement(string $key, string $regex): static + public function setRequirement(string $key, string $regex) { if ('_locale' === $key && $this->isLocalized()) { return $this; @@ -375,7 +419,10 @@ public function setRequirement(string $key, string $regex): static return $this; } - public function getCondition(): string + /** + * @return string + */ + public function getCondition() { return $this->condition; } @@ -383,7 +430,7 @@ public function getCondition(): string /** * @return $this */ - public function setCondition(?string $condition): static + public function setCondition(?string $condition) { $this->condition = (string) $condition; $this->compiled = null; @@ -394,12 +441,14 @@ public function setCondition(?string $condition): static /** * Compiles the route. * + * @return CompiledRoute + * * @throws \LogicException If the Route cannot be compiled because the * path or host pattern is invalid * * @see RouteCompiler which is responsible for the compilation process */ - public function compile(): CompiledRoute + public function compile() { if (null !== $this->compiled) { return $this->compiled; diff --git a/core/vendor/symfony/routing/RouteCollection.php b/core/vendor/symfony/routing/RouteCollection.php index c452aa0673..1b5ffd4384 100644 --- a/core/vendor/symfony/routing/RouteCollection.php +++ b/core/vendor/symfony/routing/RouteCollection.php @@ -32,7 +32,7 @@ class RouteCollection implements \IteratorAggregate, \Countable /** * @var array<string, Route> */ - private array $routes = []; + private $routes = []; /** * @var array<string, Alias> @@ -42,12 +42,12 @@ class RouteCollection implements \IteratorAggregate, \Countable /** * @var array<string, ResourceInterface> */ - private array $resources = []; + private $resources = []; /** * @var array<string, int> */ - private array $priorities = []; + private $priorities = []; public function __clone() { @@ -69,26 +69,37 @@ public function __clone() * * @return \ArrayIterator<string, Route> */ - public function getIterator(): \ArrayIterator + #[\ReturnTypeWillChange] + public function getIterator() { return new \ArrayIterator($this->all()); } /** * Gets the number of Routes in this collection. + * + * @return int */ - public function count(): int + #[\ReturnTypeWillChange] + public function count() { return \count($this->routes); } - public function add(string $name, Route $route, int $priority = 0) + /** + * @param int $priority + */ + public function add(string $name, Route $route/*, int $priority = 0*/) { + if (\func_num_args() < 3 && __CLASS__ !== static::class && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface && !$this instanceof \Mockery\MockInterface) { + trigger_deprecation('symfony/routing', '5.1', 'The "%s()" method will have a new "int $priority = 0" argument in version 6.0, not defining it is deprecated.', __METHOD__); + } + unset($this->routes[$name], $this->priorities[$name], $this->aliases[$name]); $this->routes[$name] = $route; - if ($priority) { + if ($priority = 3 <= \func_num_args() ? func_get_arg(2) : 0) { $this->priorities[$name] = $priority; } } @@ -98,7 +109,7 @@ public function add(string $name, Route $route, int $priority = 0) * * @return array<string, Route> */ - public function all(): array + public function all() { if ($this->priorities) { $priorities = $this->priorities; @@ -113,8 +124,10 @@ public function all(): array /** * Gets a route by name. + * + * @return Route|null */ - public function get(string $name): ?Route + public function get(string $name) { $visited = []; while (null !== $alias = $this->aliases[$name] ?? null) { @@ -142,7 +155,7 @@ public function get(string $name): ?Route * * @param string|string[] $name The route name or an array of route names */ - public function remove(string|array $name) + public function remove($name) { foreach ((array) $name as $n) { unset($this->routes[$n], $this->priorities[$n], $this->aliases[$n]); @@ -294,7 +307,7 @@ public function addOptions(array $options) * * @param string|string[] $schemes The scheme or an array of schemes */ - public function setSchemes(string|array $schemes) + public function setSchemes($schemes) { foreach ($this->routes as $route) { $route->setSchemes($schemes); @@ -306,7 +319,7 @@ public function setSchemes(string|array $schemes) * * @param string|string[] $methods The method or an array of methods */ - public function setMethods(string|array $methods) + public function setMethods($methods) { foreach ($this->routes as $route) { $route->setMethods($methods); @@ -318,7 +331,7 @@ public function setMethods(string|array $methods) * * @return ResourceInterface[] */ - public function getResources(): array + public function getResources() { return array_values($this->resources); } diff --git a/core/vendor/symfony/routing/RouteCollectionBuilder.php b/core/vendor/symfony/routing/RouteCollectionBuilder.php new file mode 100644 index 0000000000..d7eed31eb8 --- /dev/null +++ b/core/vendor/symfony/routing/RouteCollectionBuilder.php @@ -0,0 +1,364 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing; + +use Symfony\Component\Config\Exception\LoaderLoadException; +use Symfony\Component\Config\Loader\LoaderInterface; +use Symfony\Component\Config\Resource\ResourceInterface; +use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; + +trigger_deprecation('symfony/routing', '5.1', 'The "%s" class is deprecated, use "%s" instead.', RouteCollectionBuilder::class, RoutingConfigurator::class); + +/** + * Helps add and import routes into a RouteCollection. + * + * @author Ryan Weaver <ryan@knpuniversity.com> + * + * @deprecated since Symfony 5.1, use RoutingConfigurator instead + */ +class RouteCollectionBuilder +{ + /** + * @var Route[]|RouteCollectionBuilder[] + */ + private $routes = []; + + private $loader; + private $defaults = []; + private $prefix; + private $host; + private $condition; + private $requirements = []; + private $options = []; + private $schemes; + private $methods; + private $resources = []; + + public function __construct(LoaderInterface $loader = null) + { + $this->loader = $loader; + } + + /** + * Import an external routing resource and returns the RouteCollectionBuilder. + * + * $routes->import('blog.yml', '/blog'); + * + * @param mixed $resource + * + * @return self + * + * @throws LoaderLoadException + */ + public function import($resource, string $prefix = '/', string $type = null) + { + /** @var RouteCollection[] $collections */ + $collections = $this->load($resource, $type); + + // create a builder from the RouteCollection + $builder = $this->createBuilder(); + + foreach ($collections as $collection) { + if (null === $collection) { + continue; + } + + foreach ($collection->all() as $name => $route) { + $builder->addRoute($route, $name); + } + + foreach ($collection->getResources() as $resource) { + $builder->addResource($resource); + } + } + + // mount into this builder + $this->mount($prefix, $builder); + + return $builder; + } + + /** + * Adds a route and returns it for future modification. + * + * @return Route + */ + public function add(string $path, string $controller, string $name = null) + { + $route = new Route($path); + $route->setDefault('_controller', $controller); + $this->addRoute($route, $name); + + return $route; + } + + /** + * Returns a RouteCollectionBuilder that can be configured and then added with mount(). + * + * @return self + */ + public function createBuilder() + { + return new self($this->loader); + } + + /** + * Add a RouteCollectionBuilder. + */ + public function mount(string $prefix, self $builder) + { + $builder->prefix = trim(trim($prefix), '/'); + $this->routes[] = $builder; + } + + /** + * Adds a Route object to the builder. + * + * @return $this + */ + public function addRoute(Route $route, string $name = null) + { + if (null === $name) { + // used as a flag to know which routes will need a name later + $name = '_unnamed_route_'.spl_object_hash($route); + } + + $this->routes[$name] = $route; + + return $this; + } + + /** + * Sets the host on all embedded routes (unless already set). + * + * @return $this + */ + public function setHost(?string $pattern) + { + $this->host = $pattern; + + return $this; + } + + /** + * Sets a condition on all embedded routes (unless already set). + * + * @return $this + */ + public function setCondition(?string $condition) + { + $this->condition = $condition; + + return $this; + } + + /** + * Sets a default value that will be added to all embedded routes (unless that + * default value is already set). + * + * @param mixed $value + * + * @return $this + */ + public function setDefault(string $key, $value) + { + $this->defaults[$key] = $value; + + return $this; + } + + /** + * Sets a requirement that will be added to all embedded routes (unless that + * requirement is already set). + * + * @param mixed $regex + * + * @return $this + */ + public function setRequirement(string $key, $regex) + { + $this->requirements[$key] = $regex; + + return $this; + } + + /** + * Sets an option that will be added to all embedded routes (unless that + * option is already set). + * + * @param mixed $value + * + * @return $this + */ + public function setOption(string $key, $value) + { + $this->options[$key] = $value; + + return $this; + } + + /** + * Sets the schemes on all embedded routes (unless already set). + * + * @param array|string $schemes + * + * @return $this + */ + public function setSchemes($schemes) + { + $this->schemes = $schemes; + + return $this; + } + + /** + * Sets the methods on all embedded routes (unless already set). + * + * @param array|string $methods + * + * @return $this + */ + public function setMethods($methods) + { + $this->methods = $methods; + + return $this; + } + + /** + * Adds a resource for this collection. + * + * @return $this + */ + private function addResource(ResourceInterface $resource): self + { + $this->resources[] = $resource; + + return $this; + } + + /** + * Creates the final RouteCollection and returns it. + * + * @return RouteCollection + */ + public function build() + { + $routeCollection = new RouteCollection(); + + foreach ($this->routes as $name => $route) { + if ($route instanceof Route) { + $route->setDefaults(array_merge($this->defaults, $route->getDefaults())); + $route->setOptions(array_merge($this->options, $route->getOptions())); + + foreach ($this->requirements as $key => $val) { + if (!$route->hasRequirement($key)) { + $route->setRequirement($key, $val); + } + } + + if (null !== $this->prefix) { + $route->setPath('/'.$this->prefix.$route->getPath()); + } + + if (!$route->getHost()) { + $route->setHost($this->host); + } + + if (!$route->getCondition()) { + $route->setCondition($this->condition); + } + + if (!$route->getSchemes()) { + $route->setSchemes($this->schemes); + } + + if (!$route->getMethods()) { + $route->setMethods($this->methods); + } + + // auto-generate the route name if it's been marked + if ('_unnamed_route_' === substr($name, 0, 15)) { + $name = $this->generateRouteName($route); + } + + $routeCollection->add($name, $route); + } else { + /* @var self $route */ + $subCollection = $route->build(); + if (null !== $this->prefix) { + $subCollection->addPrefix($this->prefix); + } + + $routeCollection->addCollection($subCollection); + } + } + + foreach ($this->resources as $resource) { + $routeCollection->addResource($resource); + } + + return $routeCollection; + } + + /** + * Generates a route name based on details of this route. + */ + private function generateRouteName(Route $route): string + { + $methods = implode('_', $route->getMethods()).'_'; + + $routeName = $methods.$route->getPath(); + $routeName = str_replace(['/', ':', '|', '-'], '_', $routeName); + $routeName = preg_replace('/[^a-z0-9A-Z_.]+/', '', $routeName); + + // Collapse consecutive underscores down into a single underscore. + $routeName = preg_replace('/_+/', '_', $routeName); + + return $routeName; + } + + /** + * Finds a loader able to load an imported resource and loads it. + * + * @param mixed $resource A resource + * @param string|null $type The resource type or null if unknown + * + * @return RouteCollection[] + * + * @throws LoaderLoadException If no loader is found + */ + private function load($resource, string $type = null): array + { + if (null === $this->loader) { + throw new \BadMethodCallException('Cannot import other routing resources: you must pass a LoaderInterface when constructing RouteCollectionBuilder.'); + } + + if ($this->loader->supports($resource, $type)) { + $collections = $this->loader->load($resource, $type); + + return \is_array($collections) ? $collections : [$collections]; + } + + if (null === $resolver = $this->loader->getResolver()) { + throw new LoaderLoadException($resource, null, 0, null, $type); + } + + if (false === $loader = $resolver->resolve($resource, $type)) { + throw new LoaderLoadException($resource, null, 0, null, $type); + } + + $collections = $loader->load($resource, $type); + + return \is_array($collections) ? $collections : [$collections]; + } +} diff --git a/core/vendor/symfony/routing/RouteCompiler.php b/core/vendor/symfony/routing/RouteCompiler.php index 9a48595d8e..7e78c2931e 100644 --- a/core/vendor/symfony/routing/RouteCompiler.php +++ b/core/vendor/symfony/routing/RouteCompiler.php @@ -19,6 +19,11 @@ */ class RouteCompiler implements RouteCompilerInterface { + /** + * @deprecated since Symfony 5.1, to be removed in 6.0 + */ + public const REGEX_DELIMITER = '#'; + /** * This string defines the characters that are automatically considered separators in front of * optional placeholders (with default and no static text following). Such a single separator @@ -42,7 +47,7 @@ class RouteCompiler implements RouteCompilerInterface * @throws \DomainException if a variable name starts with a digit or if it is too long to be successfully used as * a PCRE subpattern */ - public static function compile(Route $route): CompiledRoute + public static function compile(Route $route) { $hostVariables = []; $variables = []; diff --git a/core/vendor/symfony/routing/RouteCompilerInterface.php b/core/vendor/symfony/routing/RouteCompilerInterface.php index 6215611764..9bae33a914 100644 --- a/core/vendor/symfony/routing/RouteCompilerInterface.php +++ b/core/vendor/symfony/routing/RouteCompilerInterface.php @@ -21,8 +21,10 @@ interface RouteCompilerInterface /** * Compiles the current route instance. * + * @return CompiledRoute + * * @throws \LogicException If the Route cannot be compiled because the * path or host pattern is invalid */ - public static function compile(Route $route): CompiledRoute; + public static function compile(Route $route); } diff --git a/core/vendor/symfony/routing/Router.php b/core/vendor/symfony/routing/Router.php index be653e4f00..fbab1a79fc 100644 --- a/core/vendor/symfony/routing/Router.php +++ b/core/vendor/symfony/routing/Router.php @@ -82,16 +82,22 @@ class Router implements RouterInterface, RequestMatcherInterface */ protected $defaultLocale; + /** + * @var ConfigCacheFactoryInterface|null + */ private $configCacheFactory; /** * @var ExpressionFunctionProviderInterface[] */ - private array $expressionLanguageProviders = []; + private $expressionLanguageProviders = []; - private static ?array $cache = []; + private static $cache = []; - public function __construct(LoaderInterface $loader, mixed $resource, array $options = [], RequestContext $context = null, LoggerInterface $logger = null, string $defaultLocale = null) + /** + * @param mixed $resource The main resource to load + */ + public function __construct(LoaderInterface $loader, $resource, array $options = [], RequestContext $context = null, LoggerInterface $logger = null, string $defaultLocale = null) { $this->loader = $loader; $this->resource = $resource; @@ -149,9 +155,11 @@ public function setOptions(array $options) /** * Sets an option. * + * @param mixed $value The value + * * @throws \InvalidArgumentException */ - public function setOption(string $key, mixed $value) + public function setOption(string $key, $value) { if (!\array_key_exists($key, $this->options)) { throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); @@ -163,9 +171,11 @@ public function setOption(string $key, mixed $value) /** * Gets an option value. * + * @return mixed + * * @throws \InvalidArgumentException */ - public function getOption(string $key): mixed + public function getOption(string $key) { if (!\array_key_exists($key, $this->options)) { throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); @@ -204,7 +214,7 @@ public function setContext(RequestContext $context) /** * {@inheritdoc} */ - public function getContext(): RequestContext + public function getContext() { return $this->context; } @@ -220,7 +230,7 @@ public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFa /** * {@inheritdoc} */ - public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string + public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH) { return $this->getGenerator()->generate($name, $parameters, $referenceType); } @@ -228,7 +238,7 @@ public function generate(string $name, array $parameters = [], int $referenceTyp /** * {@inheritdoc} */ - public function match(string $pathinfo): array + public function match(string $pathinfo) { return $this->getMatcher()->match($pathinfo); } @@ -236,7 +246,7 @@ public function match(string $pathinfo): array /** * {@inheritdoc} */ - public function matchRequest(Request $request): array + public function matchRequest(Request $request) { $matcher = $this->getMatcher(); if (!$matcher instanceof RequestMatcherInterface) { @@ -249,8 +259,10 @@ public function matchRequest(Request $request): array /** * Gets the UrlMatcher or RequestMatcher instance associated with this Router. + * + * @return UrlMatcherInterface|RequestMatcherInterface */ - public function getMatcher(): UrlMatcherInterface|RequestMatcherInterface + public function getMatcher() { if (null !== $this->matcher) { return $this->matcher; @@ -290,8 +302,10 @@ function (ConfigCacheInterface $cache) { /** * Gets the UrlGenerator instance associated with this Router. + * + * @return UrlGeneratorInterface */ - public function getGenerator(): UrlGeneratorInterface + public function getGenerator() { if (null !== $this->generator) { return $this->generator; @@ -331,12 +345,18 @@ public function addExpressionLanguageProvider(ExpressionFunctionProviderInterfac $this->expressionLanguageProviders[] = $provider; } - protected function getGeneratorDumperInstance(): GeneratorDumperInterface + /** + * @return GeneratorDumperInterface + */ + protected function getGeneratorDumperInstance() { return new $this->options['generator_dumper_class']($this->getRouteCollection()); } - protected function getMatcherDumperInstance(): MatcherDumperInterface + /** + * @return MatcherDumperInterface + */ + protected function getMatcherDumperInstance() { return new $this->options['matcher_dumper_class']($this->getRouteCollection()); } @@ -347,7 +367,11 @@ protected function getMatcherDumperInstance(): MatcherDumperInterface */ private function getConfigCacheFactory(): ConfigCacheFactoryInterface { - return $this->configCacheFactory ??= new ConfigCacheFactory($this->options['debug']); + if (null === $this->configCacheFactory) { + $this->configCacheFactory = new ConfigCacheFactory($this->options['debug']); + } + + return $this->configCacheFactory; } private static function getCompiledRoutes(string $path): array @@ -360,6 +384,10 @@ private static function getCompiledRoutes(string $path): array return require $path; } - return self::$cache[$path] ??= require $path; + if (isset(self::$cache[$path])) { + return self::$cache[$path]; + } + + return self::$cache[$path] = require $path; } } diff --git a/core/vendor/symfony/routing/composer.json b/core/vendor/symfony/routing/composer.json index c0b13443b9..b978c06263 100644 --- a/core/vendor/symfony/routing/composer.json +++ b/core/vendor/symfony/routing/composer.json @@ -16,22 +16,24 @@ } ], "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { - "symfony/config": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", + "symfony/config": "^5.3|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", "doctrine/annotations": "^1.12", "psr/log": "^1|^2|^3" }, "conflict": { "doctrine/annotations": "<1.12", - "symfony/config": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/yaml": "<5.4" + "symfony/config": "<5.3", + "symfony/dependency-injection": "<4.4", + "symfony/yaml": "<4.4" }, "suggest": { "symfony/http-foundation": "For using a Symfony Request object", diff --git a/core/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/core/vendor/symfony/service-contracts/Attribute/SubscribedService.php deleted file mode 100644 index 10d1bc38e8..0000000000 --- a/core/vendor/symfony/service-contracts/Attribute/SubscribedService.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -use Symfony\Contracts\Service\ServiceSubscriberTrait; - -/** - * Use with {@see ServiceSubscriberTrait} to mark a method's return type - * as a subscribed service. - * - * @author Kevin Bond <kevinbond@gmail.com> - */ -#[\Attribute(\Attribute::TARGET_METHOD)] -final class SubscribedService -{ - /** - * @param string|null $key The key to use for the service - * If null, use "ClassName::methodName" - */ - public function __construct( - public ?string $key = null - ) { - } -} diff --git a/core/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/core/vendor/symfony/service-contracts/ServiceLocatorTrait.php index 19d3e80ff9..74dfa4362e 100644 --- a/core/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ b/core/vendor/symfony/service-contracts/ServiceLocatorTrait.php @@ -26,9 +26,9 @@ class_exists(NotFoundExceptionInterface::class); */ trait ServiceLocatorTrait { - private array $factories; - private array $loading = []; - private array $providedTypes; + private $factories; + private $loading = []; + private $providedTypes; /** * @param callable[] $factories @@ -40,16 +40,20 @@ public function __construct(array $factories) /** * {@inheritdoc} + * + * @return bool */ - public function has(string $id): bool + public function has(string $id) { return isset($this->factories[$id]); } /** * {@inheritdoc} + * + * @return mixed */ - public function get(string $id): mixed + public function get(string $id) { if (!isset($this->factories[$id])) { throw $this->createNotFoundException($id); @@ -76,7 +80,7 @@ public function get(string $id): mixed */ public function getProvidedServices(): array { - if (!isset($this->providedTypes)) { + if (null === $this->providedTypes) { $this->providedTypes = []; foreach ($this->factories as $name => $factory) { diff --git a/core/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/core/vendor/symfony/service-contracts/ServiceSubscriberInterface.php index 881ab971aa..098ab908cd 100644 --- a/core/vendor/symfony/service-contracts/ServiceSubscriberInterface.php +++ b/core/vendor/symfony/service-contracts/ServiceSubscriberInterface.php @@ -49,5 +49,5 @@ interface ServiceSubscriberInterface * * @return string[] The required service types, optionally keyed by service names */ - public static function getSubscribedServices(): array; + public static function getSubscribedServices(); } diff --git a/core/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/core/vendor/symfony/service-contracts/ServiceSubscriberTrait.php index f7db0361bc..0c08530374 100644 --- a/core/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ b/core/vendor/symfony/service-contracts/ServiceSubscriberTrait.php @@ -12,11 +12,10 @@ namespace Symfony\Contracts\Service; use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\Attribute\SubscribedService; /** * Implementation of ServiceSubscriberInterface that determines subscribed services from - * method return types. Service ids are available as "ClassName::methodName". + * private method return types. Service ids are available as "ClassName::methodName". * * @author Kevin Bond <kevinbond@gmail.com> */ @@ -39,29 +38,23 @@ public static function getSubscribedServices(): array $services = \is_callable(['parent', __FUNCTION__]) ? parent::getSubscribedServices() : []; foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if (self::class !== $method->getDeclaringClass()->name) { + if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { continue; } - if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { + if (self::class !== $method->getDeclaringClass()->name) { continue; } - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); - } - - if (!$returnType = $method->getReturnType()) { - throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); + if (!($returnType = $method->getReturnType()) instanceof \ReflectionNamedType) { + continue; } - $serviceId = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; - - if ($returnType->allowsNull()) { - $serviceId = '?'.$serviceId; + if ($returnType->isBuiltin()) { + continue; } - $services[$attribute->newInstance()->key ?? self::class.'::'.$method->name] = $serviceId; + $services[self::class.'::'.$method->name] = '?'.$returnType->getName(); } return $services; @@ -69,8 +62,10 @@ public static function getSubscribedServices(): array /** * @required + * + * @return ContainerInterface|null */ - public function setContainer(ContainerInterface $container): ?ContainerInterface + public function setContainer(ContainerInterface $container) { $this->container = $container; diff --git a/core/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/core/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php index 88f6a0687a..2a1b565f50 100644 --- a/core/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ b/core/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php @@ -17,7 +17,10 @@ abstract class ServiceLocatorTest extends TestCase { - protected function getServiceLocator(array $factories): ContainerInterface + /** + * @return ContainerInterface + */ + protected function getServiceLocator(array $factories) { return new class($factories) implements ContainerInterface { use ServiceLocatorTrait; diff --git a/core/vendor/symfony/service-contracts/composer.json b/core/vendor/symfony/service-contracts/composer.json index d3b047f9a4..ad4105cef1 100644 --- a/core/vendor/symfony/service-contracts/composer.json +++ b/core/vendor/symfony/service-contracts/composer.json @@ -16,8 +16,8 @@ } ], "require": { - "php": ">=8.0.2", - "psr/container": "^2.0" + "php": ">=7.2.5", + "psr/container": "^1.1" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -31,7 +31,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/core/vendor/voku/portable-ascii/.whitesource b/core/vendor/voku/portable-ascii/.whitesource new file mode 100644 index 0000000000..55b922e8c1 --- /dev/null +++ b/core/vendor/voku/portable-ascii/.whitesource @@ -0,0 +1,12 @@ +{ + "scanSettings": { + "baseBranches": [] + }, + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure", + "displayMode": "diff" + }, + "issueSettings": { + "minSeverityLevel": "LOW" + } +} \ No newline at end of file diff --git a/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php b/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php index 68c3f9d254..d51f557a1d 100644 --- a/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php +++ b/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php @@ -1060,9 +1060,9 @@ 'Я' => 'Ya', 'я' => 'ya', ], - // Russian - GOST 7.79-2000(B) + // Russian - Passport (2013), ICAO // -> https://en.m.wikipedia.org/wiki/Romanization_of_Russian#content-collapsible-block-1 - 'ru__gost_2000_b' => [ + 'ru__passport_2013' => [ 'А' => 'A', 'а' => 'a', 'Б' => 'B', @@ -1075,8 +1075,8 @@ 'д' => 'd', 'Е' => 'E', 'е' => 'e', - 'Ё' => 'Yo', - 'ё' => 'yo', + 'Ё' => 'E', + 'ё' => 'e', 'Ж' => 'Zh', 'ж' => 'zh', 'З' => 'Z', @@ -1107,42 +1107,42 @@ 'у' => 'u', 'Ф' => 'F', 'ф' => 'f', - 'Х' => 'X', - 'х' => 'x', - 'Ц' => 'Cz', - 'ц' => 'cz', + 'Х' => 'Kh', + 'х' => 'kh', + 'Ц' => 'Ts', + 'ц' => 'ts', 'Ч' => 'Ch', 'ч' => 'ch', 'ш' => 'sh', 'Ш' => 'Sh', - 'Щ' => 'Shh', - 'щ' => 'shh', - 'Ъ' => '', - 'ъ' => '', - 'Ы' => 'Y\'', - 'ы' => 'y\'', + 'Щ' => 'Shch', + 'щ' => 'shch', + 'Ъ' => 'Ie', + 'ъ' => 'ie', + 'Ы' => 'Y', + 'ы' => 'y', 'Ь' => '', 'ь' => '', - 'Э' => 'E\'', - 'э' => 'e\'', - 'Ю' => 'Yu', - 'ю' => 'yu', - 'Я' => 'Ya', - 'я' => 'ya', - 'І' => 'I', - 'і' => 'i', - 'Ѳ' => 'Fh', - 'ѳ' => 'fh', - 'Ѣ' => 'Ye', - 'ѣ' => 'ye', - 'Ѵ' => 'Yh', - 'ѵ' => 'yh', + 'Э' => 'E', + 'э' => 'e', + 'Ю' => 'Iu', + 'ю' => 'iu', + 'Я' => 'Ia', + 'я' => 'ia', + 'І' => '', + 'і' => '', + 'Ѳ' => '', + 'ѳ' => '', + 'Ѣ' => '', + 'ѣ' => '', + 'Ѵ' => '', + 'ѵ' => '', 'Є' => '', 'є' => '', 'Ѥ' => '', 'ѥ' => '', - 'Ѕ' => 'Js', - 'ѕ' => 'js', + 'Ѕ' => '', + 'ѕ' => '', 'Ꙋ' => '', 'ꙋ' => '', 'Ѡ' => '', @@ -1162,9 +1162,9 @@ 'Ѱ' => '', 'ѱ' => '', ], - // Russian - Passport (2013), ICAO + // Russian - GOST 7.79-2000(B) // -> https://en.m.wikipedia.org/wiki/Romanization_of_Russian#content-collapsible-block-1 - 'ru__passport_2013' => [ + 'ru__gost_2000_b' => [ 'А' => 'A', 'а' => 'a', 'Б' => 'B', @@ -1177,8 +1177,8 @@ 'д' => 'd', 'Е' => 'E', 'е' => 'e', - 'Ё' => 'E', - 'ё' => 'e', + 'Ё' => 'Yo', + 'ё' => 'yo', 'Ж' => 'Zh', 'ж' => 'zh', 'З' => 'Z', @@ -1209,42 +1209,42 @@ 'у' => 'u', 'Ф' => 'F', 'ф' => 'f', - 'Х' => 'Kh', - 'х' => 'kh', - 'Ц' => 'Ts', - 'ц' => 'ts', + 'Х' => 'X', + 'х' => 'x', + 'Ц' => 'Cz', + 'ц' => 'cz', 'Ч' => 'Ch', 'ч' => 'ch', 'ш' => 'sh', 'Ш' => 'Sh', - 'Щ' => 'Shch', - 'щ' => 'shch', - 'Ъ' => 'Ie', - 'ъ' => 'ie', - 'Ы' => 'Y', - 'ы' => 'y', + 'Щ' => 'Shh', + 'щ' => 'shh', + 'Ъ' => '', + 'ъ' => '', + 'Ы' => 'Y\'', + 'ы' => 'y\'', 'Ь' => '', 'ь' => '', - 'Э' => 'E', - 'э' => 'e', - 'Ю' => 'Iu', - 'ю' => 'iu', - 'Я' => 'Ia', - 'я' => 'ia', - 'І' => '', - 'і' => '', - 'Ѳ' => '', - 'ѳ' => '', - 'Ѣ' => '', - 'ѣ' => '', - 'Ѵ' => '', - 'ѵ' => '', + 'Э' => 'E\'', + 'э' => 'e\'', + 'Ю' => 'Yu', + 'ю' => 'yu', + 'Я' => 'Ya', + 'я' => 'ya', + 'І' => 'I', + 'і' => 'i', + 'Ѳ' => 'Fh', + 'ѳ' => 'fh', + 'Ѣ' => 'Ye', + 'ѣ' => 'ye', + 'Ѵ' => 'Yh', + 'ѵ' => 'yh', 'Є' => '', 'є' => '', 'Ѥ' => '', 'ѥ' => '', - 'Ѕ' => '', - 'ѕ' => '', + 'Ѕ' => 'Js', + 'ѕ' => 'js', 'Ꙋ' => '', 'ꙋ' => '', 'Ѡ' => '', @@ -1265,32 +1265,15 @@ 'ѱ' => '', ], // Ukrainian - // -> https://zakon.rada.gov.ua/laws/show/55-2010-%D0%BF?lang=en 'uk' => [ - 'Г' => 'H', - 'г' => 'h', - 'Ґ' => 'G', - 'ґ' => 'g', 'Є' => 'Ye', 'є' => 'ye', - 'И' => 'Y', - 'и' => 'y', 'І' => 'I', 'і' => 'i', 'Ї' => 'Yi', 'ї' => 'yi', - 'Й' => 'Y', - 'й' => 'y', - 'Х' => 'Kh', - 'х' => 'kh', - 'Ц' => 'Ts', - 'ц' => 'ts', - 'Ч' => 'Ch', - 'ч' => 'ch', - 'Ш' => 'Sh', - 'ш' => 'sh', - 'Щ' => 'Shch', - 'щ' => 'shch', + 'Ґ' => 'G', + 'ґ' => 'g', ], // Kazakh 'kk' => [ @@ -1619,10 +1602,10 @@ 'fa' => [ 'ا' => 'a', 'ب' => 'b', - 'پ' => 'p', + 'پ' => 'b', 'ت' => 't', 'ث' => 's', - 'ج' => 'j', + 'ج' => 'g', 'چ' => 'ch', 'ح' => 'h', 'خ' => 'kh', @@ -2572,8 +2555,6 @@ 'j̄' => 'j', 'J̃' => 'J', 'j̃' => 'j', - 'Й' => 'i', - 'й' => 'i', 'ĸ' => 'k', 'Ĺ' => 'L', 'Ľ' => 'L', @@ -2829,8 +2810,6 @@ 'ȳ' => 'y', 'Ỹ' => 'Y', 'ỹ' => 'y', - 'Щ' => 'Shh', - 'щ' => 'shh', 'Ź' => 'Z', 'ź' => 'z', 'Z̀' => 'Z', diff --git a/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php b/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php index afe31ae2cc..426d84a4dc 100644 --- a/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php +++ b/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php @@ -199,8 +199,8 @@ '&' => ' i ', '+' => ' plus ', ], - // Russian - GOST 7.79-2000(B) - 'ru__gost_2000_b' => [ + // Russian - Passport (2013), ICAO + 'ru__passport_2013' => [ '=' => ' ravnyj ', '%' => ' procent ', '∑' => ' summa ', @@ -210,8 +210,8 @@ '&' => ' i ', '+' => ' plus ', ], - // Russian - Passport (2013), ICAO - 'ru__passport_2013' => [ + // Russian - GOST 7.79-2000(B) + 'ru__gost_2000_b' => [ '=' => ' ravnyj ', '%' => ' procent ', '∑' => ' summa ', diff --git a/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php b/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php index da81ae2366..a6345f2138 100644 --- a/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php +++ b/core/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php @@ -31,8 +31,8 @@ 'fi' => 1, 'ka' => 1, 'ru' => 1, - 'ru__gost_2000_b' => 1, 'ru__passport_2013' => 1, + 'ru__gost_2000_b' => 1, 'uk' => 1, 'kk' => 1, 'cs' => 1,