diff --git a/composer.json b/composer.json index 38fe497..f6c340a 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "ext-mbstring": "*", "scrivo/highlight.php": "v9.18.1.7", "erusev/parsedown": "^1.7", - "illuminate/database": "^8.56", + "illuminate/database": "^9.4", "ext-redis": "*" }, "autoload": { diff --git a/composer.lock b/composer.lock index a92b356..4f49a62 100644 --- a/composer.lock +++ b/composer.lock @@ -4,38 +4,34 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3f69538fd6ba08d52949041b03fc4c9c", + "content-hash": "04f306e84ef4ecc60decf6fb96ac490c", "packages": [ { "name": "doctrine/inflector", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210" + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" @@ -83,7 +79,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.x" + "source": "https://github.com/doctrine/inflector/tree/2.0.4" }, "funding": [ { @@ -99,7 +95,7 @@ "type": "tidelift" } ], - "time": "2020-05-29T15:13:26+00:00" + "time": "2021-10-22T20:16:43+00:00" }, { "name": "erusev/parsedown", @@ -153,39 +149,40 @@ }, { "name": "illuminate/collections", - "version": "v8.57.0", + "version": "v9.4.1", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "673d71d9db2827b04c096c4fe9739edddea14ac4" + "reference": "22c4bb17f4e6c6fb470b5957e8232b1b5baf76b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/673d71d9db2827b04c096c4fe9739edddea14ac4", - "reference": "673d71d9db2827b04c096c4fe9739edddea14ac4", + "url": "https://api.github.com/repos/illuminate/collections/zipball/22c4bb17f4e6c6fb470b5957e8232b1b5baf76b0", + "reference": "22c4bb17f4e6c6fb470b5957e8232b1b5baf76b0", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "php": "^7.3|^8.0" + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "php": "^8.0.2" }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^5.1.4)." + "symfony/var-dumper": "Required to use the dump method (^6.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, "files": [ "helpers.php" - ] + ], + "psr-4": { + "Illuminate\\Support\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -203,34 +200,80 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-25T13:02:21+00:00" + "time": "2022-03-07T15:02:25+00:00" }, { - "name": "illuminate/container", - "version": "v8.57.0", + "name": "illuminate/conditionable", + "version": "v9.4.1", "source": { "type": "git", - "url": "https://github.com/illuminate/container.git", - "reference": "ecb645e1838cdee62eebd07ded490b1de5505f35" + "url": "https://github.com/illuminate/conditionable.git", + "reference": "56b4ba1166c264064bf63896f498a2bee320d16a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/ecb645e1838cdee62eebd07ded490b1de5505f35", - "reference": "ecb645e1838cdee62eebd07ded490b1de5505f35", + "url": "https://api.github.com/repos/illuminate/conditionable/zipball/56b4ba1166c264064bf63896f498a2bee320d16a", + "reference": "56b4ba1166c264064bf63896f498a2bee320d16a", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "php": "^7.3|^8.0", - "psr/container": "^1.0" - }, - "provide": { - "psr/container-implementation": "1.0" + "php": "^8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "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-28T16:37:46+00:00" + }, + { + "name": "illuminate/container", + "version": "v9.4.1", + "source": { + "type": "git", + "url": "https://github.com/illuminate/container.git", + "reference": "66f9049b19fb34e74134c6eeff92a442cee068e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/container/zipball/66f9049b19fb34e74134c6eeff92a442cee068e5", + "reference": "66f9049b19fb34e74134c6eeff92a442cee068e5", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^9.0", + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1" + }, + "provide": { + "psr/container-implementation": "1.1|2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" } }, "autoload": { @@ -254,31 +297,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-03T13:42:24+00:00" + "time": "2022-03-03T14:08:19+00:00" }, { "name": "illuminate/contracts", - "version": "v8.57.0", + "version": "v9.4.1", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "7354badf7b57eae805a56d1163fb023e0f58a639" + "reference": "ce68106c575410c71f92ac1c91c5d95c561033bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/7354badf7b57eae805a56d1163fb023e0f58a639", - "reference": "7354badf7b57eae805a56d1163fb023e0f58a639", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/ce68106c575410c71f92ac1c91c5d95c561033bc", + "reference": "ce68106c575410c71f92ac1c91c5d95c561033bc", "shasum": "" }, "require": { - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -302,45 +345,45 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-24T21:29:28+00:00" + "time": "2022-03-04T18:18:32+00:00" }, { "name": "illuminate/database", - "version": "v8.57.0", + "version": "v9.4.1", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "828d1cd4ee824c405f6edc52ab3d333b549be4ee" + "reference": "0fffd6ba91eb58330cbf7331c77ea38c2a16b5d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/828d1cd4ee824c405f6edc52ab3d333b549be4ee", - "reference": "828d1cd4ee824c405f6edc52ab3d333b549be4ee", + "url": "https://api.github.com/repos/illuminate/database/zipball/0fffd6ba91eb58330cbf7331c77ea38c2a16b5d9", + "reference": "0fffd6ba91eb58330cbf7331c77ea38c2a16b5d9", "shasum": "" }, "require": { "ext-json": "*", - "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.1.4" + "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" }, "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", + "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 (^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.1.4)." + "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)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -370,29 +413,29 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-26T14:48:34+00:00" + "time": "2022-03-07T01:28:38+00:00" }, { "name": "illuminate/macroable", - "version": "v8.57.0", + "version": "v9.4.1", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", - "reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05" + "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/300aa13c086f25116b5f3cde3ca54ff5c822fb05", - "reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/25a2c6dac2b7541ecbadef952702e84ae15f5354", + "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354", "shasum": "" }, "require": { - "php": "^7.3|^8.0" + "php": "^8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -416,57 +459,58 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2020-10-27T15:20:30+00:00" + "time": "2022-02-01T14:44:21+00:00" }, { "name": "illuminate/support", - "version": "v8.57.0", + "version": "v9.4.1", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "5e8f059a5d1f298324e847822b997778a3472128" + "reference": "568ed7a21a75e0bd9ca641b6c4a626872ee26d6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/5e8f059a5d1f298324e847822b997778a3472128", - "reference": "5e8f059a5d1f298324e847822b997778a3472128", + "url": "https://api.github.com/repos/illuminate/support/zipball/568ed7a21a75e0bd9ca641b6c4a626872ee26d6f", + "reference": "568ed7a21a75e0bd9ca641b6c4a626872ee26d6f", "shasum": "" }, "require": { - "doctrine/inflector": "^1.4|^2.0", + "doctrine/inflector": "^2.0", "ext-json": "*", "ext-mbstring": "*", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "nesbot/carbon": "^2.31", - "php": "^7.3|^8.0", - "voku/portable-ascii": "^1.4.8" + "illuminate/collections": "^9.0", + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "nesbot/carbon": "^2.53.1", + "php": "^8.0.2", + "voku/portable-ascii": "^2.0" }, "conflict": { "tightenco/collect": "<5.5.33" }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0).", - "ramsey/uuid": "Required to use Str::uuid() (^4.0).", - "symfony/process": "Required to use the composer class (^5.1.4).", - "symfony/var-dumper": "Required to use the dd function (^5.1.4).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." + "illuminate/filesystem": "Required to use the composer class (^9.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^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).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, "files": [ "helpers.php" - ] + ], + "psr-4": { + "Illuminate\\Support\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -484,20 +528,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-25T13:04:37+00:00" + "time": "2022-03-08T14:39:38+00:00" }, { "name": "nesbot/carbon", - "version": "2.52.0", + "version": "2.57.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "369c0e2737c56a0f39c946dd261855255a6fccbe" + "reference": "4a54375c21eea4811dbd1149fe6b246517554e78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/369c0e2737c56a0f39c946dd261855255a6fccbe", - "reference": "369c0e2737c56a0f39c946dd261855255a6fccbe", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4a54375c21eea4811dbd1149fe6b246517554e78", + "reference": "4a54375c21eea4811dbd1149fe6b246517554e78", "shasum": "" }, "require": { @@ -505,15 +549,16 @@ "php": "^7.1.8 || ^8.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0" + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", "doctrine/orm": "^2.7", - "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^0.12.54 || ^1.0", "phpunit/phpunit": "^7.5.20 || ^8.5.14", "squizlabs/php_codesniffer": "^3.4" }, @@ -565,6 +610,7 @@ "time" ], "support": { + "docs": "https://carbon.nesbot.com/docs", "issues": "https://github.com/briannesbitt/Carbon/issues", "source": "https://github.com/briannesbitt/Carbon" }, @@ -578,26 +624,31 @@ "type": "tidelift" } ], - "time": "2021-08-14T19:10:52+00:00" + "time": "2022-02-13T18:13:33+00:00" }, { "name": "psr/container", - "version": "1.1.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -624,31 +675,31 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/simple-cache", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -663,7 +714,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -675,9 +726,9 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" }, - "time": "2017-10-23T01:57:42+00:00" + "time": "2021-10-29T13:26:27+00:00" }, { "name": "scrivo/highlight.php", @@ -757,46 +808,42 @@ }, { "name": "symfony/console", - "version": "v5.3.6", + "version": "v6.0.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" + "reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "url": "https://api.github.com/repos/symfony/console/zipball/3bebf4108b9e07492a2a4057d207aa5a77d146b1", + "reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "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" }, "suggest": { "psr/log": "For using the console logger", @@ -836,7 +883,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.6" + "source": "https://github.com/symfony/console/tree/v6.0.5" }, "funding": [ { @@ -852,92 +899,28 @@ "type": "tidelift" } ], - "time": "2021-07-27T19:10:22+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.4-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/v2.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2022-02-25T10:48:52+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, @@ -952,12 +935,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -982,7 +965,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" }, "funding": [ { @@ -998,20 +981,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { @@ -1031,12 +1014,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1063,7 +1046,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" }, "funding": [ { @@ -1079,11 +1062,11 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-23T21:10:46+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -1112,12 +1095,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1147,7 +1130,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { @@ -1167,21 +1150,24 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -1196,12 +1182,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1227,7 +1213,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -1243,99 +1229,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { @@ -1352,12 +1259,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1389,7 +1296,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -1405,25 +1312,28 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2022-03-04T08:16:47+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.4.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603", + "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1" + "php": ">=8.0.2", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" @@ -1431,7 +1341,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1468,7 +1378,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.0.0" }, "funding": [ { @@ -1484,44 +1394,46 @@ "type": "tidelift" } ], - "time": "2021-04-01T10:43:52+00:00" + "time": "2021-11-04T17:53:12+00:00" }, { "name": "symfony/string", - "version": "v5.3.3", + "version": "v6.0.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "url": "https://api.github.com/repos/symfony/string/zipball/522144f0c4c004c80d56fa47e40e17028e2eefc2", + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "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" + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" }, "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" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, "files": [ "Resources/functions.php" ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, "exclude-from-classmap": [ "/Tests/" ] @@ -1551,7 +1463,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.3" + "source": "https://github.com/symfony/string/tree/v6.0.3" }, "funding": [ { @@ -1567,50 +1479,50 @@ "type": "tidelift" } ], - "time": "2021-06-27T11:44:38+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/translation", - "version": "v5.3.4", + "version": "v6.0.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "d89ad7292932c2699cbe4af98d72c5c6bbc504c1" + "reference": "f6639cb9b5e0c57fe31e3263b900a77eedb0c908" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/d89ad7292932c2699cbe4af98d72c5c6bbc504c1", - "reference": "d89ad7292932c2699cbe4af98d72c5c6bbc504c1", + "url": "https://api.github.com/repos/symfony/translation/zipball/f6639cb9b5e0c57fe31e3263b900a77eedb0c908", + "reference": "f6639cb9b5e0c57fe31e3263b900a77eedb0c908", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" + "symfony/translation-contracts": "^2.3|^3.0" }, "conflict": { - "symfony/config": "<4.4", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" + "symfony/config": "<5.4", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4" }, "provide": { - "symfony/translation-implementation": "2.3" + "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/finder": "^4.4|^5.0", - "symfony/http-kernel": "^5.0", - "symfony/intl": "^4.4|^5.0", + "symfony/config": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^4.4|^5.0" + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^5.4|^6.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -1646,7 +1558,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.3.4" + "source": "https://github.com/symfony/translation/tree/v6.0.6" }, "funding": [ { @@ -1662,24 +1574,24 @@ "type": "tidelift" } ], - "time": "2021-07-25T09:39:16+00:00" + "time": "2022-03-02T12:58:14+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.4.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95" + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" @@ -1687,7 +1599,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1724,7 +1636,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" }, "funding": [ { @@ -1740,20 +1652,20 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2021-09-07T12:43:40+00:00" }, { "name": "voku/portable-ascii", - "version": "1.5.6", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "80953678b19901e5165c56752d087fc11526017c" + "reference": "b56450eed252f6801410d810c8e1727224ae0743" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c", - "reference": "80953678b19901e5165c56752d087fc11526017c", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", + "reference": "b56450eed252f6801410d810c8e1727224ae0743", "shasum": "" }, "require": { @@ -1790,7 +1702,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/1.5.6" + "source": "https://github.com/voku/portable-ascii/tree/2.0.1" }, "funding": [ { @@ -1814,7 +1726,7 @@ "type": "tidelift" } ], - "time": "2020-11-12T00:07:28+00:00" + "time": "2022-03-08T17:03:00+00:00" } ], "packages-dev": [], @@ -1827,8 +1739,9 @@ "ext-pdo": "*", "ext-openssl": "*", "ext-gd": "*", - "ext-mbstring": "*" + "ext-mbstring": "*", + "ext-redis": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/vendor/bin/carbon b/vendor/bin/carbon deleted file mode 120000 index 0da4804..0000000 --- a/vendor/bin/carbon +++ /dev/null @@ -1 +0,0 @@ -../nesbot/carbon/bin/carbon \ No newline at end of file diff --git a/vendor/bin/carbon b/vendor/bin/carbon new file mode 100755 index 0000000..d6da140 --- /dev/null +++ b/vendor/bin/carbon @@ -0,0 +1,117 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + 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; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + 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('phpvfscomposer', 'Composer\BinProxyWrapper')) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'); + exit(0); + } +} + +include __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'; diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 6d0c3f2..afef3fa 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,30 +42,75 @@ namespace Composer\Autoload; */ class ClassLoader { + /** @var ?string */ private $vendorDir; // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ private static $registeredLoaders = array(); + /** + * @param ?string $vendorDir + */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; } + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -75,28 +120,47 @@ class ClassLoader return array(); } + /** + * @return array[] + * @psalm-return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-return array + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -111,9 +175,11 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -156,11 +222,13 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -204,8 +272,10 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -220,10 +290,12 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -243,6 +315,8 @@ class ClassLoader * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -265,6 +339,8 @@ class ClassLoader * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -285,6 +361,8 @@ class ClassLoader * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -305,6 +383,8 @@ class ClassLoader * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { @@ -324,6 +404,8 @@ class ClassLoader /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { @@ -403,6 +485,11 @@ class ClassLoader return self::$registeredLoaders; } + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -474,6 +561,10 @@ class ClassLoader * Scope isolated include. * * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private */ function includeFile($file) { diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index b3a4e16..d50e0c9 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -20,12 +20,25 @@ use Composer\Semver\VersionParser; * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * - * To require it's presence, you can require `composer-runtime-api ^2.0` + * To require its presence, you can require `composer-runtime-api ^2.0` */ class InstalledVersions { + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ private static $installed; + + /** + * @var bool|null + */ private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ private static $installedByVendor = array(); /** @@ -228,7 +241,7 @@ class InstalledVersions /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} */ public static function getRootPackage() { @@ -242,7 +255,7 @@ class InstalledVersions * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} */ public static function getRawData() { @@ -265,7 +278,7 @@ class InstalledVersions * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -288,7 +301,7 @@ class InstalledVersions * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} $data + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data */ public static function reload($data) { @@ -298,7 +311,7 @@ class InstalledVersions /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 83006fa..53268f2 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -8,8 +8,8 @@ $baseDir = dirname($vendorDir); return array( 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index e87db70..aa2f25f 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -7,15 +7,13 @@ $baseDir = dirname($vendorDir); return array( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', + '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', - '60799491728b879e74601d83e38b2cad' => $vendorDir . '/illuminate/collections/helpers.php', 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '60799491728b879e74601d83e38b2cad' => $vendorDir . '/illuminate/collections/helpers.php', '72579e7bd17821bb1321b87411366eae' => $vendorDir . '/illuminate/support/helpers.php', 'b6ec61354e97f32c0ae683041c78392a' => $vendorDir . '/scrivo/highlight.php/HighlightUtilities/functions.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index fa123d3..2f5b6bc 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -8,7 +8,6 @@ $baseDir = dirname($vendorDir); return array( 'voku\\' => array($vendorDir . '/voku/portable-ascii/src/voku'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), 'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'), @@ -21,7 +20,7 @@ return array( 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'PonePaste\\' => array($baseDir . '/includes'), - 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/support'), + 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/conditionable', $vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/support'), 'Illuminate\\Database\\' => array($vendorDir . '/illuminate/database'), 'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'), 'Illuminate\\Container\\' => array($vendorDir . '/illuminate/container'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 4409b16..3f53fab 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -65,11 +65,16 @@ class ComposerAutoloaderInit5bf95489f4eff2c10ec062bf7ba377da } } +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ function composerRequire5bf95489f4eff2c10ec062bf7ba377da($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 595d445..c8090a5 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -8,15 +8,13 @@ class ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', + '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', - '60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php', 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php', '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php', 'b6ec61354e97f32c0ae683041c78392a' => __DIR__ . '/..' . '/scrivo/highlight.php/HighlightUtilities/functions.php', ); @@ -29,7 +27,6 @@ class ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da 'S' => array ( 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Php73\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, 'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31, @@ -72,10 +69,6 @@ class ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', ), - 'Symfony\\Polyfill\\Php73\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', - ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', @@ -126,9 +119,10 @@ class ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da ), 'Illuminate\\Support\\' => array ( - 0 => __DIR__ . '/..' . '/illuminate/collections', + 0 => __DIR__ . '/..' . '/illuminate/conditionable', 1 => __DIR__ . '/..' . '/illuminate/macroable', - 2 => __DIR__ . '/..' . '/illuminate/support', + 2 => __DIR__ . '/..' . '/illuminate/collections', + 3 => __DIR__ . '/..' . '/illuminate/support', ), 'Illuminate\\Database\\' => array ( @@ -176,8 +170,8 @@ class ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da public static $classMap = array ( 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 93ebfbe..e87d54f 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2,36 +2,32 @@ "packages": [ { "name": "doctrine/inflector", - "version": "2.0.3", - "version_normalized": "2.0.3.0", + "version": "2.0.4", + "version_normalized": "2.0.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210" + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" }, - "time": "2020-05-29T15:13:26+00:00", + "time": "2021-10-22T20:16:43+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -80,7 +76,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.x" + "source": "https://github.com/doctrine/inflector/tree/2.0.4" }, "funding": [ { @@ -153,42 +149,43 @@ }, { "name": "illuminate/collections", - "version": "v8.57.0", - "version_normalized": "8.57.0.0", + "version": "v9.4.1", + "version_normalized": "9.4.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "673d71d9db2827b04c096c4fe9739edddea14ac4" + "reference": "22c4bb17f4e6c6fb470b5957e8232b1b5baf76b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/673d71d9db2827b04c096c4fe9739edddea14ac4", - "reference": "673d71d9db2827b04c096c4fe9739edddea14ac4", + "url": "https://api.github.com/repos/illuminate/collections/zipball/22c4bb17f4e6c6fb470b5957e8232b1b5baf76b0", + "reference": "22c4bb17f4e6c6fb470b5957e8232b1b5baf76b0", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "php": "^7.3|^8.0" + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "php": "^8.0.2" }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^5.1.4)." + "symfony/var-dumper": "Required to use the dump method (^6.0)." }, - "time": "2021-08-25T13:02:21+00:00", + "time": "2022-03-07T15:02:25+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, "files": [ "helpers.php" - ] + ], + "psr-4": { + "Illuminate\\Support\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -209,33 +206,82 @@ "install-path": "../illuminate/collections" }, { - "name": "illuminate/container", - "version": "v8.57.0", - "version_normalized": "8.57.0.0", + "name": "illuminate/conditionable", + "version": "v9.4.1", + "version_normalized": "9.4.1.0", "source": { "type": "git", - "url": "https://github.com/illuminate/container.git", - "reference": "ecb645e1838cdee62eebd07ded490b1de5505f35" + "url": "https://github.com/illuminate/conditionable.git", + "reference": "56b4ba1166c264064bf63896f498a2bee320d16a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/ecb645e1838cdee62eebd07ded490b1de5505f35", - "reference": "ecb645e1838cdee62eebd07ded490b1de5505f35", + "url": "https://api.github.com/repos/illuminate/conditionable/zipball/56b4ba1166c264064bf63896f498a2bee320d16a", + "reference": "56b4ba1166c264064bf63896f498a2bee320d16a", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "php": "^7.3|^8.0", - "psr/container": "^1.0" + "php": "^8.0.2" }, - "provide": { - "psr/container-implementation": "1.0" - }, - "time": "2021-08-03T13:42:24+00:00", + "time": "2022-02-28T16:37:46+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "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/container", + "version": "v9.4.1", + "version_normalized": "9.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/container.git", + "reference": "66f9049b19fb34e74134c6eeff92a442cee068e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/container/zipball/66f9049b19fb34e74134c6eeff92a442cee068e5", + "reference": "66f9049b19fb34e74134c6eeff92a442cee068e5", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^9.0", + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1" + }, + "provide": { + "psr/container-implementation": "1.1|2.0" + }, + "time": "2022-03-03T14:08:19+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -264,29 +310,29 @@ }, { "name": "illuminate/contracts", - "version": "v8.57.0", - "version_normalized": "8.57.0.0", + "version": "v9.4.1", + "version_normalized": "9.4.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "7354badf7b57eae805a56d1163fb023e0f58a639" + "reference": "ce68106c575410c71f92ac1c91c5d95c561033bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/7354badf7b57eae805a56d1163fb023e0f58a639", - "reference": "7354badf7b57eae805a56d1163fb023e0f58a639", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/ce68106c575410c71f92ac1c91c5d95c561033bc", + "reference": "ce68106c575410c71f92ac1c91c5d95c561033bc", "shasum": "" }, "require": { - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" }, - "time": "2021-08-24T21:29:28+00:00", + "time": "2022-03-04T18:18:32+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -315,43 +361,43 @@ }, { "name": "illuminate/database", - "version": "v8.57.0", - "version_normalized": "8.57.0.0", + "version": "v9.4.1", + "version_normalized": "9.4.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "828d1cd4ee824c405f6edc52ab3d333b549be4ee" + "reference": "0fffd6ba91eb58330cbf7331c77ea38c2a16b5d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/828d1cd4ee824c405f6edc52ab3d333b549be4ee", - "reference": "828d1cd4ee824c405f6edc52ab3d333b549be4ee", + "url": "https://api.github.com/repos/illuminate/database/zipball/0fffd6ba91eb58330cbf7331c77ea38c2a16b5d9", + "reference": "0fffd6ba91eb58330cbf7331c77ea38c2a16b5d9", "shasum": "" }, "require": { "ext-json": "*", - "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.1.4" + "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" }, "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", + "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 (^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.1.4)." + "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)." }, - "time": "2021-08-26T14:48:34+00:00", + "time": "2022-03-07T01:28:38+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -386,27 +432,27 @@ }, { "name": "illuminate/macroable", - "version": "v8.57.0", - "version_normalized": "8.57.0.0", + "version": "v9.4.1", + "version_normalized": "9.4.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", - "reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05" + "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/300aa13c086f25116b5f3cde3ca54ff5c822fb05", - "reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/25a2c6dac2b7541ecbadef952702e84ae15f5354", + "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354", "shasum": "" }, "require": { - "php": "^7.3|^8.0" + "php": "^8.0.2" }, - "time": "2020-10-27T15:20:30+00:00", + "time": "2022-02-01T14:44:21+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -435,56 +481,57 @@ }, { "name": "illuminate/support", - "version": "v8.57.0", - "version_normalized": "8.57.0.0", + "version": "v9.4.1", + "version_normalized": "9.4.1.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "5e8f059a5d1f298324e847822b997778a3472128" + "reference": "568ed7a21a75e0bd9ca641b6c4a626872ee26d6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/5e8f059a5d1f298324e847822b997778a3472128", - "reference": "5e8f059a5d1f298324e847822b997778a3472128", + "url": "https://api.github.com/repos/illuminate/support/zipball/568ed7a21a75e0bd9ca641b6c4a626872ee26d6f", + "reference": "568ed7a21a75e0bd9ca641b6c4a626872ee26d6f", "shasum": "" }, "require": { - "doctrine/inflector": "^1.4|^2.0", + "doctrine/inflector": "^2.0", "ext-json": "*", "ext-mbstring": "*", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "nesbot/carbon": "^2.31", - "php": "^7.3|^8.0", - "voku/portable-ascii": "^1.4.8" + "illuminate/collections": "^9.0", + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "nesbot/carbon": "^2.53.1", + "php": "^8.0.2", + "voku/portable-ascii": "^2.0" }, "conflict": { "tightenco/collect": "<5.5.33" }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0).", - "ramsey/uuid": "Required to use Str::uuid() (^4.0).", - "symfony/process": "Required to use the composer class (^5.1.4).", - "symfony/var-dumper": "Required to use the dd function (^5.1.4).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." + "illuminate/filesystem": "Required to use the composer class (^9.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^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).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, - "time": "2021-08-25T13:04:37+00:00", + "time": "2022-03-08T14:39:38+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, "files": [ "helpers.php" - ] + ], + "psr-4": { + "Illuminate\\Support\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -506,17 +553,17 @@ }, { "name": "nesbot/carbon", - "version": "2.52.0", - "version_normalized": "2.52.0.0", + "version": "2.57.0", + "version_normalized": "2.57.0.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "369c0e2737c56a0f39c946dd261855255a6fccbe" + "reference": "4a54375c21eea4811dbd1149fe6b246517554e78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/369c0e2737c56a0f39c946dd261855255a6fccbe", - "reference": "369c0e2737c56a0f39c946dd261855255a6fccbe", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4a54375c21eea4811dbd1149fe6b246517554e78", + "reference": "4a54375c21eea4811dbd1149fe6b246517554e78", "shasum": "" }, "require": { @@ -524,19 +571,20 @@ "php": "^7.1.8 || ^8.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0" + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", "doctrine/orm": "^2.7", - "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^0.12.54 || ^1.0", "phpunit/phpunit": "^7.5.20 || ^8.5.14", "squizlabs/php_codesniffer": "^3.4" }, - "time": "2021-08-14T19:10:52+00:00", + "time": "2022-02-13T18:13:33+00:00", "bin": [ "bin/carbon" ], @@ -586,6 +634,7 @@ "time" ], "support": { + "docs": "https://carbon.nesbot.com/docs", "issues": "https://github.com/briannesbitt/Carbon/issues", "source": "https://github.com/briannesbitt/Carbon" }, @@ -603,24 +652,29 @@ }, { "name": "psr/container", - "version": "1.1.1", - "version_normalized": "1.1.1.0", + "version": "2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, - "time": "2021-03-05T17:36:06+00:00", + "time": "2021-11-05T16:47:00+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "installation-source": "dist", "autoload": { "psr-4": { @@ -648,33 +702,33 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, "install-path": "../psr/container" }, { "name": "psr/simple-cache", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, - "time": "2017-10-23T01:57:42+00:00", + "time": "2021-10-29T13:26:27+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "installation-source": "dist", @@ -690,7 +744,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -702,7 +756,7 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" }, "install-path": "../psr/simple-cache" }, @@ -787,47 +841,43 @@ }, { "name": "symfony/console", - "version": "v5.3.6", - "version_normalized": "5.3.6.0", + "version": "v6.0.5", + "version_normalized": "6.0.5.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" + "reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "url": "https://api.github.com/repos/symfony/console/zipball/3bebf4108b9e07492a2a4057d207aa5a77d146b1", + "reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "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" }, "suggest": { "psr/log": "For using the console logger", @@ -835,7 +885,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2021-07-27T19:10:22+00:00", + "time": "2022-02-25T10:48:52+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -869,7 +919,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.6" + "source": "https://github.com/symfony/console/tree/v6.0.5" }, "funding": [ { @@ -887,98 +937,31 @@ ], "install-path": "../symfony/console" }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.4.0", - "version_normalized": "2.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-03-23T23:28:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "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/v2.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, - "time": "2021-02-19T12:13:01+00:00", + "time": "2021-10-20T20:35:02+00:00", "type": "library", "extra": { "branch-alias": { @@ -991,12 +974,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1021,7 +1004,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" }, "funding": [ { @@ -1041,17 +1024,17 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { @@ -1060,7 +1043,7 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2021-05-27T12:26:48+00:00", + "time": "2021-11-23T21:10:46+00:00", "type": "library", "extra": { "branch-alias": { @@ -1073,12 +1056,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1105,7 +1088,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" }, "funding": [ { @@ -1125,8 +1108,8 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -1157,12 +1140,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1192,7 +1175,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { @@ -1212,26 +1195,29 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, - "time": "2021-05-27T12:26:48+00:00", + "time": "2021-11-30T18:21:41+00:00", "type": "library", "extra": { "branch-alias": { @@ -1244,12 +1230,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1275,7 +1261,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -1293,107 +1279,25 @@ ], "install-path": "../symfony/polyfill-mbstring" }, - { - "name": "symfony/polyfill-php73", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-02-19T12:13:01+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": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php73" - }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-07-28T13:41:28+00:00", + "time": "2022-03-04T08:16:47+00:00", "type": "library", "extra": { "branch-alias": { @@ -1406,12 +1310,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1443,7 +1347,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -1463,31 +1367,34 @@ }, { "name": "symfony/service-contracts", - "version": "v2.4.0", - "version_normalized": "2.4.0.0", + "version": "v3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603", + "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1" + "php": ">=8.0.2", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" }, - "time": "2021-04-01T10:43:52+00:00", + "time": "2021-11-04T17:53:12+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1525,7 +1432,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.0.0" }, "funding": [ { @@ -1545,43 +1452,45 @@ }, { "name": "symfony/string", - "version": "v5.3.3", - "version_normalized": "5.3.3.0", + "version": "v6.0.3", + "version_normalized": "6.0.3.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "url": "https://api.github.com/repos/symfony/string/zipball/522144f0c4c004c80d56fa47e40e17028e2eefc2", + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "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" + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" }, "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" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, - "time": "2021-06-27T11:44:38+00:00", + "time": "2022-01-02T09:55:41+00:00", "type": "library", "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, "files": [ "Resources/functions.php" ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, "exclude-from-classmap": [ "/Tests/" ] @@ -1611,7 +1520,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.3" + "source": "https://github.com/symfony/string/tree/v6.0.3" }, "funding": [ { @@ -1631,54 +1540,54 @@ }, { "name": "symfony/translation", - "version": "v5.3.4", - "version_normalized": "5.3.4.0", + "version": "v6.0.6", + "version_normalized": "6.0.6.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "d89ad7292932c2699cbe4af98d72c5c6bbc504c1" + "reference": "f6639cb9b5e0c57fe31e3263b900a77eedb0c908" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/d89ad7292932c2699cbe4af98d72c5c6bbc504c1", - "reference": "d89ad7292932c2699cbe4af98d72c5c6bbc504c1", + "url": "https://api.github.com/repos/symfony/translation/zipball/f6639cb9b5e0c57fe31e3263b900a77eedb0c908", + "reference": "f6639cb9b5e0c57fe31e3263b900a77eedb0c908", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" + "symfony/translation-contracts": "^2.3|^3.0" }, "conflict": { - "symfony/config": "<4.4", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" + "symfony/config": "<5.4", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4" }, "provide": { - "symfony/translation-implementation": "2.3" + "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/finder": "^4.4|^5.0", - "symfony/http-kernel": "^5.0", - "symfony/intl": "^4.4|^5.0", + "symfony/config": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^4.4|^5.0" + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^5.4|^6.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", "symfony/config": "", "symfony/yaml": "" }, - "time": "2021-07-25T09:39:16+00:00", + "time": "2022-03-02T12:58:14+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1709,7 +1618,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.3.4" + "source": "https://github.com/symfony/translation/tree/v6.0.6" }, "funding": [ { @@ -1729,30 +1638,30 @@ }, { "name": "symfony/translation-contracts", - "version": "v2.4.0", - "version_normalized": "2.4.0.0", + "version": "v3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95" + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" }, - "time": "2021-03-23T23:28:01+00:00", + "time": "2021-09-07T12:43:40+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1790,7 +1699,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" }, "funding": [ { @@ -1810,17 +1719,17 @@ }, { "name": "voku/portable-ascii", - "version": "1.5.6", - "version_normalized": "1.5.6.0", + "version": "2.0.1", + "version_normalized": "2.0.1.0", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "80953678b19901e5165c56752d087fc11526017c" + "reference": "b56450eed252f6801410d810c8e1727224ae0743" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c", - "reference": "80953678b19901e5165c56752d087fc11526017c", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", + "reference": "b56450eed252f6801410d810c8e1727224ae0743", "shasum": "" }, "require": { @@ -1832,7 +1741,7 @@ "suggest": { "ext-intl": "Use Intl for transliterator_transliterate() support" }, - "time": "2020-11-12T00:07:28+00:00", + "time": "2022-03-08T17:03:00+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1859,7 +1768,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/1.5.6" + "source": "https://github.com/voku/portable-ascii/tree/2.0.1" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 8021b5c..14aa73b 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '070545e294d5191c315f4691080b63cd083955b1', + 'reference' => '3c0fc75d296bbf2703fa00ff1a7ece4cc9c2164e', 'name' => 'aftercase/ponepaste', 'dev' => true, ), @@ -16,16 +16,16 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '070545e294d5191c315f4691080b63cd083955b1', + 'reference' => '3c0fc75d296bbf2703fa00ff1a7ece4cc9c2164e', 'dev_requirement' => false, ), 'doctrine/inflector' => array( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), - 'reference' => '9cf661f4eb38f7c881cac67c75ea9b00bf97b210', + 'reference' => '8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89', 'dev_requirement' => false, ), 'erusev/parsedown' => array( @@ -38,96 +38,105 @@ 'dev_requirement' => false, ), 'illuminate/collections' => array( - 'pretty_version' => 'v8.57.0', - 'version' => '8.57.0.0', + 'pretty_version' => 'v9.4.1', + 'version' => '9.4.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/collections', 'aliases' => array(), - 'reference' => '673d71d9db2827b04c096c4fe9739edddea14ac4', + 'reference' => '22c4bb17f4e6c6fb470b5957e8232b1b5baf76b0', + 'dev_requirement' => false, + ), + 'illuminate/conditionable' => array( + 'pretty_version' => 'v9.4.1', + 'version' => '9.4.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/conditionable', + 'aliases' => array(), + 'reference' => '56b4ba1166c264064bf63896f498a2bee320d16a', 'dev_requirement' => false, ), 'illuminate/container' => array( - 'pretty_version' => 'v8.57.0', - 'version' => '8.57.0.0', + 'pretty_version' => 'v9.4.1', + 'version' => '9.4.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), - 'reference' => 'ecb645e1838cdee62eebd07ded490b1de5505f35', + 'reference' => '66f9049b19fb34e74134c6eeff92a442cee068e5', 'dev_requirement' => false, ), 'illuminate/contracts' => array( - 'pretty_version' => 'v8.57.0', - 'version' => '8.57.0.0', + 'pretty_version' => 'v9.4.1', + 'version' => '9.4.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), - 'reference' => '7354badf7b57eae805a56d1163fb023e0f58a639', + 'reference' => 'ce68106c575410c71f92ac1c91c5d95c561033bc', 'dev_requirement' => false, ), 'illuminate/database' => array( - 'pretty_version' => 'v8.57.0', - 'version' => '8.57.0.0', + 'pretty_version' => 'v9.4.1', + 'version' => '9.4.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/database', 'aliases' => array(), - 'reference' => '828d1cd4ee824c405f6edc52ab3d333b549be4ee', + 'reference' => '0fffd6ba91eb58330cbf7331c77ea38c2a16b5d9', 'dev_requirement' => false, ), 'illuminate/macroable' => array( - 'pretty_version' => 'v8.57.0', - 'version' => '8.57.0.0', + 'pretty_version' => 'v9.4.1', + 'version' => '9.4.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/macroable', 'aliases' => array(), - 'reference' => '300aa13c086f25116b5f3cde3ca54ff5c822fb05', + 'reference' => '25a2c6dac2b7541ecbadef952702e84ae15f5354', 'dev_requirement' => false, ), 'illuminate/support' => array( - 'pretty_version' => 'v8.57.0', - 'version' => '8.57.0.0', + 'pretty_version' => 'v9.4.1', + 'version' => '9.4.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/support', 'aliases' => array(), - 'reference' => '5e8f059a5d1f298324e847822b997778a3472128', + 'reference' => '568ed7a21a75e0bd9ca641b6c4a626872ee26d6f', 'dev_requirement' => false, ), 'nesbot/carbon' => array( - 'pretty_version' => '2.52.0', - 'version' => '2.52.0.0', + 'pretty_version' => '2.57.0', + 'version' => '2.57.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../nesbot/carbon', 'aliases' => array(), - 'reference' => '369c0e2737c56a0f39c946dd261855255a6fccbe', + 'reference' => '4a54375c21eea4811dbd1149fe6b246517554e78', 'dev_requirement' => false, ), 'psr/container' => array( - 'pretty_version' => '1.1.1', - 'version' => '1.1.1.0', + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'dev_requirement' => false, ), 'psr/container-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '1.0', + 0 => '1.1|2.0', ), ), 'psr/log-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '1.0|2.0', + 0 => '1.0|2.0|3.0', ), ), 'psr/simple-cache' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '3.0.0', + 'version' => '3.0.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), - 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', + 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'dev_requirement' => false, ), 'scrivo/highlight.php' => array( @@ -140,44 +149,35 @@ 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v5.3.6', - 'version' => '5.3.6.0', + 'pretty_version' => 'v6.0.5', + 'version' => '6.0.5.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), - 'reference' => '51b71afd6d2dc8f5063199357b9880cea8d8bfe2', - 'dev_requirement' => false, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v2.4.0', - 'version' => '2.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'reference' => '5f38c8804a9e97d23e0c8d63341088cd8a22d627', + 'reference' => '3bebf4108b9e07492a2a4057d207aa5a77d146b1', 'dev_requirement' => false, ), 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), - 'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', + 'reference' => '30885182c981ab175d4d034db0f6f469898070ab', 'dev_requirement' => false, ), 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', 'aliases' => array(), - 'reference' => '16880ba9c5ebe3642d1995ab866db29270b36535', + 'reference' => '81b86b50cf841a64252b439e738e97f4a34e2783', 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), @@ -185,81 +185,72 @@ 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php73' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php73', - 'aliases' => array(), - 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010', + 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', + 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', 'dev_requirement' => false, ), 'symfony/service-contracts' => array( - 'pretty_version' => 'v2.4.0', - 'version' => '2.4.0.0', + 'pretty_version' => 'v3.0.0', + 'version' => '3.0.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), - 'reference' => 'f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb', + 'reference' => '36715ebf9fb9db73db0cb24263c79077c6fe8603', 'dev_requirement' => false, ), 'symfony/string' => array( - 'pretty_version' => 'v5.3.3', - 'version' => '5.3.3.0', + 'pretty_version' => 'v6.0.3', + 'version' => '6.0.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), - 'reference' => 'bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1', + 'reference' => '522144f0c4c004c80d56fa47e40e17028e2eefc2', 'dev_requirement' => false, ), 'symfony/translation' => array( - 'pretty_version' => 'v5.3.4', - 'version' => '5.3.4.0', + 'pretty_version' => 'v6.0.6', + 'version' => '6.0.6.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), - 'reference' => 'd89ad7292932c2699cbe4af98d72c5c6bbc504c1', + 'reference' => 'f6639cb9b5e0c57fe31e3263b900a77eedb0c908', 'dev_requirement' => false, ), 'symfony/translation-contracts' => array( - 'pretty_version' => 'v2.4.0', - 'version' => '2.4.0.0', + 'pretty_version' => 'v3.0.0', + 'version' => '3.0.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation-contracts', 'aliases' => array(), - 'reference' => '95c812666f3e91db75385749fe219c5e494c7f95', + 'reference' => '1b6ea5a7442af5a12dba3dbd6d71034b5b234e77', 'dev_requirement' => false, ), 'symfony/translation-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '2.3', + 0 => '2.3|3.0', ), ), 'voku/portable-ascii' => array( - 'pretty_version' => '1.5.6', - 'version' => '1.5.6.0', + 'pretty_version' => '2.0.1', + 'version' => '2.0.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../voku/portable-ascii', 'aliases' => array(), - 'reference' => '80953678b19901e5165c56752d087fc11526017c', + 'reference' => 'b56450eed252f6801410d810c8e1727224ae0743', 'dev_requirement' => false, ), ), diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index 92370c5..b168ddd 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70300)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 80002)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/vendor/doctrine/inflector/README.md b/vendor/doctrine/inflector/README.md index 341f8b2..6e3a97f 100644 --- a/vendor/doctrine/inflector/README.md +++ b/vendor/doctrine/inflector/README.md @@ -3,6 +3,5 @@ Doctrine Inflector is a small library that can perform string manipulations with regard to uppercase/lowercase and singular/plural forms of words. -[![Build Status](https://travis-ci.org/doctrine/inflector.svg)](https://travis-ci.org/doctrine/inflector) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/inflector/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/doctrine/inflector/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/doctrine/inflector/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/inflector/?branch=master) +[![Build Status](https://github.com/doctrine/inflector/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/inflector/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.0.x) +[![Code Coverage](https://codecov.io/gh/doctrine/inflector/branch/2.0.x/graph/badge.svg)](https://codecov.io/gh/doctrine/inflector/branch/2.0.x) diff --git a/vendor/doctrine/inflector/composer.json b/vendor/doctrine/inflector/composer.json index 0cd85e5..f08fdc3 100644 --- a/vendor/doctrine/inflector/composer.json +++ b/vendor/doctrine/inflector/composer.json @@ -16,11 +16,12 @@ "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" }, "autoload": { "psr-4": { @@ -31,10 +32,5 @@ "psr-4": { "Doctrine\\Tests\\Inflector\\": "tests/Doctrine/Tests/Inflector" } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } } } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php index b59ac46..2d52908 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php @@ -17,7 +17,7 @@ class CachedWordInflector implements WordInflector $this->wordInflector = $wordInflector; } - public function inflect(string $word) : string + public function inflect(string $word): string { return $this->cache[$word] ?? $this->cache[$word] = $this->wordInflector->inflect($word); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php index 1b15061..166061d 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector; use Doctrine\Inflector\Rules\Ruleset; + use function array_unshift; abstract class GenericLanguageInflectorFactory implements LanguageInflectorFactory @@ -21,7 +22,7 @@ abstract class GenericLanguageInflectorFactory implements LanguageInflectorFacto $this->pluralRulesets[] = $this->getPluralRuleset(); } - final public function build() : Inflector + final public function build(): Inflector { return new Inflector( new CachedWordInflector(new RulesetInflector( @@ -33,7 +34,7 @@ abstract class GenericLanguageInflectorFactory implements LanguageInflectorFacto ); } - final public function withSingularRules(?Ruleset $singularRules, bool $reset = false) : LanguageInflectorFactory + final public function withSingularRules(?Ruleset $singularRules, bool $reset = false): LanguageInflectorFactory { if ($reset) { $this->singularRulesets = []; @@ -46,7 +47,7 @@ abstract class GenericLanguageInflectorFactory implements LanguageInflectorFacto return $this; } - final public function withPluralRules(?Ruleset $pluralRules, bool $reset = false) : LanguageInflectorFactory + final public function withPluralRules(?Ruleset $pluralRules, bool $reset = false): LanguageInflectorFactory { if ($reset) { $this->pluralRulesets = []; @@ -59,7 +60,7 @@ abstract class GenericLanguageInflectorFactory implements LanguageInflectorFacto return $this; } - abstract protected function getSingularRuleset() : Ruleset; + abstract protected function getSingularRuleset(): Ruleset; - abstract protected function getPluralRuleset() : Ruleset; + abstract protected function getPluralRuleset(): Ruleset; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php index 2411918..610a4cf 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector; use RuntimeException; + use function chr; use function function_exists; use function lcfirst; @@ -228,7 +229,7 @@ class Inflector /** * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. */ - public function tableize(string $word) : string + public function tableize(string $word): string { $tableized = preg_replace('~(?<=\\w)([A-Z])~u', '_$1', $word); @@ -245,7 +246,7 @@ class Inflector /** * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'. */ - public function classify(string $word) : string + public function classify(string $word): string { return str_replace([' ', '_', '-'], '', ucwords($word, ' _-')); } @@ -253,7 +254,7 @@ class Inflector /** * Camelizes a word. This uses the classify() method and turns the first character to lowercase. */ - public function camelize(string $word) : string + public function camelize(string $word): string { return lcfirst($this->classify($word)); } @@ -283,7 +284,7 @@ class Inflector * * @return string The string with all delimiter-separated words capitalized. */ - public function capitalize(string $string, string $delimiters = " \n\t\r\0\x0B-") : string + public function capitalize(string $string, string $delimiters = " \n\t\r\0\x0B-"): string { return ucwords($string, $delimiters); } @@ -293,7 +294,7 @@ class Inflector * * @param string $string The string to check for utf8 characters in. */ - public function seemsUtf8(string $string) : bool + public function seemsUtf8(string $string): bool { for ($i = 0; $i < strlen($string); $i++) { if (ord($string[$i]) < 0x80) { @@ -331,7 +332,7 @@ class Inflector * * @return string Unaccented string */ - public function unaccent(string $string) : string + public function unaccent(string $string): string { if (preg_match('/[\x80-\xff]/', $string) === false) { return $string; @@ -444,7 +445,7 @@ class Inflector * * @return string Urlized string. */ - public function urlize(string $string) : string + public function urlize(string $string): string { // Remove all non url friendly characters with the unaccent function $unaccented = $this->unaccent($string); @@ -487,7 +488,7 @@ class Inflector * * @return string The word in singular form. */ - public function singularize(string $word) : string + public function singularize(string $word): string { return $this->singularizer->inflect($word); } @@ -499,7 +500,7 @@ class Inflector * * @return string The word in plural form. */ - public function pluralize(string $word) : string + public function pluralize(string $word): string { return $this->pluralizer->inflect($word); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php index 44bba5d..a0740a7 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php @@ -11,30 +11,37 @@ use Doctrine\Inflector\Rules\Portuguese; use Doctrine\Inflector\Rules\Spanish; use Doctrine\Inflector\Rules\Turkish; use InvalidArgumentException; + use function sprintf; final class InflectorFactory { - public static function create() : LanguageInflectorFactory + public static function create(): LanguageInflectorFactory { return self::createForLanguage(Language::ENGLISH); } - public static function createForLanguage(string $language) : LanguageInflectorFactory + public static function createForLanguage(string $language): LanguageInflectorFactory { switch ($language) { case Language::ENGLISH: return new English\InflectorFactory(); + case Language::FRENCH: return new French\InflectorFactory(); + case Language::NORWEGIAN_BOKMAL: return new NorwegianBokmal\InflectorFactory(); + case Language::PORTUGUESE: return new Portuguese\InflectorFactory(); + case Language::SPANISH: return new Spanish\InflectorFactory(); + case Language::TURKISH: return new Turkish\InflectorFactory(); + default: throw new InvalidArgumentException(sprintf( 'Language "%s" is not supported.', diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php index a80dd6c..a58f43c 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php @@ -15,7 +15,7 @@ interface LanguageInflectorFactory * * @return $this */ - public function withSingularRules(?Ruleset $singularRules, bool $reset = false) : self; + public function withSingularRules(?Ruleset $singularRules, bool $reset = false): self; /** * Applies custom rules for pluralisation @@ -24,10 +24,10 @@ interface LanguageInflectorFactory * * @return $this */ - public function withPluralRules(?Ruleset $pluralRules, bool $reset = false) : self; + public function withPluralRules(?Ruleset $pluralRules, bool $reset = false): self; /** * Builds the inflector instance with all applicable rules */ - public function build() : Inflector; + public function build(): Inflector; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php index 63806ec..2fdf535 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php @@ -6,7 +6,7 @@ namespace Doctrine\Inflector; class NoopWordInflector implements WordInflector { - public function inflect(string $word) : string + public function inflect(string $word): string { return $word; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php index 0de97a2..8f0919f 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('(s)tatuses$'), '\1\2tatus'); yield new Transformation(new Pattern('(s)tatus$'), '\1\2tatus'); @@ -62,7 +62,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('(s)tatus$'), '\1\2tatuses'); yield new Transformation(new Pattern('(quiz)$'), '\1zes'); @@ -94,7 +94,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('atlas'), new Word('atlases')); yield new Substitution(new Word('axe'), new Word('axes')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php index cd40021..85f92aa 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php index fcc1d19..7ccc103 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php index be37a97..e2656cc 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); @@ -33,7 +33,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); @@ -46,7 +46,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('\w+media'); yield new Pattern('advice'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php index b3f22ed..c8f1f8f 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/(b|cor|ém|gemm|soupir|trav|vant|vitr)aux$/'), '\1ail'); yield new Transformation(new Pattern('/ails$/'), 'ail'); @@ -26,21 +26,22 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/(s|x|z)$/'), '\1'); yield new Transformation(new Pattern('/(b|cor|ém|gemm|soupir|trav|vant|vitr)ail$/'), '\1aux'); yield new Transformation(new Pattern('/ail$/'), 'ails'); + yield new Transformation(new Pattern('/(chacal|carnaval|festival|récital)$/'), '\1s'); yield new Transformation(new Pattern('/al$/'), 'aux'); - yield new Transformation(new Pattern('/(bleu|émeu|landau|lieu|pneu|sarrau)$/'), '\1s'); - yield new Transformation(new Pattern('/(bijou|caillou|chou|genou|hibou|joujou|pou|au|eu|eau)$/'), '\1x'); + yield new Transformation(new Pattern('/(bleu|émeu|landau|pneu|sarrau)$/'), '\1s'); + yield new Transformation(new Pattern('/(bijou|caillou|chou|genou|hibou|joujou|lieu|pou|au|eu|eau)$/'), '\1x'); yield new Transformation(new Pattern('/$/'), 's'); } /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('monsieur'), new Word('messieurs')); yield new Substitution(new Word('madame'), new Word('mesdames')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php index 7042d49..62e31f0 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php index d25f8a8..6cd45bc 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php index 2fdc020..3cf2444 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern(''); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php index 9fae0f3..c00317d 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/re$/i'), 'r'); yield new Transformation(new Pattern('/er$/i'), ''); @@ -23,7 +23,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/e$/i'), 'er'); yield new Transformation(new Pattern('/r$/i'), 're'); @@ -33,7 +33,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('konto'), new Word('konti')); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php index 41b9b38..912ae41 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php index 5a92132..9902d35 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php index c6b9fc7..5d878c6 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('barn'); yield new Pattern('fjell'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php index 3486eba..a5f0ef7 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php @@ -25,17 +25,17 @@ final class Pattern } } - public function getPattern() : string + public function getPattern(): string { return $this->pattern; } - public function getRegex() : string + public function getRegex(): string { return $this->regex; } - public function matches(string $word) : bool + public function matches(string $word): bool { return preg_match($this->getRegex(), $word) === 1; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php index a71f1ed..e8d45cb 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php @@ -20,14 +20,14 @@ class Patterns { $this->patterns = $patterns; - $patterns = array_map(static function (Pattern $pattern) : string { + $patterns = array_map(static function (Pattern $pattern): string { return $pattern->getPattern(); }, $this->patterns); $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; } - public function matches(string $word) : bool + public function matches(string $word): bool { return preg_match($this->regex, $word, $regs) === 1; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php index 155055f..95564d4 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/^(g|)ases$/i'), '\1ás'); yield new Transformation(new Pattern('/(japon|escoc|ingl|dinamarqu|fregu|portugu)eses$/i'), '\1ês'); @@ -37,7 +37,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/^(alem|c|p)ao$/i'), '\1aes'); yield new Transformation(new Pattern('/^(irm|m)ao$/i'), '\1aos'); @@ -61,7 +61,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('abdomen'), new Word('abdomens')); yield new Substitution(new Word('alemão'), new Word('alemães')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php index 536587e..bf12d54 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php index de69b7e..897f177 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php index 52360c4..58c34f9 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('tórax'); yield new Pattern('tênis'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php index a2d32c1..39889b7 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php @@ -22,17 +22,17 @@ class Ruleset $this->irregular = $irregular; } - public function getRegular() : Transformations + public function getRegular(): Transformations { return $this->regular; } - public function getUninflected() : Patterns + public function getUninflected(): Patterns { return $this->uninflected; } - public function getIrregular() : Substitutions + public function getIrregular(): Substitutions { return $this->irregular; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php index 6cace86..c6862fa 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/ereses$/'), 'erés'); yield new Transformation(new Pattern('/iones$/'), 'ión'); @@ -26,7 +26,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/ú([sn])$/i'), 'u\1es'); yield new Transformation(new Pattern('/ó([sn])$/i'), 'o\1es'); @@ -42,7 +42,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('el'), new Word('los')); yield new Substitution(new Word('papá'), new Word('papás')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php index da643bd..85084ca 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php index f77a739..d739972 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php index b13281e..c743b39 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('lunes'); yield new Pattern('rompecabezas'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php index 681ab63..471aff9 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php @@ -18,12 +18,12 @@ final class Substitution $this->to = $to; } - public function getFrom() : Word + public function getFrom(): Word { return $this->from; } - public function getTo() : Word + public function getTo(): Word { return $this->to; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php index 24cc34a..17ee296 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector\Rules; use Doctrine\Inflector\WordInflector; + use function strtolower; use function strtoupper; use function substr; @@ -21,7 +22,7 @@ class Substitutions implements WordInflector } } - public function getFlippedSubstitutions() : Substitutions + public function getFlippedSubstitutions(): Substitutions { $substitutions = []; @@ -35,7 +36,7 @@ class Substitutions implements WordInflector return new Substitutions(...$substitutions); } - public function inflect(string $word) : string + public function inflect(string $word): string { $lowerWord = strtolower($word); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php index 84ef08b..30dcd59 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector\Rules; use Doctrine\Inflector\WordInflector; + use function preg_replace; final class Transformation implements WordInflector @@ -21,17 +22,17 @@ final class Transformation implements WordInflector $this->replacement = $replacement; } - public function getPattern() : Pattern + public function getPattern(): Pattern { return $this->pattern; } - public function getReplacement() : string + public function getReplacement(): string { return $this->replacement; } - public function inflect(string $word) : string + public function inflect(string $word): string { return (string) preg_replace($this->pattern->getRegex(), $this->replacement, $word); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php index 9f4724e..b6a48fa 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php @@ -16,7 +16,7 @@ class Transformations implements WordInflector $this->transformations = $transformations; } - public function inflect(string $word) : string + public function inflect(string $word): string { foreach ($this->transformations as $transformation) { if ($transformation->getPattern()->matches($word)) { diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php index 74900cb..d7b7064 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php @@ -14,7 +14,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield new Transformation(new Pattern('/l[ae]r$/i'), ''); } @@ -22,7 +22,7 @@ class Inflectible /** * @return Transformation[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield new Transformation(new Pattern('/([eöiü][^aoıueöiü]{0,6})$/u'), '\1ler'); yield new Transformation(new Pattern('/([aoıu][^aoıueöiü]{0,6})$/u'), '\1lar'); @@ -31,7 +31,7 @@ class Inflectible /** * @return Substitution[] */ - public static function getIrregular() : iterable + public static function getIrregular(): iterable { yield new Substitution(new Word('ben'), new Word('biz')); yield new Substitution(new Word('sen'), new Word('siz')); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php index 83b8046..c6cdebe 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php @@ -9,12 +9,12 @@ use Doctrine\Inflector\Rules\Ruleset; final class InflectorFactory extends GenericLanguageInflectorFactory { - protected function getSingularRuleset() : Ruleset + protected function getSingularRuleset(): Ruleset { return Rules::getSingularRuleset(); } - protected function getPluralRuleset() : Ruleset + protected function getPluralRuleset(): Ruleset { return Rules::getPluralRuleset(); } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php index dd0840c..ea564ac 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php @@ -11,7 +11,7 @@ use Doctrine\Inflector\Rules\Transformations; final class Rules { - public static function getSingularRuleset() : Ruleset + public static function getSingularRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getSingular()), @@ -20,7 +20,7 @@ final class Rules ); } - public static function getPluralRuleset() : Ruleset + public static function getPluralRuleset(): Ruleset { return new Ruleset( new Transformations(...Inflectible::getPlural()), diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php index c95ccbf..a75d248 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php @@ -11,7 +11,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getSingular() : iterable + public static function getSingular(): iterable { yield from self::getDefault(); } @@ -19,7 +19,7 @@ final class Uninflected /** * @return Pattern[] */ - public static function getPlural() : iterable + public static function getPlural(): iterable { yield from self::getDefault(); } @@ -27,7 +27,7 @@ final class Uninflected /** * @return Pattern[] */ - private static function getDefault() : iterable + private static function getDefault(): iterable { yield new Pattern('lunes'); yield new Pattern('rompecabezas'); diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php index 5156e93..98e93ba 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php @@ -14,7 +14,7 @@ class Word $this->word = $word; } - public function getWord() : string + public function getWord(): string { return $this->word; } diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php index 0e3a5eb..12b2ed5 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Doctrine\Inflector; use Doctrine\Inflector\Rules\Ruleset; + use function array_merge; /** @@ -26,7 +27,7 @@ class RulesetInflector implements WordInflector $this->rulesets = array_merge([$ruleset], $rulesets); } - public function inflect(string $word) : string + public function inflect(string $word): string { if ($word === '') { return ''; diff --git a/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php b/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php index f257055..b88b1d6 100644 --- a/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php +++ b/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php @@ -6,5 +6,5 @@ namespace Doctrine\Inflector; interface WordInflector { - public function inflect(string $word) : string; + public function inflect(string $word): string; } diff --git a/vendor/doctrine/inflector/psalm.xml b/vendor/doctrine/inflector/psalm.xml new file mode 100644 index 0000000..677e8d4 --- /dev/null +++ b/vendor/doctrine/inflector/psalm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/vendor/illuminate/collections/Arr.php b/vendor/illuminate/collections/Arr.php index 2c38b3c..58c5e78 100644 --- a/vendor/illuminate/collections/Arr.php +++ b/vendor/illuminate/collections/Arr.php @@ -121,6 +121,23 @@ class Arr return $results; } + /** + * Convert a flatten "dot" notation array into an expanded array. + * + * @param iterable $array + * @return array + */ + public static function undot($array) + { + $results = []; + + foreach ($array as $key => $value) { + static::set($results, $key, $value); + } + + return $results; + } + /** * Get all of the given array except for a specified array of keys. * @@ -297,7 +314,7 @@ class Arr return $array[$key]; } - if (strpos($key, '.') === false) { + if (! str_contains($key, '.')) { return $array[$key] ?? value($default); } @@ -393,6 +410,31 @@ class Arr return array_keys($keys) !== $keys; } + /** + * Determines if an array is a list. + * + * An array is a "list" if all array keys are sequential integers starting from 0 with no gaps in between. + * + * @param array $array + * @return bool + */ + public static function isList($array) + { + return ! self::isAssoc($array); + } + + /** + * Key an associative array by a field or using a callback. + * + * @param array $array + * @param callable|array|string + * @return array + */ + public static function keyBy($array, $keyBy) + { + return Collection::make($array)->keyBy($keyBy)->all(); + } + /** * Get a subset of the items from the given array. * @@ -687,6 +729,19 @@ class Arr return array_filter($array, $callback, ARRAY_FILTER_USE_BOTH); } + /** + * Filter items where the value is not null. + * + * @param array $array + * @return array + */ + public static function whereNotNull($array) + { + return static::where($array, function ($value) { + return ! is_null($value); + }); + } + /** * If the given value is not an array and not null, wrap it in one. * diff --git a/vendor/illuminate/collections/Collection.php b/vendor/illuminate/collections/Collection.php index 0b008c6..907016d 100644 --- a/vendor/illuminate/collections/Collection.php +++ b/vendor/illuminate/collections/Collection.php @@ -4,25 +4,37 @@ namespace Illuminate\Support; use ArrayAccess; use ArrayIterator; +use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString; use Illuminate\Support\Traits\EnumeratesValues; use Illuminate\Support\Traits\Macroable; use stdClass; +use Traversable; -class Collection implements ArrayAccess, Enumerable +/** + * @template TKey of array-key + * @template TValue + * + * @implements \ArrayAccess + * @implements \Illuminate\Support\Enumerable + */ +class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerable { + /** + * @use \Illuminate\Support\Traits\EnumeratesValues + */ use EnumeratesValues, Macroable; /** * The items contained in the collection. * - * @var array + * @var array */ protected $items = []; /** * Create a new collection. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items * @return void */ public function __construct($items = []) @@ -35,7 +47,7 @@ class Collection implements ArrayAccess, Enumerable * * @param int $from * @param int $to - * @return static + * @return static */ public static function range($from, $to) { @@ -45,7 +57,7 @@ class Collection implements ArrayAccess, Enumerable /** * Get all of the items in the collection. * - * @return array + * @return array */ public function all() { @@ -55,7 +67,7 @@ class Collection implements ArrayAccess, Enumerable /** * Get a lazy collection for the items in this collection. * - * @return \Illuminate\Support\LazyCollection + * @return \Illuminate\Support\LazyCollection */ public function lazy() { @@ -65,8 +77,8 @@ class Collection implements ArrayAccess, Enumerable /** * Get the average value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue): float|int)|string|null $callback + * @return float|int|null */ public function avg($callback = null) { @@ -86,8 +98,8 @@ class Collection implements ArrayAccess, Enumerable /** * Get the median of a given key. * - * @param string|array|null $key - * @return mixed + * @param string|array|null $key + * @return float|int|null */ public function median($key = null) { @@ -116,8 +128,8 @@ class Collection implements ArrayAccess, Enumerable /** * Get the mode of a given key. * - * @param string|array|null $key - * @return array|null + * @param string|array|null $key + * @return array|null */ public function mode($key = null) { @@ -145,7 +157,7 @@ class Collection implements ArrayAccess, Enumerable /** * Collapse the collection of items into a single array. * - * @return static + * @return static */ public function collapse() { @@ -155,7 +167,7 @@ class Collection implements ArrayAccess, Enumerable /** * Determine if an item exists in the collection. * - * @param mixed $key + * @param (callable(TValue, TKey): bool)|TValue|string $key * @param mixed $operator * @param mixed $value * @return bool @@ -175,11 +187,27 @@ class Collection implements ArrayAccess, Enumerable return $this->contains($this->operatorForWhere(...func_get_args())); } + /** + * 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) + { + return ! $this->contains(...func_get_args()); + } + /** * Cross join with the given lists, returning all possible permutations. * - * @param mixed ...$lists - * @return static + * @template TCrossJoinKey + * @template TCrossJoinValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$lists + * @return static> */ public function crossJoin(...$lists) { @@ -191,7 +219,7 @@ class Collection implements ArrayAccess, Enumerable /** * Get the items in the collection that are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diff($items) @@ -202,8 +230,8 @@ class Collection implements ArrayAccess, Enumerable /** * Get the items in the collection that are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback * @return static */ public function diffUsing($items, callable $callback) @@ -214,7 +242,7 @@ class Collection implements ArrayAccess, Enumerable /** * Get the items in the collection whose keys and values are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffAssoc($items) @@ -225,8 +253,8 @@ class Collection implements ArrayAccess, Enumerable /** * Get the items in the collection whose keys and values are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffAssocUsing($items, callable $callback) @@ -237,7 +265,7 @@ class Collection implements ArrayAccess, Enumerable /** * Get the items in the collection whose keys are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffKeys($items) @@ -248,8 +276,8 @@ class Collection implements ArrayAccess, Enumerable /** * Get the items in the collection whose keys are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffKeysUsing($items, callable $callback) @@ -260,7 +288,7 @@ class Collection implements ArrayAccess, Enumerable /** * Retrieve duplicate items from the collection. * - * @param callable|string|null $callback + * @param (callable(TValue): bool)|string|null $callback * @param bool $strict * @return static */ @@ -288,7 +316,7 @@ class Collection implements ArrayAccess, Enumerable /** * Retrieve duplicate items from the collection using strict comparison. * - * @param callable|string|null $callback + * @param (callable(TValue): bool)|string|null $callback * @return static */ public function duplicatesStrict($callback = null) @@ -300,7 +328,7 @@ class Collection implements ArrayAccess, Enumerable * Get the comparison function to detect duplicates. * * @param bool $strict - * @return \Closure + * @return callable(TValue, TValue): bool */ protected function duplicateComparator($strict) { @@ -318,7 +346,7 @@ class Collection implements ArrayAccess, Enumerable /** * Get all items except for those with the specified keys. * - * @param \Illuminate\Support\Collection|mixed $keys + * @param \Illuminate\Support\Enumerable|array $keys * @return static */ public function except($keys) @@ -335,7 +363,7 @@ class Collection implements ArrayAccess, Enumerable /** * Run a filter over each of the items. * - * @param callable|null $callback + * @param (callable(TValue, TKey): bool)|null $callback * @return static */ public function filter(callable $callback = null) @@ -350,9 +378,11 @@ class Collection implements ArrayAccess, Enumerable /** * Get the first item from the collection passing the given truth test. * - * @param callable|null $callback - * @param mixed $default - * @return mixed + * @template TFirstDefault + * + * @param (callable(TValue, TKey): bool)|null $callback + * @param TFirstDefault|(\Closure(): TFirstDefault) $default + * @return TValue|TFirstDefault */ public function first(callable $callback = null, $default = null) { @@ -363,7 +393,7 @@ class Collection implements ArrayAccess, Enumerable * Get a flattened array of the items in the collection. * * @param int $depth - * @return static + * @return static */ public function flatten($depth = INF) { @@ -373,7 +403,7 @@ class Collection implements ArrayAccess, Enumerable /** * Flip the items in the collection. * - * @return static + * @return static */ public function flip() { @@ -383,7 +413,7 @@ class Collection implements ArrayAccess, Enumerable /** * Remove an item from the collection by key. * - * @param string|array $keys + * @param TKey|array $keys * @return $this */ public function forget($keys) @@ -398,9 +428,11 @@ class Collection implements ArrayAccess, Enumerable /** * Get an item from the collection by key. * - * @param mixed $key - * @param mixed $default - * @return mixed + * @template TGetDefault + * + * @param TKey $key + * @param TGetDefault|(\Closure(): TGetDefault) $default + * @return TValue|TGetDefault */ public function get($key, $default = null) { @@ -411,12 +443,30 @@ class Collection implements ArrayAccess, Enumerable return value($default); } + /** + * Get an item from the collection by key or add it to collection if it does not exist. + * + * @param mixed $key + * @param mixed $value + * @return mixed + */ + public function getOrPut($key, $value) + { + if (array_key_exists($key, $this->items)) { + return $this->items[$key]; + } + + $this->offsetSet($key, $value = value($value)); + + return $value; + } + /** * Group an associative array by a field or using a callback. * - * @param array|callable|string $groupBy + * @param (callable(TValue, TKey): array-key)|array|string $groupBy * @param bool $preserveKeys - * @return static + * @return static> */ public function groupBy($groupBy, $preserveKeys = false) { @@ -460,8 +510,8 @@ class Collection implements ArrayAccess, Enumerable /** * Key an associative array by a field or using a callback. * - * @param callable|string $keyBy - * @return static + * @param (callable(TValue, TKey): array-key)|array|string $keyBy + * @return static */ public function keyBy($keyBy) { @@ -485,7 +535,7 @@ class Collection implements ArrayAccess, Enumerable /** * Determine if an item exists in the collection by key. * - * @param mixed $key + * @param TKey|array $key * @return bool */ public function has($key) @@ -501,6 +551,29 @@ class Collection implements ArrayAccess, Enumerable return true; } + /** + * Determine if any of the keys exist in the collection. + * + * @param mixed $key + * @return bool + */ + public function hasAny($key) + { + if ($this->isEmpty()) { + return false; + } + + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if ($this->has($value)) { + return true; + } + } + + return false; + } + /** * Concatenate values of a given key as a string. * @@ -522,7 +595,7 @@ class Collection implements ArrayAccess, Enumerable /** * Intersect the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersect($items) @@ -533,7 +606,7 @@ class Collection implements ArrayAccess, Enumerable /** * Intersect the collection with the given items by key. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersectByKeys($items) @@ -596,7 +669,7 @@ class Collection implements ArrayAccess, Enumerable /** * Get the keys of the collection items. * - * @return static + * @return static */ public function keys() { @@ -606,9 +679,11 @@ class Collection implements ArrayAccess, Enumerable /** * Get the last item from the collection. * - * @param callable|null $callback - * @param mixed $default - * @return mixed + * @template TLastDefault + * + * @param (callable(TValue, TKey): bool)|null $callback + * @param TLastDefault|(\Closure(): TLastDefault) $default + * @return TValue|TLastDefault */ public function last(callable $callback = null, $default = null) { @@ -618,9 +693,9 @@ class Collection implements ArrayAccess, Enumerable /** * Get the values of a given key. * - * @param string|array|int|null $value + * @param string|array $value * @param string|null $key - * @return static + * @return static */ public function pluck($value, $key = null) { @@ -630,8 +705,10 @@ class Collection implements ArrayAccess, Enumerable /** * Run a map over each of the items. * - * @param callable $callback - * @return static + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return static */ public function map(callable $callback) { @@ -647,8 +724,11 @@ class Collection implements ArrayAccess, Enumerable * * The callback should return an associative array with a single key/value pair. * - * @param callable $callback - * @return static + * @template TMapToDictionaryKey of array-key + * @template TMapToDictionaryValue + * + * @param callable(TValue, TKey): array $callback + * @return static> */ public function mapToDictionary(callable $callback) { @@ -676,8 +756,11 @@ class Collection implements ArrayAccess, Enumerable * * The callback should return an associative array with a single key/value pair. * - * @param callable $callback - * @return static + * @template TMapWithKeysKey of array-key + * @template TMapWithKeysValue + * + * @param callable(TValue, TKey): array $callback + * @return static */ public function mapWithKeys(callable $callback) { @@ -697,7 +780,7 @@ class Collection implements ArrayAccess, Enumerable /** * Merge the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function merge($items) @@ -708,8 +791,10 @@ class Collection implements ArrayAccess, Enumerable /** * Recursively merge the collection with the given items. * - * @param mixed $items - * @return static + * @template TMergeRecursiveValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static */ public function mergeRecursive($items) { @@ -719,8 +804,10 @@ class Collection implements ArrayAccess, Enumerable /** * Create a collection by using this collection for keys and another for its values. * - * @param mixed $values - * @return static + * @template TCombineValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static */ public function combine($values) { @@ -730,7 +817,7 @@ class Collection implements ArrayAccess, Enumerable /** * Union the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function union($items) @@ -765,7 +852,7 @@ class Collection implements ArrayAccess, Enumerable /** * Get the items with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array $keys * @return static */ public function only($keys) @@ -787,7 +874,7 @@ class Collection implements ArrayAccess, Enumerable * Get and remove the last N items from the collection. * * @param int $count - * @return mixed + * @return static|TValue|null */ public function pop($count = 1) { @@ -813,8 +900,8 @@ class Collection implements ArrayAccess, Enumerable /** * Push an item onto the beginning of the collection. * - * @param mixed $value - * @param mixed $key + * @param TValue $value + * @param TKey $key * @return $this */ public function prepend($value, $key = null) @@ -827,7 +914,7 @@ class Collection implements ArrayAccess, Enumerable /** * Push one or more items onto the end of the collection. * - * @param mixed $values [optional] + * @param TValue ...$values * @return $this */ public function push(...$values) @@ -842,7 +929,7 @@ class Collection implements ArrayAccess, Enumerable /** * Push all of the given items onto the collection. * - * @param iterable $source + * @param iterable $source * @return static */ public function concat($source) @@ -859,9 +946,11 @@ class Collection implements ArrayAccess, Enumerable /** * Get and remove an item from the collection. * - * @param mixed $key - * @param mixed $default - * @return mixed + * @template TPullDefault + * + * @param TKey $key + * @param TPullDefault|(\Closure(): TPullDefault) $default + * @return TValue|TPullDefault */ public function pull($key, $default = null) { @@ -871,8 +960,8 @@ class Collection implements ArrayAccess, Enumerable /** * Put an item in the collection by key. * - * @param mixed $key - * @param mixed $value + * @param TKey $key + * @param TValue $value * @return $this */ public function put($key, $value) @@ -886,7 +975,7 @@ class Collection implements ArrayAccess, Enumerable * Get one or a specified number of items randomly from the collection. * * @param int|null $number - * @return static|mixed + * @return static|TValue * * @throws \InvalidArgumentException */ @@ -902,7 +991,7 @@ class Collection implements ArrayAccess, Enumerable /** * Replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replace($items) @@ -913,7 +1002,7 @@ class Collection implements ArrayAccess, Enumerable /** * Recursively replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replaceRecursive($items) @@ -934,9 +1023,9 @@ class Collection implements ArrayAccess, Enumerable /** * Search the collection for a given value and return the corresponding key if successful. * - * @param mixed $value + * @param TValue|(callable(TValue,TKey): bool) $value * @param bool $strict - * @return mixed + * @return TKey|bool */ public function search($value, $strict = false) { @@ -957,7 +1046,7 @@ class Collection implements ArrayAccess, Enumerable * Get and remove the first N items from the collection. * * @param int $count - * @return mixed + * @return static|TValue|null */ public function shift($count = 1) { @@ -996,7 +1085,7 @@ class Collection implements ArrayAccess, Enumerable * * @param int $size * @param int $step - * @return static + * @return static */ public function sliding($size = 2, $step = 1) { @@ -1021,7 +1110,7 @@ class Collection implements ArrayAccess, Enumerable /** * Skip items in the collection until the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function skipUntil($value) @@ -1032,7 +1121,7 @@ class Collection implements ArrayAccess, Enumerable /** * Skip items in the collection while the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function skipWhile($value) @@ -1056,7 +1145,7 @@ class Collection implements ArrayAccess, Enumerable * Split a collection into a certain number of groups. * * @param int $numberOfGroups - * @return static + * @return static */ public function split($numberOfGroups) { @@ -1093,7 +1182,7 @@ class Collection implements ArrayAccess, Enumerable * Split a collection into a certain number of groups, and fill the first groups completely. * * @param int $numberOfGroups - * @return static + * @return static */ public function splitIn($numberOfGroups) { @@ -1103,10 +1192,10 @@ class Collection implements ArrayAccess, Enumerable /** * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. * - * @param mixed $key + * @param (callable(TValue, TKey): bool)|string $key * @param mixed $operator * @param mixed $value - * @return mixed + * @return TValue * * @throws \Illuminate\Support\ItemNotFoundException * @throws \Illuminate\Support\MultipleItemsFoundException @@ -1117,14 +1206,16 @@ class Collection implements ArrayAccess, Enumerable ? $this->operatorForWhere(...func_get_args()) : $key; - $items = $this->when($filter)->filter($filter); + $items = $this->unless($filter == null)->filter($filter); - if ($items->isEmpty()) { + $count = $items->count(); + + if ($count === 0) { throw new ItemNotFoundException; } - if ($items->count() > 1) { - throw new MultipleItemsFoundException; + if ($count > 1) { + throw new MultipleItemsFoundException($count); } return $items->first(); @@ -1133,10 +1224,10 @@ class Collection implements ArrayAccess, Enumerable /** * Get the first item in the collection but throw an exception if no matching items exist. * - * @param mixed $key + * @param (callable(TValue, TKey): bool)|string $key * @param mixed $operator * @param mixed $value - * @return mixed + * @return TValue * * @throws \Illuminate\Support\ItemNotFoundException */ @@ -1161,7 +1252,7 @@ class Collection implements ArrayAccess, Enumerable * Chunk the collection into chunks of the given size. * * @param int $size - * @return static + * @return static */ public function chunk($size) { @@ -1181,8 +1272,8 @@ class Collection implements ArrayAccess, Enumerable /** * Chunk the collection into chunks with a callback. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey, static): bool $callback + * @return static> */ public function chunkWhile(callable $callback) { @@ -1194,7 +1285,7 @@ class Collection implements ArrayAccess, Enumerable /** * Sort through each item with a callback. * - * @param callable|int|null $callback + * @param (callable(TValue, TValue): int)|null|int $callback * @return static */ public function sort($callback = null) @@ -1226,7 +1317,7 @@ class Collection implements ArrayAccess, Enumerable /** * Sort the collection using the given callback. * - * @param callable|array|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @param bool $descending * @return static @@ -1243,7 +1334,7 @@ class Collection implements ArrayAccess, Enumerable // First we will loop through the items and get the comparator from a callback // function which we were given. Then, we will sort the returned values and - // and grab the corresponding values for the sorted keys from this array. + // grab all the corresponding values for the sorted keys from this array. foreach ($this->items as $key => $value) { $results[$key] = $callback($value, $key); } @@ -1264,7 +1355,7 @@ class Collection implements ArrayAccess, Enumerable /** * Sort the collection using multiple comparisons. * - * @param array $comparisons + * @param array $comparisons * @return static */ protected function sortByMany(array $comparisons = []) @@ -1280,9 +1371,7 @@ class Collection implements ArrayAccess, Enumerable $ascending = Arr::get($comparison, 1, true) === true || Arr::get($comparison, 1, true) === 'asc'; - $result = 0; - - if (is_callable($prop)) { + if (! is_string($prop) && is_callable($prop)) { $result = $prop($a, $b); } else { $values = [data_get($a, $prop), data_get($b, $prop)]; @@ -1308,7 +1397,7 @@ class Collection implements ArrayAccess, Enumerable /** * Sort the collection in descending order using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @return static */ @@ -1344,12 +1433,27 @@ class Collection implements ArrayAccess, Enumerable return $this->sortKeys($options, true); } + /** + * Sort the collection keys using a callback. + * + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function sortKeysUsing(callable $callback) + { + $items = $this->items; + + uksort($items, $callback); + + return new static($items); + } + /** * Splice a portion of the underlying collection array. * * @param int $offset * @param int|null $length - * @param mixed $replacement + * @param array $replacement * @return static */ public function splice($offset, $length = null, $replacement = []) @@ -1358,7 +1462,7 @@ class Collection implements ArrayAccess, Enumerable return new static(array_splice($this->items, $offset)); } - return new static(array_splice($this->items, $offset, $length, $replacement)); + return new static(array_splice($this->items, $offset, $length, $this->getArrayableItems($replacement))); } /** @@ -1379,7 +1483,7 @@ class Collection implements ArrayAccess, Enumerable /** * Take items in the collection until the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function takeUntil($value) @@ -1390,7 +1494,7 @@ class Collection implements ArrayAccess, Enumerable /** * Take items in the collection while the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function takeWhile($value) @@ -1401,7 +1505,7 @@ class Collection implements ArrayAccess, Enumerable /** * Transform each item in the collection using a callback. * - * @param callable $callback + * @param callable(TValue, TKey): TValue $callback * @return $this */ public function transform(callable $callback) @@ -1412,10 +1516,46 @@ class Collection implements ArrayAccess, Enumerable } /** - * Reset the keys on the underlying array. + * Convert a flatten "dot" notation array into an expanded array. * * @return static */ + public function undot() + { + return new static(Arr::undot($this->all())); + } + + /** + * 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) + { + if (is_null($key) && $strict === false) { + return new static(array_unique($this->items, SORT_REGULAR)); + } + + $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; + }); + } + + /** + * Reset the keys on the underlying array. + * + * @return static + */ public function values() { return new static(array_values($this->items)); @@ -1427,8 +1567,10 @@ class Collection implements ArrayAccess, Enumerable * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]); * => [[1, 4], [2, 5], [3, 6]] * - * @param mixed ...$items - * @return static + * @template TZipValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return static> */ public function zip($items) { @@ -1446,9 +1588,11 @@ class Collection implements ArrayAccess, Enumerable /** * Pad collection to the specified length with a value. * + * @template TPadValue + * * @param int $size - * @param mixed $value - * @return static + * @param TPadValue $value + * @return static */ public function pad($size, $value) { @@ -1458,10 +1602,9 @@ class Collection implements ArrayAccess, Enumerable /** * Get an iterator for the items. * - * @return \ArrayIterator + * @return \ArrayIterator */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->items); } @@ -1471,8 +1614,7 @@ class Collection implements ArrayAccess, Enumerable * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return count($this->items); } @@ -1480,8 +1622,8 @@ class Collection implements ArrayAccess, Enumerable /** * Count the number of items in the collection by a field or using a callback. * - * @param callable|string $countBy - * @return static + * @param (callable(TValue, TKey): mixed)|string|null $countBy + * @return static */ public function countBy($countBy = null) { @@ -1491,7 +1633,7 @@ class Collection implements ArrayAccess, Enumerable /** * Add an item to the collection. * - * @param mixed $item + * @param TValue $item * @return $this */ public function add($item) @@ -1504,7 +1646,7 @@ class Collection implements ArrayAccess, Enumerable /** * Get a base Support collection instance from this collection. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function toBase() { @@ -1514,11 +1656,10 @@ class Collection implements ArrayAccess, Enumerable /** * Determine if an item exists at an offset. * - * @param mixed $key + * @param TKey $key * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists($key): bool { return isset($this->items[$key]); } @@ -1526,11 +1667,10 @@ class Collection implements ArrayAccess, Enumerable /** * Get an item at a given offset. * - * @param mixed $key - * @return mixed + * @param TKey $key + * @return TValue */ - #[\ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { return $this->items[$key]; } @@ -1538,12 +1678,11 @@ class Collection implements ArrayAccess, Enumerable /** * Set the item at a given offset. * - * @param mixed $key - * @param mixed $value + * @param TKey|null $key + * @param TValue $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { if (is_null($key)) { $this->items[] = $value; @@ -1555,11 +1694,10 @@ class Collection implements ArrayAccess, Enumerable /** * Unset the item at a given offset. * - * @param string $key + * @param TKey $key * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { unset($this->items[$key]); } diff --git a/vendor/illuminate/collections/Enumerable.php b/vendor/illuminate/collections/Enumerable.php index 261a0c8..74e9046 100644 --- a/vendor/illuminate/collections/Enumerable.php +++ b/vendor/illuminate/collections/Enumerable.php @@ -2,19 +2,31 @@ 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 + * @extends \IteratorAggregate + */ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable { /** * Create a new collection instance if the value isn't one already. * - * @param mixed $items - * @return static + * @template TMakeKey of array-key + * @template TMakeValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items + * @return static */ public static function make($items = []); @@ -39,16 +51,22 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Wrap the given value in a collection if applicable. * - * @param mixed $value - * @return static + * @template TWrapKey of array-key + * @template TWrapValue + * + * @param iterable $value + * @return static */ public static function wrap($value); /** * Get the underlying items from the given collection if applicable. * - * @param array|static $value - * @return array + * @template TUnwrapKey of array-key + * @template TUnwrapValue + * + * @param array|static $value + * @return array */ public static function unwrap($value); @@ -69,38 +87,38 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Alias for the "avg" method. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue): float|int)|string|null $callback + * @return float|int|null */ public function average($callback = null); /** * Get the median of a given key. * - * @param string|array|null $key - * @return mixed + * @param string|array|null $key + * @return float|int|null */ public function median($key = null); /** * Get the mode of a given key. * - * @param string|array|null $key - * @return array|null + * @param string|array|null $key + * @return array|null */ public function mode($key = null); /** * Collapse the items into a single enumerable. * - * @return static + * @return static */ public function collapse(); /** * Alias for the "contains" method. * - * @param mixed $key + * @param (callable(TValue, TKey): bool)|TValue|string $key * @param mixed $operator * @param mixed $value * @return bool @@ -110,8 +128,8 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Determine if an item exists, using strict comparison. * - * @param mixed $key - * @param mixed $value + * @param (callable(TValue): bool)|TValue|array-key $key + * @param TValue|null $value * @return bool */ public function containsStrict($key, $value = null); @@ -119,26 +137,39 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the average value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue): float|int)|string|null $callback + * @return float|int|null */ public function avg($callback = null); /** * Determine if an item exists in the enumerable. * - * @param mixed $key + * @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); + /** * Cross join with the given lists, returning all possible permutations. * - * @param mixed ...$lists - * @return static + * @template TCrossJoinKey + * @template TCrossJoinValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$lists + * @return static> */ public function crossJoin(...$lists); @@ -146,7 +177,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * Dump the collection and end the script. * * @param mixed ...$args - * @return void + * @return never */ public function dd(...$args); @@ -160,7 +191,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the items that are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diff($items); @@ -168,8 +199,8 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the items that are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback * @return static */ public function diffUsing($items, callable $callback); @@ -177,7 +208,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the items whose keys and values are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffAssoc($items); @@ -185,8 +216,8 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the items whose keys and values are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffAssocUsing($items, callable $callback); @@ -194,7 +225,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the items whose keys are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffKeys($items); @@ -202,8 +233,8 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the items whose keys are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffKeysUsing($items, callable $callback); @@ -211,7 +242,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Retrieve duplicate items. * - * @param callable|string|null $callback + * @param (callable(TValue): bool)|string|null $callback * @param bool $strict * @return static */ @@ -220,7 +251,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Retrieve duplicate items using strict comparison. * - * @param callable|string|null $callback + * @param (callable(TValue): bool)|string|null $callback * @return static */ public function duplicatesStrict($callback = null); @@ -228,7 +259,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Execute a callback over each item. * - * @param callable $callback + * @param callable(TValue, TKey): mixed $callback * @return $this */ public function each(callable $callback); @@ -244,7 +275,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Determine if all items pass the given truth test. * - * @param string|callable $key + * @param (callable(TValue, TKey): bool)|TValue|string $key * @param mixed $operator * @param mixed $value * @return bool @@ -254,7 +285,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get all items except for those with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array $keys * @return static */ public function except($keys); @@ -262,64 +293,76 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Run a filter over each of the items. * - * @param callable|null $callback + * @param (callable(TValue): bool)|null $callback * @return static */ public function filter(callable $callback = null); /** - * Apply the callback if the value is truthy. + * Apply the callback if the given "value" is (or resolves to) truthy. + * + * @template TWhenReturnType as null * * @param bool $value - * @param callable $callback - * @param callable|null $default - * @return static|mixed + * @param (callable($this): TWhenReturnType)|null $callback + * @param (callable($this): TWhenReturnType)|null $default + * @return $this|TWhenReturnType */ - public function when($value, callable $callback, callable $default = null); + public function when($value, callable $callback = null, callable $default = null); /** * Apply the callback if the collection is empty. * - * @param callable $callback - * @param callable|null $default - * @return static|mixed + * @template TWhenEmptyReturnType + * + * @param (callable($this): TWhenEmptyReturnType) $callback + * @param (callable($this): TWhenEmptyReturnType)|null $default + * @return $this|TWhenEmptyReturnType */ public function whenEmpty(callable $callback, callable $default = null); /** * Apply the callback if the collection is not empty. * - * @param callable $callback - * @param callable|null $default - * @return static|mixed + * @template TWhenNotEmptyReturnType + * + * @param callable($this): TWhenNotEmptyReturnType $callback + * @param (callable($this): TWhenNotEmptyReturnType)|null $default + * @return $this|TWhenNotEmptyReturnType */ public function whenNotEmpty(callable $callback, callable $default = null); /** - * Apply the callback if the value is falsy. + * Apply the callback if the given "value" is (or resolves to) truthy. + * + * @template TUnlessReturnType * * @param bool $value - * @param callable $callback - * @param callable|null $default - * @return static|mixed + * @param (callable($this): TUnlessReturnType) $callback + * @param (callable($this): TUnlessReturnType)|null $default + * @return $this|TUnlessReturnType */ public function unless($value, callable $callback, callable $default = null); /** * Apply the callback unless the collection is empty. * - * @param callable $callback - * @param callable|null $default - * @return static|mixed + * @template TUnlessEmptyReturnType + * + * @param callable($this): TUnlessEmptyReturnType $callback + * @param (callable($this): TUnlessEmptyReturnType)|null $default + * @return $this|TUnlessEmptyReturnType */ public function unlessEmpty(callable $callback, callable $default = null); /** * Apply the callback unless the collection is not empty. * - * @param callable $callback - * @param callable|null $default - * @return static|mixed + * @template TUnlessNotEmptyReturnType + * + * @param callable($this): TUnlessNotEmptyReturnType $callback + * @param (callable($this): TUnlessNotEmptyReturnType)|null $default + * @return $this|TUnlessNotEmptyReturnType */ public function unlessNotEmpty(callable $callback, callable $default = null); @@ -362,7 +405,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * Filter items by the given key value pair. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @param bool $strict * @return static */ @@ -372,7 +415,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereInStrict($key, $values); @@ -381,7 +424,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * Filter items such that the value of the given key is between the given values. * * @param string $key - * @param array $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereBetween($key, $values); @@ -390,7 +433,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * Filter items such that the value of the given key is not between the given values. * * @param string $key - * @param array $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereNotBetween($key, $values); @@ -399,7 +442,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * Filter items by the given key value pair. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @param bool $strict * @return static */ @@ -409,7 +452,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereNotInStrict($key, $values); @@ -417,7 +460,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Filter the items, removing any items that don't match the given type(s). * - * @param string|string[] $type + * @param class-string|array $type * @return static */ public function whereInstanceOf($type); @@ -425,9 +468,11 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the first item from the enumerable passing the given truth test. * - * @param callable|null $callback - * @param mixed $default - * @return mixed + * @template TFirstDefault + * + * @param (callable(TValue,TKey): bool)|null $callback + * @param TFirstDefault|(\Closure(): TFirstDefault) $default + * @return TValue|TFirstDefault */ public function first(callable $callback = null, $default = null); @@ -437,7 +482,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * @param string $key * @param mixed $operator * @param mixed $value - * @return mixed + * @return TValue|null */ public function firstWhere($key, $operator = null, $value = null); @@ -452,44 +497,54 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Flip the values with their keys. * - * @return static + * @return static */ public function flip(); /** * Get an item from the collection by key. * - * @param mixed $key - * @param mixed $default - * @return mixed + * @template TGetDefault + * + * @param TKey $key + * @param TGetDefault|(\Closure(): TGetDefault) $default + * @return TValue|TGetDefault */ public function get($key, $default = null); /** * Group an associative array by a field or using a callback. * - * @param array|callable|string $groupBy + * @param (callable(TValue, TKey): array-key)|array|string $groupBy * @param bool $preserveKeys - * @return static + * @return static> */ public function groupBy($groupBy, $preserveKeys = false); /** * Key an associative array by a field or using a callback. * - * @param callable|string $keyBy - * @return static + * @param (callable(TValue, TKey): array-key)|array|string $keyBy + * @return static */ public function keyBy($keyBy); /** * Determine if an item exists in the collection by key. * - * @param mixed $key + * @param TKey|array $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); + /** * Concatenate values of a given key as a string. * @@ -502,7 +557,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Intersect the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersect($items); @@ -510,7 +565,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Intersect the collection with the given items by key. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersectByKeys($items); @@ -529,6 +584,13 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, */ 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. * @@ -541,24 +603,28 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the keys of the collection items. * - * @return static + * @return static */ public function keys(); /** * Get the last item from the collection. * - * @param callable|null $callback - * @param mixed $default - * @return mixed + * @template TLastDefault + * + * @param (callable(TValue, TKey): bool)|null $callback + * @param TLastDefault|(\Closure(): TLastDefault) $default + * @return TValue|TLastDefault */ public function last(callable $callback = null, $default = null); /** * Run a map over each of the items. * - * @param callable $callback - * @return static + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return static */ public function map(callable $callback); @@ -575,8 +641,11 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * * The callback should return an associative array with a single key/value pair. * - * @param callable $callback - * @return static + * @template TMapToDictionaryKey of array-key + * @template TMapToDictionaryValue + * + * @param callable(TValue, TKey): array $callback + * @return static> */ public function mapToDictionary(callable $callback); @@ -585,8 +654,11 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * * The callback should return an associative array with a single key/value pair. * - * @param callable $callback - * @return static + * @template TMapToGroupsKey of array-key + * @template TMapToGroupsValue + * + * @param callable(TValue, TKey): array $callback + * @return static> */ public function mapToGroups(callable $callback); @@ -595,31 +667,36 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * * The callback should return an associative array with a single key/value pair. * - * @param callable $callback - * @return static + * @template TMapWithKeysKey of array-key + * @template TMapWithKeysValue + * + * @param callable(TValue, TKey): array $callback + * @return static */ public function mapWithKeys(callable $callback); /** * Map a collection and flatten the result by a single level. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey): mixed $callback + * @return static */ public function flatMap(callable $callback); /** * Map the values into a new class. * - * @param string $class - * @return static + * @template TMapIntoValue + * + * @param class-string $class + * @return static */ public function mapInto($class); /** * Merge the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function merge($items); @@ -627,23 +704,27 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Recursively merge the collection with the given items. * - * @param mixed $items - * @return static + * @template TMergeRecursiveValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static */ public function mergeRecursive($items); /** * Create a collection by using this collection for keys and another for its values. * - * @param mixed $values - * @return static + * @template TCombineValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static */ public function combine($values); /** * Union the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function union($items); @@ -651,16 +732,16 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the min value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue):mixed)|string|null $callback + * @return TValue */ public function min($callback = null); /** * Get the max value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue):mixed)|string|null $callback + * @return TValue */ public function max($callback = null); @@ -676,7 +757,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Get the items with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array $keys * @return static */ public function only($keys); @@ -693,17 +774,17 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Partition the collection into two arrays using the given callback or key. * - * @param callable|string $key + * @param (callable(TValue, TKey): bool)|TValue|string $key * @param mixed $operator * @param mixed $value - * @return static + * @return static, static> */ public function partition($key, $operator = null, $value = null); /** * Push all of the given items onto the collection. * - * @param iterable $source + * @param iterable $source * @return static */ public function concat($source); @@ -712,7 +793,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * Get one or a specified number of items randomly from the collection. * * @param int|null $number - * @return static|mixed + * @return static|TValue * * @throws \InvalidArgumentException */ @@ -721,16 +802,30 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Reduce the collection to a single value. * - * @param callable $callback - * @param mixed $initial - * @return mixed + * @template TReduceInitial + * @template TReduceReturnType + * + * @param callable(TReduceInitial|TReduceReturnType, TValue, TKey): 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 + */ + public function reduceSpread(callable $callback, ...$initial); + /** * Replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replace($items); @@ -738,7 +833,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Recursively replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replaceRecursive($items); @@ -753,9 +848,9 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Search the collection for a given value and return the corresponding key if successful. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @param bool $strict - * @return mixed + * @return TKey|bool */ public function search($value, $strict = false); @@ -767,6 +862,15 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, */ 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 + */ + public function sliding($size = 2, $step = 1); + /** * Skip the first {$count} items. * @@ -778,7 +882,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Skip items in the collection until the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function skipUntil($value); @@ -786,7 +890,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Skip items in the collection while the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function skipWhile($value); @@ -804,30 +908,63 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * Split a collection into a certain number of groups. * * @param int $numberOfGroups - * @return 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 + * @return static */ public function chunk($size); /** * Chunk the collection into chunks with a callback. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey, static): bool $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 + */ + public function splitIn($numberOfGroups); + /** * Sort through each item with a callback. * - * @param callable|null|int $callback + * @param (callable(TValue, TValue): int)|null|int $callback * @return static */ public function sort($callback = null); @@ -843,7 +980,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Sort the collection using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @param bool $descending * @return static @@ -853,7 +990,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Sort the collection in descending order using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @return static */ @@ -876,10 +1013,18 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, */ public function sortKeysDesc($options = SORT_REGULAR); + /** + * Sort the collection keys using a callback. + * + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function sortKeysUsing(callable $callback); + /** * Get the sum of the given values. * - * @param callable|string|null $callback + * @param (callable(TValue): mixed)|string|null $callback * @return mixed */ public function sum($callback = null); @@ -895,7 +1040,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Take items in the collection until the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function takeUntil($value); @@ -903,7 +1048,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Take items in the collection while the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function takeWhile($value); @@ -911,7 +1056,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Pass the collection to the given callback and then return it. * - * @param callable $callback + * @param callable(TValue): mixed $callback * @return $this */ public function tap(callable $callback); @@ -919,32 +1064,57 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Pass the enumerable to the given callback and return the result. * - * @param callable $callback - * @return mixed + * @template TPipeReturnType + * + * @param callable($this): TPipeReturnType $callback + * @return TPipeReturnType */ public function pipe(callable $callback); + /** + * Pass the collection into a new class. + * + * @param class-string $class + * @return mixed + */ + public function pipeInto($class); + + /** + * Pass the collection through a series of callable pipes and return the result. + * + * @param array $pipes + * @return mixed + */ + public function pipeThrough($pipes); + /** * Get the values of a given key. * - * @param string|array $value + * @param string|array $value * @param string|null $key - * @return static + * @return static */ public function pluck($value, $key = null); /** * Create a collection of all elements that do not pass a given truth test. * - * @param callable|mixed $callback + * @param (callable(TValue, TKey): bool)|bool $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 string|callable|null $key + * @param (callable(TValue, TKey): mixed)|string|null $key * @param bool $strict * @return static */ @@ -953,7 +1123,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Return only unique items from the collection array using strict comparison. * - * @param string|callable|null $key + * @param (callable(TValue, TKey): mixed)|string|null $key * @return static */ public function uniqueStrict($key = null); @@ -961,24 +1131,40 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Reset the keys on the underlying array. * - * @return static + * @return static */ public function values(); /** * Pad collection to the specified length with a value. * + * @template TPadValue + * * @param int $size - * @param mixed $value - * @return static + * @param TPadValue $value + * @return static */ public function pad($size, $value); /** - * Count the number of items in the collection using a given truth test. + * Get the values iterator. * - * @param callable|null $callback - * @return static + * @return \Traversable + */ + public function getIterator(): Traversable; + + /** + * Count the number of items in the collection. + * + * @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 */ public function countBy($callback = null); @@ -988,18 +1174,50 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]); * => [[1, 4], [2, 5], [3, 6]] * - * @param mixed ...$items - * @return static + * @template TZipValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return static> */ public function zip($items); /** * Collect the values into a collection. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function collect(); + /** + * Get the collection of items as a plain array. + * + * @return array + */ + public function toArray(); + + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + 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. * @@ -1007,6 +1225,14 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, */ 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/vendor/illuminate/collections/LazyCollection.php b/vendor/illuminate/collections/LazyCollection.php index 09f6114..2a9b93c 100644 --- a/vendor/illuminate/collections/LazyCollection.php +++ b/vendor/illuminate/collections/LazyCollection.php @@ -5,26 +5,39 @@ namespace Illuminate\Support; 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; -class LazyCollection implements Enumerable +/** + * @template TKey of array-key + * @template TValue + * + * @implements \Illuminate\Support\Enumerable + */ +class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable { + /** + * @use \Illuminate\Support\Traits\EnumeratesValues + */ use EnumeratesValues, Macroable; /** * The source from which to generate items. * - * @var callable|static + * @var (Closure(): \Generator)|static|array */ public $source; /** * Create a new lazy collection instance. * - * @param mixed $source + * @param \Illuminate\Contracts\Support\Arrayable|iterable|(Closure(): \Generator)|self|array|null $source * @return void */ public function __construct($source = null) @@ -33,17 +46,35 @@ class LazyCollection implements Enumerable $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|iterable|(Closure(): \Generator)|self|array|null $items + * @return static + */ + public static function make($items = []) + { + return new static($items); + } + /** * Create a collection with the given range. * * @param int $from * @param int $to - * @return static + * @return static */ public static function range($from, $to) { @@ -63,7 +94,7 @@ class LazyCollection implements Enumerable /** * Get all items in the enumerable. * - * @return array + * @return array */ public function all() { @@ -125,8 +156,8 @@ class LazyCollection implements Enumerable /** * Get the average value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue): float|int)|string|null $callback + * @return float|int|null */ public function avg($callback = null) { @@ -136,8 +167,8 @@ class LazyCollection implements Enumerable /** * Get the median of a given key. * - * @param string|array|null $key - * @return mixed + * @param string|array|null $key + * @return float|int|null */ public function median($key = null) { @@ -147,8 +178,8 @@ class LazyCollection implements Enumerable /** * Get the mode of a given key. * - * @param string|array|null $key - * @return array|null + * @param string|array|null $key + * @return array|null */ public function mode($key = null) { @@ -158,7 +189,7 @@ class LazyCollection implements Enumerable /** * Collapse the collection of items into a single array. * - * @return static + * @return static */ public function collapse() { @@ -176,7 +207,7 @@ class LazyCollection implements Enumerable /** * Determine if an item exists in the enumerable. * - * @param mixed $key + * @param (callable(TValue, TKey): bool)|TValue|string $key * @param mixed $operator * @param mixed $value * @return bool @@ -186,6 +217,7 @@ class LazyCollection implements Enumerable if (func_num_args() === 1 && $this->useAsCallable($key)) { $placeholder = new stdClass; + /** @var callable $key */ return $this->first($key, $placeholder) !== $placeholder; } @@ -204,11 +236,27 @@ class LazyCollection implements Enumerable return $this->contains($this->operatorForWhere(...func_get_args())); } + /** + * Determine if an item is not contained in the enumerable. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function doesntContain($key, $operator = null, $value = null) + { + return ! $this->contains(...func_get_args()); + } + /** * Cross join the given iterables, returning all possible permutations. * - * @param array ...$arrays - * @return static + * @template TCrossJoinKey + * @template TCrossJoinValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$arrays + * @return static> */ public function crossJoin(...$arrays) { @@ -218,8 +266,8 @@ class LazyCollection implements Enumerable /** * Count the number of items in the collection by a field or using a callback. * - * @param callable|string $countBy - * @return static + * @param (callable(TValue, TKey): mixed)|string|null $countBy + * @return static */ public function countBy($countBy = null) { @@ -247,7 +295,7 @@ class LazyCollection implements Enumerable /** * Get the items that are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diff($items) @@ -258,8 +306,8 @@ class LazyCollection implements Enumerable /** * Get the items that are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback * @return static */ public function diffUsing($items, callable $callback) @@ -270,7 +318,7 @@ class LazyCollection implements Enumerable /** * Get the items whose keys and values are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffAssoc($items) @@ -281,8 +329,8 @@ class LazyCollection implements Enumerable /** * Get the items whose keys and values are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffAssocUsing($items, callable $callback) @@ -293,7 +341,7 @@ class LazyCollection implements Enumerable /** * Get the items whose keys are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffKeys($items) @@ -304,8 +352,8 @@ class LazyCollection implements Enumerable /** * Get the items whose keys are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffKeysUsing($items, callable $callback) @@ -316,7 +364,7 @@ class LazyCollection implements Enumerable /** * Retrieve duplicate items. * - * @param callable|string|null $callback + * @param (callable(TValue): bool)|string|null $callback * @param bool $strict * @return static */ @@ -328,7 +376,7 @@ class LazyCollection implements Enumerable /** * Retrieve duplicate items using strict comparison. * - * @param callable|string|null $callback + * @param (callable(TValue): bool)|string|null $callback * @return static */ public function duplicatesStrict($callback = null) @@ -339,7 +387,7 @@ class LazyCollection implements Enumerable /** * Get all items except for those with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array $keys * @return static */ public function except($keys) @@ -350,7 +398,7 @@ class LazyCollection implements Enumerable /** * Run a filter over each of the items. * - * @param callable|null $callback + * @param (callable(TValue): bool)|null $callback * @return static */ public function filter(callable $callback = null) @@ -373,9 +421,11 @@ class LazyCollection implements Enumerable /** * Get the first item from the enumerable passing the given truth test. * - * @param callable|null $callback - * @param mixed $default - * @return mixed + * @template TFirstDefault + * + * @param (callable(TValue): bool)|null $callback + * @param TFirstDefault|(\Closure(): TFirstDefault) $default + * @return TValue|TFirstDefault */ public function first(callable $callback = null, $default = null) { @@ -402,7 +452,7 @@ class LazyCollection implements Enumerable * Get a flattened list of the items in the collection. * * @param int $depth - * @return static + * @return static */ public function flatten($depth = INF) { @@ -424,7 +474,7 @@ class LazyCollection implements Enumerable /** * Flip the items in the collection. * - * @return static + * @return static */ public function flip() { @@ -438,9 +488,11 @@ class LazyCollection implements Enumerable /** * Get an item by key. * - * @param mixed $key - * @param mixed $default - * @return mixed + * @template TGetDefault + * + * @param TKey|null $key + * @param TGetDefault|(\Closure(): TGetDefault) $default + * @return TValue|TGetDefault */ public function get($key, $default = null) { @@ -460,9 +512,9 @@ class LazyCollection implements Enumerable /** * Group an associative array by a field or using a callback. * - * @param array|callable|string $groupBy + * @param (callable(TValue, TKey): array-key)|array|string $groupBy * @param bool $preserveKeys - * @return static + * @return static> */ public function groupBy($groupBy, $preserveKeys = false) { @@ -472,8 +524,8 @@ class LazyCollection implements Enumerable /** * Key an associative array by a field or using a callback. * - * @param callable|string $keyBy - * @return static + * @param (callable(TValue, TKey): array-key)|array|string $keyBy + * @return static */ public function keyBy($keyBy) { @@ -512,6 +564,25 @@ class LazyCollection implements Enumerable return false; } + /** + * Determine if any of the keys exist in the collection. + * + * @param mixed $key + * @return bool + */ + public function hasAny($key) + { + $keys = array_flip(is_array($key) ? $key : func_get_args()); + + foreach ($this as $key => $value) { + if (array_key_exists($key, $keys)) { + return true; + } + } + + return false; + } + /** * Concatenate values of a given key as a string. * @@ -527,7 +598,7 @@ class LazyCollection implements Enumerable /** * Intersect the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersect($items) @@ -538,7 +609,7 @@ class LazyCollection implements Enumerable /** * Intersect the collection with the given items by key. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersectByKeys($items) @@ -581,7 +652,7 @@ class LazyCollection implements Enumerable /** * Get the keys of the collection items. * - * @return static + * @return static */ public function keys() { @@ -595,9 +666,11 @@ class LazyCollection implements Enumerable /** * Get the last item from the collection. * - * @param callable|null $callback - * @param mixed $default - * @return mixed + * @template TLastDefault + * + * @param (callable(TValue, TKey): bool)|null $callback + * @param TLastDefault|(\Closure(): TLastDefault) $default + * @return TValue|TLastDefault */ public function last(callable $callback = null, $default = null) { @@ -615,9 +688,9 @@ class LazyCollection implements Enumerable /** * Get the values of a given key. * - * @param string|array $value + * @param string|array $value * @param string|null $key - * @return static + * @return static */ public function pluck($value, $key = null) { @@ -645,8 +718,10 @@ class LazyCollection implements Enumerable /** * Run a map over each of the items. * - * @param callable $callback - * @return static + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return static */ public function map(callable $callback) { @@ -662,8 +737,11 @@ class LazyCollection implements Enumerable * * The callback should return an associative array with a single key/value pair. * - * @param callable $callback - * @return static + * @template TMapToDictionaryKey of array-key + * @template TMapToDictionaryValue + * + * @param callable(TValue, TKey): array $callback + * @return static> */ public function mapToDictionary(callable $callback) { @@ -675,8 +753,11 @@ class LazyCollection implements Enumerable * * The callback should return an associative array with a single key/value pair. * - * @param callable $callback - * @return static + * @template TMapWithKeysKey of array-key + * @template TMapWithKeysValue + * + * @param callable(TValue, TKey): array $callback + * @return static */ public function mapWithKeys(callable $callback) { @@ -690,7 +771,7 @@ class LazyCollection implements Enumerable /** * Merge the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function merge($items) @@ -701,8 +782,10 @@ class LazyCollection implements Enumerable /** * Recursively merge the collection with the given items. * - * @param mixed $items - * @return static + * @template TMergeRecursiveValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static */ public function mergeRecursive($items) { @@ -712,8 +795,10 @@ class LazyCollection implements Enumerable /** * Create a collection by using this collection for keys and another for its values. * - * @param mixed $values - * @return static + * @template TCombineValue + * + * @param \IteratorAggregate|array|(callable(): \Generator) $values + * @return static */ public function combine($values) { @@ -743,7 +828,7 @@ class LazyCollection implements Enumerable /** * Union the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function union($items) @@ -776,7 +861,7 @@ class LazyCollection implements Enumerable /** * Get the items with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array $keys * @return static */ public function only($keys) @@ -811,7 +896,7 @@ class LazyCollection implements Enumerable /** * Push all of the given items onto the collection. * - * @param iterable $source + * @param iterable $source * @return static */ public function concat($source) @@ -826,7 +911,7 @@ class LazyCollection implements Enumerable * Get one or a specified number of items randomly from the collection. * * @param int|null $number - * @return static|mixed + * @return static|TValue * * @throws \InvalidArgumentException */ @@ -840,7 +925,7 @@ class LazyCollection implements Enumerable /** * Replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replace($items) @@ -867,7 +952,7 @@ class LazyCollection implements Enumerable /** * Recursively replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replaceRecursive($items) @@ -888,12 +973,13 @@ class LazyCollection implements Enumerable /** * Search the collection for a given value and return the corresponding key if successful. * - * @param mixed $value + * @param TValue|(callable(TValue,TKey): bool) $value * @param bool $strict - * @return mixed + * @return TKey|bool */ public function search($value, $strict = false) { + /** @var (callable(TValue,TKey): bool) $predicate */ $predicate = $this->useAsCallable($value) ? $value : function ($item) use ($value, $strict) { @@ -925,7 +1011,7 @@ class LazyCollection implements Enumerable * * @param int $size * @param int $step - * @return static + * @return static */ public function sliding($size = 2, $step = 1) { @@ -938,7 +1024,7 @@ class LazyCollection implements Enumerable $chunk[$iterator->key()] = $iterator->current(); if (count($chunk) == $size) { - yield tap(new static($chunk), function () use (&$chunk, $step) { + yield (new static($chunk))->tap(function () use (&$chunk, $step) { $chunk = array_slice($chunk, $step, null, true); }); @@ -985,7 +1071,7 @@ class LazyCollection implements Enumerable /** * Skip items in the collection until the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function skipUntil($value) @@ -998,7 +1084,7 @@ class LazyCollection implements Enumerable /** * Skip items in the collection while the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $value * @return static */ public function skipWhile($value) @@ -1042,7 +1128,7 @@ class LazyCollection implements Enumerable * Split a collection into a certain number of groups. * * @param int $numberOfGroups - * @return static + * @return static */ public function split($numberOfGroups) { @@ -1052,10 +1138,10 @@ class LazyCollection implements Enumerable /** * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. * - * @param mixed $key + * @param (callable(TValue, TKey): bool)|string $key * @param mixed $operator * @param mixed $value - * @return mixed + * @return TValue * * @throws \Illuminate\Support\ItemNotFoundException * @throws \Illuminate\Support\MultipleItemsFoundException @@ -1067,7 +1153,7 @@ class LazyCollection implements Enumerable : $key; return $this - ->when($filter) + ->unless($filter == null) ->filter($filter) ->take(2) ->collect() @@ -1077,10 +1163,10 @@ class LazyCollection implements Enumerable /** * Get the first item in the collection but throw an exception if no matching items exist. * - * @param mixed $key + * @param (callable(TValue, TKey): bool)|string $key * @param mixed $operator * @param mixed $value - * @return mixed + * @return TValue * * @throws \Illuminate\Support\ItemNotFoundException */ @@ -1091,7 +1177,7 @@ class LazyCollection implements Enumerable : $key; return $this - ->when($filter) + ->unless($filter == null) ->filter($filter) ->take(1) ->collect() @@ -1102,7 +1188,7 @@ class LazyCollection implements Enumerable * Chunk the collection into chunks of the given size. * * @param int $size - * @return static + * @return static */ public function chunk($size) { @@ -1141,7 +1227,7 @@ class LazyCollection implements Enumerable * Split a collection into a certain number of groups, and fill the first groups completely. * * @param int $numberOfGroups - * @return static + * @return static */ public function splitIn($numberOfGroups) { @@ -1151,8 +1237,8 @@ class LazyCollection implements Enumerable /** * Chunk the collection into chunks with a callback. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey, Collection): bool $callback + * @return static> */ public function chunkWhile(callable $callback) { @@ -1188,7 +1274,7 @@ class LazyCollection implements Enumerable /** * Sort through each item with a callback. * - * @param callable|null|int $callback + * @param (callable(TValue, TValue): int)|null|int $callback * @return static */ public function sort($callback = null) @@ -1210,7 +1296,7 @@ class LazyCollection implements Enumerable /** * Sort the collection using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @param bool $descending * @return static @@ -1223,7 +1309,7 @@ class LazyCollection implements Enumerable /** * Sort the collection in descending order using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @return static */ @@ -1255,6 +1341,17 @@ class LazyCollection implements Enumerable return $this->passthru('sortKeysDesc', func_get_args()); } + /** + * Sort the collection keys using a callback. + * + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function sortKeysUsing(callable $callback) + { + return $this->passthru('sortKeysUsing', func_get_args()); + } + /** * Take the first or last {$limit} items. * @@ -1287,11 +1384,12 @@ class LazyCollection implements Enumerable /** * Take items in the collection until the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $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) { @@ -1315,19 +1413,30 @@ class LazyCollection implements Enumerable { $timeout = $timeout->getTimestamp(); - return $this->takeWhile(function () use ($timeout) { - return $this->now() < $timeout; + return new static(function () use ($timeout) { + if ($this->now() >= $timeout) { + return; + } + + foreach ($this as $key => $value) { + yield $key => $value; + + if ($this->now() >= $timeout) { + break; + } + } }); } /** * Take items in the collection while the given condition is met. * - * @param mixed $value + * @param TValue|callable(TValue,TKey): bool $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) { @@ -1338,7 +1447,7 @@ class LazyCollection implements Enumerable /** * Pass each item in the collection to the given callback, lazily. * - * @param callable $callback + * @param callable(TValue, TKey): mixed $callback * @return static */ public function tapEach(callable $callback) @@ -1353,10 +1462,44 @@ class LazyCollection implements Enumerable } /** - * Reset the keys on the underlying array. + * Convert a flatten "dot" notation array into an expanded array. * * @return static */ + public function undot() + { + return $this->passthru('undot', []); + } + + /** + * 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); + + return new static(function () use ($callback, $strict) { + $exists = []; + + foreach ($this as $key => $item) { + if (! in_array($id = $callback($item, $key), $exists, $strict)) { + yield $key => $item; + + $exists[] = $id; + } + } + }); + } + + /** + * Reset the keys on the underlying array. + * + * @return static + */ public function values() { return new static(function () { @@ -1372,8 +1515,10 @@ class LazyCollection implements Enumerable * e.g. new LazyCollection([1, 2, 3])->zip([4, 5, 6]); * => [[1, 4], [2, 5], [3, 6]] * - * @param mixed ...$items - * @return static + * @template TZipValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return static> */ public function zip($items) { @@ -1395,9 +1540,11 @@ class LazyCollection implements Enumerable /** * Pad collection to the specified length with a value. * + * @template TPadValue + * * @param int $size - * @param mixed $value - * @return static + * @param TPadValue $value + * @return static */ public function pad($size, $value) { @@ -1423,10 +1570,9 @@ class LazyCollection implements Enumerable /** * Get the values iterator. * - * @return \Traversable + * @return \Traversable */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return $this->makeIterator($this->source); } @@ -1436,8 +1582,7 @@ class LazyCollection implements Enumerable * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { if (is_array($this->source)) { return count($this->source); @@ -1449,8 +1594,11 @@ class LazyCollection implements Enumerable /** * Make an iterator from the given source. * - * @param mixed $source - * @return \Traversable + * @template TIteratorKey of array-key + * @template TIteratorValue + * + * @param \IteratorAggregate|array|(callable(): \Generator) $source + * @return \Traversable */ protected function makeIterator($source) { @@ -1468,9 +1616,9 @@ class LazyCollection implements Enumerable /** * Explode the "value" and "key" arguments passed to "pluck". * - * @param string|array $value - * @param string|array|null $key - * @return array + * @param string|string[] $value + * @param string|string[]|null $key + * @return array{string[],string[]|null} */ protected function explodePluckParameters($value, $key) { @@ -1485,7 +1633,7 @@ class LazyCollection implements Enumerable * Pass this lazy collection through a method on the collection class. * * @param string $method - * @param array $params + * @param array $params * @return static */ protected function passthru($method, array $params) diff --git a/vendor/illuminate/collections/MultipleItemsFoundException.php b/vendor/illuminate/collections/MultipleItemsFoundException.php index 944b2dc..d90d835 100644 --- a/vendor/illuminate/collections/MultipleItemsFoundException.php +++ b/vendor/illuminate/collections/MultipleItemsFoundException.php @@ -6,4 +6,35 @@ use RuntimeException; class MultipleItemsFoundException extends RuntimeException { + /** + * The number of items found. + * + * @var int + */ + public $count; + + /** + * Create a new exception instance. + * + * @param int $count + * @param int $code + * @param \Throwable|null $previous + * @return void + */ + public function __construct($count, $code = 0, $previous = null) + { + $this->count = $count; + + parent::__construct("$count items were found.", $code, $previous); + } + + /** + * Get the number of items found. + * + * @return int + */ + public function getCount() + { + return $this->count; + } } diff --git a/vendor/illuminate/collections/Traits/EnumeratesValues.php b/vendor/illuminate/collections/Traits/EnumeratesValues.php index 19f32a3..fec5502 100644 --- a/vendor/illuminate/collections/Traits/EnumeratesValues.php +++ b/vendor/illuminate/collections/Traits/EnumeratesValues.php @@ -11,15 +11,19 @@ use Illuminate\Support\Arr; 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 @@ -32,28 +36,40 @@ use Traversable; * @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. + * + * @var bool + */ + protected $escapeWhenCastingToString = false; + /** * The methods that can be proxied. * - * @var string[] + * @var array */ protected static $proxies = [ 'average', 'avg', 'contains', + 'doesntContain', 'each', 'every', 'filter', @@ -75,14 +91,19 @@ trait EnumeratesValues 'takeUntil', 'takeWhile', 'unique', + 'unless', 'until', + 'when', ]; /** * Create a new collection instance if the value isn't one already. * - * @param mixed $items - * @return static + * @template TMakeKey of array-key + * @template TMakeValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items + * @return static */ public static function make($items = []) { @@ -92,8 +113,11 @@ trait EnumeratesValues /** * Wrap the given value in a collection if applicable. * - * @param mixed $value - * @return static + * @template TWrapKey of array-key + * @template TWrapValue + * + * @param iterable $value + * @return static */ public static function wrap($value) { @@ -105,8 +129,11 @@ trait EnumeratesValues /** * Get the underlying items from the given collection if applicable. * - * @param array|static $value - * @return array + * @template TUnwrapKey of array-key + * @template TUnwrapValue + * + * @param array|static $value + * @return array */ public static function unwrap($value) { @@ -126,9 +153,11 @@ trait EnumeratesValues /** * Create a new collection by invoking the callback a given amount of times. * + * @template TTimesValue + * * @param int $number - * @param callable|null $callback - * @return static + * @param (callable(int): TTimesValue)|null $callback + * @return static */ public static function times($number, callable $callback = null) { @@ -137,15 +166,15 @@ trait EnumeratesValues } return static::range(1, $number) - ->when($callback) + ->unless($callback == null) ->map($callback); } /** * Alias for the "avg" method. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue): float|int)|string|null $callback + * @return float|int|null */ public function average($callback = null) { @@ -155,7 +184,7 @@ trait EnumeratesValues /** * Alias for the "contains" method. * - * @param mixed $key + * @param (callable(TValue, TKey): bool)|TValue|string $key * @param mixed $operator * @param mixed $value * @return bool @@ -168,8 +197,8 @@ trait EnumeratesValues /** * Determine if an item exists, using strict comparison. * - * @param mixed $key - * @param mixed $value + * @param (callable(TValue): bool)|TValue|array-key $key + * @param TValue|null $value * @return bool */ public function containsStrict($key, $value = null) @@ -197,7 +226,7 @@ trait EnumeratesValues * Dump the items and end the script. * * @param mixed ...$args - * @return void + * @return never */ public function dd(...$args) { @@ -225,7 +254,7 @@ trait EnumeratesValues /** * Execute a callback over each item. * - * @param callable $callback + * @param callable(TValue, TKey): mixed $callback * @return $this */ public function each(callable $callback) @@ -242,7 +271,7 @@ trait EnumeratesValues /** * Execute a callback over each nested chunk of items. * - * @param callable $callback + * @param callable(...mixed): mixed $callback * @return static */ public function eachSpread(callable $callback) @@ -257,7 +286,7 @@ trait EnumeratesValues /** * Determine if all items pass the given truth test. * - * @param string|callable $key + * @param (callable(TValue, TKey): bool)|TValue|string $key * @param mixed $operator * @param mixed $value * @return bool @@ -285,7 +314,7 @@ trait EnumeratesValues * @param string $key * @param mixed $operator * @param mixed $value - * @return mixed + * @return TValue|null */ public function firstWhere($key, $operator = null, $value = null) { @@ -305,8 +334,10 @@ trait EnumeratesValues /** * Run a map over each nested chunk of items. * - * @param callable $callback - * @return static + * @template TMapSpreadValue + * + * @param callable(mixed): TMapSpreadValue $callback + * @return static */ public function mapSpread(callable $callback) { @@ -322,8 +353,11 @@ trait EnumeratesValues * * The callback should return an associative array with a single key/value pair. * - * @param callable $callback - * @return static + * @template TMapToGroupsKey of array-key + * @template TMapToGroupsValue + * + * @param callable(TValue, TKey): array $callback + * @return static> */ public function mapToGroups(callable $callback) { @@ -335,8 +369,8 @@ trait EnumeratesValues /** * Map a collection and flatten the result by a single level. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey): mixed $callback + * @return static */ public function flatMap(callable $callback) { @@ -346,8 +380,10 @@ trait EnumeratesValues /** * Map the values into a new class. * - * @param string $class - * @return static + * @template TMapIntoValue + * + * @param class-string $class + * @return static */ public function mapInto($class) { @@ -359,8 +395,8 @@ trait EnumeratesValues /** * Get the min value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue):mixed)|string|null $callback + * @return TValue */ public function min($callback = null) { @@ -378,8 +414,8 @@ trait EnumeratesValues /** * Get the max value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue):mixed)|string|null $callback + * @return TValue */ public function max($callback = null) { @@ -411,10 +447,10 @@ trait EnumeratesValues /** * Partition the collection into two arrays using the given callback or key. * - * @param callable|string $key - * @param mixed $operator - * @param mixed $value - * @return static + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param TValue|string|null $operator + * @param TValue|null $value + * @return static, static> */ public function partition($key, $operator = null, $value = null) { @@ -439,7 +475,7 @@ trait EnumeratesValues /** * Get the sum of the given values. * - * @param callable|string|null $callback + * @param (callable(TValue): mixed)|string|null $callback * @return mixed */ public function sum($callback = null) @@ -453,35 +489,14 @@ trait EnumeratesValues }, 0); } - /** - * Apply the callback if the value is truthy. - * - * @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 $callback - * @param callable|null $default - * @return static|mixed + * @template TWhenEmptyReturnType + * + * @param (callable($this): TWhenEmptyReturnType) $callback + * @param (callable($this): TWhenEmptyReturnType)|null $default + * @return $this|TWhenEmptyReturnType */ public function whenEmpty(callable $callback, callable $default = null) { @@ -491,34 +506,25 @@ trait EnumeratesValues /** * Apply the callback if the collection is not empty. * - * @param callable $callback - * @param callable|null $default - * @return static|mixed + * @template TWhenNotEmptyReturnType + * + * @param callable($this): TWhenNotEmptyReturnType $callback + * @param (callable($this): TWhenNotEmptyReturnType)|null $default + * @return $this|TWhenNotEmptyReturnType */ public function whenNotEmpty(callable $callback, callable $default = null) { return $this->when($this->isNotEmpty(), $callback, $default); } - /** - * Apply the callback if the value is falsy. - * - * @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 $callback - * @param callable|null $default - * @return static|mixed + * @template TUnlessEmptyReturnType + * + * @param callable($this): TUnlessEmptyReturnType $callback + * @param (callable($this): TUnlessEmptyReturnType)|null $default + * @return $this|TUnlessEmptyReturnType */ public function unlessEmpty(callable $callback, callable $default = null) { @@ -528,9 +534,11 @@ trait EnumeratesValues /** * Apply the callback unless the collection is not empty. * - * @param callable $callback - * @param callable|null $default - * @return static|mixed + * @template TUnlessNotEmptyReturnType + * + * @param callable($this): TUnlessNotEmptyReturnType $callback + * @param (callable($this): TUnlessNotEmptyReturnType)|null $default + * @return $this|TUnlessNotEmptyReturnType */ public function unlessNotEmpty(callable $callback, callable $default = null) { @@ -588,7 +596,7 @@ trait EnumeratesValues * Filter items by the given key value pair. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @param bool $strict * @return static */ @@ -605,7 +613,7 @@ trait EnumeratesValues * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereInStrict($key, $values) @@ -617,7 +625,7 @@ trait EnumeratesValues * Filter items such that the value of the given key is between the given values. * * @param string $key - * @param array $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereBetween($key, $values) @@ -629,7 +637,7 @@ trait EnumeratesValues * Filter items such that the value of the given key is not between the given values. * * @param string $key - * @param array $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereNotBetween($key, $values) @@ -643,7 +651,7 @@ trait EnumeratesValues * Filter items by the given key value pair. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @param bool $strict * @return static */ @@ -660,7 +668,7 @@ trait EnumeratesValues * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereNotInStrict($key, $values) @@ -671,7 +679,7 @@ trait EnumeratesValues /** * Filter the items, removing any items that don't match the given type(s). * - * @param string|string[] $type + * @param class-string|array $type * @return static */ public function whereInstanceOf($type) @@ -694,8 +702,10 @@ trait EnumeratesValues /** * Pass the collection to the given callback and return the result. * - * @param callable $callback - * @return mixed + * @template TPipeReturnType + * + * @param callable($this): TPipeReturnType $callback + * @return TPipeReturnType */ public function pipe(callable $callback) { @@ -705,7 +715,7 @@ trait EnumeratesValues /** * Pass the collection into a new class. * - * @param string $class + * @param class-string $class * @return mixed */ public function pipeInto($class) @@ -714,24 +724,30 @@ trait EnumeratesValues } /** - * Pass the collection to the given callback and then return it. + * Pass the collection through a series of callable pipes and return the result. * - * @param callable $callback - * @return $this + * @param array $callbacks + * @return mixed */ - public function tap(callable $callback) + public function pipeThrough($callbacks) { - $callback(clone $this); - - return $this; + return Collection::make($callbacks)->reduce( + function ($carry, $callback) { + return $callback($carry); + }, + $this, + ); } /** * Reduce the collection to a single value. * - * @param callable $callback - * @param mixed $initial - * @return mixed + * @template TReduceInitial + * @template TReduceReturnType + * + * @param callable(TReduceInitial|TReduceReturnType, TValue, TKey): TReduceReturnType $callback + * @param TReduceInitial $initial + * @return TReduceReturnType */ public function reduce(callable $callback, $initial = null) { @@ -745,21 +761,36 @@ trait EnumeratesValues } /** - * Reduce an associative collection to a single value. + * Reduce the collection to multiple aggregate values. * * @param callable $callback - * @param mixed $initial - * @return mixed + * @param mixed ...$initial + * @return array + * + * @throws \UnexpectedValueException */ - public function reduceWithKeys(callable $callback, $initial = null) + public function reduceSpread(callable $callback, ...$initial) { - return $this->reduce($callback, $initial); + $result = $initial; + + foreach ($this as $key => $value) { + $result = call_user_func_array($callback, array_merge($result, [$value, $key])); + + if (! is_array($result)) { + throw new UnexpectedValueException(sprintf( + "%s::reduceMany expects reducer to return an array, but got a '%s' instead.", + class_basename(static::class), gettype($result) + )); + } + } + + return $result; } /** * Create a collection of all elements that do not pass a given truth test. * - * @param callable|mixed $callback + * @param (callable(TValue, TKey): bool)|bool $callback * @return static */ public function reject($callback = true) @@ -773,10 +804,23 @@ trait EnumeratesValues }); } + /** + * 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 string|callable|null $key + * @param (callable(TValue, TKey): mixed)|string|null $key * @param bool $strict * @return static */ @@ -798,7 +842,7 @@ trait EnumeratesValues /** * Return only unique items from the collection array using strict comparison. * - * @param string|callable|null $key + * @param (callable(TValue, TKey): mixed)|string|null $key * @return static */ public function uniqueStrict($key = null) @@ -809,7 +853,7 @@ trait EnumeratesValues /** * Collect the values into a collection. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function collect() { @@ -819,7 +863,7 @@ trait EnumeratesValues /** * Get the collection of items as a plain array. * - * @return array + * @return array */ public function toArray() { @@ -831,10 +875,9 @@ trait EnumeratesValues /** * Convert the object into something JSON serializable. * - * @return array + * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return array_map(function ($value) { if ($value instanceof JsonSerializable) { @@ -878,7 +921,22 @@ trait EnumeratesValues */ public function __toString() { - return $this->toJson(); + return $this->escapeWhenCastingToString + ? e($this->toJson()) + : $this->toJson(); + } + + /** + * Indicate that the model's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true) + { + $this->escapeWhenCastingToString = $escape; + + return $this; } /** @@ -913,7 +971,7 @@ trait EnumeratesValues * Results array of items from Collection or Arrayable. * * @param mixed $items - * @return array + * @return array */ protected function getArrayableItems($items) { @@ -1015,7 +1073,7 @@ trait EnumeratesValues * Make a function to check an item's equality. * * @param mixed $value - * @return \Closure + * @return \Closure(mixed): bool */ protected function equality($value) { @@ -1040,7 +1098,7 @@ trait EnumeratesValues /** * Make a function that returns what's passed to it. * - * @return \Closure + * @return \Closure(TValue): TValue */ protected function identity() { diff --git a/vendor/illuminate/collections/composer.json b/vendor/illuminate/collections/composer.json index cb23d3e..cc9aad3 100644 --- a/vendor/illuminate/collections/composer.json +++ b/vendor/illuminate/collections/composer.json @@ -14,9 +14,10 @@ } ], "require": { - "php": "^7.3|^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0" + "php": "^8.0.2", + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0" }, "autoload": { "psr-4": { @@ -28,11 +29,11 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^5.1.4)." + "symfony/var-dumper": "Required to use the dump method (^6.0)." }, "config": { "sort-packages": true diff --git a/vendor/illuminate/collections/helpers.php b/vendor/illuminate/collections/helpers.php index 67669e5..45fc6d4 100644 --- a/vendor/illuminate/collections/helpers.php +++ b/vendor/illuminate/collections/helpers.php @@ -7,8 +7,11 @@ if (! function_exists('collect')) { /** * Create a collection from the given value. * - * @param mixed $value - * @return \Illuminate\Support\Collection + * @template TKey of array-key + * @template TValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $value + * @return \Illuminate\Support\Collection */ function collect($value = null) { @@ -58,7 +61,7 @@ if (! function_exists('data_get')) { if ($segment === '*') { if ($target instanceof Collection) { $target = $target->all(); - } elseif (! is_array($target)) { + } elseif (! is_iterable($target)) { return value($default); } diff --git a/vendor/illuminate/collections/HigherOrderWhenProxy.php b/vendor/illuminate/conditionable/HigherOrderWhenProxy.php similarity index 54% rename from vendor/illuminate/collections/HigherOrderWhenProxy.php rename to vendor/illuminate/conditionable/HigherOrderWhenProxy.php index 6653c03..173a783 100644 --- a/vendor/illuminate/collections/HigherOrderWhenProxy.php +++ b/vendor/illuminate/conditionable/HigherOrderWhenProxy.php @@ -2,17 +2,14 @@ namespace Illuminate\Support; -/** - * @mixin \Illuminate\Support\Enumerable - */ class HigherOrderWhenProxy { /** - * The collection being operated on. + * The target being conditionally operated on. * - * @var \Illuminate\Support\Enumerable + * @var mixed */ - protected $collection; + protected $target; /** * The condition for proxying. @@ -24,18 +21,18 @@ class HigherOrderWhenProxy /** * Create a new proxy instance. * - * @param \Illuminate\Support\Enumerable $collection + * @param mixed $target * @param bool $condition * @return void */ - public function __construct(Enumerable $collection, $condition) + public function __construct($target, $condition) { + $this->target = $target; $this->condition = $condition; - $this->collection = $collection; } /** - * Proxy accessing an attribute onto the collection. + * Proxy accessing an attribute onto the target. * * @param string $key * @return mixed @@ -43,12 +40,12 @@ class HigherOrderWhenProxy public function __get($key) { return $this->condition - ? $this->collection->{$key} - : $this->collection; + ? $this->target->{$key} + : $this->target; } /** - * Proxy a method call onto the collection. + * Proxy a method call on the target. * * @param string $method * @param array $parameters @@ -57,7 +54,7 @@ class HigherOrderWhenProxy public function __call($method, $parameters) { return $this->condition - ? $this->collection->{$method}(...$parameters) - : $this->collection; + ? $this->target->{$method}(...$parameters) + : $this->target; } } diff --git a/vendor/symfony/polyfill-php73/LICENSE b/vendor/illuminate/conditionable/LICENSE.md similarity index 83% rename from vendor/symfony/polyfill-php73/LICENSE rename to vendor/illuminate/conditionable/LICENSE.md index 3f853aa..79810c8 100644 --- a/vendor/symfony/polyfill-php73/LICENSE +++ b/vendor/illuminate/conditionable/LICENSE.md @@ -1,14 +1,16 @@ -Copyright (c) 2018-2019 Fabien Potencier +The MIT License (MIT) + +Copyright (c) Taylor Otwell 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/vendor/illuminate/conditionable/Traits/Conditionable.php b/vendor/illuminate/conditionable/Traits/Conditionable.php new file mode 100644 index 0000000..81451bc --- /dev/null +++ b/vendor/illuminate/conditionable/Traits/Conditionable.php @@ -0,0 +1,65 @@ +isVariadic()) { + $variadicDependencies = $container->make($className); + + $dependencies = array_merge($dependencies, is_array($variadicDependencies) + ? $variadicDependencies + : [$variadicDependencies]); } else { $dependencies[] = $container->make($className); } @@ -191,6 +197,6 @@ class BoundMethod */ protected static function isCallableWithAtSign($callback) { - return is_string($callback) && strpos($callback, '@') !== false; + return is_string($callback) && str_contains($callback, '@'); } } diff --git a/vendor/illuminate/container/Container.php b/vendor/illuminate/container/Container.php index 9aa69ac..37ae6e0 100755 --- a/vendor/illuminate/container/Container.php +++ b/vendor/illuminate/container/Container.php @@ -187,9 +187,11 @@ class Container implements ArrayAccess, ContainerContract } /** - * {@inheritdoc} + * {@inheritdoc} + * + * @return bool */ - public function has($id) + public function has(string $id): bool { return $this->bound($id); } @@ -607,7 +609,7 @@ class Container implements ArrayAccess, ContainerContract $instance = $this->make($abstract); foreach ($this->getReboundCallbacks($abstract) as $callback) { - call_user_func($callback, $this, $instance); + $callback($this, $instance); } } @@ -693,9 +695,11 @@ class Container implements ArrayAccess, ContainerContract } /** - * {@inheritdoc} + * {@inheritdoc} + * + * @return mixed */ - public function get($id) + public function get(string $id) { try { return $this->resolve($id); @@ -882,10 +886,6 @@ class Container implements ArrayAccess, ContainerContract return $this->notInstantiable($concrete); } - // if (in_array($concrete, $this->buildStack)) { - // throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}]."); - // } - $this->buildStack[] = $concrete; $constructor = $reflector->getConstructor(); @@ -1001,7 +1001,7 @@ class Container implements ArrayAccess, ContainerContract protected function resolvePrimitive(ReflectionParameter $parameter) { if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->getName()))) { - return $concrete instanceof Closure ? $concrete($this) : $concrete; + return Util::unwrapIfClosure($concrete, $this); } if ($parameter->isDefaultValueAvailable()) { @@ -1237,7 +1237,6 @@ class Container implements ArrayAccess, ContainerContract * @param string $abstract * @param object $object * @param array $callbacksPerType - * * @return array */ protected function getCallbacksForType($abstract, $object, array $callbacksPerType) @@ -1402,8 +1401,7 @@ class Container implements ArrayAccess, ContainerContract * @param string $key * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists($key): bool { return $this->bound($key); } @@ -1414,8 +1412,7 @@ class Container implements ArrayAccess, ContainerContract * @param string $key * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { return $this->make($key); } @@ -1427,8 +1424,7 @@ class Container implements ArrayAccess, ContainerContract * @param mixed $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { $this->bind($key, $value instanceof Closure ? $value : function () use ($value) { return $value; @@ -1441,8 +1437,7 @@ class Container implements ArrayAccess, ContainerContract * @param string $key * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { unset($this->bindings[$key], $this->instances[$key], $this->resolved[$key]); } diff --git a/vendor/illuminate/container/ContextualBindingBuilder.php b/vendor/illuminate/container/ContextualBindingBuilder.php index 1d15dcd..ae4c02a 100644 --- a/vendor/illuminate/container/ContextualBindingBuilder.php +++ b/vendor/illuminate/container/ContextualBindingBuilder.php @@ -86,7 +86,7 @@ class ContextualBindingBuilder implements ContextualBindingBuilderContract * Specify the configuration item to bind as a primitive. * * @param string $key - * @param ?string $default + * @param mixed $default * @return void */ public function giveConfig($key, $default = null) diff --git a/vendor/illuminate/container/RewindableGenerator.php b/vendor/illuminate/container/RewindableGenerator.php index 4ee7bb2..14c0bd0 100644 --- a/vendor/illuminate/container/RewindableGenerator.php +++ b/vendor/illuminate/container/RewindableGenerator.php @@ -4,6 +4,7 @@ namespace Illuminate\Container; use Countable; use IteratorAggregate; +use Traversable; class RewindableGenerator implements Countable, IteratorAggregate { @@ -37,10 +38,9 @@ class RewindableGenerator implements Countable, IteratorAggregate /** * Get an iterator from the generator. * - * @return mixed + * @return \Traversable */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return ($this->generator)(); } @@ -50,8 +50,7 @@ class RewindableGenerator implements Countable, IteratorAggregate * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { if (is_callable($count = $this->count)) { $this->count = $count(); diff --git a/vendor/illuminate/container/Util.php b/vendor/illuminate/container/Util.php index 8180a45..8d5023b 100644 --- a/vendor/illuminate/container/Util.php +++ b/vendor/illuminate/container/Util.php @@ -33,11 +33,12 @@ class Util * From global value() helper in Illuminate\Support. * * @param mixed $value + * @param mixed ...$args * @return mixed */ - public static function unwrapIfClosure($value) + public static function unwrapIfClosure($value, ...$args) { - return $value instanceof Closure ? $value() : $value; + return $value instanceof Closure ? $value(...$args) : $value; } /** @@ -53,7 +54,7 @@ class Util $type = $parameter->getType(); if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) { - return; + return null; } $name = $type->getName(); diff --git a/vendor/illuminate/container/composer.json b/vendor/illuminate/container/composer.json index cf93160..8944b5b 100755 --- a/vendor/illuminate/container/composer.json +++ b/vendor/illuminate/container/composer.json @@ -14,12 +14,12 @@ } ], "require": { - "php": "^7.3|^8.0", - "illuminate/contracts": "^8.0", - "psr/container": "^1.0" + "php": "^8.0.2", + "illuminate/contracts": "^9.0", + "psr/container": "^1.1.1|^2.0.1" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.1|2.0" }, "autoload": { "psr-4": { @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "config": { diff --git a/vendor/illuminate/contracts/Auth/Guard.php b/vendor/illuminate/contracts/Auth/Guard.php index 2a27fb5..2796f1a 100644 --- a/vendor/illuminate/contracts/Auth/Guard.php +++ b/vendor/illuminate/contracts/Auth/Guard.php @@ -40,6 +40,13 @@ interface Guard */ 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/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php b/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php index 47b1c08..683a903 100644 --- a/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php +++ b/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php @@ -8,7 +8,7 @@ interface PasswordBrokerFactory * Get a password broker instance by name. * * @param string|null $name - * @return mixed + * @return \Illuminate\Contracts\Auth\PasswordBroker */ public function broker($name = null); } diff --git a/vendor/illuminate/contracts/Broadcasting/Broadcaster.php b/vendor/illuminate/contracts/Broadcasting/Broadcaster.php index 1034e44..2d317d0 100644 --- a/vendor/illuminate/contracts/Broadcasting/Broadcaster.php +++ b/vendor/illuminate/contracts/Broadcasting/Broadcaster.php @@ -28,6 +28,8 @@ interface Broadcaster * @param string $event * @param array $payload * @return void + * + * @throws \Illuminate\Broadcasting\BroadcastException */ public function broadcast(array $channels, $event, array $payload = []); } diff --git a/vendor/illuminate/contracts/Container/Container.php b/vendor/illuminate/contracts/Container/Container.php index 1b8bb64..7d7f2c9 100644 --- a/vendor/illuminate/contracts/Container/Container.php +++ b/vendor/illuminate/contracts/Container/Container.php @@ -81,6 +81,24 @@ interface Container extends ContainerInterface */ 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. * @@ -163,6 +181,15 @@ interface Container extends ContainerInterface */ 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/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php b/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php index 149e7b2..1d84ef8 100644 --- a/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php +++ b/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php @@ -27,4 +27,13 @@ interface ContextualBindingBuilder * @return void */ public function giveTagged($tag); + + /** + * Specify the configuration item to bind as a primitive. + * + * @param string $key + * @param mixed $default + * @return void + */ + public function giveConfig($key, $default = null); } diff --git a/vendor/illuminate/contracts/Database/Eloquent/Builder.php b/vendor/illuminate/contracts/Database/Eloquent/Builder.php new file mode 100644 index 0000000..6fdf405 --- /dev/null +++ b/vendor/illuminate/contracts/Database/Eloquent/Builder.php @@ -0,0 +1,14 @@ + */ public function getQueueableIds(); /** * Get the relationships of the entities being queued. * - * @return array + * @return array */ public function getQueueableRelations(); diff --git a/vendor/illuminate/contracts/Routing/ResponseFactory.php b/vendor/illuminate/contracts/Routing/ResponseFactory.php index 2cd928d..86c16ca 100644 --- a/vendor/illuminate/contracts/Routing/ResponseFactory.php +++ b/vendor/illuminate/contracts/Routing/ResponseFactory.php @@ -7,7 +7,7 @@ interface ResponseFactory /** * Create a new response instance. * - * @param string $content + * @param array|string $content * @param int $status * @param array $headers * @return \Illuminate\Http\Response diff --git a/vendor/illuminate/contracts/Routing/UrlGenerator.php b/vendor/illuminate/contracts/Routing/UrlGenerator.php index e576dda..cca221c 100644 --- a/vendor/illuminate/contracts/Routing/UrlGenerator.php +++ b/vendor/illuminate/contracts/Routing/UrlGenerator.php @@ -69,6 +69,13 @@ interface UrlGenerator */ 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/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php b/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php new file mode 100644 index 0000000..113f420 --- /dev/null +++ b/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php @@ -0,0 +1,8 @@ + */ public function toArray(); } diff --git a/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php b/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php new file mode 100644 index 0000000..e1be6fe --- /dev/null +++ b/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php @@ -0,0 +1,14 @@ +model = $class; + } +} diff --git a/vendor/illuminate/database/Concerns/BuildsQueries.php b/vendor/illuminate/database/Concerns/BuildsQueries.php index 8e712f0..20e5e62 100644 --- a/vendor/illuminate/database/Concerns/BuildsQueries.php +++ b/vendor/illuminate/database/Concerns/BuildsQueries.php @@ -5,6 +5,7 @@ namespace Illuminate\Database\Concerns; use Illuminate\Container\Container; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\MultipleRecordsFoundException; +use Illuminate\Database\Query\Expression; use Illuminate\Database\RecordsNotFoundException; use Illuminate\Pagination\Cursor; use Illuminate\Pagination\CursorPaginator; @@ -12,6 +13,7 @@ use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\Paginator; use Illuminate\Support\Collection; use Illuminate\Support\LazyCollection; +use Illuminate\Support\Str; use Illuminate\Support\Traits\Conditionable; use InvalidArgumentException; use RuntimeException; @@ -111,9 +113,9 @@ trait BuildsQueries */ public function chunkById($count, callable $callback, $column = null, $alias = null) { - $column = $column ?? $this->defaultKeyName(); + $column ??= $this->defaultKeyName(); - $alias = $alias ?? $column; + $alias ??= $column; $lastId = null; @@ -210,7 +212,7 @@ trait BuildsQueries /** * Query lazily, by chunking the results of a query by comparing IDs. * - * @param int $count + * @param int $chunkSize * @param string|null $column * @param string|null $alias * @return \Illuminate\Support\LazyCollection @@ -218,22 +220,57 @@ trait BuildsQueries * @throws \InvalidArgumentException */ public function lazyById($chunkSize = 1000, $column = null, $alias = null) + { + return $this->orderedLazyById($chunkSize, $column, $alias); + } + + /** + * Query lazily, by chunking the results of a query by comparing IDs in descending order. + * + * @param int $chunkSize + * @param string|null $column + * @param string|null $alias + * @return \Illuminate\Support\LazyCollection + * + * @throws \InvalidArgumentException + */ + public function lazyByIdDesc($chunkSize = 1000, $column = null, $alias = null) + { + return $this->orderedLazyById($chunkSize, $column, $alias, true); + } + + /** + * Query lazily, by chunking the results of a query by comparing IDs in a given order. + * + * @param int $chunkSize + * @param string|null $column + * @param string|null $alias + * @param bool $descending + * @return \Illuminate\Support\LazyCollection + * + * @throws \InvalidArgumentException + */ + protected function orderedLazyById($chunkSize = 1000, $column = null, $alias = null, $descending = false) { if ($chunkSize < 1) { throw new InvalidArgumentException('The chunk size should be at least 1'); } - $column = $column ?? $this->defaultKeyName(); + $column ??= $this->defaultKeyName(); - $alias = $alias ?? $column; + $alias ??= $column; - return LazyCollection::make(function () use ($chunkSize, $column, $alias) { + return LazyCollection::make(function () use ($chunkSize, $column, $alias, $descending) { $lastId = null; while (true) { $clone = clone $this; - $results = $clone->forPageAfterId($chunkSize, $lastId, $column)->get(); + if ($descending) { + $results = $clone->forPageBeforeId($chunkSize, $lastId, $column)->get(); + } else { + $results = $clone->forPageAfterId($chunkSize, $lastId, $column)->get(); + } foreach ($results as $result) { yield $result; @@ -272,12 +309,14 @@ trait BuildsQueries { $result = $this->take(2)->get($columns); - if ($result->isEmpty()) { + $count = $result->count(); + + if ($count === 0) { throw new RecordsNotFoundException; } - if ($result->count() > 1) { - throw new MultipleRecordsFoundException; + if ($count > 1) { + throw new MultipleRecordsFoundException($count); } return $result->first(); @@ -305,8 +344,10 @@ trait BuildsQueries if (! is_null($cursor)) { $addCursorConditions = function (self $builder, $previousColumn, $i) use (&$addCursorConditions, $cursor, $orders) { if (! is_null($previousColumn)) { + $originalColumn = $this->getOriginalColumnNameForCursorPagination($this, $previousColumn); + $builder->where( - $this->getOriginalColumnNameForCursorPagination($this, $previousColumn), + Str::contains($originalColumn, ['(', ')']) ? new Expression($originalColumn) : $originalColumn, '=', $cursor->parameter($previousColumn) ); @@ -315,8 +356,10 @@ trait BuildsQueries $builder->where(function (self $builder) use ($addCursorConditions, $cursor, $orders, $i) { ['column' => $column, 'direction' => $direction] = $orders[$i]; + $originalColumn = $this->getOriginalColumnNameForCursorPagination($this, $column); + $builder->where( - $this->getOriginalColumnNameForCursorPagination($this, $column), + Str::contains($originalColumn, ['(', ')']) ? new Expression($originalColumn) : $originalColumn, $direction === 'asc' ? '>' : '<', $cursor->parameter($column) ); @@ -359,7 +402,7 @@ trait BuildsQueries [$original, $alias] = explode($as, $column); - if ($parameter === $alias) { + if ($parameter === $alias || $builder->getGrammar()->wrap($parameter) === $alias) { return $original; } } @@ -422,10 +465,12 @@ trait BuildsQueries * Pass the query to a given callback. * * @param callable $callback - * @return $this|mixed + * @return $this */ public function tap($callback) { - return $this->when(true, $callback); + $callback($this); + + return $this; } } diff --git a/vendor/illuminate/database/Concerns/ManagesTransactions.php b/vendor/illuminate/database/Concerns/ManagesTransactions.php index fac7029..3b1875f 100644 --- a/vendor/illuminate/database/Concerns/ManagesTransactions.php +++ b/vendor/illuminate/database/Concerns/ManagesTransactions.php @@ -48,7 +48,7 @@ trait ManagesTransactions $this->transactions = max(0, $this->transactions - 1); if ($this->transactions == 0) { - optional($this->transactionsManager)->commit($this->getName()); + $this->transactionsManager?->commit($this->getName()); } } catch (Throwable $e) { $this->handleCommitTransactionException( @@ -83,7 +83,7 @@ trait ManagesTransactions $this->transactions > 1) { $this->transactions--; - optional($this->transactionsManager)->rollback( + $this->transactionsManager?->rollback( $this->getName(), $this->transactions ); @@ -116,7 +116,7 @@ trait ManagesTransactions $this->transactions++; - optional($this->transactionsManager)->begin( + $this->transactionsManager?->begin( $this->getName(), $this->transactions ); @@ -194,7 +194,7 @@ trait ManagesTransactions $this->transactions = max(0, $this->transactions - 1); if ($this->transactions == 0) { - optional($this->transactionsManager)->commit($this->getName()); + $this->transactionsManager?->commit($this->getName()); } $this->fireConnectionEvent('committed'); @@ -258,7 +258,7 @@ trait ManagesTransactions $this->transactions = $toLevel; - optional($this->transactionsManager)->rollback( + $this->transactionsManager?->rollback( $this->getName(), $this->transactions ); @@ -297,7 +297,7 @@ trait ManagesTransactions if ($this->causedByLostConnection($e)) { $this->transactions = 0; - optional($this->transactionsManager)->rollback( + $this->transactionsManager?->rollback( $this->getName(), $this->transactions ); } diff --git a/vendor/illuminate/database/Concerns/ParsesSearchPath.php b/vendor/illuminate/database/Concerns/ParsesSearchPath.php new file mode 100644 index 0000000..437ff2b --- /dev/null +++ b/vendor/illuminate/database/Concerns/ParsesSearchPath.php @@ -0,0 +1,29 @@ +bindValue( is_string($key) ? $key : $key + 1, $value, - is_int($value) ? PDO::PARAM_INT : PDO::PARAM_STR + match (true) { + is_int($value) => PDO::PARAM_INT, + is_resource($value) => PDO::PARAM_LOB, + default => PDO::PARAM_STR + }, ); } } @@ -641,6 +661,10 @@ class Connection implements ConnectionInterface */ protected function run($query, $bindings, Closure $callback) { + foreach ($this->beforeExecutingCallbacks as $beforeExecutingCallback) { + $beforeExecutingCallback($query, $bindings, $this); + } + $this->reconnectIfMissingConnection(); $start = microtime(true); @@ -807,6 +831,19 @@ class Connection implements ConnectionInterface $this->setPdo(null)->setReadPdo(null); } + /** + * Register a hook to be run just before a database query is executed. + * + * @param \Closure $callback + * @return $this + */ + public function beforeExecuting(Closure $callback) + { + $this->beforeExecutingCallbacks[] = $callback; + + return $this; + } + /** * Register a database query listener with the connection. * @@ -832,14 +869,12 @@ class Connection implements ConnectionInterface return; } - 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)); - } + return $this->events->dispatch(match ($event) { + 'beganTransaction' => new TransactionBeginning($this), + 'committed' => new TransactionCommitted($this), + 'rollingBack' => new TransactionRolledBack($this), + default => null, + }); } /** @@ -978,14 +1013,46 @@ class Connection implements ConnectionInterface $this->doctrineConnection = new DoctrineConnection(array_filter([ 'pdo' => $this->getPdo(), 'dbname' => $this->getDatabaseName(), - 'driver' => method_exists($driver, 'getName') ? $driver->getName() : null, + 'driver' => $driver->getName(), 'serverVersion' => $this->getConfig('server_version'), ]), $driver); + + foreach ($this->doctrineTypeMappings as $name => $type) { + $this->doctrineConnection + ->getDatabasePlatform() + ->registerDoctrineTypeMapping($type, $name); + } } return $this->doctrineConnection; } + /** + * Register a custom Doctrine mapping type. + * + * @param string $class + * @param string $name + * @param string $type + * @return void + * + * @throws \Doctrine\DBAL\DBALException + * @throws \RuntimeException + */ + public function registerDoctrineType(string $class, string $name, string $type): void + { + if (! $this->isDoctrineAvailable()) { + throw new RuntimeException( + 'Registering a custom Doctrine type requires Doctrine DBAL (doctrine/dbal).' + ); + } + + if (! Type::hasType($name)) { + Type::addType($name, $class); + } + + $this->doctrineTypeMappings[$name] = $type; + } + /** * Get the current PDO connection. * diff --git a/vendor/illuminate/database/Connectors/ConnectionFactory.php b/vendor/illuminate/database/Connectors/ConnectionFactory.php index ad46505..e057470 100755 --- a/vendor/illuminate/database/Connectors/ConnectionFactory.php +++ b/vendor/illuminate/database/Connectors/ConnectionFactory.php @@ -241,18 +241,13 @@ class ConnectionFactory return $this->container->make($key); } - 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']}]."); + return match ($config['driver']) { + 'mysql' => new MySqlConnector, + 'pgsql' => new PostgresConnector, + 'sqlite' => new SQLiteConnector, + 'sqlsrv' => new SqlServerConnector, + default => throw new InvalidArgumentException("Unsupported driver [{$config['driver']}]."), + }; } /** @@ -273,17 +268,12 @@ class ConnectionFactory return $resolver($connection, $database, $prefix, $config); } - 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}]."); + 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}]."), + }; } } diff --git a/vendor/illuminate/database/Connectors/PostgresConnector.php b/vendor/illuminate/database/Connectors/PostgresConnector.php index a3ca25e..6331bc2 100755 --- a/vendor/illuminate/database/Connectors/PostgresConnector.php +++ b/vendor/illuminate/database/Connectors/PostgresConnector.php @@ -2,10 +2,13 @@ namespace Illuminate\Database\Connectors; +use Illuminate\Database\Concerns\ParsesSearchPath; use PDO; class PostgresConnector extends Connector implements ConnectorInterface { + use ParsesSearchPath; + /** * The default PDO connection options. * @@ -33,6 +36,8 @@ class PostgresConnector extends Connector implements ConnectorInterface $this->getDsn($config), $config, $this->getOptions($config) ); + $this->configureIsolationLevel($connection, $config); + $this->configureEncoding($connection, $config); // Next, we will check to see if a timezone has been specified in this config @@ -40,7 +45,7 @@ class PostgresConnector extends Connector implements ConnectorInterface // database. Setting this DB timezone is an optional configuration item. $this->configureTimezone($connection, $config); - $this->configureSchema($connection, $config); + $this->configureSearchPath($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 @@ -52,6 +57,20 @@ class PostgresConnector extends Connector implements ConnectorInterface return $connection; } + /** + * Set the connection transaction isolation level. + * + * @param \PDO $connection + * @param array $config + * @return void + */ + protected function configureIsolationLevel($connection, array $config) + { + if (isset($config['isolation_level'])) { + $connection->prepare("set session characteristics as transaction isolation level {$config['isolation_level']}")->execute(); + } + } + /** * Set the connection character set and collation. * @@ -85,38 +104,36 @@ class PostgresConnector extends Connector implements ConnectorInterface } /** - * Set the schema on the connection. + * Set the "search_path" on the database connection. * * @param \PDO $connection * @param array $config * @return void */ - protected function configureSchema($connection, $config) + protected function configureSearchPath($connection, $config) { - if (isset($config['schema'])) { - $schema = $this->formatSchema($config['schema']); + if (isset($config['search_path']) || isset($config['schema'])) { + $searchPath = $this->quoteSearchPath( + $this->parseSearchPath($config['search_path'] ?? $config['schema']) + ); - $connection->prepare("set search_path to {$schema}")->execute(); + $connection->prepare("set search_path to {$searchPath}")->execute(); } } /** - * Format the schema for the DSN. + * Format the search path for the DSN. * - * @param array|string $schema + * @param array $searchPath * @return string */ - protected function formatSchema($schema) + protected function quoteSearchPath($searchPath) { - if (is_array($schema)) { - return '"'.implode('", "', $schema).'"'; - } - - return '"'.$schema.'"'; + return count($searchPath) === 1 ? '"'.$searchPath[0].'"' : '"'.implode('", "', $searchPath).'"'; } /** - * Set the schema on the connection. + * Set the application name on the connection. * * @param \PDO $connection * @param array $config @@ -146,7 +163,7 @@ class PostgresConnector extends Connector implements ConnectorInterface $host = isset($host) ? "host={$host};" : ''; - $dsn = "pgsql:{$host}dbname={$database}"; + $dsn = "pgsql:{$host}dbname='{$database}'"; // If a port was specified, we will add it to this Postgres DSN connections // format. Once we have done that we are ready to return this connection diff --git a/vendor/illuminate/database/Console/DbCommand.php b/vendor/illuminate/database/Console/DbCommand.php index a5c627a..c2c4593 100644 --- a/vendor/illuminate/database/Console/DbCommand.php +++ b/vendor/illuminate/database/Console/DbCommand.php @@ -67,8 +67,16 @@ class DbCommand extends Command } if ($this->option('read')) { + if (is_array($connection['read']['host'])) { + $connection['read']['host'] = $connection['read']['host'][0]; + } + $connection = array_merge($connection, $connection['read']); } elseif ($this->option('write')) { + if (is_array($connection['write']['host'])) { + $connection['write']['host'] = $connection['write']['host'][0]; + } + $connection = array_merge($connection, $connection['write']); } @@ -135,8 +143,8 @@ class DbCommand extends Command '--user='.$connection['username'], ], $this->getOptionalArguments([ 'password' => '--password='.$connection['password'], - 'unix_socket' => '--socket='.$connection['unix_socket'], - 'charset' => '--default-character-set='.$connection['charset'], + 'unix_socket' => '--socket='.($connection['unix_socket'] ?? ''), + 'charset' => '--default-character-set='.($connection['charset'] ?? ''), ], $connection), [$connection['database']]); } diff --git a/vendor/illuminate/database/Console/DumpCommand.php b/vendor/illuminate/database/Console/DumpCommand.php index fe73fb2..bf0568f 100644 --- a/vendor/illuminate/database/Console/DumpCommand.php +++ b/vendor/illuminate/database/Console/DumpCommand.php @@ -22,6 +22,15 @@ 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/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php b/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php index 6233fe2..0b3039a 100644 --- a/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php +++ b/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php @@ -15,6 +15,15 @@ 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. * @@ -112,7 +121,7 @@ class FactoryMakeCommand extends GeneratorCommand */ protected function guessModelName($name) { - if (Str::endsWith($name, 'Factory')) { + if (str_ends_with($name, 'Factory')) { $name = substr($name, 0, -7); } diff --git a/vendor/illuminate/database/Console/Factories/stubs/factory.stub b/vendor/illuminate/database/Console/Factories/stubs/factory.stub index f7a898c..0759b5d 100644 --- a/vendor/illuminate/database/Console/Factories/stubs/factory.stub +++ b/vendor/illuminate/database/Console/Factories/stubs/factory.stub @@ -3,21 +3,16 @@ namespace {{ factoryNamespace }}; use Illuminate\Database\Eloquent\Factories\Factory; -use {{ namespacedModel }}; +/** + * @extends \Illuminate\Database\Eloquent\Factories\Factory<\{{ namespacedModel }}> + */ class {{ factory }}Factory extends Factory { - /** - * The name of the factory's corresponding model. - * - * @var string - */ - protected $model = {{ model }}::class; - /** * Define the model's default state. * - * @return array + * @return array */ public function definition() { diff --git a/vendor/illuminate/database/Console/PruneCommand.php b/vendor/illuminate/database/Console/PruneCommand.php index 74be6b9..aeb10e2 100644 --- a/vendor/illuminate/database/Console/PruneCommand.php +++ b/vendor/illuminate/database/Console/PruneCommand.php @@ -6,8 +6,10 @@ use Illuminate\Console\Command; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Database\Eloquent\MassPrunable; use Illuminate\Database\Eloquent\Prunable; +use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Events\ModelsPruned; use Illuminate\Support\Str; +use InvalidArgumentException; use Symfony\Component\Finder\Finder; class PruneCommand extends Command @@ -19,7 +21,9 @@ class PruneCommand extends Command */ protected $signature = 'model:prune {--model=* : Class names of the models to be pruned} - {--chunk=1000 : The number of models to retrieve per chunk of models to be deleted}'; + {--except=* : Class names of the models to be excluded from pruning} + {--chunk=1000 : The number of models to retrieve per chunk of models to be deleted} + {--pretend : Display the number of prunable records found instead of deleting them}'; /** * The console command description. @@ -44,6 +48,14 @@ class PruneCommand extends Command return; } + if ($this->option('pretend')) { + $models->each(function ($model) { + $this->pretendToPrune($model); + }); + + return; + } + $events->listen(ModelsPruned::class, function ($event) { $this->info("{$event->count} [{$event->model}] records have been pruned."); }); @@ -78,7 +90,13 @@ class PruneCommand extends Command return collect($models); } - return collect((new Finder)->in(app_path('Models'))->files()) + $except = $this->option('except'); + + if (! empty($models) && ! empty($except)) { + throw new InvalidArgumentException('The --models and --except options cannot be combined.'); + } + + return collect((new Finder)->in($this->getDefaultPath())->files()->name('*.php')) ->map(function ($model) { $namespace = $this->laravel->getNamespace(); @@ -87,11 +105,25 @@ class PruneCommand extends Command ['\\', ''], Str::after($model->getRealPath(), realpath(app_path()).DIRECTORY_SEPARATOR) ); + })->when(! empty($except), function ($models) use ($except) { + return $models->reject(function ($model) use ($except) { + return in_array($model, $except); + }); })->filter(function ($model) { return $this->isPrunable($model); })->values(); } + /** + * Get the default path where models are located. + * + * @return string + */ + protected function getDefaultPath() + { + return app_path('Models'); + } + /** * Determine if the given model class is prunable. * @@ -104,4 +136,26 @@ class PruneCommand extends Command return in_array(Prunable::class, $uses) || in_array(MassPrunable::class, $uses); } + + /** + * Display how many models will be pruned. + * + * @param string $model + * @return void + */ + protected function pretendToPrune($model) + { + $instance = new $model; + + $count = $instance->prunable() + ->when(in_array(SoftDeletes::class, class_uses_recursive(get_class($instance))), function ($query) { + $query->withTrashed(); + })->count(); + + if ($count === 0) { + $this->info("No prunable [$model] records found."); + } else { + $this->info("{$count} [{$model}] records will be pruned."); + } + } } diff --git a/vendor/illuminate/database/Console/Seeds/SeedCommand.php b/vendor/illuminate/database/Console/Seeds/SeedCommand.php index 058e545..1d0b96e 100644 --- a/vendor/illuminate/database/Console/Seeds/SeedCommand.php +++ b/vendor/illuminate/database/Console/Seeds/SeedCommand.php @@ -20,6 +20,15 @@ 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. * @@ -84,7 +93,7 @@ class SeedCommand extends Command { $class = $this->input->getArgument('class') ?? $this->input->getOption('class'); - if (strpos($class, '\\') === false) { + if (! str_contains($class, '\\')) { $class = 'Database\\Seeders\\'.$class; } diff --git a/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php b/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php index aef7a77..716f187 100644 --- a/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php +++ b/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php @@ -13,6 +13,15 @@ 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/vendor/illuminate/database/Console/Seeds/WithoutModelEvents.php b/vendor/illuminate/database/Console/Seeds/WithoutModelEvents.php new file mode 100644 index 0000000..acd9ec3 --- /dev/null +++ b/vendor/illuminate/database/Console/Seeds/WithoutModelEvents.php @@ -0,0 +1,19 @@ + Model::withoutEvents($callback); + } +} diff --git a/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub b/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub index 5662969..29e4af4 100644 --- a/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub +++ b/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub @@ -2,6 +2,7 @@ namespace Database\Seeders; +use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; class {{ class }} extends Seeder diff --git a/vendor/illuminate/database/Console/WipeCommand.php b/vendor/illuminate/database/Console/WipeCommand.php index 30825ed..2a7c1e5 100644 --- a/vendor/illuminate/database/Console/WipeCommand.php +++ b/vendor/illuminate/database/Console/WipeCommand.php @@ -17,6 +17,15 @@ 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/vendor/illuminate/database/DBAL/TimestampType.php b/vendor/illuminate/database/DBAL/TimestampType.php index 0ab733c..4fa9851 100644 --- a/vendor/illuminate/database/DBAL/TimestampType.php +++ b/vendor/illuminate/database/DBAL/TimestampType.php @@ -2,39 +2,29 @@ namespace Illuminate\Database\DBAL; -use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Exception as DBALException; use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Types\PhpDateTimeMappingType; use Doctrine\DBAL\Types\Type; -class TimestampType extends Type +class TimestampType extends Type implements PhpDateTimeMappingType { /** * {@inheritdoc} */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { - $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 DBALException('Invalid platform: '.$name); - } + 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), + }; } /** diff --git a/vendor/illuminate/database/DatabaseManager.php b/vendor/illuminate/database/DatabaseManager.php index 5d2f7cd..59283b1 100755 --- a/vendor/illuminate/database/DatabaseManager.php +++ b/vendor/illuminate/database/DatabaseManager.php @@ -2,12 +2,14 @@ namespace Illuminate\Database; +use Doctrine\DBAL\Types\Type; use Illuminate\Database\Connectors\ConnectionFactory; use Illuminate\Support\Arr; use Illuminate\Support\ConfigurationUrlParser; use Illuminate\Support\Str; use InvalidArgumentException; use PDO; +use RuntimeException; /** * @mixin \Illuminate\Database\Connection @@ -49,6 +51,13 @@ class DatabaseManager implements ConnectionResolverInterface */ protected $reconnector; + /** + * The custom Doctrine column types. + * + * @var array + */ + protected $doctrineTypes = []; + /** * Create a new database manager instance. * @@ -183,6 +192,8 @@ class DatabaseManager implements ConnectionResolverInterface // the connection, which will allow us to reconnect from the connections. $connection->setReconnector($this->reconnector); + $this->registerConfiguredDoctrineTypes($connection); + return $connection; } @@ -204,6 +215,49 @@ class DatabaseManager implements ConnectionResolverInterface return $connection; } + /** + * Register custom Doctrine types with the connection. + * + * @param \Illuminate\Database\Connection $connection + * @return void + */ + protected function registerConfiguredDoctrineTypes(Connection $connection): void + { + foreach ($this->app['config']->get('database.dbal.types', []) as $name => $class) { + $this->registerDoctrineType($class, $name, $name); + } + + foreach ($this->doctrineTypes as $name => [$type, $class]) { + $connection->registerDoctrineType($class, $name, $type); + } + } + + /** + * Register a custom Doctrine type. + * + * @param string $class + * @param string $name + * @param string $type + * @return void + * + * @throws \Doctrine\DBAL\DBALException + * @throws \RuntimeException + */ + public function registerDoctrineType(string $class, string $name, string $type): void + { + if (! class_exists('Doctrine\DBAL\Connection')) { + throw new RuntimeException( + 'Registering a custom Doctrine type requires Doctrine DBAL (doctrine/dbal).' + ); + } + + if (! Type::hasType($name)) { + Type::addType($name, $class); + } + + $this->doctrineTypes[$name] = [$type, $class]; + } + /** * Disconnect from the given database and remove from local cache. * @@ -342,6 +396,17 @@ class DatabaseManager implements ConnectionResolverInterface $this->extensions[$name] = $resolver; } + /** + * Remove an extension connection resolver. + * + * @param string $name + * @return void + */ + public function forgetExtension($name) + { + unset($this->extensions[$name]); + } + /** * Return all of the created connections. * diff --git a/vendor/illuminate/database/DatabaseServiceProvider.php b/vendor/illuminate/database/DatabaseServiceProvider.php index 9f2ab18..9a2f47d 100755 --- a/vendor/illuminate/database/DatabaseServiceProvider.php +++ b/vendor/illuminate/database/DatabaseServiceProvider.php @@ -2,7 +2,6 @@ namespace Illuminate\Database; -use Doctrine\DBAL\Types\Type; use Faker\Factory as FakerFactory; use Faker\Generator as FakerGenerator; use Illuminate\Contracts\Queue\EntityResolver; @@ -44,7 +43,6 @@ class DatabaseServiceProvider extends ServiceProvider $this->registerConnectionServices(); $this->registerEloquentFactory(); $this->registerQueueableEntityResolver(); - $this->registerDoctrineTypes(); } /** @@ -72,6 +70,10 @@ class DatabaseServiceProvider extends ServiceProvider 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; }); @@ -108,24 +110,4 @@ class DatabaseServiceProvider extends ServiceProvider return new QueueEntityResolver; }); } - - /** - * Register custom types with the Doctrine DBAL library. - * - * @return void - */ - protected function registerDoctrineTypes() - { - if (! class_exists(Type::class)) { - return; - } - - $types = $this->app['config']->get('database.dbal.types', []); - - foreach ($types as $name => $class) { - if (! Type::hasType($name)) { - Type::addType($name, $class); - } - } - } } diff --git a/vendor/illuminate/database/DatabaseTransactionRecord.php b/vendor/illuminate/database/DatabaseTransactionRecord.php index 3259552..4736ee9 100755 --- a/vendor/illuminate/database/DatabaseTransactionRecord.php +++ b/vendor/illuminate/database/DatabaseTransactionRecord.php @@ -57,7 +57,7 @@ class DatabaseTransactionRecord public function executeCallbacks() { foreach ($this->callbacks as $callback) { - call_user_func($callback); + $callback(); } } diff --git a/vendor/illuminate/database/DatabaseTransactionsManager.php b/vendor/illuminate/database/DatabaseTransactionsManager.php index add2f7c..8c36504 100755 --- a/vendor/illuminate/database/DatabaseTransactionsManager.php +++ b/vendor/illuminate/database/DatabaseTransactionsManager.php @@ -81,7 +81,7 @@ class DatabaseTransactionsManager return $current->addCallback($callback); } - call_user_func($callback); + $callback(); } /** diff --git a/vendor/illuminate/database/DetectsConcurrencyErrors.php b/vendor/illuminate/database/DetectsConcurrencyErrors.php index adbe4dc..c6c66f4 100644 --- a/vendor/illuminate/database/DetectsConcurrencyErrors.php +++ b/vendor/illuminate/database/DetectsConcurrencyErrors.php @@ -16,7 +16,7 @@ trait DetectsConcurrencyErrors */ protected function causedByConcurrencyError(Throwable $e) { - if ($e instanceof PDOException && $e->getCode() === '40001') { + if ($e instanceof PDOException && ($e->getCode() === 40001 || $e->getCode() === '40001')) { return true; } diff --git a/vendor/illuminate/database/DetectsLostConnections.php b/vendor/illuminate/database/DetectsLostConnections.php index 93be53b..16c8687 100644 --- a/vendor/illuminate/database/DetectsLostConnections.php +++ b/vendor/illuminate/database/DetectsLostConnections.php @@ -54,6 +54,9 @@ trait DetectsLostConnections 'SQLSTATE[08S01]: Communication link failure', 'SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host', 'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: No route to host', + 'The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.', + 'SQLSTATE[08006] [7] could not translate host name', + 'TCP Provider: Error code 0x274C', ]); } } diff --git a/vendor/illuminate/database/Eloquent/Builder.php b/vendor/illuminate/database/Eloquent/Builder.php index cd64abb..830f54f 100755 --- a/vendor/illuminate/database/Eloquent/Builder.php +++ b/vendor/illuminate/database/Eloquent/Builder.php @@ -5,9 +5,10 @@ namespace Illuminate\Database\Eloquent; 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\Concerns\ExplainsQueries; +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; @@ -24,11 +25,10 @@ use ReflectionMethod; * * @mixin \Illuminate\Database\Query\Builder */ -class Builder +class Builder implements BuilderContract { - use Concerns\QueriesRelationships, ExplainsQueries, ForwardsCalls; - use BuildsQueries { - sole as baseSole; + use BuildsQueries, ForwardsCalls, QueriesRelationships { + BuildsQueries::sole as baseSole; } /** @@ -73,12 +73,22 @@ class Builder */ protected $onDelete; + /** + * The properties that should be returned from query builder. + * + * @var string[] + */ + protected $propertyPassthru = [ + 'from', + ]; + /** * The methods that should be returned from query builder. * * @var string[] */ protected $passthru = [ + 'aggregate', 'average', 'avg', 'count', @@ -86,6 +96,7 @@ class Builder 'doesntExist', 'dump', 'exists', + 'explain', 'getBindings', 'getConnection', 'getGrammar', @@ -285,7 +296,7 @@ class Builder */ public function firstWhere($column, $operator = null, $value = null, $boolean = 'and') { - return $this->where($column, $operator, $value, $boolean)->first(); + return $this->where(...func_get_args())->first(); } /** @@ -305,6 +316,33 @@ class Builder return $this->where($column, $operator, $value, 'or'); } + /** + * Add a basic "where not" clause to the query. + * + * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column + * @param mixed $operator + * @param mixed $value + * @param string $boolean + * @return $this + */ + public function whereNot($column, $operator = null, $value = null, $boolean = 'and') + { + return $this->where($column, $operator, $value, $boolean.' not'); + } + + /** + * Add an "or where not" clause to the query. + * + * @param \Closure|array|string|\Illuminate\Database\Query\Expression $column + * @param mixed $operator + * @param mixed $value + * @return $this + */ + public function orWhereNot($column, $operator = null, $value = null) + { + return $this->whereNot($column, $operator, $value, 'or'); + } + /** * Add an "order by" clause for a timestamp to the query. * @@ -415,7 +453,7 @@ class Builder * @param array $columns * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static|static[] * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> */ public function findOrFail($id, $columns = ['*']) { @@ -424,16 +462,22 @@ class Builder $id = $id instanceof Arrayable ? $id->toArray() : $id; if (is_array($id)) { - if (count($result) === count(array_unique($id))) { - return $result; + if (count($result) !== count(array_unique($id))) { + throw (new ModelNotFoundException)->setModel( + get_class($this->model), array_diff($id, $result->modelKeys()) + ); } - } elseif (! is_null($result)) { + return $result; } - throw (new ModelNotFoundException)->setModel( - get_class($this->model), $id - ); + if (is_null($result)) { + throw (new ModelNotFoundException)->setModel( + get_class($this->model), $id + ); + } + + return $result; } /** @@ -506,7 +550,7 @@ class Builder * @param array $columns * @return \Illuminate\Database\Eloquent\Model|static * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> */ public function firstOrFail($columns = ['*']) { @@ -545,7 +589,7 @@ class Builder * @param array|string $columns * @return \Illuminate\Database\Eloquent\Model * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> * @throws \Illuminate\Database\MultipleRecordsFoundException */ public function sole($columns = ['*']) @@ -570,6 +614,33 @@ class Builder } } + /** + * Get a single column's value from the first result of a query if it's the sole matching record. + * + * @param string|\Illuminate\Database\Query\Expression $column + * @return mixed + * + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> + * @throws \Illuminate\Database\MultipleRecordsFoundException + */ + public function soleValue($column) + { + return $this->sole([$column])->{Str::afterLast($column, '.')}; + } + + /** + * Get a single column's value from the first result of the query or throw an exception. + * + * @param string|\Illuminate\Database\Query\Expression $column + * @return mixed + * + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> + */ + public function valueOrFail($column) + { + return $this->firstOrFail([$column])->{Str::afterLast($column, '.')}; + } + /** * Execute the query as a "select" statement. * @@ -615,7 +686,7 @@ class Builder // 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 (strpos($name, '.') === false) { + if (! str_contains($name, '.')) { $models = $this->eagerLoadRelation($models, $name, $constraints); } } @@ -713,7 +784,7 @@ class Builder */ protected function isNestedUnder($relation, $name) { - return Str::contains($name, '.') && Str::startsWith($name, $relation.'.'); + return str_contains($name, '.') && str_starts_with($name, $relation.'.'); } /** @@ -842,9 +913,7 @@ class Builder */ protected function ensureOrderForCursorPagination($shouldReverse = false) { - $orders = collect($this->query->orders); - - if ($orders->count() === 0) { + if (empty($this->query->orders) && empty($this->query->unionOrders)) { $this->enforceOrderBy(); } @@ -856,6 +925,10 @@ class Builder })->toArray(); } + if ($this->query->unionOrders) { + return collect($this->query->unionOrders); + } + return collect($this->query->orders); } @@ -979,7 +1052,7 @@ class Builder $qualifiedColumn = end($segments).'.'.$column; - $values[$qualifiedColumn] = $values[$column]; + $values[$qualifiedColumn] = Arr::get($values, $qualifiedColumn, $values[$column]); unset($values[$column]); @@ -1336,7 +1409,7 @@ class Builder if (is_numeric($name)) { $name = $constraints; - [$name, $constraints] = Str::contains($name, ':') + [$name, $constraints] = str_contains($name, ':') ? $this->createSelectWithConstraint($name) : [$name, static function () { // @@ -1364,7 +1437,7 @@ class Builder { 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; } @@ -1586,6 +1659,10 @@ class Builder return new HigherOrderBuilderProxy($this, $key); } + if (in_array($key, $this->propertyPassthru)) { + return $this->toBase()->{$key}; + } + throw new Exception("Property [{$key}] does not exist on the Eloquent builder instance."); } diff --git a/vendor/illuminate/database/Eloquent/Casts/ArrayObject.php b/vendor/illuminate/database/Eloquent/Casts/ArrayObject.php index 6f1713c..2da92c3 100644 --- a/vendor/illuminate/database/Eloquent/Casts/ArrayObject.php +++ b/vendor/illuminate/database/Eloquent/Casts/ArrayObject.php @@ -33,8 +33,7 @@ class ArrayObject extends BaseArrayObject implements Arrayable, JsonSerializable * * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return $this->getArrayCopy(); } diff --git a/vendor/illuminate/database/Eloquent/Casts/AsEncryptedArrayObject.php b/vendor/illuminate/database/Eloquent/Casts/AsEncryptedArrayObject.php index 5918bc1..cd65624 100644 --- a/vendor/illuminate/database/Eloquent/Casts/AsEncryptedArrayObject.php +++ b/vendor/illuminate/database/Eloquent/Casts/AsEncryptedArrayObject.php @@ -20,17 +20,25 @@ class AsEncryptedArrayObject implements Castable { public function get($model, $key, $value, $attributes) { - return new ArrayObject(json_decode(Crypt::decryptString($attributes[$key]), true)); + if (isset($attributes[$key])) { + return new ArrayObject(json_decode(Crypt::decryptString($attributes[$key]), true)); + } + + return null; } public function set($model, $key, $value, $attributes) { - return [$key => Crypt::encryptString(json_encode($value))]; + if (! is_null($value)) { + return [$key => Crypt::encryptString(json_encode($value))]; + } + + return null; } public function serialize($model, string $key, $value, array $attributes) { - return $value->getArrayCopy(); + return ! is_null($value) ? $value->getArrayCopy() : null; } }; } diff --git a/vendor/illuminate/database/Eloquent/Casts/AsEncryptedCollection.php b/vendor/illuminate/database/Eloquent/Casts/AsEncryptedCollection.php index ad11b17..4d9fee7 100644 --- a/vendor/illuminate/database/Eloquent/Casts/AsEncryptedCollection.php +++ b/vendor/illuminate/database/Eloquent/Casts/AsEncryptedCollection.php @@ -21,12 +21,20 @@ class AsEncryptedCollection implements Castable { public function get($model, $key, $value, $attributes) { - return new Collection(json_decode(Crypt::decryptString($attributes[$key]), true)); + if (isset($attributes[$key])) { + return new Collection(json_decode(Crypt::decryptString($attributes[$key]), true)); + } + + return null; } public function set($model, $key, $value, $attributes) { - return [$key => Crypt::encryptString(json_encode($value))]; + if (! is_null($value)) { + return [$key => Crypt::encryptString(json_encode($value))]; + } + + return null; } }; } diff --git a/vendor/illuminate/database/Eloquent/Casts/AsStringable.php b/vendor/illuminate/database/Eloquent/Casts/AsStringable.php new file mode 100644 index 0000000..912659f --- /dev/null +++ b/vendor/illuminate/database/Eloquent/Casts/AsStringable.php @@ -0,0 +1,32 @@ +get = $get; + $this->set = $set; + } + + /** + * Create a new attribute accessor / mutator. + * + * @param callable|null $get + * @param callable|null $set + * @return static + */ + public static function make(callable $get = null, callable $set = null): static + { + return new static($get, $set); + } + + /** + * Create a new attribute accessor. + * + * @param callable $get + * @return static + */ + public static function get(callable $get) + { + return new static($get); + } + + /** + * Create a new attribute mutator. + * + * @param callable $set + * @return static + */ + public static function set(callable $set) + { + return new static(null, $set); + } + + /** + * Disable object caching for the attribute. + * + * @return static + */ + public function withoutObjectCaching() + { + $this->withObjectCaching = false; + + return $this; + } +} diff --git a/vendor/illuminate/database/Eloquent/Collection.php b/vendor/illuminate/database/Eloquent/Collection.php index ff9b274..efdd507 100755 --- a/vendor/illuminate/database/Eloquent/Collection.php +++ b/vendor/illuminate/database/Eloquent/Collection.php @@ -7,17 +7,24 @@ use Illuminate\Contracts\Queue\QueueableEntity; 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 + */ class Collection extends BaseCollection implements QueueableCollection { /** * Find a model in the collection by key. * + * @template TFindDefault + * * @param mixed $key - * @param mixed $default - * @return \Illuminate\Database\Eloquent\Model|static|null + * @param TFindDefault $default + * @return static|TModel|TFindDefault */ public function find($key, $default = null) { @@ -45,7 +52,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Load a set of relationships onto the collection. * - * @param array|string $relations + * @param array|string $relations * @return $this */ public function load($relations) @@ -66,9 +73,9 @@ class Collection extends BaseCollection implements QueueableCollection /** * Load a set of aggregations over relationship's column onto the collection. * - * @param array|string $relations + * @param array|string $relations * @param string $column - * @param string $function + * @param string|null $function * @return $this */ public function loadAggregate($relations, $column, $function = null) @@ -92,7 +99,9 @@ class Collection extends BaseCollection implements QueueableCollection $this->each(function ($model) use ($models, $attributes) { $extraAttributes = Arr::only($models->get($model->getKey())->getAttributes(), $attributes); - $model->forceFill($extraAttributes)->syncOriginalAttributes($attributes); + $model->forceFill($extraAttributes) + ->syncOriginalAttributes($attributes) + ->mergeCasts($models->get($model->getKey())->getCasts()); }); return $this; @@ -101,7 +110,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Load a set of relationship counts onto the collection. * - * @param array|string $relations + * @param array|string $relations * @return $this */ public function loadCount($relations) @@ -112,7 +121,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Load a set of relationship's max column values onto the collection. * - * @param array|string $relations + * @param array|string $relations * @param string $column * @return $this */ @@ -124,7 +133,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Load a set of relationship's min column values onto the collection. * - * @param array|string $relations + * @param array|string $relations * @param string $column * @return $this */ @@ -136,7 +145,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Load a set of relationship's column summations onto the collection. * - * @param array|string $relations + * @param array|string $relations * @param string $column * @return $this */ @@ -148,7 +157,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Load a set of relationship's average column values onto the collection. * - * @param array|string $relations + * @param array|string $relations * @param string $column * @return $this */ @@ -160,7 +169,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Load a set of related existences onto the collection. * - * @param array|string $relations + * @param array|string $relations * @return $this */ public function loadExists($relations) @@ -171,7 +180,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Load a set of relationships onto the collection if they are not already eager loaded. * - * @param array|string $relations + * @param array|string $relations * @return $this */ public function loadMissing($relations) @@ -187,7 +196,7 @@ class Collection extends BaseCollection implements QueueableCollection $segments = explode('.', explode(':', $key)[0]); - if (Str::contains($key, ':')) { + if (str_contains($key, ':')) { $segments[count($segments) - 1] .= ':'.explode(':', $key)[1]; } @@ -245,7 +254,7 @@ class Collection extends BaseCollection implements QueueableCollection * Load a set of relationships onto the mixed relationship collection. * * @param string $relation - * @param array $relations + * @param array $relations * @return $this */ public function loadMorph($relation, $relations) @@ -266,7 +275,7 @@ class Collection extends BaseCollection implements QueueableCollection * Load a set of relationship counts onto the mixed relationship collection. * * @param string $relation - * @param array $relations + * @param array $relations * @return $this */ public function loadMorphCount($relation, $relations) @@ -286,7 +295,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Determine if a key exists in the collection. * - * @param mixed $key + * @param (callable(TModel, TKey): bool)|TModel|string $key * @param mixed $operator * @param mixed $value * @return bool @@ -311,7 +320,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Get the array of primary keys. * - * @return array + * @return array */ public function modelKeys() { @@ -323,7 +332,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Merge the collection with the given items. * - * @param \ArrayAccess|array $items + * @param iterable $items * @return static */ public function merge($items) @@ -340,8 +349,10 @@ class Collection extends BaseCollection implements QueueableCollection /** * Run a map over each of the items. * - * @param callable $callback - * @return \Illuminate\Support\Collection|static + * @template TMapValue + * + * @param callable(TModel, TKey): TMapValue $callback + * @return \Illuminate\Support\Collection|static */ public function map(callable $callback) { @@ -357,8 +368,11 @@ class Collection extends BaseCollection implements QueueableCollection * * The callback should return an associative array with a single key / value pair. * - * @param callable $callback - * @return \Illuminate\Support\Collection|static + * @template TMapWithKeysKey of array-key + * @template TMapWithKeysValue + * + * @param callable(TModel, TKey): array $callback + * @return \Illuminate\Support\Collection|static */ public function mapWithKeys(callable $callback) { @@ -372,7 +386,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Reload a fresh model instance from the database for all the entities. * - * @param array|string $with + * @param array|string $with * @return static */ public function fresh($with = []) @@ -400,7 +414,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Diff the collection with the given items. * - * @param \ArrayAccess|array $items + * @param iterable $items * @return static */ public function diff($items) @@ -421,7 +435,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Intersect the collection with the given items. * - * @param \ArrayAccess|array $items + * @param iterable $items * @return static */ public function intersect($items) @@ -446,9 +460,9 @@ class Collection extends BaseCollection implements QueueableCollection /** * Return only unique items from the collection. * - * @param string|callable|null $key + * @param (callable(TModel, TKey): mixed)|string|null $key * @param bool $strict - * @return static + * @return static */ public function unique($key = null, $strict = false) { @@ -462,8 +476,8 @@ class Collection extends BaseCollection implements QueueableCollection /** * Returns only the models from the collection with the specified keys. * - * @param mixed $keys - * @return static + * @param array|null $keys + * @return static */ public function only($keys) { @@ -479,8 +493,8 @@ class Collection extends BaseCollection implements QueueableCollection /** * Returns all models in the collection except the models with specified keys. * - * @param mixed $keys - * @return static + * @param array|null $keys + * @return static */ public function except($keys) { @@ -492,7 +506,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Make the given, typically visible, attributes hidden across the entire collection. * - * @param array|string $attributes + * @param array|string $attributes * @return $this */ public function makeHidden($attributes) @@ -503,7 +517,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Make the given, typically hidden, attributes visible across the entire collection. * - * @param array|string $attributes + * @param array|string $attributes * @return $this */ public function makeVisible($attributes) @@ -514,7 +528,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Append an attribute across the entire collection. * - * @param array|string $attributes + * @param array|string $attributes * @return $this */ public function append($attributes) @@ -525,8 +539,8 @@ class Collection extends BaseCollection implements QueueableCollection /** * Get a dictionary keyed by primary keys. * - * @param \ArrayAccess|array|null $items - * @return array + * @param iterable|null $items + * @return array */ public function getDictionary($items = null) { @@ -548,9 +562,9 @@ class Collection extends BaseCollection implements QueueableCollection /** * Get an array with the values of a given key. * - * @param string|array $value + * @param string|array $value * @param string|null $key - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function pluck($value, $key = null) { @@ -560,7 +574,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Get the keys of the collection items. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function keys() { @@ -570,8 +584,10 @@ class Collection extends BaseCollection implements QueueableCollection /** * Zip the collection together with one or more arrays. * - * @param mixed ...$items - * @return \Illuminate\Support\Collection + * @template TZipValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return \Illuminate\Support\Collection> */ public function zip($items) { @@ -581,7 +597,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Collapse the collection of items into a single array. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function collapse() { @@ -592,7 +608,7 @@ class Collection extends BaseCollection implements QueueableCollection * Get a flattened array of the items in the collection. * * @param int $depth - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function flatten($depth = INF) { @@ -602,7 +618,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Flip the items in the collection. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function flip() { @@ -612,9 +628,11 @@ class Collection extends BaseCollection implements QueueableCollection /** * Pad collection to the specified length with a value. * + * @template TPadValue + * * @param int $size - * @param mixed $value - * @return \Illuminate\Support\Collection + * @param TPadValue $value + * @return \Illuminate\Support\Collection */ public function pad($size, $value) { @@ -625,7 +643,7 @@ class Collection extends BaseCollection implements QueueableCollection * Get the comparison function to detect duplicates. * * @param bool $strict - * @return \Closure + * @return callable(TValue, TValue): bool */ protected function duplicateComparator($strict) { @@ -661,7 +679,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Get the identifiers for all of the entities. * - * @return array + * @return array */ public function getQueueableIds() { @@ -677,7 +695,7 @@ class Collection extends BaseCollection implements QueueableCollection /** * Get the relationships of the entities being queued. * - * @return array + * @return array */ public function getQueueableRelations() { diff --git a/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php b/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php index 60b510c..b2e6651 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php +++ b/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php @@ -2,8 +2,6 @@ namespace Illuminate\Database\Eloquent\Concerns; -use Illuminate\Support\Str; - trait GuardsAttributes { /** @@ -187,8 +185,8 @@ trait GuardsAttributes } return empty($this->getFillable()) && - strpos($key, '.') === false && - ! Str::startsWith($key, '_'); + ! str_contains($key, '.') && + ! str_starts_with($key, '_'); } /** @@ -217,9 +215,14 @@ trait GuardsAttributes protected function isGuardableColumn($key) { if (! isset(static::$guardableColumns[get_class($this)])) { - static::$guardableColumns[get_class($this)] = $this->getConnection() + $columns = $this->getConnection() ->getSchemaBuilder() ->getColumnListing($this->getTable()); + + if (empty($columns)) { + return true; + } + static::$guardableColumns[get_class($this)] = $columns; } return in_array($key, static::$guardableColumns[get_class($this)]); diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php b/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php index 56034ea..2046258 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php +++ b/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php @@ -4,10 +4,14 @@ namespace Illuminate\Database\Eloquent\Concerns; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; +use DateTimeImmutable; use DateTimeInterface; use Illuminate\Contracts\Database\Eloquent\Castable; use Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes; use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Database\Eloquent\Casts\AsArrayObject; +use Illuminate\Database\Eloquent\Casts\AsCollection; +use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\InvalidCastException; use Illuminate\Database\Eloquent\JsonEncodingException; use Illuminate\Database\Eloquent\Relations\Relation; @@ -20,6 +24,9 @@ use Illuminate\Support\Facades\Date; use Illuminate\Support\Str; use InvalidArgumentException; use LogicException; +use ReflectionClass; +use ReflectionMethod; +use ReflectionNamedType; trait HasAttributes { @@ -58,6 +65,13 @@ trait HasAttributes */ protected $classCastCache = []; + /** + * The attributes that have been cast using "Attribute" return type mutators. + * + * @var array + */ + protected $attributeCastCache = []; + /** * The built-in, primitive cast types supported by Eloquent. * @@ -128,6 +142,27 @@ trait HasAttributes */ protected static $mutatorCache = []; + /** + * The cache of the "Attribute" return type marked mutated attributes for each class. + * + * @var array + */ + protected static $attributeMutatorCache = []; + + /** + * The cache of the "Attribute" return type marked mutated, gettable attributes for each class. + * + * @var array + */ + protected static $getAttributeMutatorCache = []; + + /** + * The cache of the "Attribute" return type marked mutated, settable attributes for each class. + * + * @var array + */ + protected static $setAttributeMutatorCache = []; + /** * The encrypter instance that is used to encrypt attributes. * @@ -253,7 +288,7 @@ trait HasAttributes $attributes[$key] = $attributes[$key]->format(explode(':', $value, 2)[1]); } - if ($attributes[$key] && $attributes[$key] instanceof DateTimeInterface && + if ($attributes[$key] instanceof DateTimeInterface && $this->isClassCastable($key)) { $attributes[$key] = $this->serializeDate($attributes[$key]); } @@ -262,6 +297,10 @@ trait HasAttributes $attributes[$key] = $this->serializeClassCastableAttribute($key, $attributes[$key]); } + if ($this->isEnumCastable($key) && (! ($attributes[$key] ?? null) instanceof Arrayable)) { + $attributes[$key] = isset($attributes[$key]) ? $attributes[$key]->value : null; + } + if ($attributes[$key] instanceof Arrayable) { $attributes[$key] = $attributes[$key]->toArray(); } @@ -387,6 +426,7 @@ trait HasAttributes if (array_key_exists($key, $this->attributes) || array_key_exists($key, $this->casts) || $this->hasGetMutator($key) || + $this->hasAttributeMutator($key) || $this->isClassCastable($key)) { return $this->getAttributeValue($key); } @@ -460,6 +500,10 @@ trait HasAttributes */ public function isRelation($key) { + if ($this->hasAttributeMutator($key)) { + return false; + } + return method_exists($this, $key) || (static::$relationResolvers[get_class($this)][$key] ?? null); } @@ -519,6 +563,48 @@ trait HasAttributes return method_exists($this, 'get'.Str::studly($key).'Attribute'); } + /** + * Determine if a "Attribute" return type marked mutator exists for an attribute. + * + * @param string $key + * @return bool + */ + public function hasAttributeMutator($key) + { + if (isset(static::$attributeMutatorCache[get_class($this)][$key])) { + return static::$attributeMutatorCache[get_class($this)][$key]; + } + + if (! method_exists($this, $method = Str::camel($key))) { + return static::$attributeMutatorCache[get_class($this)][$key] = false; + } + + $returnType = (new ReflectionMethod($this, $method))->getReturnType(); + + return static::$attributeMutatorCache[get_class($this)][$key] = + $returnType instanceof ReflectionNamedType && + $returnType->getName() === Attribute::class; + } + + /** + * Determine if a "Attribute" return type marked get mutator exists for an attribute. + * + * @param string $key + * @return bool + */ + public function hasAttributeGetMutator($key) + { + if (isset(static::$getAttributeMutatorCache[get_class($this)][$key])) { + return static::$getAttributeMutatorCache[get_class($this)][$key]; + } + + if (! $this->hasAttributeMutator($key)) { + return static::$getAttributeMutatorCache[get_class($this)][$key] = false; + } + + return static::$getAttributeMutatorCache[get_class($this)][$key] = is_callable($this->{Str::camel($key)}()->get); + } + /** * Get the value of an attribute using its mutator. * @@ -531,6 +617,34 @@ trait HasAttributes return $this->{'get'.Str::studly($key).'Attribute'}($value); } + /** + * Get the value of an "Attribute" return type marked attribute using its mutator. + * + * @param string $key + * @param mixed $value + * @return mixed + */ + protected function mutateAttributeMarkedAttribute($key, $value) + { + if (isset($this->attributeCastCache[$key])) { + return $this->attributeCastCache[$key]; + } + + $attribute = $this->{Str::camel($key)}(); + + $value = call_user_func($attribute->get ?: function ($value) { + return $value; + }, $value, $this->attributes); + + if (! is_object($value) || ! $attribute->withObjectCaching) { + unset($this->attributeCastCache[$key]); + } else { + $this->attributeCastCache[$key] = $value; + } + + return $value; + } + /** * Get the value of an attribute using its mutator for array conversion. * @@ -540,9 +654,18 @@ trait HasAttributes */ protected function mutateAttributeForArray($key, $value) { - $value = $this->isClassCastable($key) - ? $this->getClassCastableAttributeValue($key, $value) - : $this->mutateAttribute($key, $value); + if ($this->isClassCastable($key)) { + $value = $this->getClassCastableAttributeValue($key, $value); + } elseif (isset(static::$getAttributeMutatorCache[get_class($this)][$key]) && + static::$getAttributeMutatorCache[get_class($this)][$key] === true) { + $value = $this->mutateAttributeMarkedAttribute($key, $value); + + $value = $value instanceof DateTimeInterface + ? $this->serializeDate($value) + : $value; + } else { + $value = $this->mutateAttribute($key, $value); + } return $value instanceof Arrayable ? $value->toArray() : $value; } @@ -620,6 +743,10 @@ trait HasAttributes return $this->asTimestamp($value); } + if ($this->isEnumCastable($key)) { + return $this->getEnumCastableAttributeValue($key, $value); + } + if ($this->isClassCastable($key)) { return $this->getClassCastableAttributeValue($key, $value); } @@ -655,6 +782,28 @@ trait HasAttributes } } + /** + * Cast the given attribute to an enum. + * + * @param string $key + * @param mixed $value + * @return mixed + */ + protected function getEnumCastableAttributeValue($key, $value) + { + if (is_null($value)) { + return; + } + + $castType = $this->getCasts()[$key]; + + if ($value instanceof $castType) { + return $value; + } + + return $castType::from($value); + } + /** * Get the type of cast for a model attribute. * @@ -715,8 +864,8 @@ trait HasAttributes */ protected function isCustomDateTimeCast($cast) { - return strncmp($cast, 'date:', 5) === 0 || - strncmp($cast, 'datetime:', 9) === 0; + return str_starts_with($cast, 'date:') || + str_starts_with($cast, 'datetime:'); } /** @@ -739,7 +888,7 @@ trait HasAttributes */ protected function isDecimalCast($cast) { - return strncmp($cast, 'decimal:', 8) === 0; + return str_starts_with($cast, 'decimal:'); } /** @@ -756,6 +905,8 @@ trait HasAttributes // this model, such as "json_encoding" a listing of data for storage. if ($this->hasSetMutator($key)) { return $this->setMutatedAttributeValue($key, $value); + } elseif ($this->hasAttributeSetMutator($key)) { + return $this->setAttributeMarkedMutatedAttributeValue($key, $value); } // If an attribute is listed as a "date", we'll convert it from a DateTime @@ -765,6 +916,12 @@ trait HasAttributes $value = $this->fromDateTime($value); } + if ($this->isEnumCastable($key)) { + $this->setEnumCastableAttribute($key, $value); + + return $this; + } + if ($this->isClassCastable($key)) { $this->setClassCastableAttribute($key, $value); @@ -778,7 +935,7 @@ trait HasAttributes // 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); } @@ -802,6 +959,32 @@ trait HasAttributes return method_exists($this, 'set'.Str::studly($key).'Attribute'); } + /** + * Determine if an "Attribute" return type marked set mutator exists for an attribute. + * + * @param string $key + * @return bool + */ + public function hasAttributeSetMutator($key) + { + $class = get_class($this); + + if (isset(static::$setAttributeMutatorCache[$class][$key])) { + return static::$setAttributeMutatorCache[$class][$key]; + } + + if (! method_exists($this, $method = Str::camel($key))) { + return static::$setAttributeMutatorCache[$class][$key] = false; + } + + $returnType = (new ReflectionMethod($this, $method))->getReturnType(); + + return static::$setAttributeMutatorCache[$class][$key] = + $returnType instanceof ReflectionNamedType && + $returnType->getName() === Attribute::class && + is_callable($this->{$method}()->set); + } + /** * Set the value of an attribute using its mutator. * @@ -814,6 +997,35 @@ trait HasAttributes return $this->{'set'.Str::studly($key).'Attribute'}($value); } + /** + * Set the value of a "Attribute" return type marked attribute using its mutator. + * + * @param string $key + * @param mixed $value + * @return mixed + */ + protected function setAttributeMarkedMutatedAttributeValue($key, $value) + { + $attribute = $this->{Str::camel($key)}(); + + $callback = $attribute->set ?: function ($value) use ($key) { + $this->attributes[$key] = $value; + }; + + $this->attributes = array_merge( + $this->attributes, + $this->normalizeCastClassResponse( + $key, $callback($value, $this->attributes) + ) + ); + + if (! is_object($value) || ! $attribute->withObjectCaching) { + unset($this->attributeCastCache[$key]); + } else { + $this->attributeCastCache[$key] = $value; + } + } + /** * Determine if the given attribute is a date or date castable. * @@ -859,22 +1071,12 @@ trait HasAttributes { $caster = $this->resolveCasterClass($key); - 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 - )) - ); - } + $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]); @@ -883,6 +1085,26 @@ trait HasAttributes } } + /** + * Set the value of an enum castable attribute. + * + * @param string $key + * @param \BackedEnum $value + * @return void + */ + protected function setEnumCastableAttribute($key, $value) + { + $enumClass = $this->getCasts()[$key]; + + if (! isset($value)) { + $this->attributes[$key] = null; + } elseif ($value instanceof $enumClass) { + $this->attributes[$key] = $value->value; + } else { + $this->attributes[$key] = $enumClass::from($value)->value; + } + } + /** * Get an array attribute with the given key and value set. * @@ -1002,16 +1224,12 @@ trait HasAttributes */ public function fromFloat($value) { - switch ((string) $value) { - case 'Infinity': - return INF; - case '-Infinity': - return -INF; - case 'NaN': - return NAN; - default: - return (float) $value; - } + return match ((string) $value) { + 'Infinity' => INF, + '-Infinity' => -INF, + 'NaN' => NAN, + default => (float) $value, + }; } /** @@ -1132,7 +1350,7 @@ trait HasAttributes */ protected function serializeDate(DateTimeInterface $date) { - return $date instanceof \DateTimeImmutable ? + return $date instanceof DateTimeImmutable ? CarbonImmutable::instance($date)->toJSON() : Carbon::instance($date)->toJSON(); } @@ -1220,6 +1438,17 @@ trait HasAttributes return $this->hasCast($key, ['date', 'datetime', 'immutable_date', 'immutable_datetime']); } + /** + * Determine whether a value is Date / DateTime custom-castable for inbound manipulation. + * + * @param string $key + * @return bool + */ + protected function isDateCastableWithCustomFormat($key) + { + return $this->hasCast($key, ['custom_datetime', 'immutable_custom_datetime']); + } + /** * Determine whether a value is JSON castable for inbound manipulation. * @@ -1269,6 +1498,29 @@ trait HasAttributes throw new InvalidCastException($this->getModel(), $key, $castType); } + /** + * Determine if the given key is cast using an enum. + * + * @param string $key + * @return bool + */ + protected function isEnumCastable($key) + { + if (! array_key_exists($key, $this->getCasts())) { + return false; + } + + $castType = $this->getCasts()[$key]; + + if (in_array($castType, static::$primitiveCastTypes)) { + return false; + } + + if (function_exists('enum_exists') && enum_exists($castType)) { + return true; + } + } + /** * Determine if the key is deviable using a custom class. * @@ -1294,8 +1546,9 @@ trait HasAttributes */ protected function isClassSerializable($key) { - return $this->isClassCastable($key) && - method_exists($this->parseCasterClass($this->getCasts()[$key]), 'serialize'); + return ! $this->isEnumCastable($key) && + $this->isClassCastable($key) && + method_exists($this->resolveCasterClass($key), 'serialize'); } /** @@ -1310,7 +1563,7 @@ trait HasAttributes $arguments = []; - if (is_string($castType) && strpos($castType, ':') !== false) { + if (is_string($castType) && str_contains($castType, ':')) { $segments = explode(':', $castType, 2); $castType = $segments[0]; @@ -1336,11 +1589,22 @@ trait HasAttributes */ protected function parseCasterClass($class) { - return strpos($class, ':') === false + return ! str_contains($class, ':') ? $class : explode(':', $class, 2)[0]; } + /** + * Merge the cast class and attribute cast attributes back into the model. + * + * @return void + */ + protected function mergeAttributesFromCachedCasts() + { + $this->mergeAttributesFromClassCasts(); + $this->mergeAttributesFromAttributeCasts(); + } + /** * Merge the cast class attributes back into the model. * @@ -1360,6 +1624,33 @@ trait HasAttributes } } + /** + * Merge the cast class attributes back into the model. + * + * @return void + */ + protected function mergeAttributesFromAttributeCasts() + { + foreach ($this->attributeCastCache as $key => $value) { + $attribute = $this->{Str::camel($key)}(); + + if ($attribute->get && ! $attribute->set) { + continue; + } + + $callback = $attribute->set ?: function ($value) use ($key) { + $this->attributes[$key] = $value; + }; + + $this->attributes = array_merge( + $this->attributes, + $this->normalizeCastClassResponse( + $key, $callback($value, $this->attributes) + ) + ); + } + } + /** * Normalize the response from a custom class caster. * @@ -1379,7 +1670,7 @@ trait HasAttributes */ public function getAttributes() { - $this->mergeAttributesFromClassCasts(); + $this->mergeAttributesFromCachedCasts(); return $this->attributes; } @@ -1410,6 +1701,7 @@ trait HasAttributes } $this->classCastCache = []; + $this->attributeCastCache = []; return $this; } @@ -1643,14 +1935,14 @@ trait HasAttributes return true; } elseif (is_null($attribute)) { return false; - } elseif ($this->isDateAttribute($key)) { + } elseif ($this->isDateAttribute($key) || $this->isDateCastableWithCustomFormat($key)) { return $this->fromDateTime($attribute) === $this->fromDateTime($original); } elseif ($this->hasCast($key, ['object', 'collection'])) { return $this->castAttribute($key, $attribute) == $this->castAttribute($key, $original); } elseif ($this->hasCast($key, ['real', 'float', 'double'])) { - if (($attribute === null && $original !== null) || ($attribute !== null && $original === null)) { + if ($original === null) { return false; } @@ -1658,6 +1950,8 @@ trait HasAttributes } elseif ($this->hasCast($key, static::$primitiveCastTypes)) { return $this->castAttribute($key, $attribute) === $this->castAttribute($key, $original); + } elseif ($this->isClassCastable($key) && in_array($this->getCasts()[$key], [AsArrayObject::class, AsCollection::class])) { + return $this->fromJson($attribute) === $this->fromJson($original); } return is_numeric($attribute) && is_numeric($original) @@ -1678,6 +1972,8 @@ trait HasAttributes // retrieval from the model to a form that is more useful for usage. if ($this->hasGetMutator($key)) { return $this->mutateAttribute($key, $value); + } elseif ($this->hasAttributeGetMutator($key)) { + return $this->mutateAttributeMarkedAttribute($key, $value); } // If the attribute exists within the cast array, we will convert it to @@ -1761,9 +2057,17 @@ trait HasAttributes */ public static function cacheMutatedAttributes($class) { - static::$mutatorCache[$class] = collect(static::getMutatorMethods($class))->map(function ($match) { - return lcfirst(static::$snakeAttributes ? Str::snake($match) : $match); - })->all(); + static::$getAttributeMutatorCache[$class] = + collect($attributeMutatorMethods = static::getAttributeMarkedMutatorMethods($class)) + ->mapWithKeys(function ($match) { + return [lcfirst(static::$snakeAttributes ? Str::snake($match) : $match) => true]; + })->all(); + + static::$mutatorCache[$class] = collect(static::getMutatorMethods($class)) + ->merge($attributeMutatorMethods) + ->map(function ($match) { + return lcfirst(static::$snakeAttributes ? Str::snake($match) : $match); + })->all(); } /** @@ -1778,4 +2082,30 @@ trait HasAttributes return $matches[1]; } + + /** + * Get all of the "Attribute" return typed attribute mutator methods. + * + * @param mixed $class + * @return array + */ + protected static function getAttributeMarkedMutatorMethods($class) + { + $instance = is_object($class) ? $class : new $class; + + return collect((new ReflectionClass($instance))->getMethods())->filter(function ($method) use ($instance) { + $returnType = $method->getReturnType(); + + if ($returnType instanceof ReflectionNamedType && + $returnType->getName() === Attribute::class) { + $method->setAccessible(true); + + if (is_callable($method->invoke($instance)->get)) { + return true; + } + } + + return false; + })->map->name->values()->all(); + } } diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php b/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php index 0dc5430..eb6a970 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php +++ b/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php @@ -147,7 +147,7 @@ trait HasEvents * Register a model event with the dispatcher. * * @param string $event - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ protected static function registerModelEvent($event, $callback) @@ -230,7 +230,7 @@ trait HasEvents /** * Register a retrieved model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function retrieved($callback) @@ -241,7 +241,7 @@ trait HasEvents /** * Register a saving model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function saving($callback) @@ -252,7 +252,7 @@ trait HasEvents /** * Register a saved model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function saved($callback) @@ -263,7 +263,7 @@ trait HasEvents /** * Register an updating model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function updating($callback) @@ -274,7 +274,7 @@ trait HasEvents /** * Register an updated model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function updated($callback) @@ -285,7 +285,7 @@ trait HasEvents /** * Register a creating model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function creating($callback) @@ -296,7 +296,7 @@ trait HasEvents /** * Register a created model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function created($callback) @@ -307,7 +307,7 @@ trait HasEvents /** * Register a replicating model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function replicating($callback) @@ -318,7 +318,7 @@ trait HasEvents /** * Register a deleting model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function deleting($callback) @@ -329,7 +329,7 @@ trait HasEvents /** * Register a deleted model event with the dispatcher. * - * @param \Closure|string $callback + * @param \Illuminate\Events\QueuedClosure|\Closure|string $callback * @return void */ public static function deleted($callback) diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php b/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php index 1742679..72afb17 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php +++ b/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 \Closure|null $implementation + * @param \Illuminate\Database\Eloquent\Scope|\Closure|null $implementation * @return mixed * * @throws \InvalidArgumentException */ - public static function addGlobalScope($scope, Closure $implementation = null) + public static function addGlobalScope($scope, $implementation = null) { - if (is_string($scope) && ! is_null($implementation)) { + if (is_string($scope) && ($implementation instanceof Closure || $implementation instanceof Scope)) { return static::$globalScopes[static::class][$scope] = $implementation; } elseif ($scope instanceof Closure) { return static::$globalScopes[static::class][spl_object_hash($scope)] = $scope; diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasRelationships.php b/vendor/illuminate/database/Eloquent/Concerns/HasRelationships.php index 5262d43..089390c 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/HasRelationships.php +++ b/vendor/illuminate/database/Eloquent/Concerns/HasRelationships.php @@ -3,6 +3,7 @@ namespace Illuminate\Database\Eloquent\Concerns; use Closure; +use Illuminate\Database\ClassMorphViolationException; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; @@ -16,6 +17,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Database\Eloquent\Relations\MorphToMany; +use Illuminate\Database\Eloquent\Relations\Pivot; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Support\Arr; use Illuminate\Support\Str; @@ -731,6 +733,14 @@ trait HasRelationships return array_search(static::class, $morphMap, true); } + if (static::class === Pivot::class) { + return static::class; + } + + if (Relation::requiresMorphMap()) { + throw new ClassMorphViolationException($this); + } + return static::class; } diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php b/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php index 13ebd31..add911a 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php +++ b/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php @@ -16,10 +16,17 @@ trait HasTimestamps /** * Update the model's update timestamp. * + * @param string|null $attribute * @return bool */ - public function touch() + public function touch($attribute = null) { + if ($attribute) { + $this->$attribute = $this->freshTimestamp(); + + return $this->save(); + } + if (! $this->usesTimestamps()) { return false; } diff --git a/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php b/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php index 065d48a..31b8b98 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php +++ b/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php @@ -2,8 +2,6 @@ namespace Illuminate\Database\Eloquent\Concerns; -use Closure; - trait HidesAttributes { /** @@ -88,7 +86,7 @@ trait HidesAttributes /** * 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 */ @@ -115,7 +113,7 @@ trait HidesAttributes /** * 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/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php b/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php index 63cb031..8b6f9b4 100644 --- a/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php +++ b/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php @@ -2,8 +2,11 @@ namespace Illuminate\Database\Eloquent\Concerns; +use BadMethodCallException; use Closure; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\RelationNotFoundException; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder; @@ -27,7 +30,7 @@ trait QueriesRelationships public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null) { if (is_string($relation)) { - if (strpos($relation, '.') !== false) { + if (str_contains($relation, '.')) { return $this->hasNested($relation, $operator, $count, $boolean, $callback); } @@ -384,7 +387,7 @@ trait QueriesRelationships * Add a polymorphic relationship condition to the query with a where clause. * * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types + * @param string|array $types * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column * @param mixed $operator * @param mixed $value @@ -401,7 +404,7 @@ trait QueriesRelationships * Add a polymorphic relationship condition to the query with an "or where" clause. * * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation - * @param string|array $types + * @param string|array $types * @param \Closure|string|array|\Illuminate\Database\Query\Expression $column * @param mixed $operator * @param mixed $value @@ -414,6 +417,97 @@ trait QueriesRelationships }); } + /** + * Add a morph-to relationship condition to the query. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param \Illuminate\Database\Eloquent\Model|string $model + * @return \Illuminate\Database\Eloquent\Builder|static + */ + public function whereMorphedTo($relation, $model, $boolean = 'and') + { + if (is_string($relation)) { + $relation = $this->getRelationWithoutConstraints($relation); + } + + if (is_string($model)) { + $morphMap = Relation::morphMap(); + + if (! empty($morphMap) && in_array($model, $morphMap)) { + $model = array_search($model, $morphMap, true); + } + + return $this->where($relation->getMorphType(), $model, null, $boolean); + } + + return $this->where(function ($query) use ($relation, $model) { + $query->where($relation->getMorphType(), $model->getMorphClass()) + ->where($relation->getForeignKeyName(), $model->getKey()); + }, null, null, $boolean); + } + + /** + * Add a morph-to relationship condition to the query with an "or where" clause. + * + * @param \Illuminate\Database\Eloquent\Relations\MorphTo|string $relation + * @param \Illuminate\Database\Eloquent\Model|string $model + * @return \Illuminate\Database\Eloquent\Builder|static + */ + public function orWhereMorphedTo($relation, $model) + { + return $this->whereMorphedTo($relation, $model, 'or'); + } + + /** + * Add a "belongs to" relationship where clause to the query. + * + * @param \Illuminate\Database\Eloquent\Model $related + * @param string|null $relationshipName + * @param string $boolean + * @return $this + * + * @throws \Illuminate\Database\Eloquent\RelationNotFoundException + */ + public function whereBelongsTo($related, $relationshipName = null, $boolean = 'and') + { + if ($relationshipName === null) { + $relationshipName = Str::camel(class_basename($related)); + } + + try { + $relationship = $this->model->{$relationshipName}(); + } catch (BadMethodCallException $exception) { + throw RelationNotFoundException::make($this->model, $relationshipName); + } + + if (! $relationship instanceof BelongsTo) { + throw RelationNotFoundException::make($this->model, $relationshipName, BelongsTo::class); + } + + $this->where( + $relationship->getQualifiedForeignKeyName(), + '=', + $related->getAttributeValue($relationship->getOwnerKeyName()), + $boolean, + ); + + return $this; + } + + /** + * Add an "BelongsTo" relationship with an "or where" clause to the query. + * + * @param \Illuminate\Database\Eloquent\Model $related + * @param string|null $relationshipName + * @return $this + * + * @throws \RuntimeException + */ + public function orWhereBelongsTo($related, $relationshipName = null) + { + return $this->whereBelongsTo($related, $relationshipName, 'or'); + } + /** * Add subselect queries to include an aggregate value for a relationship. * @@ -487,7 +581,7 @@ trait QueriesRelationships // Finally, we will make the proper column alias to the query and run this sub-select on // the query builder. Then, we will return the builder instance back to the developer // for further constraint chaining that needs to take place on the query as needed. - $alias = $alias ?? Str::snake( + $alias ??= Str::snake( preg_replace('/[^[:alnum:][:space:]_]/u', '', "$name $function $column") ); diff --git a/vendor/illuminate/database/Eloquent/Factories/CrossJoinSequence.php b/vendor/illuminate/database/Eloquent/Factories/CrossJoinSequence.php new file mode 100644 index 0000000..b0efbd0 --- /dev/null +++ b/vendor/illuminate/database/Eloquent/Factories/CrossJoinSequence.php @@ -0,0 +1,26 @@ + */ protected $model; @@ -137,14 +141,14 @@ abstract class Factory /** * Define the model's default state. * - * @return array + * @return array */ abstract public function definition(); /** * Get a new factory instance for the given attributes. * - * @param callable|array $attributes + * @param (callable(array): array)|array $attributes * @return static */ public static function new($attributes = []) @@ -176,9 +180,9 @@ abstract class Factory /** * Get the raw attributes generated by the factory. * - * @param array $attributes + * @param (callable(array): array)|array $attributes * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return array + * @return array */ public function raw($attributes = [], ?Model $parent = null) { @@ -194,19 +198,30 @@ abstract class Factory /** * Create a single model and persist it to the database. * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model + * @param (callable(array): array)|array $attributes + * @return \Illuminate\Database\Eloquent\Model|TModel */ public function createOne($attributes = []) { return $this->count(null)->create($attributes); } + /** + * Create a single model and persist it to the database. + * + * @param (callable(array): array)|array $attributes + * @return \Illuminate\Database\Eloquent\Model|TModel + */ + public function createOneQuietly($attributes = []) + { + return $this->count(null)->createQuietly($attributes); + } + /** * Create a collection of models and persist them to the database. * - * @param iterable $records - * @return \Illuminate\Database\Eloquent\Collection + * @param iterable> $records + * @return \Illuminate\Database\Eloquent\Collection */ public function createMany(iterable $records) { @@ -220,9 +235,22 @@ abstract class Factory /** * Create a collection of models and persist them to the database. * - * @param array $attributes + * @param iterable> $records + * @return \Illuminate\Database\Eloquent\Collection + */ + public function createManyQuietly(iterable $records) + { + return Model::withoutEvents(function () use ($records) { + return $this->createMany($records); + }); + } + + /** + * Create a collection of models and persist them to the database. + * + * @param (callable(array): array)|array $attributes * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|TModel */ public function create($attributes = [], ?Model $parent = null) { @@ -245,12 +273,26 @@ abstract class Factory return $results; } + /** + * Create a collection of models and persist them to the database. + * + * @param array $attributes + * @param \Illuminate\Database\Eloquent\Model|null $parent + * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|TModel + */ + public function createQuietly($attributes = [], ?Model $parent = null) + { + return Model::withoutEvents(function () use ($attributes, $parent) { + return $this->create($attributes, $parent); + }); + } + /** * Create a callback that persists a model in the database when invoked. * - * @param array $attributes + * @param array $attributes * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Closure + * @return \Closure(): (\Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|TModel) */ public function lazy(array $attributes = [], ?Model $parent = null) { @@ -296,8 +338,8 @@ abstract class Factory /** * Make a single instance of the model. * - * @param callable|array $attributes - * @return \Illuminate\Database\Eloquent\Model + * @param (callable(array): array)|array $attributes + * @return \Illuminate\Database\Eloquent\Model|TModel */ public function makeOne($attributes = []) { @@ -307,9 +349,9 @@ abstract class Factory /** * Create a collection of models. * - * @param array $attributes + * @param (callable(array): array)|array $attributes * @param \Illuminate\Database\Eloquent\Model|null $parent - * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model + * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|TModel */ public function make($attributes = [], ?Model $parent = null) { @@ -427,7 +469,7 @@ abstract class Factory /** * Add a new state transformation to the model definition. * - * @param callable|array $state + * @param (callable(array): array)|array $state * @return static */ public function state($state) @@ -452,6 +494,17 @@ abstract class Factory return $this->state(new Sequence(...$sequence)); } + /** + * Add a new cross joined sequenced state transformation to the model definition. + * + * @param array $sequence + * @return static + */ + public function crossJoinSequence(...$sequence) + { + return $this->state(new CrossJoinSequence(...$sequence)); + } + /** * Define a child relationship for the model. * @@ -485,7 +538,7 @@ abstract class Factory * Define an attached relationship for the model. * * @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model $factory - * @param callable|array $pivot + * @param (callable(): array)|array $pivot * @param string|null $relationship * @return static */ @@ -524,7 +577,7 @@ abstract class Factory /** * Add a new "after making" callback to the model definition. * - * @param \Closure $callback + * @param \Closure(\Illuminate\Database\Eloquent\Model|TModel): mixed $callback * @return static */ public function afterMaking(Closure $callback) @@ -535,7 +588,7 @@ abstract class Factory /** * Add a new "after creating" callback to the model definition. * - * @param \Closure $callback + * @param \Closure(\Illuminate\Database\Eloquent\Model|TModel): mixed $callback * @return static */ public function afterCreating(Closure $callback) @@ -618,8 +671,8 @@ abstract class Factory /** * Get a new model instance. * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model + * @param array $attributes + * @return \Illuminate\Database\Eloquent\Model|TModel */ public function newModel(array $attributes = []) { @@ -631,17 +684,21 @@ abstract class Factory /** * Get the name of the model that is generated by the factory. * - * @return string + * @return class-string<\Illuminate\Database\Eloquent\Model|TModel> */ public function modelName() { $resolver = static::$modelNameResolver ?: function (self $factory) { + $namespacedFactoryBasename = Str::replaceLast( + 'Factory', '', Str::replaceFirst(static::$namespace, '', get_class($factory)) + ); + $factoryBasename = Str::replaceLast('Factory', '', class_basename($factory)); $appNamespace = static::appNamespace(); - return class_exists($appNamespace.'Models\\'.$factoryBasename) - ? $appNamespace.'Models\\'.$factoryBasename + return class_exists($appNamespace.'Models\\'.$namespacedFactoryBasename) + ? $appNamespace.'Models\\'.$namespacedFactoryBasename : $appNamespace.$factoryBasename; }; @@ -651,7 +708,7 @@ abstract class Factory /** * Specify the callback that should be invoked to guess model names based on factory names. * - * @param callable $callback + * @param callable(self): class-string<\Illuminate\Database\Eloquent\Model|TModel> $callback * @return void */ public static function guessModelNamesUsing(callable $callback) @@ -673,8 +730,8 @@ abstract class Factory /** * Get a new factory instance for the given model name. * - * @param string $modelName - * @return static + * @param class-string<\Illuminate\Database\Eloquent\Model> $modelName + * @return \Illuminate\Database\Eloquent\Factories\Factory */ public static function factoryForModel(string $modelName) { @@ -686,7 +743,7 @@ abstract class Factory /** * Specify the callback that should be invoked to guess factory names based on dynamic relationship names. * - * @param callable $callback + * @param callable(class-string<\Illuminate\Database\Eloquent\Model>): class-string<\Illuminate\Database\Eloquent\Factories\Factory> $callback * @return void */ public static function guessFactoryNamesUsing(callable $callback) @@ -707,8 +764,8 @@ abstract class Factory /** * Get the factory name for the given model name. * - * @param string $modelName - * @return string + * @param class-string<\Illuminate\Database\Eloquent\Model> $modelName + * @return class-string<\Illuminate\Database\Eloquent\Factories\Factory> */ public static function resolveFactoryName(string $modelName) { @@ -768,9 +825,9 @@ abstract class Factory $factory = static::factoryForModel($relatedModel); } - if (Str::startsWith($method, 'for')) { + if (str_starts_with($method, 'for')) { return $this->for($factory->state($parameters[0] ?? []), $relationship); - } elseif (Str::startsWith($method, 'has')) { + } elseif (str_starts_with($method, 'has')) { return $this->has( $factory ->count(is_numeric($parameters[0] ?? null) ? $parameters[0] : 1) diff --git a/vendor/illuminate/database/Eloquent/Factories/HasFactory.php b/vendor/illuminate/database/Eloquent/Factories/HasFactory.php index 7d2be22..f10281d 100644 --- a/vendor/illuminate/database/Eloquent/Factories/HasFactory.php +++ b/vendor/illuminate/database/Eloquent/Factories/HasFactory.php @@ -7,22 +7,23 @@ trait HasFactory /** * Get a new factory instance for the model. * - * @param mixed $parameters - * @return \Illuminate\Database\Eloquent\Factories\Factory + * @param callable|array|int|null $count + * @param callable|array $state + * @return \Illuminate\Database\Eloquent\Factories\Factory */ - public static function factory(...$parameters) + public static function factory($count = null, $state = []) { $factory = static::newFactory() ?: Factory::factoryForModel(get_called_class()); return $factory - ->count(is_numeric($parameters[0] ?? null) ? $parameters[0] : null) - ->state(is_array($parameters[0] ?? null) ? $parameters[0] : ($parameters[1] ?? [])); + ->count(is_numeric($count) ? $count : null) + ->state(is_callable($count) || is_array($count) ? $count : $state); } /** * Create a new factory instance for the model. * - * @return \Illuminate\Database\Eloquent\Factories\Factory + * @return \Illuminate\Database\Eloquent\Factories\Factory */ protected static function newFactory() { diff --git a/vendor/illuminate/database/Eloquent/Factories/Sequence.php b/vendor/illuminate/database/Eloquent/Factories/Sequence.php index 169cc1d..064cc4a 100644 --- a/vendor/illuminate/database/Eloquent/Factories/Sequence.php +++ b/vendor/illuminate/database/Eloquent/Factories/Sequence.php @@ -2,7 +2,9 @@ namespace Illuminate\Database\Eloquent\Factories; -class Sequence +use Countable; + +class Sequence implements Countable { /** * The sequence of return values. @@ -37,6 +39,16 @@ class Sequence $this->count = count($sequence); } + /** + * Get the current count of the sequence items. + * + * @return int + */ + public function count(): int + { + return $this->count; + } + /** * Get the next value in the sequence. * diff --git a/vendor/illuminate/database/Eloquent/Model.php b/vendor/illuminate/database/Eloquent/Model.php index 0ce4a0e..600b150 100644 --- a/vendor/illuminate/database/Eloquent/Model.php +++ b/vendor/illuminate/database/Eloquent/Model.php @@ -8,6 +8,7 @@ use Illuminate\Contracts\Queue\QueueableCollection; use Illuminate\Contracts\Queue\QueueableEntity; use Illuminate\Contracts\Routing\UrlRoutable; use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Database\ConnectionResolverInterface as Resolver; use Illuminate\Database\Eloquent\Collection as EloquentCollection; @@ -22,7 +23,7 @@ use Illuminate\Support\Traits\ForwardsCalls; use JsonSerializable; use LogicException; -abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jsonable, JsonSerializable, QueueableEntity, UrlRoutable +abstract class Model implements Arrayable, ArrayAccess, CanBeEscapedWhenCastToString, HasBroadcastChannel, Jsonable, JsonSerializable, QueueableEntity, UrlRoutable { use Concerns\HasAttributes, Concerns\HasEvents, @@ -110,6 +111,13 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public $wasRecentlyCreated = false; + /** + * Indicates that the object's string representation should be escaped when __toString is invoked. + * + * @var bool + */ + protected $escapeWhenCastingToString = false; + /** * The connection resolver instance. * @@ -453,7 +461,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public function qualifyColumn($column) { - if (Str::contains($column, '.')) { + if (str_contains($column, '.')) { return $column; } @@ -485,7 +493,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso // This method just provides a convenient way for us to generate fresh model // instances of this current model. It is particularly useful during the // hydration of new objects via the Eloquent query builder instances. - $model = new static((array) $attributes); + $model = new static; $model->exists = $exists; @@ -497,6 +505,8 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso $model->mergeCasts($this->casts); + $model->fill((array) $attributes); + return $model; } @@ -552,7 +562,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso * Get all of the models from the database. * * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Collection|static[] + * @return \Illuminate\Database\Eloquent\Collection */ public static function all($columns = ['*']) { @@ -877,6 +887,24 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso return $this->fill($attributes)->save($options); } + /** + * Update the model in the database within a transaction. + * + * @param array $attributes + * @param array $options + * @return bool + * + * @throws \Throwable + */ + public function updateOrFail(array $attributes = [], array $options = []) + { + if (! $this->exists) { + return false; + } + + return $this->fill($attributes)->saveOrFail($options); + } + /** * Update the model in the database without raising any events. * @@ -942,7 +970,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public function save(array $options = []) { - $this->mergeAttributesFromClassCasts(); + $this->mergeAttributesFromCachedCasts(); $query = $this->newModelQuery(); @@ -984,7 +1012,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso } /** - * Save the model to the database using transaction. + * Save the model to the database within a transaction. * * @param array $options * @return bool @@ -1211,7 +1239,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public function delete() { - $this->mergeAttributesFromClassCasts(); + $this->mergeAttributesFromCachedCasts(); if (is_null($this->getKeyName())) { throw new LogicException('No primary key defined on model.'); @@ -1243,6 +1271,24 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso return true; } + /** + * Delete the model from the database within a transaction. + * + * @return bool|null + * + * @throws \Throwable + */ + public function deleteOrFail() + { + if (! $this->exists) { + return false; + } + + return $this->getConnection()->transaction(function () { + return $this->delete(); + }); + } + /** * Force a hard delete on a soft deleted model. * @@ -1453,7 +1499,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso { $json = json_encode($this->jsonSerialize(), $options); - if (JSON_ERROR_NONE !== json_last_error()) { + if (json_last_error() !== JSON_ERROR_NONE) { throw JsonEncodingException::forModel($this, json_last_error_msg()); } @@ -1465,8 +1511,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso * * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return $this->toArray(); } @@ -1484,6 +1529,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso } return $this->setKeysForSelectQuery($this->newQueryWithoutScopes()) + ->useWritePdo() ->with(is_string($with) ? func_get_args() : $with) ->first(); } @@ -1500,7 +1546,10 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso } $this->setRawAttributes( - $this->setKeysForSelectQuery($this->newQueryWithoutScopes())->firstOrFail()->attributes + $this->setKeysForSelectQuery($this->newQueryWithoutScopes()) + ->useWritePdo() + ->firstOrFail() + ->attributes ); $this->load(collect($this->relations)->reject(function ($relation) { @@ -1785,7 +1834,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso } if ($relation instanceof QueueableEntity) { - foreach ($relation->getQueueableRelations() as $entityKey => $entityValue) { + foreach ($relation->getQueueableRelations() as $entityValue) { $relations[] = $key.'.'.$entityValue; } } @@ -1833,7 +1882,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public function resolveRouteBinding($value, $field = null) { - return $this->where($field ?? $this->getRouteKeyName(), $value)->first(); + return $this->resolveRouteBindingQuery($this, $value, $field)->first(); } /** @@ -1845,7 +1894,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public function resolveSoftDeletableRouteBinding($value, $field = null) { - return $this->where($field ?? $this->getRouteKeyName(), $value)->withTrashed()->first(); + return $this->resolveRouteBindingQuery($this, $value, $field)->withTrashed()->first(); } /** @@ -1880,7 +1929,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso * @param string $childType * @param mixed $value * @param string|null $field - * @return \Illuminate\Database\Eloquent\Model|null + * @return \Illuminate\Database\Eloquent\Relations\Relation */ protected function resolveChildRouteBindingQuery($childType, $value, $field) { @@ -1890,10 +1939,25 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso if ($relationship instanceof HasManyThrough || $relationship instanceof BelongsToMany) { - return $relationship->where($relationship->getRelated()->getTable().'.'.$field, $value); - } else { - return $relationship->where($field, $value); + $field = $relationship->getRelated()->getTable().'.'.$field; } + + return $relationship instanceof Model + ? $relationship->resolveRouteBindingQuery($relationship, $value, $field) + : $relationship->getRelated()->resolveRouteBindingQuery($relationship, $value, $field); + } + + /** + * Retrieve the model for a bound value. + * + * @param \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Relations\Relation $query + * @param mixed $value + * @param string|null $field + * @return \Illuminate\Database\Eloquent\Relations\Relation + */ + public function resolveRouteBindingQuery($query, $value, $field = null) + { + return $query->where($field ?? $this->getRouteKeyName(), $value); } /** @@ -1988,8 +2052,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso * @param mixed $offset * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return ! is_null($this->getAttribute($offset)); } @@ -2000,8 +2063,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso * @param mixed $offset * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return $this->getAttribute($offset); } @@ -2013,8 +2075,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso * @param mixed $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->setAttribute($offset, $value); } @@ -2025,8 +2086,7 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso * @param mixed $offset * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->attributes[$offset], $this->relations[$offset]); } @@ -2092,7 +2152,22 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public function __toString() { - return $this->toJson(); + return $this->escapeWhenCastingToString + ? e($this->toJson()) + : $this->toJson(); + } + + /** + * Indicate that the object's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true) + { + $this->escapeWhenCastingToString = $escape; + + return $this; } /** @@ -2102,9 +2177,10 @@ abstract class Model implements Arrayable, ArrayAccess, HasBroadcastChannel, Jso */ public function __sleep() { - $this->mergeAttributesFromClassCasts(); + $this->mergeAttributesFromCachedCasts(); $this->classCastCache = []; + $this->attributeCastCache = []; return array_keys(get_object_vars($this)); } diff --git a/vendor/illuminate/database/Eloquent/ModelNotFoundException.php b/vendor/illuminate/database/Eloquent/ModelNotFoundException.php index c35598b..79ae8a3 100755 --- a/vendor/illuminate/database/Eloquent/ModelNotFoundException.php +++ b/vendor/illuminate/database/Eloquent/ModelNotFoundException.php @@ -5,27 +5,30 @@ namespace Illuminate\Database\Eloquent; use Illuminate\Database\RecordsNotFoundException; use Illuminate\Support\Arr; +/** + * @template TModel of \Illuminate\Database\Eloquent\Model + */ class ModelNotFoundException extends RecordsNotFoundException { /** * Name of the affected Eloquent model. * - * @var string + * @var class-string */ protected $model; /** * The affected model IDs. * - * @var int|array + * @var array */ protected $ids; /** * Set the affected Eloquent model and instance ids. * - * @param string $model - * @param int|array $ids + * @param class-string $model + * @param array|int|string $ids * @return $this */ public function setModel($model, $ids = []) @@ -47,7 +50,7 @@ class ModelNotFoundException extends RecordsNotFoundException /** * Get the affected Eloquent model. * - * @return string + * @return class-string */ public function getModel() { @@ -57,7 +60,7 @@ class ModelNotFoundException extends RecordsNotFoundException /** * Get the affected Eloquent model IDs. * - * @return int|array + * @return array */ public function getIds() { diff --git a/vendor/illuminate/database/Eloquent/RelationNotFoundException.php b/vendor/illuminate/database/Eloquent/RelationNotFoundException.php index 5acc0b3..73257bb 100755 --- a/vendor/illuminate/database/Eloquent/RelationNotFoundException.php +++ b/vendor/illuminate/database/Eloquent/RelationNotFoundException.php @@ -25,13 +25,18 @@ class RelationNotFoundException extends RuntimeException * * @param object $model * @param string $relation + * @param string|null $type * @return static */ - public static function make($model, $relation) + public static function make($model, $relation, $type = null) { $class = get_class($model); - $instance = new static("Call to undefined relationship [{$relation}] on model [{$class}]."); + $instance = new static( + is_null($type) + ? "Call to undefined relationship [{$relation}] on model [{$class}]." + : "Call to undefined relationship [{$relation}] on model [{$class}] of type [{$type}].", + ); $instance->model = $class; $instance->relation = $relation; diff --git a/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php b/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php index a98cba0..c17b733 100755 --- a/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php +++ b/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php @@ -51,7 +51,6 @@ class BelongsTo extends Relation * @param string $foreignKey * @param string $ownerKey * @param string $relationName - * * @return void */ public function __construct(Builder $query, Model $child, $foreignKey, $ownerKey, $relationName) @@ -199,7 +198,7 @@ class BelongsTo extends Relation /** * Associate the model instance to the given parent. * - * @param \Illuminate\Database\Eloquent\Model|int|string $model + * @param \Illuminate\Database\Eloquent\Model|int|string|null $model * @return \Illuminate\Database\Eloquent\Model */ public function associate($model) diff --git a/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php b/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php index 32bdf88..fd62627 100755 --- a/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Eloquent\Relations; +use Closure; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; @@ -163,7 +164,7 @@ class BelongsToMany extends Relation */ protected function resolveTableName($table) { - if (! Str::contains($table, '\\') || ! class_exists($table)) { + if (! str_contains($table, '\\') || ! class_exists($table)) { return $table; } @@ -277,7 +278,7 @@ class BelongsToMany extends Relation // Once we have an array dictionary of child objects we can easily match the // children back to their parent using the dictionary and the keys on the - // the parent models. Then we will return the hydrated models back out. + // parent models. Then we should return these hydrated models back out. foreach ($models as $model) { $key = $this->getDictionaryKey($model->{$this->parentKey}); @@ -594,12 +595,13 @@ class BelongsToMany extends Relation * 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) + public function firstOrNew(array $attributes = [], array $values = []) { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->related->newInstance($attributes); + if (is_null($instance = $this->related->where($attributes)->first())) { + $instance = $this->related->newInstance(array_merge($attributes, $values)); } return $instance; @@ -609,14 +611,15 @@ class BelongsToMany extends Relation * 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 $joining = [], $touch = true) + public function firstOrCreate(array $attributes = [], array $values = [], array $joining = [], $touch = true) { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->create($attributes, $joining, $touch); + if (is_null($instance = $this->related->where($attributes)->first())) { + $instance = $this->create(array_merge($attributes, $values), $joining, $touch); } return $instance; @@ -633,8 +636,8 @@ class BelongsToMany extends Relation */ public function updateOrCreate(array $attributes, array $values = [], array $joining = [], $touch = true) { - if (is_null($instance = $this->where($attributes)->first())) { - return $this->create($values, $joining, $touch); + if (is_null($instance = $this->related->where($attributes)->first())) { + return $this->create(array_merge($attributes, $values), $joining, $touch); } $instance->fill($values); @@ -689,7 +692,7 @@ class BelongsToMany extends Relation * @param array $columns * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> */ public function findOrFail($id, $columns = ['*']) { @@ -741,7 +744,7 @@ class BelongsToMany extends Relation * @param array $columns * @return \Illuminate\Database\Eloquent\Model|static * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> */ public function firstOrFail($columns = ['*']) { @@ -752,6 +755,28 @@ class BelongsToMany extends Relation 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(); + } + /** * Get the results of the relationship. * @@ -909,11 +934,11 @@ class BelongsToMany extends Relation { $this->prepareQueryBuilder(); - $column = $column ?? $this->getRelated()->qualifyColumn( + $column ??= $this->getRelated()->qualifyColumn( $this->getRelatedKeyName() ); - $alias = $alias ?? $this->getRelatedKeyName(); + $alias ??= $this->getRelatedKeyName(); return $this->query->chunkById($count, function ($results) use ($callback) { $this->hydratePivotRelation($results->all()); @@ -958,18 +983,18 @@ class BelongsToMany extends Relation /** * Query lazily, by chunking the results of a query by comparing IDs. * - * @param int $count + * @param int $chunkSize * @param string|null $column * @param string|null $alias * @return \Illuminate\Support\LazyCollection */ public function lazyById($chunkSize = 1000, $column = null, $alias = null) { - $column = $column ?? $this->getRelated()->qualifyColumn( + $column ??= $this->getRelated()->qualifyColumn( $this->getRelatedKeyName() ); - $alias = $alias ?? $this->getRelatedKeyName(); + $alias ??= $this->getRelatedKeyName(); return $this->prepareQueryBuilder()->lazyById($chunkSize, $column, $alias)->map(function ($model) { $this->hydratePivotRelation([$model]); @@ -1034,7 +1059,7 @@ class BelongsToMany extends Relation // 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 (strpos($key, 'pivot_') === 0) { + if (str_starts_with($key, 'pivot_')) { $values[substr($key, 6)] = $value; unset($model->$key); @@ -1130,6 +1155,21 @@ class BelongsToMany extends Relation 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. * @@ -1405,7 +1445,7 @@ class BelongsToMany extends Relation */ public function qualifyPivotColumn($column) { - return Str::contains($column, '.') + return str_contains($column, '.') ? $column : $this->table.'.'.$column; } diff --git a/vendor/illuminate/database/Eloquent/Relations/Concerns/AsPivot.php b/vendor/illuminate/database/Eloquent/Relations/Concerns/AsPivot.php index af9defb..e6f9f23 100644 --- a/vendor/illuminate/database/Eloquent/Relations/Concerns/AsPivot.php +++ b/vendor/illuminate/database/Eloquent/Relations/Concerns/AsPivot.php @@ -2,7 +2,6 @@ namespace Illuminate\Database\Eloquent\Relations\Concerns; -use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; @@ -77,7 +76,9 @@ trait AsPivot $instance->timestamps = $instance->hasTimestampAttributes($attributes); - $instance->setRawAttributes($attributes, $exists); + $instance->setRawAttributes( + array_merge($instance->getRawOriginal(), $attributes), $exists + ); return $instance; } @@ -278,7 +279,7 @@ trait AsPivot return $this->newQueryForCollectionRestoration($ids); } - if (! Str::contains($ids, ':')) { + if (! str_contains($ids, ':')) { return parent::newQueryForRestoration($ids); } @@ -299,7 +300,7 @@ trait AsPivot { $ids = array_values($ids); - if (! Str::contains($ids[0], ':')) { + if (! str_contains($ids[0], ':')) { return parent::newQueryForRestoration($ids); } diff --git a/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php b/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php index 71fa6bd..25b9a58 100644 --- a/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/Concerns/CanBeOneOfMany.php @@ -6,7 +6,6 @@ use Closure; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Arr; -use Illuminate\Support\Str; use InvalidArgumentException; trait CanBeOneOfMany @@ -52,7 +51,7 @@ trait CanBeOneOfMany /** * Add join query constraints for one of many relationships. * - * @param \Illuminate\Database\Eloquent\JoinClause $join + * @param \Illuminate\Database\Query\JoinClause $join * @return void */ abstract public function addOneOfManyJoinSubQueryConstraints(JoinClause $join); @@ -61,7 +60,7 @@ trait CanBeOneOfMany * 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 * @@ -102,7 +101,9 @@ trait CanBeOneOfMany if (isset($previous)) { $this->addOneOfManyJoinSubQuery($subQuery, $previous['subQuery'], $previous['column']); - } elseif (isset($closure)) { + } + + if (isset($closure)) { $closure($subQuery); } @@ -122,6 +123,12 @@ trait CanBeOneOfMany $this->addConstraints(); + $columns = $this->query->getQuery()->columns; + + if (is_null($columns) || $columns === ['*']) { + $this->select([$this->qualifyColumn('*')]); + } + return $this; } @@ -129,7 +136,6 @@ trait CanBeOneOfMany * 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 */ @@ -137,14 +143,13 @@ trait CanBeOneOfMany { return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) { return [$column => 'MAX']; - })->all(), 'MAX', $relation ?: $this->guessRelationship()); + })->all(), 'MAX', $relation); } /** * 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 */ @@ -152,7 +157,7 @@ trait CanBeOneOfMany { return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) { return [$column => 'MIN']; - })->all(), 'MIN', $relation ?: $this->guessRelationship()); + })->all(), 'MIN', $relation); } /** @@ -179,14 +184,15 @@ trait CanBeOneOfMany protected function newOneOfManySubQuery($groupBy, $column = null, $aggregate = null) { $subQuery = $this->query->getModel() - ->newQuery(); + ->newQuery() + ->withoutGlobalScopes($this->removedScopes()); foreach (Arr::wrap($groupBy) as $group) { $subQuery->groupBy($this->qualifyRelatedColumn($group)); } if (! is_null($column)) { - $subQuery->selectRaw($aggregate.'('.$subQuery->getQuery()->grammar->wrap($column).') as '.$subQuery->getQuery()->grammar->wrap($column)); + $subQuery->selectRaw($aggregate.'('.$subQuery->getQuery()->grammar->wrap($subQuery->qualifyColumn($column)).') as '.$subQuery->getQuery()->grammar->wrap($column.'_aggregate')); } $this->addOneOfManySubQueryConstraints($subQuery, $groupBy, $column, $aggregate); @@ -208,7 +214,7 @@ trait CanBeOneOfMany $subQuery->applyBeforeQueryCallbacks(); $parent->joinSub($subQuery, $this->relationName, function ($join) use ($on) { - $join->on($this->qualifySubSelectColumn($on), '=', $this->qualifyRelatedColumn($on)); + $join->on($this->qualifySubSelectColumn($on.'_aggregate'), '=', $this->qualifyRelatedColumn($on)); $this->addOneOfManyJoinSubQueryConstraints($join, $on); }); @@ -218,7 +224,7 @@ trait CanBeOneOfMany /** * Merge the relationship query joins to the given query builder. * - * @param \Illuminate\Database\Eloquent\Builder $builder + * @param \Illuminate\Database\Eloquent\Builder $query * @return void */ protected function mergeOneOfManyJoinsTo(Builder $query) @@ -269,7 +275,7 @@ trait CanBeOneOfMany */ 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/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithDictionary.php b/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithDictionary.php index abdfdd6..ba4ae9a 100644 --- a/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithDictionary.php +++ b/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithDictionary.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Eloquent\Relations\Concerns; +use BackedEnum; use Doctrine\Instantiator\Exception\InvalidArgumentException; trait InteractsWithDictionary @@ -21,6 +22,11 @@ trait InteractsWithDictionary return $attribute->__toString(); } + if (function_exists('enum_exists') && + $attribute instanceof BackedEnum) { + return $attribute->value; + } + throw new InvalidArgumentException('Model attribute value is an object but does not have a __toString method.'); } diff --git a/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php b/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php index 7a1cbfa..342a562 100644 --- a/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php +++ b/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php @@ -207,7 +207,7 @@ trait InteractsWithPivotTable return $this->updateExistingPivotUsingCustomClass($id, $attributes, $touch); } - if (in_array($this->updatedAt(), $this->pivotColumns)) { + if ($this->hasPivotColumn($this->updatedAt())) { $attributes = $this->addTimestampsToAttachment($attributes, true); } @@ -669,18 +669,11 @@ trait InteractsWithPivotTable */ protected function getTypeSwapValue($type, $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; - } + return match (strtolower($type)) { + 'int', 'integer' => (int) $value, + 'real', 'float', 'double' => (float) $value, + 'string' => (string) $value, + default => $value, + }; } } diff --git a/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php b/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php index 9ea3075..7432695 100644 --- a/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php +++ b/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Eloquent\Relations; +use Closure; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; @@ -290,7 +291,7 @@ class HasManyThrough extends Relation * @param array $columns * @return \Illuminate\Database\Eloquent\Model|static * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> */ public function firstOrFail($columns = ['*']) { @@ -301,6 +302,28 @@ class HasManyThrough extends Relation 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. * @@ -346,7 +369,7 @@ class HasManyThrough extends Relation * @param array $columns * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> */ public function findOrFail($id, $columns = ['*']) { @@ -431,6 +454,22 @@ class HasManyThrough extends Relation return $this->query->simplePaginate($perPage, $columns, $pageName, $page); } + /** + * Paginate the given query into a cursor paginator. + * + * @param int|null $perPage + * @param array $columns + * @param string $cursorName + * @param string|null $cursor + * @return \Illuminate\Contracts\Pagination\CursorPaginator + */ + public function cursorPaginate($perPage = null, $columns = ['*'], $cursorName = 'cursor', $cursor = null) + { + $this->query->addSelect($this->shouldSelect($columns)); + + return $this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor); + } + /** * Set the select clause for the relation query. * @@ -469,9 +508,9 @@ class HasManyThrough extends Relation */ public function chunkById($count, callable $callback, $column = null, $alias = null) { - $column = $column ?? $this->getRelated()->getQualifiedKeyName(); + $column ??= $this->getRelated()->getQualifiedKeyName(); - $alias = $alias ?? $this->getRelated()->getKeyName(); + $alias ??= $this->getRelated()->getKeyName(); return $this->prepareQueryBuilder()->chunkById($count, $callback, $column, $alias); } @@ -518,16 +557,16 @@ class HasManyThrough extends Relation /** * Query lazily, by chunking the results of a query by comparing IDs. * - * @param int $count + * @param int $chunkSize * @param string|null $column * @param string|null $alias * @return \Illuminate\Support\LazyCollection */ public function lazyById($chunkSize = 1000, $column = null, $alias = null) { - $column = $column ?? $this->getRelated()->getQualifiedKeyName(); + $column ??= $this->getRelated()->getQualifiedKeyName(); - $alias = $alias ?? $this->getRelated()->getKeyName(); + $alias ??= $this->getRelated()->getKeyName(); return $this->prepareQueryBuilder()->lazyById($chunkSize, $column, $alias); } diff --git a/vendor/illuminate/database/Eloquent/Relations/HasOne.php b/vendor/illuminate/database/Eloquent/Relations/HasOne.php index 15c735c..ed85f1e 100755 --- a/vendor/illuminate/database/Eloquent/Relations/HasOne.php +++ b/vendor/illuminate/database/Eloquent/Relations/HasOne.php @@ -103,7 +103,7 @@ class HasOne extends HasOneOrMany implements SupportsPartialRelations /** * Add join query constraints for one of many relationships. * - * @param \Illuminate\Database\Eloquent\JoinClause $join + * @param \Illuminate\Database\Query\JoinClause $join * @return void */ public function addOneOfManyJoinSubQueryConstraints(JoinClause $join) diff --git a/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php b/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php index 1c7ff59..4de0651 100755 --- a/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php @@ -267,6 +267,19 @@ abstract class HasOneOrMany extends Relation 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/vendor/illuminate/database/Eloquent/Relations/MorphOne.php b/vendor/illuminate/database/Eloquent/Relations/MorphOne.php index ff52684..fc8f4dc 100755 --- a/vendor/illuminate/database/Eloquent/Relations/MorphOne.php +++ b/vendor/illuminate/database/Eloquent/Relations/MorphOne.php @@ -101,7 +101,7 @@ class MorphOne extends MorphOneOrMany implements SupportsPartialRelations /** * Add join query constraints for one of many relationships. * - * @param \Illuminate\Database\Eloquent\JoinClause $join + * @param \Illuminate\Database\Query\JoinClause $join * @return void */ public function addOneOfManyJoinSubQueryConstraints(JoinClause $join) diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphOneOrMany.php b/vendor/illuminate/database/Eloquent/Relations/MorphOneOrMany.php index ff58ef9..6e2297f 100755 --- a/vendor/illuminate/database/Eloquent/Relations/MorphOneOrMany.php +++ b/vendor/illuminate/database/Eloquent/Relations/MorphOneOrMany.php @@ -48,9 +48,9 @@ abstract class MorphOneOrMany extends HasOneOrMany public function addConstraints() { if (static::$constraints) { - parent::addConstraints(); - $this->getRelationQuery()->where($this->morphType, $this->morphClass); + + parent::addConstraints(); } } diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php b/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php index 7fbe484..5ca8b48 100644 --- a/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php +++ b/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php @@ -2,8 +2,6 @@ namespace Illuminate\Database\Eloquent\Relations; -use Illuminate\Support\Str; - class MorphPivot extends Pivot { /** @@ -141,7 +139,7 @@ class MorphPivot extends Pivot return $this->newQueryForCollectionRestoration($ids); } - if (! Str::contains($ids, ':')) { + if (! str_contains($ids, ':')) { return parent::newQueryForRestoration($ids); } @@ -163,7 +161,7 @@ class MorphPivot extends Pivot { $ids = array_values($ids); - if (! Str::contains($ids[0], ':')) { + if (! str_contains($ids[0], ':')) { return parent::newQueryForRestoration($ids); } diff --git a/vendor/illuminate/database/Eloquent/Relations/Relation.php b/vendor/illuminate/database/Eloquent/Relations/Relation.php index 7fe9f3e..58d6b31 100755 --- a/vendor/illuminate/database/Eloquent/Relations/Relation.php +++ b/vendor/illuminate/database/Eloquent/Relations/Relation.php @@ -3,6 +3,7 @@ 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; @@ -13,13 +14,10 @@ use Illuminate\Support\Arr; use Illuminate\Support\Traits\ForwardsCalls; use Illuminate\Support\Traits\Macroable; -/** - * @mixin \Illuminate\Database\Eloquent\Builder - */ -abstract class Relation +abstract class Relation implements BuilderContract { use ForwardsCalls, Macroable { - __call as macroCall; + Macroable::__call as macroCall; } /** @@ -57,6 +55,13 @@ abstract class Relation */ public static $morphMap = []; + /** + * Prevents morph relationships without a morph map. + * + * @var bool + */ + protected static $requireMorphMap = false; + /** * The count of self joins. * @@ -159,19 +164,21 @@ abstract class Relation * @param array|string $columns * @return \Illuminate\Database\Eloquent\Model * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException + * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<\Illuminate\Database\Eloquent\Model> * @throws \Illuminate\Database\MultipleRecordsFoundException */ public function sole($columns = ['*']) { $result = $this->take(2)->get($columns); - if ($result->isEmpty()) { + $count = $result->count(); + + if ($count === 0) { throw (new ModelNotFoundException)->setModel(get_class($this->related)); } - if ($result->count() > 1) { - throw new MultipleRecordsFoundException; + if ($count > 1) { + throw new MultipleRecordsFoundException($count); } return $result->first(); @@ -294,9 +301,21 @@ abstract class Relation /** * 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(); } @@ -376,6 +395,41 @@ abstract class Relation : 'whereIn'; } + /** + * Prevent polymorphic relationships from being used without model mappings. + * + * @param bool $requireMorphMap + * @return void + */ + public static function requireMorphMap($requireMorphMap = true) + { + static::$requireMorphMap = $requireMorphMap; + } + + /** + * Determine if polymorphic relationships require explicit model mapping. + * + * @return bool + */ + public static function requiresMorphMap() + { + return static::$requireMorphMap; + } + + /** + * Define the morph map for polymorphic relations and require all morphed models to be explicitly mapped. + * + * @param array $map + * @param bool $merge + * @return array + */ + public static function enforceMorphMap(array $map, $merge = true) + { + static::requireMorphMap(); + + return static::morphMap($map, $merge); + } + /** * Set or get the morph map for polymorphic relations. * @@ -436,13 +490,7 @@ abstract class Relation return $this->macroCall($method, $parameters); } - $result = $this->forwardCallTo($this->query, $method, $parameters); - - if ($result === $this->query) { - return $this; - } - - return $result; + return $this->forwardDecoratedCallTo($this->query, $method, $parameters); } /** diff --git a/vendor/illuminate/database/Eloquent/SoftDeletes.php b/vendor/illuminate/database/Eloquent/SoftDeletes.php index cac971c..78ad75e 100644 --- a/vendor/illuminate/database/Eloquent/SoftDeletes.php +++ b/vendor/illuminate/database/Eloquent/SoftDeletes.php @@ -3,9 +3,9 @@ namespace Illuminate\Database\Eloquent; /** - * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withTrashed(bool $withTrashed = true) - * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder onlyTrashed() - * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withoutTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withTrashed(bool $withTrashed = true) + * @method static \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withoutTrashed() */ trait SoftDeletes { @@ -64,9 +64,9 @@ trait SoftDeletes protected function performDeleteOnModel() { if ($this->forceDeleting) { - $this->exists = false; - - return $this->setKeysForSaveQuery($this->newModelQuery())->forceDelete(); + return tap($this->setKeysForSaveQuery($this->newModelQuery())->forceDelete(), function () { + $this->exists = false; + }); } return $this->runSoftDelete(); diff --git a/vendor/illuminate/database/Events/MigrationsEnded.php b/vendor/illuminate/database/Events/MigrationsEnded.php index 387f6a9..f668281 100644 --- a/vendor/illuminate/database/Events/MigrationsEnded.php +++ b/vendor/illuminate/database/Events/MigrationsEnded.php @@ -2,9 +2,7 @@ namespace Illuminate\Database\Events; -use Illuminate\Contracts\Database\Events\MigrationEvent as MigrationEventContract; - -class MigrationsEnded implements MigrationEventContract +class MigrationsEnded extends MigrationsEvent { // } diff --git a/vendor/illuminate/database/Events/MigrationsEvent.php b/vendor/illuminate/database/Events/MigrationsEvent.php new file mode 100644 index 0000000..c1f465a --- /dev/null +++ b/vendor/illuminate/database/Events/MigrationsEvent.php @@ -0,0 +1,26 @@ +method = $method; + } +} diff --git a/vendor/illuminate/database/Events/MigrationsStarted.php b/vendor/illuminate/database/Events/MigrationsStarted.php index 123e032..5283b49 100644 --- a/vendor/illuminate/database/Events/MigrationsStarted.php +++ b/vendor/illuminate/database/Events/MigrationsStarted.php @@ -2,9 +2,7 @@ namespace Illuminate\Database\Events; -use Illuminate\Contracts\Database\Events\MigrationEvent as MigrationEventContract; - -class MigrationsStarted implements MigrationEventContract +class MigrationsStarted extends MigrationsEvent { // } diff --git a/vendor/illuminate/database/Grammar.php b/vendor/illuminate/database/Grammar.php index cc1e0b9..697f325 100755 --- a/vendor/illuminate/database/Grammar.php +++ b/vendor/illuminate/database/Grammar.php @@ -4,6 +4,7 @@ namespace Illuminate\Database; use Illuminate\Database\Query\Expression; use Illuminate\Support\Traits\Macroable; +use RuntimeException; abstract class Grammar { @@ -62,6 +63,13 @@ abstract class Grammar 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)); } @@ -116,6 +124,30 @@ abstract class Grammar 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. * @@ -179,7 +211,7 @@ abstract class Grammar * Get the value of a raw expression. * * @param \Illuminate\Database\Query\Expression $expression - * @return string + * @return mixed */ public function getValue($expression) { diff --git a/vendor/illuminate/database/MigrationServiceProvider.php b/vendor/illuminate/database/MigrationServiceProvider.php index 9ae7685..d61f442 100755 --- a/vendor/illuminate/database/MigrationServiceProvider.php +++ b/vendor/illuminate/database/MigrationServiceProvider.php @@ -25,14 +25,14 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv * @var array */ protected $commands = [ - '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', + 'Migrate' => MigrateCommand::class, + 'MigrateFresh' => FreshCommand::class, + 'MigrateInstall' => InstallCommand::class, + 'MigrateRefresh' => RefreshCommand::class, + 'MigrateReset' => ResetCommand::class, + 'MigrateRollback' => RollbackCommand::class, + 'MigrateStatus' => StatusCommand::class, + 'MigrateMake' => MigrateMakeCommand::class, ]; /** @@ -116,7 +116,7 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv */ protected function registerMigrateCommand() { - $this->app->singleton('command.migrate', function ($app) { + $this->app->singleton(MigrateCommand::class, function ($app) { return new MigrateCommand($app['migrator'], $app[Dispatcher::class]); }); } @@ -128,9 +128,7 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv */ protected function registerMigrateFreshCommand() { - $this->app->singleton('command.migrate.fresh', function () { - return new FreshCommand; - }); + $this->app->singleton(FreshCommand::class); } /** @@ -140,7 +138,7 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv */ protected function registerMigrateInstallCommand() { - $this->app->singleton('command.migrate.install', function ($app) { + $this->app->singleton(InstallCommand::class, function ($app) { return new InstallCommand($app['migration.repository']); }); } @@ -152,7 +150,7 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv */ protected function registerMigrateMakeCommand() { - $this->app->singleton('command.migrate.make', function ($app) { + $this->app->singleton(MigrateMakeCommand::class, 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. @@ -171,9 +169,7 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv */ protected function registerMigrateRefreshCommand() { - $this->app->singleton('command.migrate.refresh', function () { - return new RefreshCommand; - }); + $this->app->singleton(RefreshCommand::class); } /** @@ -183,7 +179,7 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv */ protected function registerMigrateResetCommand() { - $this->app->singleton('command.migrate.reset', function ($app) { + $this->app->singleton(ResetCommand::class, function ($app) { return new ResetCommand($app['migrator']); }); } @@ -195,7 +191,7 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv */ protected function registerMigrateRollbackCommand() { - $this->app->singleton('command.migrate.rollback', function ($app) { + $this->app->singleton(RollbackCommand::class, function ($app) { return new RollbackCommand($app['migrator']); }); } @@ -207,7 +203,7 @@ class MigrationServiceProvider extends ServiceProvider implements DeferrableProv */ protected function registerMigrateStatusCommand() { - $this->app->singleton('command.migrate.status', function ($app) { + $this->app->singleton(StatusCommand::class, function ($app) { return new StatusCommand($app['migrator']); }); } diff --git a/vendor/illuminate/database/Migrations/MigrationCreator.php b/vendor/illuminate/database/Migrations/MigrationCreator.php index a79039a..d8f1ce9 100755 --- a/vendor/illuminate/database/Migrations/MigrationCreator.php +++ b/vendor/illuminate/database/Migrations/MigrationCreator.php @@ -68,13 +68,13 @@ class MigrationCreator $this->files->ensureDirectoryExists(dirname($path)); $this->files->put( - $path, $this->populateStub($name, $stub, $table) + $path, $this->populateStub($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); + $this->firePostCreateHooks($table, $path); return $path; } @@ -132,18 +132,12 @@ class MigrationCreator /** * Populate the place-holders in the migration stub. * - * @param string $name * @param string $stub * @param string|null $table * @return string */ - protected function populateStub($name, $stub, $table) + protected function populateStub($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. @@ -184,12 +178,13 @@ class MigrationCreator * Fire the registered post create hooks. * * @param string|null $table + * @param string $path * @return void */ - protected function firePostCreateHooks($table) + protected function firePostCreateHooks($table, $path) { foreach ($this->postCreate as $callback) { - $callback($table); + $callback($table, $path); } } diff --git a/vendor/illuminate/database/Migrations/Migrator.php b/vendor/illuminate/database/Migrations/Migrator.php index db3eae2..361747c 100755 --- a/vendor/illuminate/database/Migrations/Migrator.php +++ b/vendor/illuminate/database/Migrations/Migrator.php @@ -158,7 +158,7 @@ class Migrator $step = $options['step'] ?? false; - $this->fireMigrationEvent(new MigrationsStarted); + $this->fireMigrationEvent(new MigrationsStarted('up')); // Once we have the array of migrations, we will spin through them and run the // migrations "up" so the changes are made to the databases. We'll then log @@ -171,7 +171,7 @@ class Migrator } } - $this->fireMigrationEvent(new MigrationsEnded); + $this->fireMigrationEvent(new MigrationsEnded('up')); } /** @@ -265,7 +265,7 @@ class Migrator $this->requireFiles($files = $this->getMigrationFiles($paths)); - $this->fireMigrationEvent(new MigrationsStarted); + $this->fireMigrationEvent(new MigrationsStarted('down')); // Next we will run through all of the migrations and call the "down" method // which will reverse each migration in order. This getLast method on the @@ -287,7 +287,7 @@ class Migrator ); } - $this->fireMigrationEvent(new MigrationsEnded); + $this->fireMigrationEvent(new MigrationsEnded('down')); return $rolledBack; } @@ -387,11 +387,11 @@ class Migrator $migration->getConnection() ); - $callback = function () use ($migration, $method) { + $callback = function () use ($connection, $migration, $method) { if (method_exists($migration, $method)) { $this->fireMigrationEvent(new MigrationStarted($migration, $method)); - $migration->{$method}(); + $this->runMethod($connection, $migration, $method); $this->fireMigrationEvent(new MigrationEnded($migration, $method)); } @@ -447,13 +447,34 @@ class Migrator $migration->getConnection() ); - return $db->pretend(function () use ($migration, $method) { + return $db->pretend(function () use ($db, $migration, $method) { if (method_exists($migration, $method)) { - $migration->{$method}(); + $this->runMethod($db, $migration, $method); } }); } + /** + * Run a migration method on the given connection. + * + * @param \Illuminate\Database\Connection $connection + * @param object $migration + * @param string $method + * @return void + */ + protected function runMethod($connection, $migration, $method) + { + $previousConnection = $this->resolver->getDefaultConnection(); + + try { + $this->resolver->setDefaultConnection($connection->getName()); + + $migration->{$method}(); + } finally { + $this->resolver->setDefaultConnection($previousConnection); + } + } + /** * Resolve a migration instance from a file. * @@ -506,7 +527,7 @@ class Migrator public function getMigrationFiles($paths) { return Collection::make($paths)->flatMap(function ($path) { - return Str::endsWith($path, '.php') ? [$path] : $this->files->glob($path.'/*_*.php'); + return str_ends_with($path, '.php') ? [$path] : $this->files->glob($path.'/*_*.php'); })->filter()->values()->keyBy(function ($file) { return $this->getMigrationName($file); })->sortBy(function ($file, $key) { diff --git a/vendor/illuminate/database/Migrations/stubs/migration.create.stub b/vendor/illuminate/database/Migrations/stubs/migration.create.stub index f4a56a0..0e0ec22 100755 --- a/vendor/illuminate/database/Migrations/stubs/migration.create.stub +++ b/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; -class {{ class }} extends Migration +return new class extends Migration { /** * Run the migrations. @@ -28,4 +28,4 @@ class {{ class }} extends Migration { Schema::dropIfExists('{{ table }}'); } -} +}; diff --git a/vendor/illuminate/database/Migrations/stubs/migration.stub b/vendor/illuminate/database/Migrations/stubs/migration.stub index fd0e437..41dd1c8 100755 --- a/vendor/illuminate/database/Migrations/stubs/migration.stub +++ b/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; -class {{ class }} extends Migration +return new class extends Migration { /** * Run the migrations. @@ -25,4 +25,4 @@ class {{ class }} extends Migration { // } -} +}; diff --git a/vendor/illuminate/database/Migrations/stubs/migration.update.stub b/vendor/illuminate/database/Migrations/stubs/migration.update.stub index f1a04eb..d31a2c0 100755 --- a/vendor/illuminate/database/Migrations/stubs/migration.update.stub +++ b/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; -class {{ class }} extends Migration +return new class extends Migration { /** * Run the migrations. @@ -29,4 +29,4 @@ class {{ class }} extends Migration // }); } -} +}; diff --git a/vendor/illuminate/database/MultipleRecordsFoundException.php b/vendor/illuminate/database/MultipleRecordsFoundException.php index cccb7e4..b14a859 100755 --- a/vendor/illuminate/database/MultipleRecordsFoundException.php +++ b/vendor/illuminate/database/MultipleRecordsFoundException.php @@ -6,5 +6,35 @@ use RuntimeException; class MultipleRecordsFoundException extends RuntimeException { - // + /** + * The number of records found. + * + * @var int + */ + public $count; + + /** + * Create a new exception instance. + * + * @param int $count + * @param int $code + * @param \Throwable|null $previous + * @return void + */ + public function __construct($count, $code = 0, $previous = null) + { + $this->count = $count; + + parent::__construct("$count records were found.", $code, $previous); + } + + /** + * Get the number of records found. + * + * @return int + */ + public function getCount() + { + return $this->count; + } } diff --git a/vendor/illuminate/database/MySqlConnection.php b/vendor/illuminate/database/MySqlConnection.php index 9760358..54e3d47 100755 --- a/vendor/illuminate/database/MySqlConnection.php +++ b/vendor/illuminate/database/MySqlConnection.php @@ -2,8 +2,6 @@ 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; @@ -22,7 +20,7 @@ class MySqlConnection extends Connection */ public function isMaria() { - return strpos($this->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), 'MariaDB') !== false; + return str_contains($this->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), 'MariaDB'); } /** @@ -84,10 +82,10 @@ class MySqlConnection extends Connection /** * Get the Doctrine DBAL driver. * - * @return \Doctrine\DBAL\Driver\PDOMySql\Driver|\Illuminate\Database\PDO\MySqlDriver + * @return \Illuminate\Database\PDO\MySqlDriver */ protected function getDoctrineDriver() { - return class_exists(Version::class) ? new DoctrineDriver : new MySqlDriver; + return new MySqlDriver; } } diff --git a/vendor/illuminate/database/PDO/Concerns/ConnectsToDatabase.php b/vendor/illuminate/database/PDO/Concerns/ConnectsToDatabase.php index 84c3338..d2a8d60 100644 --- a/vendor/illuminate/database/PDO/Concerns/ConnectsToDatabase.php +++ b/vendor/illuminate/database/PDO/Concerns/ConnectsToDatabase.php @@ -11,12 +11,15 @@ trait ConnectsToDatabase /** * Create a new database connection. * - * @param array $params + * @param mixed[] $params + * @param string|null $username + * @param string|null $password + * @param mixed[] $driverOptions * @return \Illuminate\Database\PDO\Connection * * @throws \InvalidArgumentException */ - public function connect(array $params) + public function connect(array $params, $username = null, $password = null, array $driverOptions = []) { 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/vendor/illuminate/database/PDO/MySqlDriver.php b/vendor/illuminate/database/PDO/MySqlDriver.php index 5f68c6f..54ac375 100644 --- a/vendor/illuminate/database/PDO/MySqlDriver.php +++ b/vendor/illuminate/database/PDO/MySqlDriver.php @@ -8,4 +8,12 @@ use Illuminate\Database\PDO\Concerns\ConnectsToDatabase; class MySqlDriver extends AbstractMySQLDriver { use ConnectsToDatabase; + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'pdo_mysql'; + } } diff --git a/vendor/illuminate/database/PDO/PostgresDriver.php b/vendor/illuminate/database/PDO/PostgresDriver.php index eb29c96..0d95611 100644 --- a/vendor/illuminate/database/PDO/PostgresDriver.php +++ b/vendor/illuminate/database/PDO/PostgresDriver.php @@ -8,4 +8,12 @@ use Illuminate\Database\PDO\Concerns\ConnectsToDatabase; class PostgresDriver extends AbstractPostgreSQLDriver { use ConnectsToDatabase; + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'pdo_pgsql'; + } } diff --git a/vendor/illuminate/database/PDO/SQLiteDriver.php b/vendor/illuminate/database/PDO/SQLiteDriver.php index 2dac06d..f50da08 100644 --- a/vendor/illuminate/database/PDO/SQLiteDriver.php +++ b/vendor/illuminate/database/PDO/SQLiteDriver.php @@ -8,4 +8,12 @@ use Illuminate\Database\PDO\Concerns\ConnectsToDatabase; class SQLiteDriver extends AbstractSQLiteDriver { use ConnectsToDatabase; + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'pdo_sqlite'; + } } diff --git a/vendor/illuminate/database/PDO/SqlServerConnection.php b/vendor/illuminate/database/PDO/SqlServerConnection.php index bbbb8b0..0f09c3a 100644 --- a/vendor/illuminate/database/PDO/SqlServerConnection.php +++ b/vendor/illuminate/database/PDO/SqlServerConnection.php @@ -123,7 +123,7 @@ class SqlServerConnection implements ServerInfoAwareConnection $val = $this->connection->quote($value, $type); // Fix for a driver version terminating all values with null byte... - if (\is_string($val) && \strpos($val, "\0") !== false) { + if (\is_string($val) && str_contains($val, "\0")) { $val = \substr($val, 0, -1); } diff --git a/vendor/illuminate/database/PDO/SqlServerDriver.php b/vendor/illuminate/database/PDO/SqlServerDriver.php index bbb3bbd..1b0d957 100644 --- a/vendor/illuminate/database/PDO/SqlServerDriver.php +++ b/vendor/illuminate/database/PDO/SqlServerDriver.php @@ -6,10 +6,27 @@ use Doctrine\DBAL\Driver\AbstractSQLServerDriver; class SqlServerDriver extends AbstractSQLServerDriver { - public function connect(array $params) + /** + * Create a new database connection. + * + * @param mixed[] $params + * @param string|null $username + * @param string|null $password + * @param mixed[] $driverOptions + * @return \Illuminate\Database\PDO\SqlServerConnection + */ + public function connect(array $params, $username = null, $password = null, array $driverOptions = []) { return new SqlServerConnection( new Connection($params['pdo']) ); } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'pdo_sqlsrv'; + } } diff --git a/vendor/illuminate/database/PostgresConnection.php b/vendor/illuminate/database/PostgresConnection.php index 5d68d1d..f750f64 100755 --- a/vendor/illuminate/database/PostgresConnection.php +++ b/vendor/illuminate/database/PostgresConnection.php @@ -2,8 +2,6 @@ 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; @@ -11,36 +9,9 @@ use Illuminate\Database\Schema\Grammars\PostgresGrammar as SchemaGrammar; use Illuminate\Database\Schema\PostgresBuilder; use Illuminate\Database\Schema\PostgresSchemaState; use Illuminate\Filesystem\Filesystem; -use PDO; class PostgresConnection extends Connection { - /** - * Bind values to their parameters in the given statement. - * - * @param \PDOStatement $statement - * @param array $bindings - * @return void - */ - public function bindValues($statement, $bindings) - { - foreach ($bindings as $key => $value) { - if (is_int($value)) { - $pdoParam = PDO::PARAM_INT; - } elseif (is_resource($value)) { - $pdoParam = PDO::PARAM_LOB; - } else { - $pdoParam = PDO::PARAM_STR; - } - - $statement->bindValue( - is_string($key) ? $key : $key + 1, - $value, - $pdoParam - ); - } - } - /** * Get the default query grammar instance. * @@ -100,10 +71,10 @@ class PostgresConnection extends Connection /** * Get the Doctrine DBAL driver. * - * @return \Doctrine\DBAL\Driver\PDOPgSql\Driver|\Illuminate\Database\PDO\PostgresDriver + * @return \Illuminate\Database\PDO\PostgresDriver */ protected function getDoctrineDriver() { - return class_exists(Version::class) ? new DoctrineDriver : new PostgresDriver; + return new PostgresDriver; } } diff --git a/vendor/illuminate/database/Query/Builder.php b/vendor/illuminate/database/Query/Builder.php index eebdc15..ab0a573 100755 --- a/vendor/illuminate/database/Query/Builder.php +++ b/vendor/illuminate/database/Query/Builder.php @@ -2,8 +2,11 @@ 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; @@ -20,9 +23,10 @@ use Illuminate\Support\Str; use Illuminate\Support\Traits\ForwardsCalls; use Illuminate\Support\Traits\Macroable; use InvalidArgumentException; +use LogicException; use RuntimeException; -class Builder +class Builder implements BuilderContract { use BuildsQueries, ExplainsQueries, ForwardsCalls, Macroable { __call as macroCall; @@ -201,6 +205,15 @@ class Builder 'not similar to', 'not ilike', '~~*', '!~~*', ]; + /** + * All of the available bitwise operators. + * + * @var string[] + */ + public $bitwiseOperators = [ + '&', '|', '^', '<<', '>>', '&~', + ]; + /** * Whether to use write pdo for the select. * @@ -235,6 +248,7 @@ class Builder { $this->columns = []; $this->bindings['select'] = []; + $columns = is_array($columns) ? $columns : func_get_args(); foreach ($columns as $as => $column) { @@ -371,7 +385,7 @@ class Builder $this->getConnection()->getDatabaseName()) { $databaseName = $query->getConnection()->getDatabaseName(); - if (strpos($query->from, $databaseName) !== 0 && strpos($query->from, '.') === false) { + if (! str_starts_with($query->from, $databaseName) && ! str_contains($query->from, '.')) { $query->from($databaseName.'.'.$query->from); } } @@ -407,7 +421,6 @@ class Builder /** * Force the query to only return distinct results. * - * @param mixed ...$distinct * @return $this */ public function distinct() @@ -674,6 +687,8 @@ class Builder $this->bindings['where'] = array_values( array_merge($this->bindings['where'], (array) $bindings) ); + + return $this; } /** @@ -744,7 +759,7 @@ class Builder // 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)) { @@ -752,6 +767,10 @@ class Builder } } + if ($this->isBitwiseOperator($operator)) { + $type = 'Bitwise'; + } + // Now that we are working with just a simple query we can put the elements // in our array and add the query binding to our array of bindings that // will be bound to each SQL statements when it is finally executed. @@ -831,8 +850,20 @@ class Builder */ protected function invalidOperator($operator) { - return ! in_array(strtolower($operator), $this->operators, true) && - ! in_array(strtolower($operator), $this->grammar->getOperators(), true); + return ! is_string($operator) || (! in_array(strtolower($operator), $this->operators, true) && + ! in_array(strtolower($operator), $this->grammar->getOperators(), true)); + } + + /** + * Determine if the operator is a bitwise operator. + * + * @param string $operator + * @return bool + */ + protected function isBitwiseOperator($operator) + { + return in_array(strtolower($operator), $this->bitwiseOperators, true) || + in_array(strtolower($operator), $this->grammar->getBitwiseOperators(), true); } /** @@ -852,6 +883,33 @@ class Builder return $this->where($column, $operator, $value, 'or'); } + /** + * Add a basic "where not" clause to the query. + * + * @param \Closure|string|array $column + * @param mixed $operator + * @param mixed $value + * @param string $boolean + * @return $this + */ + public function whereNot($column, $operator = null, $value = null, $boolean = 'and') + { + return $this->where($column, $operator, $value, $boolean.' not'); + } + + /** + * Add an "or where not" clause to the query. + * + * @param \Closure|string|array $column + * @param mixed $operator + * @param mixed $value + * @return $this + */ + public function orWhereNot($column, $operator = null, $value = null) + { + return $this->whereNot($column, $operator, $value, 'or'); + } + /** * Add a "where" clause comparing two columns to the query. * @@ -1118,15 +1176,19 @@ class Builder * Add a where between statement to the query. * * @param string|\Illuminate\Database\Query\Expression $column - * @param array $values + * @param iterable $values * @param string $boolean * @param bool $not * @return $this */ - public function whereBetween($column, array $values, $boolean = 'and', $not = false) + public function whereBetween($column, iterable $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'); @@ -1156,10 +1218,10 @@ class Builder * Add an or where between statement to the query. * * @param string $column - * @param array $values + * @param iterable $values * @return $this */ - public function orWhereBetween($column, array $values) + public function orWhereBetween($column, iterable $values) { return $this->whereBetween($column, $values, 'or'); } @@ -1180,11 +1242,11 @@ class Builder * Add a where not between statement to the query. * * @param string $column - * @param array $values + * @param iterable $values * @param string $boolean * @return $this */ - public function whereNotBetween($column, array $values, $boolean = 'and') + public function whereNotBetween($column, iterable $values, $boolean = 'and') { return $this->whereBetween($column, $values, $boolean, true); } @@ -1206,10 +1268,10 @@ class Builder * Add an or where not between statement to the query. * * @param string $column - * @param array $values + * @param iterable $values * @return $this */ - public function orWhereNotBetween($column, array $values) + public function orWhereNotBetween($column, iterable $values) { return $this->whereNotBetween($column, $values, 'or'); } @@ -1480,7 +1542,7 @@ class Builder */ public function whereNested(Closure $callback, $boolean = 'and') { - call_user_func($callback, $query = $this->forNestedWhere()); + $callback($query = $this->forNestedWhere()); return $this->addNestedWhereQuery($query, $boolean); } @@ -1531,7 +1593,7 @@ class Builder // 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. - call_user_func($callback, $query = $this->forSubQuery()); + $callback($query = $this->forSubQuery()); $this->wheres[] = compact( 'type', 'column', 'operator', 'query', 'boolean' @@ -1557,7 +1619,7 @@ class Builder // 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. - call_user_func($callback, $query); + $callback($query); return $this->addWhereExistsQuery($query, $boolean, $not); } @@ -1819,6 +1881,39 @@ class Builder $this->where(Str::snake($segment), '=', $parameters[$index], $bool); } + /** + * Add a "where fulltext" clause to the query. + * + * @param string|string[] $columns + * @param string $value + * @param string $boolean + * @return $this + */ + public function whereFullText($columns, $value, array $options = [], $boolean = 'and') + { + $type = 'Fulltext'; + + $columns = (array) $columns; + + $this->wheres[] = compact('type', 'columns', 'value', 'options', 'boolean'); + + $this->addBinding($value); + + return $this; + } + + /** + * Add a "or where fulltext" clause to the query. + * + * @param string|string[] $columns + * @param string $value + * @return $this + */ + public function orWhereFullText($columns, $value, array $options = []) + { + return $this->whereFulltext($columns, $value, $options, 'or'); + } + /** * Add a "group by" clause to the query. * @@ -1856,7 +1951,7 @@ class Builder /** * Add a "having" clause to the query. * - * @param string $column + * @param \Closure|string $column * @param string|null $operator * @param string|null $value * @param string $boolean @@ -1873,6 +1968,10 @@ class Builder $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. @@ -1880,6 +1979,10 @@ class Builder [$value, $operator] = [$operator, '=']; } + if ($this->isBitwiseOperator($operator)) { + $type = 'Bitwise'; + } + $this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean'); if (! $value instanceof Expression) { @@ -1892,7 +1995,7 @@ class Builder /** * Add an "or having" clause to the query. * - * @param string $column + * @param \Closure|string $column * @param string|null $operator * @param string|null $value * @return $this @@ -1906,6 +2009,93 @@ class Builder 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. * @@ -2100,7 +2290,7 @@ class Builder $property = $this->unions ? 'unionLimit' : 'limit'; if ($value >= 0) { - $this->$property = $value; + $this->$property = ! is_null($value) ? (int) $value : null; } return $this; @@ -2204,7 +2394,7 @@ class Builder public function union($query, $all = false) { if ($query instanceof Closure) { - call_user_func($query, $query = $this->newQuery()); + $query($query = $this->newQuery()); } $this->unions[] = compact('query', 'all'); @@ -2326,6 +2516,22 @@ class Builder return count($result) > 0 ? reset($result) : null; } + /** + * Get a single column's value from the first result of a query if it's the sole matching record. + * + * @param string $column + * @return mixed + * + * @throws \Illuminate\Database\RecordsNotFoundException + * @throws \Illuminate\Database\MultipleRecordsFoundException + */ + public function soleValue($column) + { + $result = (array) $this->sole([$column]); + + return reset($result); + } + /** * Execute the query as a "select" statement. * @@ -2592,7 +2798,7 @@ class Builder return $column; } - $separator = strpos(strtolower($column), ' as ') !== false ? ' as ' : '\.'; + $separator = str_contains(strtolower($column), ' as ') ? ' as ' : '\.'; return last(preg_split('~'.$separator.'~i', $column)); } @@ -2828,7 +3034,7 @@ class Builder // 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 strpos((string) $result, '.') === false + return ! str_contains((string) $result, '.') ? (int) $result : (float) $result; } @@ -3000,6 +3206,27 @@ class Builder )); } + /** + * Update records in a PostgreSQL database using the update from syntax. + * + * @param array $values + * @return int + */ + public function updateFrom(array $values) + { + if (! method_exists($this->grammar, 'compileUpdateFrom')) { + throw new LogicException('This database engine does not support the updateFrom method.'); + } + + $this->applyBeforeQueryCallbacks(); + + $sql = $this->grammar->compileUpdateFrom($this, $values); + + return $this->connection->update($sql, $this->cleanBindings( + $this->grammar->prepareBindingsForUpdateFrom($this->bindings, $values) + )); + } + /** * Insert or update a record matching the attributes, and fill it with values. * @@ -3236,14 +3463,32 @@ class Builder } if (is_array($value)) { - $this->bindings[$type] = array_values(array_merge($this->bindings[$type], $value)); + $this->bindings[$type] = array_values(array_map( + [$this, 'castBinding'], + array_merge($this->bindings[$type], $value), + )); } else { - $this->bindings[$type][] = $value; + $this->bindings[$type][] = $this->castBinding($value); } return $this; } + /** + * Cast the given binding value. + * + * @param mixed $value + * @return mixed + */ + public function castBinding($value) + { + if (function_exists('enum_exists') && $value instanceof BackedEnum) { + return $value->value; + } + + return $value; + } + /** * Merge an array of bindings into our bindings. * @@ -3265,9 +3510,13 @@ class Builder */ public function cleanBindings(array $bindings) { - return array_values(array_filter($bindings, function ($binding) { - return ! $binding instanceof Expression; - })); + return collect($bindings) + ->reject(function ($binding) { + return $binding instanceof Expression; + }) + ->map([$this, 'castBinding']) + ->values() + ->all(); } /** @@ -3322,7 +3571,7 @@ class Builder } /** - * Use the write pdo for query. + * Use the "write" PDO connection when executing the query. * * @return $this */ @@ -3402,7 +3651,7 @@ class Builder /** * Die and dump the current SQL and bindings. * - * @return void + * @return never */ public function dd() { @@ -3424,7 +3673,7 @@ class Builder return $this->macroCall($method, $parameters); } - if (Str::startsWith($method, 'where')) { + if (str_starts_with($method, 'where')) { return $this->dynamicWhere($method, $parameters); } diff --git a/vendor/illuminate/database/Query/Grammars/Grammar.php b/vendor/illuminate/database/Query/Grammars/Grammar.php index d7bc534..91b8af7 100755 --- a/vendor/illuminate/database/Query/Grammars/Grammar.php +++ b/vendor/illuminate/database/Query/Grammars/Grammar.php @@ -18,6 +18,13 @@ class Grammar extends BaseGrammar */ protected $operators = []; + /** + * The grammar specific bitwise operators. + * + * @var array + */ + protected $bitwiseOperators = []; + /** * The components that make up a select clause. * @@ -255,6 +262,18 @@ class Grammar extends BaseGrammar return $this->wrap($where['column']).' '.$operator.' '.$value; } + /** + * Compile a bitwise operator where clause. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $where + * @return string + */ + protected function whereBitwise(Builder $query, $where) + { + return $this->whereBasic($query, $where); + } + /** * Compile a "where in" clause. * @@ -358,9 +377,9 @@ class Grammar extends BaseGrammar { $between = $where['not'] ? 'not between' : 'between'; - $min = $this->parameter(reset($where['values'])); + $min = $this->parameter(is_array($where['values']) ? reset($where['values']) : $where['values'][0]); - $max = $this->parameter(end($where['values'])); + $max = $this->parameter(is_array($where['values']) ? end($where['values']) : $where['values'][1]); return $this->wrap($where['column']).' '.$between.' '.$min.' and '.$max; } @@ -376,9 +395,9 @@ class Grammar extends BaseGrammar { $between = $where['not'] ? 'not between' : 'between'; - $min = $this->wrap(reset($where['values'])); + $min = $this->wrap(is_array($where['values']) ? reset($where['values']) : $where['values'][0]); - $max = $this->wrap(end($where['values'])); + $max = $this->wrap(is_array($where['values']) ? end($where['values']) : $where['values'][1]); return $this->wrap($where['column']).' '.$between.' '.$min.' and '.$max; } @@ -571,7 +590,8 @@ class Grammar extends BaseGrammar $not = $where['not'] ? 'not ' : ''; return $not.$this->compileJsonContains( - $where['column'], $this->parameter($where['value']) + $where['column'], + $this->parameter($where['value']) ); } @@ -610,7 +630,9 @@ class Grammar extends BaseGrammar protected function whereJsonLength(Builder $query, $where) { return $this->compileJsonLength( - $where['column'], $where['operator'], $this->parameter($where['value']) + $where['column'], + $where['operator'], + $this->parameter($where['value']) ); } @@ -629,6 +651,18 @@ class Grammar extends BaseGrammar throw new RuntimeException('This database engine does not support JSON length operations.'); } + /** + * Compile a "where fulltext" clause. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $where + * @return string + */ + public function whereFullText(Builder $query, $where) + { + throw new RuntimeException('This database engine does not support fulltext search operations.'); + } + /** * Compile the "group by" portions of the query. * @@ -645,14 +679,13 @@ class Grammar extends BaseGrammar * Compile the "having" portions of the query. * * @param \Illuminate\Database\Query\Builder $query - * @param array $havings * @return string */ - protected function compileHavings(Builder $query, $havings) + protected function compileHavings(Builder $query) { - $sql = implode(' ', array_map([$this, 'compileHaving'], $havings)); - - return 'having '.$this->removeLeadingBoolean($sql); + return 'having '.$this->removeLeadingBoolean(collect($query->havings)->map(function ($having) { + return $having['boolean'].' '.$this->compileHaving($having); + })->implode(' ')); } /** @@ -667,9 +700,17 @@ class Grammar extends BaseGrammar // 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['boolean'].' '.$having['sql']; + return $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); @@ -687,7 +728,7 @@ class Grammar extends BaseGrammar $parameter = $this->parameter($having['value']); - return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter; + return $column.' '.$having['operator'].' '.$parameter; } /** @@ -706,7 +747,59 @@ class Grammar extends BaseGrammar $max = $this->parameter(last($having['values'])); - return $having['boolean'].' '.$column.' '.$between.' '.$min.' and '.$max; + 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).')'; } /** @@ -998,7 +1091,7 @@ class Grammar extends BaseGrammar /** * Compile an "upsert" statement into SQL. * - * @param \Illuminate\Database\Query\Builder $query + * @param \Illuminate\Database\Query\Builder $query * @param array $values * @param array $uniqueBy * @param array $update @@ -1144,49 +1237,6 @@ class Grammar extends BaseGrammar 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. * @@ -1237,18 +1287,34 @@ class Grammar extends BaseGrammar { $value = preg_replace("/([\\\\]+)?\\'/", "''", $value); - return '\'$."'.str_replace($delimiter, '"."', $value).'"\''; + $jsonPath = collect(explode($delimiter, $value)) + ->map(function ($segment) { + return $this->wrapJsonPathSegment($segment); + }) + ->join('.'); + + return "'$".(str_starts_with($jsonPath, '[') ? '' : '.').$jsonPath."'"; } /** - * Determine if the given string is a JSON selector. + * Wrap the given JSON path segment. * - * @param string $value - * @return bool + * @param string $segment + * @return string */ - protected function isJsonSelector($value) + protected function wrapJsonPathSegment($segment) { - return Str::contains($value, '->'); + if (preg_match('/(\[[^\]]+\])+$/', $segment, $parts)) { + $key = Str::beforeLast($segment, $parts[0]); + + if (! empty($key)) { + return '"'.$key.'"'.$parts[0]; + } + + return $parts[0]; + } + + return '"'.$segment.'"'; } /** @@ -1284,4 +1350,14 @@ class Grammar extends BaseGrammar { return $this->operators; } + + /** + * Get the grammar specific bitwise operators. + * + * @return array + */ + public function getBitwiseOperators() + { + return $this->bitwiseOperators; + } } diff --git a/vendor/illuminate/database/Query/Grammars/MySqlGrammar.php b/vendor/illuminate/database/Query/Grammars/MySqlGrammar.php index 17b1aff..404b3d5 100755 --- a/vendor/illuminate/database/Query/Grammars/MySqlGrammar.php +++ b/vendor/illuminate/database/Query/Grammars/MySqlGrammar.php @@ -50,6 +50,30 @@ class MySqlGrammar extends Grammar return parent::whereNotNull($query, $where); } + /** + * Compile a "where fulltext" clause. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $where + * @return string + */ + public function whereFullText(Builder $query, $where) + { + $columns = $this->columnize($where['columns']); + + $value = $this->parameter($where['value']); + + $mode = ($where['options']['mode'] ?? []) === 'boolean' + ? ' in boolean mode' + : ' in natural language mode'; + + $expanded = ($where['options']['expanded'] ?? []) && ($where['options']['mode'] ?? []) !== 'boolean' + ? ' with query expansion' + : ''; + + return "match ({$columns}) against (".$value."{$mode}{$expanded})"; + } + /** * Compile an insert ignore statement into SQL. * diff --git a/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php b/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php index 85ff012..6683e14 100755 --- a/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php +++ b/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php @@ -4,7 +4,6 @@ namespace Illuminate\Database\Query\Grammars; use Illuminate\Database\Query\Builder; use Illuminate\Support\Arr; -use Illuminate\Support\Str; class PostgresGrammar extends Grammar { @@ -22,7 +21,16 @@ class PostgresGrammar extends Grammar ]; /** - * {@inheritdoc} + * The grammar specific bitwise operators. + * + * @var array + */ + protected $bitwiseOperators = [ + '~', '&', '|', '#', '<<', '>>', '<<=', '>>=', + ]; + + /** + * Compile a basic where clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where @@ -30,7 +38,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']), @@ -42,6 +50,22 @@ class PostgresGrammar extends Grammar return parent::whereBasic($query, $where); } + /** + * Compile a bitwise operator where clause. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $where + * @return string + */ + protected function whereBitwise(Builder $query, $where) + { + $value = $this->parameter($where['value']); + + $operator = str_replace('?', '??', $where['operator']); + + return '('.$this->wrap($where['column']).' '.$operator.' '.$value.')::bool'; + } + /** * Compile a "where date" clause. * @@ -85,6 +109,71 @@ class PostgresGrammar extends Grammar return 'extract('.$type.' from '.$this->wrap($where['column']).') '.$where['operator'].' '.$value; } + /** + * Compile a "where fulltext" clause. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $where + * @return string + */ + public function whereFullText(Builder $query, $where) + { + $language = $where['options']['language'] ?? 'english'; + + if (! in_array($language, $this->validFullTextLanguages())) { + $language = 'english'; + } + + $columns = collect($where['columns'])->map(function ($column) use ($language) { + return "to_tsvector('{$language}', {$this->wrap($column)})"; + })->implode(' || '); + + $mode = 'plainto_tsquery'; + + if (($where['options']['mode'] ?? []) === 'phrase') { + $mode = 'phraseto_tsquery'; + } + + if (($where['options']['mode'] ?? []) === 'websearch') { + $mode = 'websearch_to_tsquery'; + } + + return "({$columns}) @@ {$mode}('{$language}', {$this->parameter($where['value'])})"; + } + + /** + * Get an array of valid full text languages. + * + * @return array + */ + protected function validFullTextLanguages() + { + return [ + 'simple', + 'arabic', + 'danish', + 'dutch', + 'english', + 'finnish', + 'french', + 'german', + 'hungarian', + 'indonesian', + 'irish', + 'italian', + 'lithuanian', + 'nepali', + 'norwegian', + 'portuguese', + 'romanian', + 'russian', + 'spanish', + 'swedish', + 'tamil', + 'turkish', + ]; + } + /** * Compile the "select *" portion of the query. * @@ -138,7 +227,37 @@ class PostgresGrammar extends Grammar { $column = str_replace('->>', '->', $this->wrap($column)); - return 'json_array_length(('.$column.')::json) '.$operator.' '.$value; + return 'jsonb_array_length(('.$column.')::jsonb) '.$operator.' '.$value; + } + + /** + * Compile a single having clause. + * + * @param array $having + * @return string + */ + protected function compileHaving(array $having) + { + if ($having['type'] === 'Bitwise') { + return $this->compileHavingBitwise($having); + } + + return parent::compileHaving($having); + } + + /** + * Compile a having clause involving a bitwise operator. + * + * @param array $having + * @return string + */ + protected function compileHavingBitwise($having) + { + $column = $this->wrap($having['column']); + + $parameter = $this->parameter($having['value']); + + return '('.$column.' '.$having['operator'].' '.$parameter.')::bool'; } /** @@ -260,6 +379,114 @@ class PostgresGrammar extends Grammar return "{$field} = jsonb_set({$field}::jsonb, {$path}, {$this->parameter($value)})"; } + /** + * Compile an update from statement into SQL. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $values + * @return string + */ + public function compileUpdateFrom(Builder $query, $values) + { + $table = $this->wrapTable($query->from); + + // Each one of the columns in the update statements needs to be wrapped in the + // keyword identifiers, also a place-holder needs to be created for each of + // the values in the list of bindings so we can make the sets statements. + $columns = $this->compileUpdateColumns($query, $values); + + $from = ''; + + if (isset($query->joins)) { + // When using Postgres, updates with joins list the joined tables in the from + // clause, which is different than other systems like MySQL. Here, we will + // compile out the tables that are joined and add them to a from clause. + $froms = collect($query->joins)->map(function ($join) { + return $this->wrapTable($join->table); + })->all(); + + if (count($froms) > 0) { + $from = ' from '.implode(', ', $froms); + } + } + + $where = $this->compileUpdateWheres($query); + + return trim("update {$table} set {$columns}{$from} {$where}"); + } + + /** + * Compile the additional where clauses for updates with joins. + * + * @param \Illuminate\Database\Query\Builder $query + * @return string + */ + protected function compileUpdateWheres(Builder $query) + { + $baseWheres = $this->compileWheres($query); + + if (! isset($query->joins)) { + return $baseWheres; + } + + // Once we compile the join constraints, we will either use them as the where + // clause or append them to the existing base where clauses. If we need to + // strip the leading boolean we will do so when using as the only where. + $joinWheres = $this->compileUpdateJoinWheres($query); + + if (trim($baseWheres) == '') { + return 'where '.$this->removeLeadingBoolean($joinWheres); + } + + return $baseWheres.' '.$joinWheres; + } + + /** + * Compile the "join" clause where clauses for an update. + * + * @param \Illuminate\Database\Query\Builder $query + * @return string + */ + protected function compileUpdateJoinWheres(Builder $query) + { + $joinWheres = []; + + // Here we will just loop through all of the join constraints and compile them + // all out then implode them. This should give us "where" like syntax after + // everything has been built and then we will join it to the real wheres. + foreach ($query->joins as $join) { + foreach ($join->wheres as $where) { + $method = "where{$where['type']}"; + + $joinWheres[] = $where['boolean'].' '.$this->$method($query, $where); + } + } + + return implode(' ', $joinWheres); + } + + /** + * Prepare the bindings for an update statement. + * + * @param array $bindings + * @param array $values + * @return array + */ + public function prepareBindingsForUpdateFrom(array $bindings, array $values) + { + $values = collect($values)->map(function ($value, $column) { + return is_array($value) || ($this->isJsonSelector($column) && ! $this->isExpression($value)) + ? json_encode($value) + : $value; + })->all(); + + $bindingsWithoutWhere = Arr::except($bindings, ['select', 'where']); + + return array_values( + array_merge($values, $bindings['where'], Arr::flatten($bindingsWithoutWhere)) + ); + } + /** * Compile an update statement with joins or limit into SQL. * diff --git a/vendor/illuminate/database/Query/Grammars/SqlServerGrammar.php b/vendor/illuminate/database/Query/Grammars/SqlServerGrammar.php index 0f5a27a..e717051 100755 --- a/vendor/illuminate/database/Query/Grammars/SqlServerGrammar.php +++ b/vendor/illuminate/database/Query/Grammars/SqlServerGrammar.php @@ -31,15 +31,21 @@ class SqlServerGrammar extends Grammar return parent::compileSelect($query); } - // If an offset is present on the query, we will need to wrap the query in - // a big "ANSI" offset syntax block. This is very nasty compared to the - // other database systems but is necessary for implementing features. if (is_null($query->columns)) { $query->columns = ['*']; } + $components = $this->compileComponents($query); + + if (! empty($components['orders'])) { + return parent::compileSelect($query)." offset {$query->offset} rows fetch next {$query->limit} rows only"; + } + + // If an offset is present on the query, we will need to wrap the query in + // a big "ANSI" offset syntax block. This is very nasty compared to the + // other database systems but is necessary for implementing features. return $this->compileAnsiOffset( - $query, $this->compileComponents($query) + $query, $components ); } @@ -90,6 +96,22 @@ class SqlServerGrammar extends Grammar return $from; } + /** + * {@inheritdoc} + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $where + * @return string + */ + protected function whereBitwise(Builder $query, $where) + { + $value = $this->parameter($where['value']); + + $operator = str_replace('?', '??', $where['operator']); + + return '('.$this->wrap($where['column']).' '.$operator.' '.$value.') != 0'; + } + /** * Compile a "where date" clause. * @@ -158,6 +180,36 @@ class SqlServerGrammar extends Grammar return '(select count(*) from openjson('.$field.$path.')) '.$operator.' '.$value; } + /** + * Compile a single having clause. + * + * @param array $having + * @return string + */ + protected function compileHaving(array $having) + { + if ($having['type'] === 'Bitwise') { + return $this->compileHavingBitwise($having); + } + + return parent::compileHaving($having); + } + + /** + * Compile a having clause involving a bitwise operator. + * + * @param array $having + * @return string + */ + protected function compileHavingBitwise($having) + { + $column = $this->wrap($having['column']); + + $parameter = $this->parameter($having['value']); + + return '('.$column.' '.$having['operator'].' '.$parameter.') != 0'; + } + /** * Create a full ANSI offset clause for the query. * diff --git a/vendor/illuminate/database/SQLiteConnection.php b/vendor/illuminate/database/SQLiteConnection.php index 3811687..59b5edb 100755 --- a/vendor/illuminate/database/SQLiteConnection.php +++ b/vendor/illuminate/database/SQLiteConnection.php @@ -2,8 +2,6 @@ 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; @@ -98,11 +96,11 @@ class SQLiteConnection extends Connection /** * Get the Doctrine DBAL driver. * - * @return \Doctrine\DBAL\Driver\PDOSqlite\Driver|\Illuminate\Database\PDO\SQLiteDriver + * @return \Illuminate\Database\PDO\SQLiteDriver */ protected function getDoctrineDriver() { - return class_exists(Version::class) ? new DoctrineDriver : new SQLiteDriver; + return new SQLiteDriver; } /** diff --git a/vendor/illuminate/database/Schema/Blueprint.php b/vendor/illuminate/database/Schema/Blueprint.php index e2b968a..7d1f059 100755 --- a/vendor/illuminate/database/Schema/Blueprint.php +++ b/vendor/illuminate/database/Schema/Blueprint.php @@ -208,7 +208,7 @@ class Blueprint protected function addFluentIndexes() { foreach ($this->columns as $column) { - foreach (['primary', 'unique', 'index', 'spatialIndex'] as $index) { + foreach (['primary', 'unique', 'index', 'fulltext', 'fullText', 'spatialIndex'] as $index) { // If the index has been specified on the given column, but is simply equal // to "true" (boolean), no name has been specified for this index so the // index method can be called without a name and it will generate one. @@ -367,6 +367,17 @@ class Blueprint return $this->dropIndexCommand('dropIndex', 'index', $index); } + /** + * Indicate that the given fulltext index should be dropped. + * + * @param string|array $index + * @return \Illuminate\Support\Fluent + */ + public function dropFullText($index) + { + return $this->dropIndexCommand('dropFullText', 'fulltext', $index); + } + /** * Indicate that the given spatial index should be dropped. * @@ -402,6 +413,38 @@ class Blueprint 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. * @@ -530,6 +573,19 @@ class Blueprint return $this->indexCommand('index', $columns, $name, $algorithm); } + /** + * Specify an fulltext for the table. + * + * @param string|array $columns + * @param string|null $name + * @param string|null $algorithm + * @return \Illuminate\Support\Fluent + */ + public function fullText($columns, $name = null, $algorithm = null) + { + return $this->indexCommand('fulltext', $columns, $name, $algorithm); + } + /** * Specify a spatial index for the table. * @@ -658,7 +714,7 @@ class Blueprint */ public function char($column, $length = null) { - $length = $length ?: Builder::$defaultStringLength; + $length = ! is_null($length) ? $length : Builder::$defaultStringLength; return $this->addColumn('char', $column, compact('length')); } @@ -1192,7 +1248,7 @@ class Blueprint * @param string $column * @return \Illuminate\Database\Schema\ColumnDefinition */ - public function uuid($column) + public function uuid($column = 'uuid') { return $this->addColumn('uuid', $column); } @@ -1217,7 +1273,7 @@ class Blueprint * @param string $column * @return \Illuminate\Database\Schema\ColumnDefinition */ - public function ipAddress($column) + public function ipAddress($column = 'ip_address') { return $this->addColumn('ipAddress', $column); } @@ -1228,7 +1284,7 @@ class Blueprint * @param string $column * @return \Illuminate\Database\Schema\ColumnDefinition */ - public function macAddress($column) + public function macAddress($column = 'mac_address') { return $this->addColumn('macAddress', $column); } diff --git a/vendor/illuminate/database/Schema/Builder.php b/vendor/illuminate/database/Schema/Builder.php index c919d17..dd4290a 100755 --- a/vendor/illuminate/database/Schema/Builder.php +++ b/vendor/illuminate/database/Schema/Builder.php @@ -3,11 +3,10 @@ namespace Illuminate\Database\Schema; use Closure; -use Doctrine\DBAL\Types\Type; +use Illuminate\Container\Container; use Illuminate\Database\Connection; use InvalidArgumentException; use LogicException; -use RuntimeException; class Builder { @@ -382,36 +381,7 @@ class Builder return call_user_func($this->resolver, $table, $callback, $prefix); } - return new Blueprint($table, $callback, $prefix); - } - - /** - * Register a custom Doctrine mapping type. - * - * @param string $class - * @param string $name - * @param string $type - * @return void - * - * @throws \Doctrine\DBAL\DBALException - * @throws \RuntimeException - */ - public function registerCustomDoctrineType($class, $name, $type) - { - if (! $this->connection->isDoctrineAvailable()) { - throw new RuntimeException( - 'Registering a custom Doctrine type requires Doctrine DBAL (doctrine/dbal).' - ); - } - - if (! Type::hasType($name)) { - Type::addType($name, $class); - - $this->connection - ->getDoctrineSchemaManager() - ->getDatabasePlatform() - ->registerDoctrineTypeMapping($type, $name); - } + return Container::getInstance()->make(Blueprint::class, compact('table', 'callback', 'prefix')); } /** diff --git a/vendor/illuminate/database/Schema/ColumnDefinition.php b/vendor/illuminate/database/Schema/ColumnDefinition.php index e2fd9cc..85f8ba3 100644 --- a/vendor/illuminate/database/Schema/ColumnDefinition.php +++ b/vendor/illuminate/database/Schema/ColumnDefinition.php @@ -14,12 +14,15 @@ use Illuminate\Support\Fluent; * @method $this comment(string $comment) Add a comment to the column (MySQL/PostgreSQL) * @method $this default(mixed $value) Specify a "default" value for the column * @method $this first() Place the column "first" in the table (MySQL) + * @method $this from(int $startingValue) Set the starting value of an auto-incrementing field (MySQL / PostgreSQL) * @method $this generatedAs(string|Expression $expression = null) Create a SQL compliant identity column (PostgreSQL) * @method $this index(string $indexName = null) Add an index + * @method $this invisible() Specify that the column should be invisible to "SELECT *" (MySQL) * @method $this nullable(bool $value = true) Allow NULL values to be inserted into the column * @method $this persisted() Mark the computed generated column as persistent (SQL Server) * @method $this primary() Add a primary index - * @method $this spatialIndex() Add a spatial index + * @method $this fulltext(string $indexName = null) Add a fulltext index + * @method $this spatialIndex(string $indexName = null) Add a spatial index * @method $this startingValue(int $startingValue) Set the starting value of an auto-incrementing field (MySQL/PostgreSQL) * @method $this storedAs(string $expression) Create a stored generated column (MySQL/PostgreSQL/SQLite) * @method $this type(string $type) Specify a type for the column diff --git a/vendor/illuminate/database/Schema/ForeignKeyDefinition.php b/vendor/illuminate/database/Schema/ForeignKeyDefinition.php index 0354cc9..a03fcff 100644 --- a/vendor/illuminate/database/Schema/ForeignKeyDefinition.php +++ b/vendor/illuminate/database/Schema/ForeignKeyDefinition.php @@ -24,6 +24,16 @@ class ForeignKeyDefinition extends Fluent return $this->onUpdate('cascade'); } + /** + * Indicate that updates should be restricted. + * + * @return $this + */ + public function restrictOnUpdate() + { + return $this->onUpdate('restrict'); + } + /** * Indicate that deletes should cascade. * diff --git a/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php b/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php index 6167b21..70ec666 100644 --- a/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php +++ b/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php @@ -125,6 +125,10 @@ class ChangeColumn $options['length'] = static::calculateDoctrineTextLength($fluent['type']); } + if ($fluent['type'] === 'char') { + $options['fixed'] = true; + } + if (static::doesntNeedCharacterOptions($fluent['type'])) { $options['customSchemaOptions'] = [ 'collation' => '', @@ -145,26 +149,15 @@ class ChangeColumn { $type = strtolower($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); + return Type::getType(match ($type) { + 'biginteger' => 'bigint', + 'smallinteger' => 'smallint', + 'mediumtext', 'longtext' => 'text', + 'binary' => 'blob', + 'uuid' => 'guid', + 'char' => 'string', + default => $type, + }); } /** @@ -175,14 +168,11 @@ class ChangeColumn */ protected static function calculateDoctrineTextLength($type) { - switch ($type) { - case 'mediumText': - return 65535 + 1; - case 'longText': - return 16777215 + 1; - default: - return 255 + 1; - } + return match ($type) { + 'mediumText' => 65535 + 1, + 'longText' => 16777215 + 1, + default => 255 + 1, + }; } /** @@ -198,6 +188,7 @@ class ChangeColumn 'binary', 'boolean', 'date', + 'dateTime', 'decimal', 'double', 'float', @@ -218,19 +209,13 @@ class ChangeColumn */ protected static function mapFluentOptionToDoctrine($attribute) { - switch ($attribute) { - case 'type': - case 'name': - return; - case 'nullable': - return 'notnull'; - case 'total': - return 'precision'; - case 'places': - return 'scale'; - default: - return $attribute; - } + return match ($attribute) { + 'type', 'name' => null, + 'nullable' => 'notnull', + 'total' => 'precision', + 'places' => 'scale', + default => $attribute, + }; } /** diff --git a/vendor/illuminate/database/Schema/Grammars/Grammar.php b/vendor/illuminate/database/Schema/Grammars/Grammar.php index 2acaa76..ff2c455 100755 --- a/vendor/illuminate/database/Schema/Grammars/Grammar.php +++ b/vendor/illuminate/database/Schema/Grammars/Grammar.php @@ -83,6 +83,34 @@ abstract class Grammar extends BaseGrammar return ChangeColumn::compile($this, $blueprint, $command, $connection); } + /** + * Compile a fulltext index key command. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command + * @return string + * + * @throws \RuntimeException + */ + public function compileFulltext(Blueprint $blueprint, Fluent $command) + { + throw new RuntimeException('This database driver does not support fulltext index creation.'); + } + + /** + * Compile a drop fulltext index command. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command + * @return string + * + * @throws \RuntimeException + */ + public function compileDropFullText(Blueprint $blueprint, Fluent $command) + { + throw new RuntimeException('This database driver does not support fulltext index removal.'); + } + /** * Compile a foreign key command. * @@ -245,6 +273,37 @@ abstract class Grammar extends BaseGrammar ); } + /** + * 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/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php b/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php index b6e4e35..78f5a9c 100755 --- a/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php +++ b/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php @@ -15,7 +15,7 @@ class MySqlGrammar extends Grammar * @var string[] */ protected $modifiers = [ - 'Unsigned', 'Charset', 'Collate', 'VirtualAs', 'StoredAs', 'Nullable', + 'Unsigned', 'Charset', 'Collate', 'VirtualAs', 'StoredAs', 'Nullable', 'Invisible', 'Srid', 'Default', 'Increment', 'Comment', 'After', 'First', ]; @@ -241,6 +241,18 @@ class MySqlGrammar extends Grammar return $this->compileKey($blueprint, $command, 'index'); } + /** + * Compile a fulltext index key command. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command + * @return string + */ + public function compileFullText(Blueprint $blueprint, Fluent $command) + { + return $this->compileKey($blueprint, $command, 'fulltext'); + } + /** * Compile a spatial index key command. * @@ -350,6 +362,18 @@ class MySqlGrammar extends Grammar return "alter table {$this->wrapTable($blueprint)} drop index {$index}"; } + /** + * Compile a drop fulltext index command. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command + * @return string + */ + public function compileDropFullText(Blueprint $blueprint, Fluent $command) + { + return $this->compileDropIndex($blueprint, $command); + } + /** * Compile a drop spatial index command. * @@ -935,8 +959,16 @@ class MySqlGrammar extends Grammar */ protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) { - if (! is_null($column->virtualAs)) { - return " as ({$column->virtualAs})"; + 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})"; } } @@ -949,8 +981,16 @@ class MySqlGrammar extends Grammar */ protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) { - if (! is_null($column->storedAs)) { - return " as ({$column->storedAs}) stored"; + 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"; } } @@ -1005,7 +1045,10 @@ class MySqlGrammar extends Grammar */ protected function modifyNullable(Blueprint $blueprint, Fluent $column) { - if (is_null($column->virtualAs) && is_null($column->storedAs)) { + if (is_null($column->virtualAs) && + is_null($column->virtualAsJson) && + is_null($column->storedAs) && + is_null($column->storedAsJson)) { return $column->nullable ? ' null' : ' not null'; } @@ -1014,6 +1057,20 @@ class MySqlGrammar extends Grammar } } + /** + * Get the SQL for an invisible column modifier. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column + * @return string|null + */ + protected function modifyInvisible(Blueprint $blueprint, Fluent $column) + { + if (! is_null($column->invisible)) { + return ' invisible'; + } + } + /** * Get the SQL for a default column modifier. * @@ -1093,7 +1150,7 @@ class MySqlGrammar extends Grammar */ protected function modifySrid(Blueprint $blueprint, Fluent $column) { - if (! is_null($column->srid) && is_int($column->srid) && $column->srid > 0) { + if (is_int($column->srid) && $column->srid > 0) { return ' srid '.$column->srid; } } @@ -1112,4 +1169,17 @@ class MySqlGrammar extends Grammar 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/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php b/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php index 133da28..603eb24 100755 --- a/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php +++ b/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php @@ -72,7 +72,7 @@ class PostgresGrammar extends Grammar */ public function compileTableExists() { - return "select * from information_schema.tables where table_schema = ? and table_name = ? and table_type = 'BASE TABLE'"; + return "select * from information_schema.tables where table_catalog = ? and table_schema = ? and table_name = ? and table_type = 'BASE TABLE'"; } /** @@ -82,7 +82,7 @@ class PostgresGrammar extends Grammar */ public function compileColumnListing() { - return 'select column_name from information_schema.columns where table_schema = ? and table_name = ?'; + return 'select column_name from information_schema.columns where table_catalog = ? and table_schema = ? and table_name = ?'; } /** @@ -176,6 +176,30 @@ class PostgresGrammar extends Grammar ); } + /** + * Compile a fulltext index key command. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command + * @return string + * + * @throws \RuntimeException + */ + public function compileFulltext(Blueprint $blueprint, Fluent $command) + { + $language = $command->language ?: 'english'; + + $columns = array_map(function ($column) use ($language) { + return "to_tsvector({$this->quoteString($language)}, {$this->wrap($column)})"; + }, $command->columns); + + return sprintf('create index %s on %s using gin ((%s))', + $this->wrap($command->index), + $this->wrapTable($blueprint), + implode(' || ', $columns) + ); + } + /** * Compile a spatial index key command. * @@ -276,23 +300,23 @@ class PostgresGrammar extends Grammar /** * Compile the SQL needed to retrieve all table names. * - * @param string|array $schema + * @param string|array $searchPath * @return string */ - public function compileGetAllTables($schema) + public function compileGetAllTables($searchPath) { - return "select tablename from pg_catalog.pg_tables where schemaname in ('".implode("','", (array) $schema)."')"; + return "select tablename from pg_catalog.pg_tables where schemaname in ('".implode("','", (array) $searchPath)."')"; } /** * Compile the SQL needed to retrieve all view names. * - * @param string|array $schema + * @param string|array $searchPath * @return string */ - public function compileGetAllViews($schema) + public function compileGetAllViews($searchPath) { - return "select viewname from pg_catalog.pg_views where schemaname in ('".implode("','", (array) $schema)."')"; + return "select viewname from pg_catalog.pg_views where schemaname in ('".implode("','", (array) $searchPath)."')"; } /** @@ -359,6 +383,18 @@ class PostgresGrammar extends Grammar return "drop index {$this->wrap($command->index)}"; } + /** + * Compile a drop fulltext index command. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command + * @return string + */ + public function compileDropFullText(Blueprint $blueprint, Fluent $command) + { + return $this->compileDropIndex($blueprint, $command); + } + /** * Compile a drop spatial index command. * diff --git a/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php b/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php index b7e406f..4abdf65 100755 --- a/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php +++ b/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php @@ -638,6 +638,7 @@ class SQLiteGrammar extends Grammar * Create the column definition for a date-time (with time zone) type. * * Note: "SQLite does not have a storage class set aside for storing dates and/or times." + * * @link https://www.sqlite.org/datatype3.html * * @param \Illuminate\Support\Fluent $column @@ -857,8 +858,16 @@ class SQLiteGrammar extends Grammar */ protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) { - if (! is_null($column->virtualAs)) { - return " as ({$column->virtualAs})"; + 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})"; } } @@ -871,7 +880,15 @@ class SQLiteGrammar extends Grammar */ protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) { - if (! is_null($column->storedAs)) { + 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 ({$column->storedAs}) stored"; } } @@ -885,7 +902,10 @@ class SQLiteGrammar extends Grammar */ protected function modifyNullable(Blueprint $blueprint, Fluent $column) { - if (is_null($column->virtualAs) && is_null($column->storedAs)) { + if (is_null($column->virtualAs) && + is_null($column->virtualAsJson) && + is_null($column->storedAs) && + is_null($column->storedAsJson)) { return $column->nullable ? '' : ' not null'; } @@ -903,7 +923,7 @@ class SQLiteGrammar extends Grammar */ protected function modifyDefault(Blueprint $blueprint, Fluent $column) { - if (! is_null($column->default) && is_null($column->virtualAs) && is_null($column->storedAs)) { + if (! is_null($column->default) && is_null($column->virtualAs) && is_null($column->virtualAsJson) && is_null($column->storedAs)) { return ' default '.$this->getDefaultValue($column->default); } } @@ -921,4 +941,17 @@ class SQLiteGrammar extends Grammar 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/vendor/illuminate/database/Schema/Grammars/SqlServerGrammar.php b/vendor/illuminate/database/Schema/Grammars/SqlServerGrammar.php index caec020..e594cfd 100755 --- a/vendor/illuminate/database/Schema/Grammars/SqlServerGrammar.php +++ b/vendor/illuminate/database/Schema/Grammars/SqlServerGrammar.php @@ -239,7 +239,7 @@ class SqlServerGrammar extends Grammar $sql = "DECLARE @sql NVARCHAR(MAX) = '';"; $sql .= "SELECT @sql += 'ALTER TABLE [dbo].[{$tableName}] DROP CONSTRAINT ' + OBJECT_NAME([default_object_id]) + ';' "; - $sql .= 'FROM SYS.COLUMNS '; + $sql .= 'FROM sys.columns '; $sql .= "WHERE [object_id] = OBJECT_ID('[dbo].[{$tableName}]') AND [name] in ({$columns}) AND [default_object_id] <> 0;"; $sql .= 'EXEC(@sql)'; diff --git a/vendor/illuminate/database/Schema/MySqlSchemaState.php b/vendor/illuminate/database/Schema/MySqlSchemaState.php index e772fb6..d28ab10 100644 --- a/vendor/illuminate/database/Schema/MySqlSchemaState.php +++ b/vendor/illuminate/database/Schema/MySqlSchemaState.php @@ -85,7 +85,7 @@ class MySqlSchemaState extends SchemaState */ protected function baseDumpCommand() { - $command = 'mysqldump '.$this->connectionString().' --skip-add-locks --skip-comments --skip-set-charset --tz-utc'; + $command = 'mysqldump '.$this->connectionString().' --no-tablespaces --skip-add-locks --skip-comments --skip-set-charset --tz-utc'; if (! $this->connection->isMaria()) { $command .= ' --column-statistics=0 --set-gtid-purged=OFF'; @@ -103,10 +103,16 @@ class MySqlSchemaState extends SchemaState { $value = ' --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}"'; - $value .= $this->connection->getConfig()['unix_socket'] ?? false + $config = $this->connection->getConfig(); + + $value .= $config['unix_socket'] ?? false ? ' --socket="${:LARAVEL_LOAD_SOCKET}"' : ' --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}"'; + if (isset($config['options'][\PDO::MYSQL_ATTR_SSL_CA])) { + $value .= ' --ssl-ca="${:LARAVEL_LOAD_SSL_CA}"'; + } + return $value; } @@ -118,7 +124,7 @@ class MySqlSchemaState extends SchemaState */ protected function baseVariables(array $config) { - $config['host'] = $config['host'] ?? ''; + $config['host'] ??= ''; return [ 'LARAVEL_LOAD_SOCKET' => $config['unix_socket'] ?? '', @@ -127,6 +133,7 @@ class MySqlSchemaState extends SchemaState 'LARAVEL_LOAD_USER' => $config['username'], 'LARAVEL_LOAD_PASSWORD' => $config['password'] ?? '', 'LARAVEL_LOAD_DATABASE' => $config['database'], + 'LARAVEL_LOAD_SSL_CA' => $config['options'][\PDO::MYSQL_ATTR_SSL_CA] ?? '', ]; } @@ -149,7 +156,7 @@ class MySqlSchemaState extends SchemaState ), $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/vendor/illuminate/database/Schema/PostgresBuilder.php b/vendor/illuminate/database/Schema/PostgresBuilder.php index ce1b577..f0f8662 100755 --- a/vendor/illuminate/database/Schema/PostgresBuilder.php +++ b/vendor/illuminate/database/Schema/PostgresBuilder.php @@ -2,8 +2,14 @@ namespace Illuminate\Database\Schema; +use Illuminate\Database\Concerns\ParsesSearchPath; + class PostgresBuilder extends Builder { + use ParsesSearchPath { + parseSearchPath as baseParseSearchPath; + } + /** * Create a database in the schema. * @@ -38,12 +44,12 @@ class PostgresBuilder extends Builder */ public function hasTable($table) { - [$schema, $table] = $this->parseSchemaAndTable($table); + [$database, $schema, $table] = $this->parseSchemaAndTable($table); $table = $this->connection->getTablePrefix().$table; return count($this->connection->select( - $this->grammar->compileTableExists(), [$schema, $table] + $this->grammar->compileTableExists(), [$database, $schema, $table] )) > 0; } @@ -133,7 +139,11 @@ class PostgresBuilder extends Builder public function getAllTables() { return $this->connection->select( - $this->grammar->compileGetAllTables((array) $this->connection->getConfig('schema')) + $this->grammar->compileGetAllTables( + $this->parseSearchPath( + $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema') + ) + ) ); } @@ -145,7 +155,11 @@ class PostgresBuilder extends Builder public function getAllViews() { return $this->connection->select( - $this->grammar->compileGetAllViews((array) $this->connection->getConfig('schema')) + $this->grammar->compileGetAllViews( + $this->parseSearchPath( + $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema') + ) + ) ); } @@ -169,35 +183,70 @@ class PostgresBuilder extends Builder */ public function getColumnListing($table) { - [$schema, $table] = $this->parseSchemaAndTable($table); + [$database, $schema, $table] = $this->parseSchemaAndTable($table); $table = $this->connection->getTablePrefix().$table; $results = $this->connection->select( - $this->grammar->compileColumnListing(), [$schema, $table] + $this->grammar->compileColumnListing(), [$database, $schema, $table] ); return $this->connection->getPostProcessor()->processColumnListing($results); } /** - * Parse the table name and extract the schema and table. + * Parse the database object reference and extract the database, schema, and table. * - * @param string $table + * @param string $reference * @return array */ - protected function parseSchemaAndTable($table) + protected function parseSchemaAndTable($reference) { - $table = explode('.', $table); + $searchPath = $this->parseSearchPath( + $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema') ?: 'public' + ); - if (is_array($schema = $this->connection->getConfig('schema'))) { - if (in_array($table[0], $schema)) { - return [array_shift($table), implode('.', $table)]; - } + $parts = explode('.', $reference); - $schema = head($schema); + $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); } - return [$schema ?: 'public', implode('.', $table)]; + // 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]; + + if (count($parts) === 2) { + $schema = $parts[0]; + array_shift($parts); + } + + return [$database, $schema, $parts[0]]; + } + + /** + * Parse the "search_path" configuration value into an array. + * + * @param string|array|null $searchPath + * @return array + */ + protected function parseSearchPath($searchPath) + { + $searchPath = $this->baseParseSearchPath($searchPath); + + array_walk($searchPath, function (&$schema) { + $schema = $schema === '$user' + ? $this->connection->getConfig('username') + : $schema; + }); + + return $searchPath; } } diff --git a/vendor/illuminate/database/Schema/PostgresSchemaState.php b/vendor/illuminate/database/Schema/PostgresSchemaState.php index 3e2f566..b6d4273 100644 --- a/vendor/illuminate/database/Schema/PostgresSchemaState.php +++ b/vendor/illuminate/database/Schema/PostgresSchemaState.php @@ -3,7 +3,6 @@ namespace Illuminate\Database\Schema; use Illuminate\Database\Connection; -use Illuminate\Support\Str; class PostgresSchemaState extends SchemaState { @@ -41,7 +40,7 @@ class PostgresSchemaState extends SchemaState { $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::endsWith($path, '.sql')) { + if (str_ends_with($path, '.sql')) { $command = 'psql --file="${:LARAVEL_LOAD_PATH}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --username="${:LARAVEL_LOAD_USER}" --dbname="${:LARAVEL_LOAD_DATABASE}"'; } @@ -70,7 +69,7 @@ class PostgresSchemaState extends SchemaState */ protected function baseVariables(array $config) { - $config['host'] = $config['host'] ?? ''; + $config['host'] ??= ''; return [ 'LARAVEL_LOAD_HOST' => is_array($config['host']) ? $config['host'][0] : $config['host'], diff --git a/vendor/illuminate/database/Schema/SchemaState.php b/vendor/illuminate/database/Schema/SchemaState.php index 5629a7a..e6f35ab 100644 --- a/vendor/illuminate/database/Schema/SchemaState.php +++ b/vendor/illuminate/database/Schema/SchemaState.php @@ -58,7 +58,7 @@ abstract class SchemaState $this->files = $files ?: new Filesystem; $this->processFactory = $processFactory ?: function (...$arguments) { - return Process::fromShellCommandline(...$arguments); + return Process::fromShellCommandline(...$arguments)->setTimeout(null); }; $this->handleOutputUsing(function () { diff --git a/vendor/illuminate/database/Seeder.php b/vendor/illuminate/database/Seeder.php index 441fa27..1a7a12e 100755 --- a/vendor/illuminate/database/Seeder.php +++ b/vendor/illuminate/database/Seeder.php @@ -4,6 +4,7 @@ namespace Illuminate\Database; use Illuminate\Console\Command; use Illuminate\Container\Container; +use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Support\Arr; use InvalidArgumentException; @@ -23,6 +24,13 @@ abstract class Seeder */ protected $command; + /** + * Seeders that have been called at least one time. + * + * @var array + */ + protected static $called = []; + /** * Run the given seeder class. * @@ -53,6 +61,8 @@ abstract class Seeder if ($silent === false && isset($this->command)) { $this->command->getOutput()->writeln("Seeded: {$name} ({$runTime}ms)"); } + + static::$called[] = $class; } return $this; @@ -82,6 +92,22 @@ abstract class Seeder $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. * @@ -145,8 +171,16 @@ abstract class Seeder throw new InvalidArgumentException('Method [run] missing from '.get_class($this)); } - return isset($this->container) - ? $this->container->call([$this, 'run'], $parameters) - : $this->run(...$parameters); + $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(); } } diff --git a/vendor/illuminate/database/SqlServerConnection.php b/vendor/illuminate/database/SqlServerConnection.php index 87628b9..ab8983d 100755 --- a/vendor/illuminate/database/SqlServerConnection.php +++ b/vendor/illuminate/database/SqlServerConnection.php @@ -3,8 +3,6 @@ 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; @@ -116,10 +114,10 @@ class SqlServerConnection extends Connection /** * Get the Doctrine DBAL driver. * - * @return \Doctrine\DBAL\Driver\PDOSqlsrv\Driver|\Illuminate\Database\PDO\SqlServerDriver + * @return \Illuminate\Database\PDO\SqlServerDriver */ protected function getDoctrineDriver() { - return class_exists(Version::class) ? new DoctrineDriver : new SqlServerDriver; + return new SqlServerDriver; } } diff --git a/vendor/illuminate/database/composer.json b/vendor/illuminate/database/composer.json index 0a7cda0..df3d06c 100644 --- a/vendor/illuminate/database/composer.json +++ b/vendor/illuminate/database/composer.json @@ -15,14 +15,14 @@ } ], "require": { - "php": "^7.3|^8.0", + "php": "^8.0.2", "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "symfony/console": "^5.1.4" + "illuminate/collections": "^9.0", + "illuminate/container": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0", + "symfony/console": "^6.0" }, "autoload": { "psr-4": { @@ -31,17 +31,17 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", + "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 (^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.1.4)." + "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)." }, "config": { "sort-packages": true diff --git a/vendor/illuminate/macroable/Traits/Macroable.php b/vendor/illuminate/macroable/Traits/Macroable.php index 406f65e..2269142 100644 --- a/vendor/illuminate/macroable/Traits/Macroable.php +++ b/vendor/illuminate/macroable/Traits/Macroable.php @@ -62,6 +62,16 @@ trait Macroable return isset(static::$macros[$name]); } + /** + * Flush the existing macros. + * + * @return void + */ + public static function flushMacros() + { + static::$macros = []; + } + /** * Dynamically handle calls to the class. * diff --git a/vendor/illuminate/macroable/composer.json b/vendor/illuminate/macroable/composer.json index dfa5c62..0417dbe 100644 --- a/vendor/illuminate/macroable/composer.json +++ b/vendor/illuminate/macroable/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.3|^8.0" + "php": "^8.0.2" }, "autoload": { "psr-4": { @@ -23,7 +23,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "config": { diff --git a/vendor/illuminate/support/DateFactory.php b/vendor/illuminate/support/DateFactory.php index e1d0ca1..f36cb46 100644 --- a/vendor/illuminate/support/DateFactory.php +++ b/vendor/illuminate/support/DateFactory.php @@ -64,7 +64,7 @@ use InvalidArgumentException; * @method static Carbon setHumanDiffOptions($humanDiffOptions) * @method static bool setLocale($locale) * @method static void setMidDayAt($hour) - * @method static Carbon setTestNow($testNow = null) + * @method static void setTestNow($testNow = null) * @method static void setToStringFormat($format) * @method static void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) * @method static Carbon setUtf8($utf8) diff --git a/vendor/illuminate/support/Facades/App.php b/vendor/illuminate/support/Facades/App.php index d0004db..8fbec3d 100755 --- a/vendor/illuminate/support/Facades/App.php +++ b/vendor/illuminate/support/Facades/App.php @@ -8,9 +8,12 @@ namespace Illuminate\Support\Facades; * @method static \Illuminate\Support\ServiceProvider resolveProvider(string $provider) * @method static array getProviders(\Illuminate\Support\ServiceProvider|string $provider) * @method static mixed make($abstract, array $parameters = []) + * @method static mixed makeWith($abstract, array $parameters = []) * @method static bool configurationIsCached() * @method static bool hasBeenBootstrapped() * @method static bool isDownForMaintenance() + * @method static bool isLocal() + * @method static bool isProduction() * @method static bool routesAreCached() * @method static bool runningInConsole() * @method static bool runningUnitTests() @@ -34,7 +37,7 @@ namespace Illuminate\Support\Facades; * @method static string storagePath(string $path = '') * @method static string version() * @method static string|bool environment(string|array ...$environments) - * @method static void abort(int $code, string $message = '', array $headers = []) + * @method static never abort(int $code, string $message = '', array $headers = []) * @method static void boot() * @method static void booted(callable $callback) * @method static void booting(callable $callback) diff --git a/vendor/illuminate/support/Facades/Auth.php b/vendor/illuminate/support/Facades/Auth.php index 67aa9b0..3a2715c 100755 --- a/vendor/illuminate/support/Facades/Auth.php +++ b/vendor/illuminate/support/Facades/Auth.php @@ -14,6 +14,7 @@ use RuntimeException; * @method static \Illuminate\Contracts\Auth\UserProvider|null createUserProvider(string $provider = null) * @method static \Symfony\Component\HttpFoundation\Response|null onceBasic(string $field = 'email',array $extraConditions = []) * @method static bool attempt(array $credentials = [], bool $remember = false) + * @method static bool hasUser() * @method static bool check() * @method static bool guest() * @method static bool once(array $credentials = []) diff --git a/vendor/illuminate/support/Facades/Blade.php b/vendor/illuminate/support/Facades/Blade.php index 8c7df0c..81019e2 100755 --- a/vendor/illuminate/support/Facades/Blade.php +++ b/vendor/illuminate/support/Facades/Blade.php @@ -8,6 +8,8 @@ namespace Illuminate\Support\Facades; * @method static array getExtensions() * @method static bool check(string $name, array ...$parameters) * @method static string compileString(string $value) + * @method static string render(string $string, array $data = [], bool $deleteCachedView = false) + * @method static string renderComponent(\Illuminate\View\Component $component) * @method static string getPath() * @method static string stripParentheses(string $expression) * @method static void aliasComponent(string $path, string|null $alias = null) diff --git a/vendor/illuminate/support/Facades/Bus.php b/vendor/illuminate/support/Facades/Bus.php index 4be212e..f0c22cb 100644 --- a/vendor/illuminate/support/Facades/Bus.php +++ b/vendor/illuminate/support/Facades/Bus.php @@ -24,6 +24,12 @@ use Illuminate\Support\Testing\Fakes\BusFake; * @method static void assertDispatchedAfterResponseTimes(string $command, int $times = 1) * @method static void assertNotDispatchedAfterResponse(string|\Closure $command, callable $callback = null) * @method static void assertBatched(callable $callback) + * @method static void assertBatchCount(int $count) + * @method static void assertChained(array $expectedChain) + * @method static void assertDispatchedSync(string|\Closure $command, callable $callback = null) + * @method static void assertDispatchedSyncTimes(string $command, int $times = 1) + * @method static void assertNotDispatchedSync(string|\Closure $command, callable $callback = null) + * @method static void assertDispatchedWithoutChain(string|\Closure $command, callable $callback = null) * * @see \Illuminate\Contracts\Bus\Dispatcher */ diff --git a/vendor/illuminate/support/Facades/Cache.php b/vendor/illuminate/support/Facades/Cache.php index 70aa1dc..18fb9c4 100755 --- a/vendor/illuminate/support/Facades/Cache.php +++ b/vendor/illuminate/support/Facades/Cache.php @@ -14,10 +14,10 @@ namespace Illuminate\Support\Facades; * @method static bool forget(string $key) * @method static bool has(string $key) * @method static bool missing(string $key) - * @method static bool put(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null) + * @method static bool put(array|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(string $key, mixed $default = null) + * @method static mixed get(array|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/vendor/illuminate/support/Facades/DB.php b/vendor/illuminate/support/Facades/DB.php index 997f790..08ca4a9 100755 --- a/vendor/illuminate/support/Facades/DB.php +++ b/vendor/illuminate/support/Facades/DB.php @@ -28,6 +28,8 @@ namespace Illuminate\Support\Facades; * @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) * @method static void setDefaultConnection(string $name) diff --git a/vendor/illuminate/support/Facades/Date.php b/vendor/illuminate/support/Facades/Date.php index 68d99a4..2f2a39e 100644 --- a/vendor/illuminate/support/Facades/Date.php +++ b/vendor/illuminate/support/Facades/Date.php @@ -16,23 +16,23 @@ use Illuminate\Support\DateFactory; * @method static \Illuminate\Support\Carbon createFromTimestampMs($timestamp, $tz = null) * @method static \Illuminate\Support\Carbon createFromTimestampUTC($timestamp) * @method static \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) - * @method static \Illuminate\Support\Carbon disableHumanDiffOption($humanDiffOption) - * @method static \Illuminate\Support\Carbon enableHumanDiffOption($humanDiffOption) + * @method static void disableHumanDiffOption($humanDiffOption) + * @method static void enableHumanDiffOption($humanDiffOption) * @method static \Illuminate\Support\Carbon fromSerialized($value) - * @method static \Illuminate\Support\Carbon getLastErrors() - * @method static \Illuminate\Support\Carbon getTestNow() + * @method static array getLastErrors() + * @method static \Illuminate\Support\Carbon|null getTestNow() * @method static \Illuminate\Support\Carbon instance($date) - * @method static \Illuminate\Support\Carbon isMutable() + * @method static bool isMutable() * @method static \Illuminate\Support\Carbon maxValue() * @method static \Illuminate\Support\Carbon minValue() * @method static \Illuminate\Support\Carbon now($tz = null) * @method static \Illuminate\Support\Carbon parse($time = null, $tz = null) - * @method static \Illuminate\Support\Carbon setHumanDiffOptions($humanDiffOptions) - * @method static \Illuminate\Support\Carbon setTestNow($testNow = null) - * @method static \Illuminate\Support\Carbon setUtf8($utf8) + * @method static void setHumanDiffOptions($humanDiffOptions) + * @method static void setTestNow($testNow = null) + * @method static void setUtf8($utf8) * @method static \Illuminate\Support\Carbon today($tz = null) * @method static \Illuminate\Support\Carbon tomorrow($tz = null) - * @method static \Illuminate\Support\Carbon useStrictMode($strictModeEnabled = true) + * @method static void useStrictMode($strictModeEnabled = true) * @method static \Illuminate\Support\Carbon yesterday($tz = null) * @method static \Illuminate\Support\Carbon|false createFromFormat($format, $time, $tz = null) * @method static \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) diff --git a/vendor/illuminate/support/Facades/Event.php b/vendor/illuminate/support/Facades/Event.php index b8b9c2f..02f26f9 100755 --- a/vendor/illuminate/support/Facades/Event.php +++ b/vendor/illuminate/support/Facades/Event.php @@ -16,7 +16,8 @@ use Illuminate\Support\Testing\Fakes\EventFake; * @method static void assertDispatched(string|\Closure $event, callable|int $callback = null) * @method static void assertDispatchedTimes(string $event, int $times = 1) * @method static void assertNotDispatched(string|\Closure $event, callable|int $callback = null) - * @method static void assertListening(string $expectedEvent, string expectedListener) + * @method static void assertNothingDispatched() + * @method static void assertListening(string $expectedEvent, string $expectedListener) * @method static void flush(string $event) * @method static void forget(string $event) * @method static void forgetPushed() @@ -44,12 +45,27 @@ class Event extends Facade return $fake; } + /** + * Replace the bound instance with a fake that fakes all events except the given events. + * + * @param string[]|string $eventsToAllow + * @return \Illuminate\Support\Testing\Fakes\EventFake + */ + public static function fakeExcept($eventsToAllow) + { + return static::fake([ + function ($eventName) use ($eventsToAllow) { + return ! in_array($eventName, (array) $eventsToAllow); + }, + ]); + } + /** * Replace the bound instance with a fake during the given callable's execution. * * @param callable $callable * @param array $eventsToFake - * @return callable + * @return mixed */ public static function fakeFor(callable $callable, array $eventsToFake = []) { @@ -65,6 +81,27 @@ class Event extends Facade }); } + /** + * Replace the bound instance with a fake during the given callable's execution. + * + * @param callable $callable + * @param array $eventsToAllow + * @return mixed + */ + public static function fakeExceptFor(callable $callable, array $eventsToAllow = []) + { + $originalDispatcher = static::getFacadeRoot(); + + static::fakeExcept($eventsToAllow); + + return tap($callable(), function () use ($originalDispatcher) { + static::swap($originalDispatcher); + + Model::setEventDispatcher($originalDispatcher); + Cache::refreshEventDispatcher(); + }); + } + /** * Get the registered name of the component. * diff --git a/vendor/illuminate/support/Facades/Facade.php b/vendor/illuminate/support/Facades/Facade.php index befe902..d17e16c 100755 --- a/vendor/illuminate/support/Facades/Facade.php +++ b/vendor/illuminate/support/Facades/Facade.php @@ -3,6 +3,10 @@ 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; @@ -23,6 +27,13 @@ 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. * @@ -84,12 +95,28 @@ abstract class Facade $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. * @@ -181,21 +208,21 @@ abstract class Facade /** * Resolve the facade root instance from the container. * - * @param object|string $name + * @param 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) { - return static::$resolvedInstance[$name] = static::$app[$name]; + if (static::$cached) { + return static::$resolvedInstance[$name] = static::$app[$name]; + } + + return static::$app[$name]; } } @@ -220,6 +247,55 @@ abstract class Facade 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/vendor/illuminate/support/Facades/Gate.php b/vendor/illuminate/support/Facades/Gate.php index 21355f2..49d8b66 100644 --- a/vendor/illuminate/support/Facades/Gate.php +++ b/vendor/illuminate/support/Facades/Gate.php @@ -8,6 +8,8 @@ use Illuminate\Contracts\Auth\Access\Gate as GateContract; * @method static \Illuminate\Auth\Access\Gate guessPolicyNamesUsing(callable $callback) * @method static \Illuminate\Auth\Access\Response authorize(string $ability, array|mixed $arguments = []) * @method static \Illuminate\Auth\Access\Response inspect(string $ability, array|mixed $arguments = []) + * @method static \Illuminate\Auth\Access\Response allowIf(\Closure|bool $condition, string|null $message = null, mixed $code = null) + * @method static \Illuminate\Auth\Access\Response denyIf(\Closure|bool $condition, string|null $message = null, mixed $code = null) * @method static \Illuminate\Contracts\Auth\Access\Gate after(callable $callback) * @method static \Illuminate\Contracts\Auth\Access\Gate before(callable $callback) * @method static \Illuminate\Contracts\Auth\Access\Gate define(string $ability, callable|string $callback) diff --git a/vendor/illuminate/support/Facades/Hash.php b/vendor/illuminate/support/Facades/Hash.php index 2c71090..b9855fd 100755 --- a/vendor/illuminate/support/Facades/Hash.php +++ b/vendor/illuminate/support/Facades/Hash.php @@ -7,6 +7,7 @@ namespace Illuminate\Support\Facades; * @method static bool check(string $value, string $hashedValue, array $options = []) * @method static bool needsRehash(string $hashedValue, array $options = []) * @method static string make(string $value, array $options = []) + * @method static \Illuminate\Hashing\HashManager extend($driver, \Closure $callback) * * @see \Illuminate\Hashing\HashManager */ diff --git a/vendor/illuminate/support/Facades/Http.php b/vendor/illuminate/support/Facades/Http.php index d6f2f66..72f8769 100644 --- a/vendor/illuminate/support/Facades/Http.php +++ b/vendor/illuminate/support/Facades/Http.php @@ -6,7 +6,6 @@ use Illuminate\Http\Client\Factory; /** * @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() @@ -20,7 +19,7 @@ use Illuminate\Http\Client\Factory; * @method static \Illuminate\Http\Client\PendingRequest contentType(string $contentType) * @method static \Illuminate\Http\Client\PendingRequest dd() * @method static \Illuminate\Http\Client\PendingRequest dump() - * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0, ?callable $when = null) + * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0, ?callable $when = null, bool $throw = true) * @method static \Illuminate\Http\Client\PendingRequest sink(string|resource $to) * @method static \Illuminate\Http\Client\PendingRequest stub(callable $callback) * @method static \Illuminate\Http\Client\PendingRequest timeout(int $seconds) @@ -43,7 +42,6 @@ use Illuminate\Http\Client\Factory; * @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) @@ -64,4 +62,46 @@ class Http extends Facade { 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/vendor/illuminate/support/Facades/Log.php b/vendor/illuminate/support/Facades/Log.php index c7b715a..68493fd 100755 --- a/vendor/illuminate/support/Facades/Log.php +++ b/vendor/illuminate/support/Facades/Log.php @@ -5,6 +5,7 @@ namespace Illuminate\Support\Facades; /** * @method static \Psr\Log\LoggerInterface channel(string $channel = null) * @method static \Psr\Log\LoggerInterface stack(array $channels, string $channel = null) + * @method static \Psr\Log\LoggerInterface build(array $config) * @method static \Illuminate\Log\Logger withContext(array $context = []) * @method static \Illuminate\Log\Logger withoutContext() * @method static void alert(string $message, array $context = []) diff --git a/vendor/illuminate/support/Facades/Mail.php b/vendor/illuminate/support/Facades/Mail.php index 36796e7..0097834 100755 --- a/vendor/illuminate/support/Facades/Mail.php +++ b/vendor/illuminate/support/Facades/Mail.php @@ -6,10 +6,18 @@ use Illuminate\Support\Testing\Fakes\MailFake; /** * @method static \Illuminate\Mail\Mailer mailer(string|null $name = null) + * @method static void alwaysFrom(string $address, string|null $name = null) + * @method static void alwaysReplyTo(string $address, string|null $name = null) + * @method static void alwaysReturnPath(string $address) + * @method static void alwaysTo(string $address, string|null $name = null) * @method static \Illuminate\Mail\PendingMail bcc($users) * @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) @@ -23,10 +31,6 @@ use Illuminate\Support\Testing\Fakes\MailFake; * @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/vendor/illuminate/support/Facades/Notification.php b/vendor/illuminate/support/Facades/Notification.php index 8ab683e..68f7201 100644 --- a/vendor/illuminate/support/Facades/Notification.php +++ b/vendor/illuminate/support/Facades/Notification.php @@ -13,7 +13,10 @@ use Illuminate\Support\Testing\Fakes\NotificationFake; * @method static mixed channel(string|null $name = null) * @method static void assertNotSentTo(mixed $notifiable, string|\Closure $notification, callable $callback = null) * @method static void assertNothingSent() + * @method static void assertNothingSentTo(mixed $notifiable) + * @method static void assertSentOnDemand(string|\Closure $notification, callable $callback = null) * @method static void assertSentTo(mixed $notifiable, string|\Closure $notification, callable $callback = null) + * @method static void assertSentOnDemandTimes(string $notification, int $times = 1) * @method static void assertSentToTimes(mixed $notifiable, string $notification, int $times = 1) * @method static void assertTimesSent(int $expectedCount, string $notification) * @method static void send(\Illuminate\Support\Collection|array|mixed $notifiables, $notification) diff --git a/vendor/illuminate/support/Facades/Queue.php b/vendor/illuminate/support/Facades/Queue.php index 1947f88..5af1329 100755 --- a/vendor/illuminate/support/Facades/Queue.php +++ b/vendor/illuminate/support/Facades/Queue.php @@ -19,7 +19,7 @@ use Illuminate\Support\Testing\Fakes\QueueFake; * @method static void assertNotPushed(string|\Closure $job, callable $callback = null) * @method static void assertNothingPushed() * @method static void assertPushed(string|\Closure $job, callable|int $callback = null) - * @method static void assertPushedOn(string $queue, string|\Closure $job, callable|int $callback = null) + * @method static void assertPushedOn(string $queue, string|\Closure $job, callable $callback = null) * @method static void assertPushedWithChain(string $job, array $expectedChain = [], callable $callback = null) * * @see \Illuminate\Queue\QueueManager diff --git a/vendor/illuminate/support/Facades/RateLimiter.php b/vendor/illuminate/support/Facades/RateLimiter.php index 5cfd784..3c33eb2 100644 --- a/vendor/illuminate/support/Facades/RateLimiter.php +++ b/vendor/illuminate/support/Facades/RateLimiter.php @@ -25,6 +25,6 @@ class RateLimiter extends Facade */ protected static function getFacadeAccessor() { - return 'Illuminate\Cache\RateLimiter'; + return \Illuminate\Cache\RateLimiter::class; } } diff --git a/vendor/illuminate/support/Facades/Redirect.php b/vendor/illuminate/support/Facades/Redirect.php index 19310ec..c8569b3 100755 --- a/vendor/illuminate/support/Facades/Redirect.php +++ b/vendor/illuminate/support/Facades/Redirect.php @@ -3,17 +3,17 @@ namespace Illuminate\Support\Facades; /** - * @method static \Illuminate\Http\RedirectResponse action(string $action, array $parameters = [], int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse action(string $action, mixed $parameters = [], int $status = 302, array $headers = []) * @method static \Illuminate\Http\RedirectResponse away(string $path, int $status = 302, array $headers = []) * @method static \Illuminate\Http\RedirectResponse back(int $status = 302, array $headers = [], $fallback = false) * @method static \Illuminate\Http\RedirectResponse guest(string $path, int $status = 302, array $headers = [], bool $secure = null) * @method static \Illuminate\Http\RedirectResponse home(int $status = 302) * @method static \Illuminate\Http\RedirectResponse intended(string $default = '/', int $status = 302, array $headers = [], bool $secure = null) * @method static \Illuminate\Http\RedirectResponse refresh(int $status = 302, array $headers = []) - * @method static \Illuminate\Http\RedirectResponse route(string $route, array $parameters = [], int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse route(string $route, mixed $parameters = [], int $status = 302, array $headers = []) * @method static \Illuminate\Http\RedirectResponse secure(string $path, int $status = 302, array $headers = []) - * @method static \Illuminate\Http\RedirectResponse signedRoute(string $name, array $parameters = [], \DateTimeInterface|\DateInterval|int $expiration = null, int $status = 302, array $headers = []) - * @method static \Illuminate\Http\RedirectResponse temporarySignedRoute(string $name, \DateTimeInterface|\DateInterval|int $expiration, array $parameters = [], int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse signedRoute(string $name, mixed $parameters = [], \DateTimeInterface|\DateInterval|int $expiration = null, int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse temporarySignedRoute(string $name, \DateTimeInterface|\DateInterval|int $expiration, mixed $parameters = [], int $status = 302, array $headers = []) * @method static \Illuminate\Http\RedirectResponse to(string $path, int $status = 302, array $headers = [], bool $secure = null) * @method static \Illuminate\Routing\UrlGenerator getUrlGenerator() * @method static void setSession(\Illuminate\Session\Store $session) diff --git a/vendor/illuminate/support/Facades/Response.php b/vendor/illuminate/support/Facades/Response.php index da1b9ce..6f31960 100755 --- a/vendor/illuminate/support/Facades/Response.php +++ b/vendor/illuminate/support/Facades/Response.php @@ -12,7 +12,7 @@ use Illuminate\Contracts\Routing\ResponseFactory as ResponseFactoryContract; * @method static \Illuminate\Http\RedirectResponse redirectToAction(string $action, mixed $parameters = [], int $status = 302, array $headers = []) * @method static \Illuminate\Http\RedirectResponse redirectToIntended(string $default = '/', int $status = 302, array $headers = [], bool|null $secure = null) * @method static \Illuminate\Http\RedirectResponse redirectToRoute(string $route, mixed $parameters = [], int $status = 302, array $headers = []) - * @method static \Illuminate\Http\Response make(string $content = '', int $status = 200, array $headers = []) + * @method static \Illuminate\Http\Response make(array|string $content = '', int $status = 200, array $headers = []) * @method static \Illuminate\Http\Response noContent($status = 204, array $headers = []) * @method static \Illuminate\Http\Response view(string $view, array $data = [], int $status = 200, array $headers = []) * @method static \Symfony\Component\HttpFoundation\BinaryFileResponse download(\SplFileInfo|string $file, string|null $name = null, array $headers = [], string|null $disposition = 'attachment') diff --git a/vendor/illuminate/support/Facades/Route.php b/vendor/illuminate/support/Facades/Route.php index 458f23c..bc956c1 100755 --- a/vendor/illuminate/support/Facades/Route.php +++ b/vendor/illuminate/support/Facades/Route.php @@ -22,11 +22,13 @@ namespace Illuminate\Support\Facades; * @method static \Illuminate\Routing\Route substituteBindings(\Illuminate\Support\Facades\Route $route) * @method static \Illuminate\Routing\Route view(string $uri, string $view, array $data = [], int|array $status = 200, array $headers = []) * @method static \Illuminate\Routing\RouteRegistrar as(string $value) + * @method static \Illuminate\Routing\RouteRegistrar controller(string $controller) * @method static \Illuminate\Routing\RouteRegistrar domain(string $value) * @method static \Illuminate\Routing\RouteRegistrar middleware(array|string|null $middleware) * @method static \Illuminate\Routing\RouteRegistrar name(string $value) * @method static \Illuminate\Routing\RouteRegistrar namespace(string|null $value) * @method static \Illuminate\Routing\RouteRegistrar prefix(string $prefix) + * @method static \Illuminate\Routing\RouteRegistrar scopeBindings() * @method static \Illuminate\Routing\RouteRegistrar where(array $where) * @method static \Illuminate\Routing\Router|\Illuminate\Routing\RouteRegistrar group(\Closure|string|array $attributes, \Closure|string $routes) * @method static \Illuminate\Routing\ResourceRegistrar resourceVerbs(array $verbs = []) diff --git a/vendor/illuminate/support/Facades/Schema.php b/vendor/illuminate/support/Facades/Schema.php index 896e176..2b0584d 100755 --- a/vendor/illuminate/support/Facades/Schema.php +++ b/vendor/illuminate/support/Facades/Schema.php @@ -17,13 +17,23 @@ namespace Illuminate\Support\Facades; * @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() + * @method static \Illuminate\Database\Connection getConnection() + * @method static \Illuminate\Database\Schema\Builder setConnection(\Illuminate\Database\Connection $connection) * * @see \Illuminate\Database\Schema\Builder */ 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. * @@ -36,12 +46,12 @@ class Schema extends Facade } /** - * Get a schema builder instance for the default connection. + * Get the registered name of the component. * - * @return \Illuminate\Database\Schema\Builder + * @return string */ protected static function getFacadeAccessor() { - return static::$app['db']->connection()->getSchemaBuilder(); + return 'db.schema'; } } diff --git a/vendor/illuminate/support/Facades/Storage.php b/vendor/illuminate/support/Facades/Storage.php index 3202382..581183f 100644 --- a/vendor/illuminate/support/Facades/Storage.php +++ b/vendor/illuminate/support/Facades/Storage.php @@ -26,7 +26,7 @@ use Illuminate\Filesystem\Filesystem; * @method static bool missing(string $path) * @method static bool move(string $from, string $to) * @method static bool prepend(string $path, string $data) - * @method static bool put(string $path, string|resource $contents, mixed $options = []) + * @method static bool put(string $path, \Psr\Http\Message\StreamInterface|\Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|resource $contents, mixed $options = []) * @method static bool setVisibility(string $path, string $visibility) * @method static bool writeStream(string $path, resource $resource, array $options = []) * @method static int lastModified(string $path) @@ -40,6 +40,8 @@ use Illuminate\Filesystem\Filesystem; * @method static string|false mimeType(string $path) * @method static string|false putFile(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, mixed $options = []) * @method static string|false putFileAs(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, string $name, mixed $options = []) + * @method static void macro(string $name, object|callable $macro) + * @method static void buildTemporaryUrlsUsing(\Closure $callback) * * @see \Illuminate\Filesystem\FilesystemManager */ @@ -68,7 +70,9 @@ class Storage extends Facade 'root' => $root, ]))); - return $fake; + return tap($fake)->buildTemporaryUrlsUsing(function ($path, $expiration) { + return URL::to($path.'?expiration='.$expiration->getTimestamp()); + }); } /** diff --git a/vendor/illuminate/support/Facades/Validator.php b/vendor/illuminate/support/Facades/Validator.php index f12cb38..0141277 100755 --- a/vendor/illuminate/support/Facades/Validator.php +++ b/vendor/illuminate/support/Facades/Validator.php @@ -4,6 +4,8 @@ namespace Illuminate\Support\Facades; /** * @method static \Illuminate\Contracts\Validation\Validator make(array $data, array $rules, array $messages = [], array $customAttributes = []) + * @method static void includeUnvalidatedArrayKeys() + * @method static void excludeUnvalidatedArrayKeys() * @method static void extend(string $rule, \Closure|string $extension, string $message = null) * @method static void extendImplicit(string $rule, \Closure|string $extension, string $message = null) * @method static void replacer(string $rule, \Closure|string $replacer) diff --git a/vendor/illuminate/support/Facades/View.php b/vendor/illuminate/support/Facades/View.php index 9b66464..4988ee9 100755 --- a/vendor/illuminate/support/Facades/View.php +++ b/vendor/illuminate/support/Facades/View.php @@ -6,6 +6,7 @@ namespace Illuminate\Support\Facades; * @method static \Illuminate\Contracts\View\Factory addNamespace(string $namespace, string|array $hints) * @method static \Illuminate\Contracts\View\View first(array $views, \Illuminate\Contracts\Support\Arrayable|array $data = [], array $mergeData = []) * @method static \Illuminate\Contracts\View\Factory replaceNamespace(string $namespace, string|array $hints) + * @method static \Illuminate\Contracts\View\Factory addExtension(string $extension, string $engine, \Closure|null $resolver = null) * @method static \Illuminate\Contracts\View\View file(string $path, array $data = [], array $mergeData = []) * @method static \Illuminate\Contracts\View\View make(string $view, array $data = [], array $mergeData = []) * @method static array composer(array|string $views, \Closure|string $callback) diff --git a/vendor/illuminate/support/Fluent.php b/vendor/illuminate/support/Fluent.php index 4660283..f7e67c9 100755 --- a/vendor/illuminate/support/Fluent.php +++ b/vendor/illuminate/support/Fluent.php @@ -7,19 +7,26 @@ use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Support\Jsonable; use JsonSerializable; +/** + * @template TKey of array-key + * @template TValue + * + * @implements \Illuminate\Contracts\Support\Arrayable + * @implements \ArrayAccess + */ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable { /** * All of the attributes set on the fluent instance. * - * @var array + * @var array */ protected $attributes = []; /** * Create a new fluent instance. * - * @param array|object $attributes + * @param iterable $attributes * @return void */ public function __construct($attributes = []) @@ -32,9 +39,11 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Get an attribute from the fluent instance. * - * @param string $key - * @param mixed $default - * @return mixed + * @template TGetDefault + * + * @param TKey $key + * @param TGetDefault|(\Closure(): TGetDefault) $default + * @return TValue|TGetDefault */ public function get($key, $default = null) { @@ -48,7 +57,7 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Get the attributes from the fluent instance. * - * @return array + * @return array */ public function getAttributes() { @@ -58,7 +67,7 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Convert the fluent instance to an array. * - * @return array + * @return array */ public function toArray() { @@ -68,10 +77,9 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Convert the object into something JSON serializable. * - * @return array + * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return $this->toArray(); } @@ -90,11 +98,10 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Determine if the given offset exists. * - * @param string $offset + * @param TKey $offset * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->attributes[$offset]); } @@ -102,11 +109,10 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Get the value for a given offset. * - * @param string $offset - * @return mixed + * @param TKey $offset + * @return TValue|null */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return $this->get($offset); } @@ -114,12 +120,11 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Set the value at the given offset. * - * @param string $offset - * @param mixed $value + * @param TKey $offset + * @param TValue $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->attributes[$offset] = $value; } @@ -127,11 +132,10 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Unset the value at the given offset. * - * @param string $offset + * @param TKey $offset * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->attributes[$offset]); } @@ -139,8 +143,8 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Handle dynamic calls to the fluent instance to set attributes. * - * @param string $method - * @param array $parameters + * @param TKey $method + * @param array{0: ?TValue} $parameters * @return $this */ public function __call($method, $parameters) @@ -153,8 +157,8 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Dynamically retrieve the value of an attribute. * - * @param string $key - * @return mixed + * @param TKey $key + * @return TValue|null */ public function __get($key) { @@ -164,8 +168,8 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Dynamically set the value of an attribute. * - * @param string $key - * @param mixed $value + * @param TKey $key + * @param TValue $value * @return void */ public function __set($key, $value) @@ -176,7 +180,7 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Dynamically check if an attribute is set. * - * @param string $key + * @param TKey $key * @return bool */ public function __isset($key) @@ -187,7 +191,7 @@ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable /** * Dynamically unset an attribute. * - * @param string $key + * @param TKey $key * @return void */ public function __unset($key) diff --git a/vendor/illuminate/support/Js.php b/vendor/illuminate/support/Js.php new file mode 100644 index 0000000..5a1d23a --- /dev/null +++ b/vendor/illuminate/support/Js.php @@ -0,0 +1,145 @@ +js = $this->convertDataToJavaScriptExpression($data, $flags, $depth); + } + + /** + * Create a new JavaScript string from the given data. + * + * @param mixed $data + * @param int $flags + * @param int $depth + * @return static + * + * @throws \JsonException + */ + public static function from($data, $flags = 0, $depth = 512) + { + return new static($data, $flags, $depth); + } + + /** + * Convert the given data to a JavaScript expression. + * + * @param mixed $data + * @param int $flags + * @param int $depth + * @return string + * + * @throws \JsonException + */ + protected function convertDataToJavaScriptExpression($data, $flags = 0, $depth = 512) + { + if ($data instanceof self) { + return $data->toHtml(); + } + + $json = $this->jsonEncode($data, $flags, $depth); + + if (is_string($data)) { + return "'".substr($json, 1, -1)."'"; + } + + return $this->convertJsonToJavaScriptExpression($json, $flags); + } + + /** + * Encode the given data as JSON. + * + * @param mixed $data + * @param int $flags + * @param int $depth + * @return string + * + * @throws \JsonException + */ + protected function jsonEncode($data, $flags = 0, $depth = 512) + { + if ($data instanceof Jsonable) { + return $data->toJson($flags | static::REQUIRED_FLAGS); + } + + if ($data instanceof Arrayable && ! ($data instanceof JsonSerializable)) { + $data = $data->toArray(); + } + + return json_encode($data, $flags | static::REQUIRED_FLAGS, $depth); + } + + /** + * Convert the given JSON to a JavaScript expression. + * + * @param string $json + * @param int $flags + * @return string + * + * @throws \JsonException + */ + protected function convertJsonToJavaScriptExpression($json, $flags = 0) + { + if ($json === '[]' || $json === '{}') { + return $json; + } + + if (Str::startsWith($json, ['"', '{', '['])) { + return "JSON.parse('".substr(json_encode($json, $flags | static::REQUIRED_FLAGS), 1, -1)."')"; + } + + return $json; + } + + /** + * Get the string representation of the data for use in HTML. + * + * @return string + */ + public function toHtml() + { + return $this->js; + } + + /** + * Get the string representation of the data for use in HTML. + * + * @return string + */ + public function __toString() + { + return $this->toHtml(); + } +} diff --git a/vendor/illuminate/support/MessageBag.php b/vendor/illuminate/support/MessageBag.php index e53d509..cfc6d88 100755 --- a/vendor/illuminate/support/MessageBag.php +++ b/vendor/illuminate/support/MessageBag.php @@ -193,7 +193,7 @@ class MessageBag implements Jsonable, JsonSerializable, MessageBagContract, Mess ); } - if (Str::contains($key, '*')) { + if (str_contains($key, '*')) { return $this->getMessagesForWildcardKey($key, $format); } @@ -368,8 +368,7 @@ class MessageBag implements Jsonable, JsonSerializable, MessageBagContract, Mess * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return count($this->messages, COUNT_RECURSIVE) - count($this->messages); } @@ -389,8 +388,7 @@ class MessageBag implements Jsonable, JsonSerializable, MessageBagContract, Mess * * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return $this->toArray(); } diff --git a/vendor/illuminate/support/MultipleInstanceManager.php b/vendor/illuminate/support/MultipleInstanceManager.php new file mode 100644 index 0000000..8544bdf --- /dev/null +++ b/vendor/illuminate/support/MultipleInstanceManager.php @@ -0,0 +1,191 @@ +app = $app; + } + + /** + * Get the default instance name. + * + * @return string + */ + abstract public function getDefaultInstance(); + + /** + * Set the default instance name. + * + * @param string $name + * @return void + */ + abstract public function setDefaultInstance($name); + + /** + * Get the instance specific configuration. + * + * @param string $name + * @return array + */ + abstract public function getInstanceConfig($name); + + /** + * Get an instance instance by name. + * + * @param string|null $name + * @return mixed + */ + public function instance($name = null) + { + $name = $name ?: $this->getDefaultInstance(); + + return $this->instances[$name] = $this->get($name); + } + + /** + * Attempt to get an instance from the local cache. + * + * @param string $name + * @return mixed + */ + protected function get($name) + { + return $this->instances[$name] ?? $this->resolve($name); + } + + /** + * Resolve the given instance. + * + * @param string $name + * @return mixed + * + * @throws \InvalidArgumentException + */ + protected function resolve($name) + { + $config = $this->getInstanceConfig($name); + + if (is_null($config)) { + throw new InvalidArgumentException("Instance [{$name}] is not defined."); + } + + if (! array_key_exists('driver', $config)) { + throw new RuntimeException("Instance [{$name}] does not specify a driver."); + } + + if (isset($this->customCreators[$config['driver']])) { + return $this->callCustomCreator($config); + } else { + $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; + + if (method_exists($this, $driverMethod)) { + return $this->{$driverMethod}($config); + } else { + throw new InvalidArgumentException("Instance driver [{$config['driver']}] is not supported."); + } + } + } + + /** + * Call a custom instance creator. + * + * @param array $config + * @return mixed + */ + protected function callCustomCreator(array $config) + { + return $this->customCreators[$config['driver']]($this->app, $config); + } + + /** + * Unset the given instances. + * + * @param array|string|null $name + * @return $this + */ + public function forgetInstance($name = null) + { + $name ??= $this->getDefaultInstance(); + + foreach ((array) $name as $instanceName) { + if (isset($this->instances[$instanceName])) { + unset($this->instances[$instanceName]); + } + } + + return $this; + } + + /** + * Disconnect the given instance and remove from local cache. + * + * @param string|null $name + * @return void + */ + public function purge($name = null) + { + $name ??= $this->getDefaultInstance(); + + unset($this->instances[$name]); + } + + /** + * Register a custom instance creator Closure. + * + * @param string $name + * @param \Closure $callback + * @return $this + */ + public function extend($name, Closure $callback) + { + $this->customCreators[$name] = $callback->bindTo($this, $this); + + return $this; + } + + /** + * Dynamically call the default instance. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->instance()->$method(...$parameters); + } +} diff --git a/vendor/illuminate/support/NamespacedItemResolver.php b/vendor/illuminate/support/NamespacedItemResolver.php index e9251db..a059c6d 100755 --- a/vendor/illuminate/support/NamespacedItemResolver.php +++ b/vendor/illuminate/support/NamespacedItemResolver.php @@ -29,7 +29,7 @@ class NamespacedItemResolver // 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 (strpos($key, '::') === false) { + if (! str_contains($key, '::')) { $segments = explode('.', $key); $parsed = $this->parseBasicSegments($segments); @@ -99,4 +99,14 @@ class NamespacedItemResolver { $this->parsed[$key] = $parsed; } + + /** + * Flush the cache of parsed keys. + * + * @return void + */ + public function flushParsedKeys() + { + $this->parsed = []; + } } diff --git a/vendor/illuminate/support/Optional.php b/vendor/illuminate/support/Optional.php index 816190d..ba84a2c 100644 --- a/vendor/illuminate/support/Optional.php +++ b/vendor/illuminate/support/Optional.php @@ -68,8 +68,7 @@ class Optional implements ArrayAccess * @param mixed $key * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists($key): bool { return Arr::accessible($this->value) && Arr::exists($this->value, $key); } @@ -80,8 +79,7 @@ class Optional implements ArrayAccess * @param mixed $key * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { return Arr::get($this->value, $key); } @@ -93,8 +91,7 @@ class Optional implements ArrayAccess * @param mixed $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { if (Arr::accessible($this->value)) { $this->value[$key] = $value; @@ -107,8 +104,7 @@ class Optional implements ArrayAccess * @param string $key * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { if (Arr::accessible($this->value)) { unset($this->value[$key]); diff --git a/vendor/illuminate/support/Pluralizer.php b/vendor/illuminate/support/Pluralizer.php index 5babd0e..fbe5182 100755 --- a/vendor/illuminate/support/Pluralizer.php +++ b/vendor/illuminate/support/Pluralizer.php @@ -2,10 +2,7 @@ namespace Illuminate\Support; -use Doctrine\Inflector\CachedWordInflector; -use Doctrine\Inflector\Inflector; -use Doctrine\Inflector\Rules\English; -use Doctrine\Inflector\RulesetInflector; +use Doctrine\Inflector\InflectorFactory; class Pluralizer { @@ -64,11 +61,15 @@ class Pluralizer * Get the plural form of an English word. * * @param string $value - * @param int $count + * @param int|array|\Countable $count * @return string */ public static function plural($value, $count = 2) { + if (is_countable($count)) { + $count = count($count); + } + if ((int) abs($count) === 1 || static::uncountable($value) || preg_match('/^(.*)[A-Za-z0-9\x{0080}-\x{FFFF}]$/u', $value) == 0) { return $value; } @@ -132,14 +133,7 @@ class Pluralizer static $inflector; if (is_null($inflector)) { - $inflector = new Inflector( - new CachedWordInflector(new RulesetInflector( - English\Rules::getSingularRuleset() - )), - new CachedWordInflector(new RulesetInflector( - English\Rules::getPluralRuleset() - )) - ); + $inflector = InflectorFactory::createForLanguage('english')->build(); } return $inflector; diff --git a/vendor/illuminate/support/ProcessUtils.php b/vendor/illuminate/support/ProcessUtils.php index 1caa9e1..165e751 100644 --- a/vendor/illuminate/support/ProcessUtils.php +++ b/vendor/illuminate/support/ProcessUtils.php @@ -22,7 +22,7 @@ class ProcessUtils // @see https://bugs.php.net/bug.php?id=43784 // @see https://bugs.php.net/bug.php?id=49446 if ('\\' === DIRECTORY_SEPARATOR) { - if ('' === $argument) { + if ($argument === '') { return '""'; } @@ -30,14 +30,14 @@ class ProcessUtils $quote = false; foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { - if ('"' === $part) { + if ($part === '"') { $escapedArgument .= '\\"'; } elseif (self::isSurroundedBy($part, '%')) { // Avoid environment variable expansion $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; } else { // escape trailing backslash - if ('\\' === substr($part, -1)) { + if (str_ends_with($part, '\\')) { $part .= '\\'; } $quote = true; @@ -64,6 +64,6 @@ class ProcessUtils */ protected static function isSurroundedBy($arg, $char) { - return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; + return strlen($arg) > 2 && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; } } diff --git a/vendor/illuminate/support/Reflector.php b/vendor/illuminate/support/Reflector.php index 9e7896a..1390c9d 100644 --- a/vendor/illuminate/support/Reflector.php +++ b/vendor/illuminate/support/Reflector.php @@ -3,6 +3,7 @@ namespace Illuminate\Support; use ReflectionClass; +use ReflectionEnum; use ReflectionMethod; use ReflectionNamedType; use ReflectionUnionType; @@ -22,8 +23,7 @@ class Reflector return is_callable($var, $syntaxOnly); } - if ((! isset($var[0]) || ! isset($var[1])) || - ! is_string($var[1] ?? null)) { + if (! isset($var[0], $var[1]) || ! is_string($var[1] ?? null)) { return false; } @@ -135,8 +135,28 @@ class Reflector { $paramClassName = static::getParameterClassName($parameter); - return ($paramClassName && class_exists($paramClassName)) - ? (new ReflectionClass($paramClassName))->isSubclassOf($className) - : false; + return $paramClassName + && (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/vendor/illuminate/support/ServiceProvider.php b/vendor/illuminate/support/ServiceProvider.php index 1f361b1..6c530c1 100755 --- a/vendor/illuminate/support/ServiceProvider.php +++ b/vendor/illuminate/support/ServiceProvider.php @@ -97,8 +97,12 @@ abstract class ServiceProvider */ public function callBootingCallbacks() { - foreach ($this->bootingCallbacks as $callback) { - $this->app->call($callback); + $index = 0; + + while ($index < count($this->bootingCallbacks)) { + $this->app->call($this->bootingCallbacks[$index]); + + $index++; } } @@ -109,8 +113,12 @@ abstract class ServiceProvider */ public function callBootedCallbacks() { - foreach ($this->bootedCallbacks as $callback) { - $this->app->call($callback); + $index = 0; + + while ($index < count($this->bootedCallbacks)) { + $this->app->call($this->bootedCallbacks[$index]); + + $index++; } } diff --git a/vendor/illuminate/support/Str.php b/vendor/illuminate/support/Str.php index f1ab26d..a87afe9 100644 --- a/vendor/illuminate/support/Str.php +++ b/vendor/illuminate/support/Str.php @@ -99,6 +99,19 @@ class Str return ASCII::to_ascii((string) $value, $language); } + /** + * Transliterate a string to its closest ASCII representation. + * + * @param string $string + * @param string|null $unknown + * @param bool|null $strict + * @return string + */ + public static function transliterate($string, $unknown = '?', $strict = false) + { + return ASCII::to_transliterate($string, $unknown, $strict); + } + /** * Get the portion of a string before the first occurrence of a given value. * @@ -156,6 +169,23 @@ class Str return static::beforeLast(static::after($subject, $from), $to); } + /** + * Get the smallest possible portion of a string between two given values. + * + * @param string $subject + * @param string $from + * @param string $to + * @return string + */ + public static function betweenFirst($subject, $from, $to) + { + if ($from === '' || $to === '') { + return $subject; + } + + return static::before(static::after($subject, $from), $to); + } + /** * Convert a value to camel case. * @@ -176,12 +206,18 @@ class Str * * @param string $haystack * @param string|string[] $needles + * @param bool $ignoreCase * @return bool */ - public static function contains($haystack, $needles) + public static function contains($haystack, $needles, $ignoreCase = false) { + if ($ignoreCase) { + $haystack = mb_strtolower($haystack); + $needles = array_map('mb_strtolower', (array) $needles); + } + foreach ((array) $needles as $needle) { - if ($needle !== '' && mb_strpos($haystack, $needle) !== false) { + if ($needle !== '' && str_contains($haystack, $needle)) { return true; } } @@ -194,10 +230,16 @@ class Str * * @param string $haystack * @param string[] $needles + * @param bool $ignoreCase * @return bool */ - public static function containsAll($haystack, array $needles) + public static function containsAll($haystack, array $needles, $ignoreCase = false) { + if ($ignoreCase) { + $haystack = mb_strtolower($haystack); + $needles = array_map('mb_strtolower', $needles); + } + foreach ($needles as $needle) { if (! static::contains($haystack, $needle)) { return false; @@ -219,7 +261,7 @@ class Str foreach ((array) $needles as $needle) { if ( $needle !== '' && $needle !== null - && substr($haystack, -strlen($needle)) === (string) $needle + && str_ends_with($haystack, $needle) ) { return true; } @@ -228,6 +270,42 @@ class Str 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. * @@ -253,15 +331,19 @@ class Str { $patterns = Arr::wrap($pattern); + $value = (string) $value; + if (empty($patterns)) { return false; } foreach ($patterns as $pattern) { + $pattern = (string) $pattern; + // 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; } @@ -391,7 +473,39 @@ class Str { $converter = new GithubFlavoredMarkdownConverter($options); - return (string) $converter->convertToHtml($string); + return (string) $converter->convert($string); + } + + /** + * Masks a portion of a string with a repeated character. + * + * @param string $string + * @param string $character + * @param int $index + * @param int|null $length + * @param string $encoding + * @return string + */ + public static function mask($string, $character, $index, $length = null, $encoding = 'UTF-8') + { + if ($character === '') { + return $string; + } + + if (is_null($length) && PHP_MAJOR_VERSION < 8) { + $length = mb_strlen($string, $encoding); + } + + $segment = mb_substr($string, $index, $length, $encoding); + + if ($segment === '') { + return $string; + } + + $start = mb_substr($string, 0, mb_strpos($string, $segment, 0, $encoding), $encoding); + $end = mb_substr($string, mb_strpos($string, $segment, 0, $encoding) + mb_strlen($segment, $encoding)); + + return $start.str_repeat(mb_substr($character, 0, 1, $encoding), mb_strlen($segment, $encoding)).$end; } /** @@ -485,7 +599,7 @@ class Str * Get the plural form of an English word. * * @param string $value - * @param int $count + * @param int|array|\Countable $count * @return string */ public static function plural($value, $count = 2) @@ -497,7 +611,7 @@ class Str * Pluralize the last word of an English, studly caps case string. * * @param string $value - * @param int $count + * @param int|array|\Countable $count * @return string */ public static function pluralStudly($value, $count = 2) @@ -586,6 +700,8 @@ class Str */ public static function replaceFirst($search, $replace, $subject) { + $search = (string) $search; + if ($search === '') { return $subject; } @@ -639,6 +755,17 @@ class Str return $subject; } + /** + * Reverse the given string. + * + * @param string $value + * @return string + */ + public static function reverse(string $value) + { + return implode(array_reverse(mb_str_split($value))); + } + /** * Begin a string with a single instance of a given value. * @@ -675,6 +802,25 @@ class Str return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8'); } + /** + * Convert the given string to title case for each word. + * + * @param string $value + * @return string + */ + public static function headline($value) + { + $parts = explode(' ', $value); + + $parts = count($parts) > 1 + ? array_map([static::class, 'title'], $parts) + : array_map([static::class, 'title'], static::ucsplit(implode('_', $parts))); + + $collapsed = static::replace(['-', '_', ' '], '_', implode('_', $parts)); + + return implode(' ', array_filter(explode('_', $collapsed))); + } + /** * Get the singular form of an English word. * @@ -749,7 +895,7 @@ class Str public static function startsWith($haystack, $needles) { foreach ((array) $needles as $needle) { - if ((string) $needle !== '' && strncmp($haystack, $needle, strlen($needle)) === 0) { + if ((string) $needle !== '' && str_starts_with($haystack, $needle)) { return true; } } @@ -771,9 +917,13 @@ class Str return static::$studlyCache[$key]; } - $value = ucwords(str_replace(['-', '_'], ' ', $value)); + $words = explode(' ', static::replace(['-', '_'], ' ', $value)); - return static::$studlyCache[$key] = str_replace(' ', '', $value); + $studlyWords = array_map(function ($word) { + return static::ucfirst($word); + }, $words); + + return static::$studlyCache[$key] = implode($studlyWords); } /** @@ -807,6 +957,47 @@ class Str } } + /** + * Replace text within a portion of a string. + * + * @param string|array $string + * @param string|array $replace + * @param array|int $offset + * @param array|int|null $length + * @return string|array + */ + public static function substrReplace($string, $replace, $offset = 0, $length = null) + { + if ($length === null) { + $length = strlen($string); + } + + return substr_replace($string, $replace, $offset, $length); + } + + /** + * Swap multiple keywords in a string with other keywords. + * + * @param array $map + * @param string $subject + * @return string + */ + public static function swap(array $map, $subject) + { + return strtr($subject, $map); + } + + /** + * Make a string's first character lowercase. + * + * @param string $string + * @return string + */ + public static function lcfirst($string) + { + return static::lower(static::substr($string, 0, 1)).static::substr($string, 1); + } + /** * Make a string's first character uppercase. * @@ -818,6 +1009,17 @@ class Str return static::upper(static::substr($string, 0, 1)).static::substr($string, 1); } + /** + * Split a string into pieces by uppercase characters. + * + * @param string $string + * @return array + */ + public static function ucsplit($string) + { + return preg_split('/(?=\p{Lu})/u', $string, -1, PREG_SPLIT_NO_EMPTY); + } + /** * Get the number of words a string contains. * @@ -886,4 +1088,16 @@ class Str { static::$uuidFactory = null; } + + /** + * Remove all strings from the casing caches. + * + * @return void + */ + public static function flushCache() + { + static::$snakeCache = []; + static::$camelCache = []; + static::$studlyCache = []; + } } diff --git a/vendor/illuminate/support/Stringable.php b/vendor/illuminate/support/Stringable.php index 9fa57c5..90177d5 100644 --- a/vendor/illuminate/support/Stringable.php +++ b/vendor/illuminate/support/Stringable.php @@ -130,6 +130,18 @@ class Stringable implements JsonSerializable return new static(Str::between($this->value, $from, $to)); } + /** + * Get the smallest possible portion of a string between two given values. + * + * @param string $from + * @param string $to + * @return static + */ + public function betweenFirst($from, $to) + { + return new static(Str::betweenFirst($this->value, $from, $to)); + } + /** * Convert a value to camel case. * @@ -143,7 +155,7 @@ class Stringable implements JsonSerializable /** * Determine if a given string contains a given substring. * - * @param string|array $needles + * @param string|string[] $needles * @return bool */ public function contains($needles) @@ -176,7 +188,7 @@ class Stringable implements JsonSerializable /** * Determine if a given string ends with a given substring. * - * @param string|array $needles + * @param string|string[] $needles * @return bool */ public function endsWith($needles) @@ -195,6 +207,18 @@ class Stringable implements JsonSerializable 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. * @@ -342,6 +366,20 @@ class Stringable implements JsonSerializable return new static(Str::markdown($this->value, $options)); } + /** + * Masks a portion of a string with a repeated character. + * + * @param string $character + * @param int $index + * @param int|null $length + * @param string $encoding + * @return static + */ + public function mask($character, $index, $length = null, $encoding = 'UTF-8') + { + return new static(Str::mask($this->value, $character, $index, $length, $encoding)); + } + /** * Get the string matching the given pattern. * @@ -430,7 +468,7 @@ class Stringable implements JsonSerializable */ public function pipe(callable $callback) { - return new static(call_user_func($callback, $this)); + return new static($callback($this)); } /** @@ -478,6 +516,16 @@ class Stringable implements JsonSerializable return new static(Str::remove($search, $this->value, $caseSensitive)); } + /** + * Reverse the string. + * + * @return static + */ + public function reverse() + { + return new static(Str::reverse($this->value)); + } + /** * Repeat the string. * @@ -486,7 +534,7 @@ class Stringable implements JsonSerializable */ public function repeat(int $times) { - return new static(Str::repeat($this->value, $times)); + return new static(str_repeat($this->value, $times)); } /** @@ -498,7 +546,7 @@ class Stringable implements JsonSerializable */ public function replace($search, $replace) { - return new static(Str::replace($search, $replace, $this->value)); + return new static(str_replace($search, $replace, $this->value)); } /** @@ -554,6 +602,17 @@ class Stringable implements JsonSerializable return new static(preg_replace($pattern, $replace, $this->value, $limit)); } + /** + * Parse input from a string to a collection, according to a format. + * + * @param string $format + * @return \Illuminate\Support\Collection + */ + public function scan($format) + { + return collect(sscanf($this->value, $format)); + } + /** * Begin a string with a single instance of a given value. * @@ -565,6 +624,17 @@ class Stringable implements JsonSerializable return new static(Str::start($this->value, $prefix)); } + /** + * Strip HTML and PHP tags from the given string. + * + * @param string $allowedTags + * @return static + */ + public function stripTags($allowedTags = null) + { + return new static(strip_tags($this->value, $allowedTags)); + } + /** * Convert the given string to upper-case. * @@ -585,6 +655,16 @@ class Stringable implements JsonSerializable return new static(Str::title($this->value)); } + /** + * Convert the given string to title case for each word. + * + * @return static + */ + public function headline() + { + return new static(Str::headline($this->value)); + } + /** * Get the singular form of an English word. * @@ -621,7 +701,7 @@ class Stringable implements JsonSerializable /** * Determine if a given string starts with a given substring. * - * @param string|array $needles + * @param string|string[] $needles * @return bool */ public function startsWith($needles) @@ -664,6 +744,30 @@ class Stringable implements JsonSerializable return Str::substrCount($this->value, $needle, $offset ?? 0, $length); } + /** + * Replace text within a portion of a string. + * + * @param string|array $replace + * @param array|int $offset + * @param array|int|null $length + * @return static + */ + public function substrReplace($replace, $offset = 0, $length = null) + { + return new static(Str::substrReplace($this->value, $replace, $offset, $length)); + } + + /** + * Swap multiple keywords in a string with other keywords. + * + * @param array $map + * @return static + */ + public function swap(array $map) + { + return new static(strtr($this->value, $map)); + } + /** * Trim the string of the given characters. * @@ -697,6 +801,16 @@ class Stringable implements JsonSerializable return new static(rtrim(...array_merge([$this->value], func_get_args()))); } + /** + * Make a string's first character lowercase. + * + * @return static + */ + public function lcfirst() + { + return new static(Str::lcfirst($this->value)); + } + /** * Make a string's first character uppercase. * @@ -707,38 +821,153 @@ class Stringable implements JsonSerializable return new static(Str::ucfirst($this->value)); } + /** + * Split a string by uppercase characters. + * + * @return \Illuminate\Support\Collection + */ + public function ucsplit() + { + return collect(Str::ucsplit($this->value)); + } + + /** + * Execute the given callback if the string contains a given substring. + * + * @param string|string[] $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenContains($needles, $callback, $default = null) + { + return $this->when($this->contains($needles), $callback, $default); + } + + /** + * Execute the given callback if the string contains all array values. + * + * @param array $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenContainsAll(array $needles, $callback, $default = null) + { + return $this->when($this->containsAll($needles), $callback, $default); + } + /** * Execute the given callback if the string is empty. * * @param callable $callback + * @param callable|null $default * @return static */ - public function whenEmpty($callback) + public function whenEmpty($callback, $default = null) { - if ($this->isEmpty()) { - $result = $callback($this); - - return is_null($result) ? $this : $result; - } - - return $this; + return $this->when($this->isEmpty(), $callback, $default); } /** * Execute the given callback if the string is not empty. * * @param callable $callback + * @param callable|null $default * @return static */ - public function whenNotEmpty($callback) + public function whenNotEmpty($callback, $default = null) { - if ($this->isNotEmpty()) { - $result = $callback($this); + return $this->when($this->isNotEmpty(), $callback, $default); + } - return is_null($result) ? $this : $result; - } + /** + * Execute the given callback if the string ends with a given substring. + * + * @param string|string[] $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenEndsWith($needles, $callback, $default = null) + { + return $this->when($this->endsWith($needles), $callback, $default); + } - return $this; + /** + * Execute the given callback if the string is an exact match with the given value. + * + * @param string $value + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenExactly($value, $callback, $default = null) + { + return $this->when($this->exactly($value), $callback, $default); + } + + /** + * Execute the given callback if the string matches a given pattern. + * + * @param string|array $pattern + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIs($pattern, $callback, $default = null) + { + return $this->when($this->is($pattern), $callback, $default); + } + + /** + * Execute the given callback if the string is 7 bit ASCII. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIsAscii($callback, $default = null) + { + return $this->when($this->isAscii(), $callback, $default); + } + + /** + * Execute the given callback if the string is a valid UUID. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIsUuid($callback, $default = null) + { + return $this->when($this->isUuid(), $callback, $default); + } + + /** + * Execute the given callback if the string starts with a given substring. + * + * @param string|string[] $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenStartsWith($needles, $callback, $default = null) + { + return $this->when($this->startsWith($needles), $callback, $default); + } + + /** + * Execute the given callback if the string matches the given pattern. + * + * @param string $pattern + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenTest($pattern, $callback, $default = null) + { + return $this->when($this->test($pattern), $callback, $default); } /** @@ -763,6 +992,16 @@ class Stringable implements JsonSerializable return str_word_count($this->value); } + /** + * Convert the string into a `HtmlString` instance. + * + * @return \Illuminate\Support\HtmlString + */ + public function toHtmlString() + { + return new HtmlString($this->value); + } + /** * Dump the string. * @@ -778,7 +1017,7 @@ class Stringable implements JsonSerializable /** * Dump the string and end the script. * - * @return void + * @return never */ public function dd() { @@ -787,13 +1026,32 @@ class Stringable implements JsonSerializable 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 */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): string { return $this->__toString(); } diff --git a/vendor/illuminate/support/Testing/Fakes/BusFake.php b/vendor/illuminate/support/Testing/Fakes/BusFake.php index 3413dc6..122252d 100644 --- a/vendor/illuminate/support/Testing/Fakes/BusFake.php +++ b/vendor/illuminate/support/Testing/Fakes/BusFake.php @@ -135,6 +135,16 @@ class BusFake implements QueueingDispatcher ); } + /** + * Assert that no jobs were dispatched. + * + * @return void + */ + public function assertNothingDispatched() + { + PHPUnit::assertEmpty($this->commands, 'Jobs were dispatched unexpectedly.'); + } + /** * Assert if a job was explicitly dispatched synchronously based on a truth-test callback. * @@ -213,7 +223,7 @@ class BusFake implements QueueingDispatcher PHPUnit::assertTrue( $this->dispatchedAfterResponse($command, $callback)->count() > 0, - "The expected [{$command}] job was not dispatched for after sending the response." + "The expected [{$command}] job was not dispatched after sending the response." ); } @@ -249,7 +259,7 @@ class BusFake implements QueueingDispatcher PHPUnit::assertCount( 0, $this->dispatchedAfterResponse($command, $callback), - "The unexpected [{$command}] job was dispatched for after sending the response." + "The unexpected [{$command}] job was dispatched after sending the response." ); } @@ -403,6 +413,19 @@ class BusFake implements QueueingDispatcher ); } + /** + * Assert the number of batches that have been dispatched. + * + * @param int $count + * @return void + */ + public function assertBatchCount($count) + { + PHPUnit::assertCount( + $count, $this->batches, + ); + } + /** * Get all of the jobs matching a truth-test callback. * @@ -636,7 +659,7 @@ class BusFake implements QueueingDispatcher /** * Record the fake pending batch dispatch. * - * @param \Illuminate\Bus\PendingBatch $pendingBatch + * @param \Illuminate\Bus\PendingBatch $pendingBatch * @return \Illuminate\Bus\Batch */ public function recordPendingBatch(PendingBatch $pendingBatch) diff --git a/vendor/illuminate/support/Testing/Fakes/MailFake.php b/vendor/illuminate/support/Testing/Fakes/MailFake.php index 9e69c67..4fea2cb 100644 --- a/vendor/illuminate/support/Testing/Fakes/MailFake.php +++ b/vendor/illuminate/support/Testing/Fakes/MailFake.php @@ -419,7 +419,7 @@ class MailFake implements Factory, Mailer, MailQueue * Infer mailable class using reflection if a typehinted closure is passed to assertion. * * @param string|\Closure $mailable - * @param callable|null $callback + * @param callable|null $callback * @return array */ protected function prepareMailableAndCallback($mailable, $callback) @@ -430,4 +430,16 @@ class MailFake implements Factory, Mailer, MailQueue return [$mailable, $callback]; } + + /** + * Forget all of the resolved mailer instances. + * + * @return $this + */ + public function forgetMailers() + { + $this->currentMailer = null; + + return $this; + } } diff --git a/vendor/illuminate/support/Testing/Fakes/NotificationFake.php b/vendor/illuminate/support/Testing/Fakes/NotificationFake.php index 28526d5..4c08911 100644 --- a/vendor/illuminate/support/Testing/Fakes/NotificationFake.php +++ b/vendor/illuminate/support/Testing/Fakes/NotificationFake.php @@ -7,6 +7,7 @@ use Exception; use Illuminate\Contracts\Notifications\Dispatcher as NotificationDispatcher; use Illuminate\Contracts\Notifications\Factory as NotificationFactory; use Illuminate\Contracts\Translation\HasLocalePreference; +use Illuminate\Notifications\AnonymousNotifiable; use Illuminate\Support\Collection; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; @@ -31,6 +32,20 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory */ public $locale; + /** + * Assert if a notification was sent on-demand based on a truth-test callback. + * + * @param string|\Closure $notification + * @param callable|null $callback + * @return void + * + * @throws \Exception + */ + public function assertSentOnDemand($notification, $callback = null) + { + $this->assertSentTo(new AnonymousNotifiable, $notification, $callback); + } + /** * Assert if a notification was sent based on a truth-test callback. * @@ -69,6 +84,18 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory ); } + /** + * Assert if a notification was sent on-demand a number of times. + * + * @param string $notification + * @param int $times + * @return void + */ + public function assertSentOnDemandTimes($notification, $times = 1) + { + return $this->assertSentToTimes(new AnonymousNotifiable, $notification, $times); + } + /** * Assert if a notification was sent a number of times. * @@ -131,14 +158,42 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory PHPUnit::assertEmpty($this->notifications, 'Notifications were sent unexpectedly.'); } + /** + * Assert that no notifications were sent to the given notifiable. + * + * @param mixed $notifiable + * @return void + * + * @throws \Exception + */ + public function assertNothingSentTo($notifiable) + { + if (is_array($notifiable) || $notifiable instanceof Collection) { + if (count($notifiable) === 0) { + throw new Exception('No notifiable given.'); + } + + foreach ($notifiable as $singleNotifiable) { + $this->assertNothingSentTo($singleNotifiable); + } + + return; + } + + PHPUnit::assertEmpty( + $this->notifications[get_class($notifiable)][$notifiable->getKey()] ?? [], + 'Notifications were sent unexpectedly.', + ); + } + /** * Assert the total amount of times a notification was sent. * - * @param int $expectedCount * @param string $notification + * @param int $expectedCount * @return void */ - public function assertTimesSent($expectedCount, $notification) + public function assertSentTimes($notification, $expectedCount) { $actualCount = collect($this->notifications) ->flatten(1) @@ -152,6 +207,20 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory ); } + /** + * Assert the total amount of times a notification was sent. + * + * @param int $expectedCount + * @param string $notification + * @return void + * + * @deprecated Use the assertSentTimes method instead + */ + public function assertTimesSent($expectedCount, $notification) + { + $this->assertSentTimes($notification, $expectedCount); + } + /** * Get all of the notifications matching a truth-test callback. * @@ -232,9 +301,24 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory $notification->id = Str::uuid()->toString(); } + $notifiableChannels = $channels ?: $notification->via($notifiable); + + if (method_exists($notification, 'shouldSend')) { + $notifiableChannels = array_filter( + $notifiableChannels, + function ($channel) use ($notification, $notifiable) { + return $notification->shouldSend($notifiable, $channel) !== false; + } + ); + + if (empty($notifiableChannels)) { + continue; + } + } + $this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [ 'notification' => $notification, - 'channels' => $channels ?: $notification->via($notifiable), + 'channels' => $notifiableChannels, 'notifiable' => $notifiable, 'locale' => $notification->locale ?? $this->locale ?? value(function () use ($notifiable) { if ($notifiable instanceof HasLocalePreference) { diff --git a/vendor/illuminate/support/Testing/Fakes/QueueFake.php b/vendor/illuminate/support/Testing/Fakes/QueueFake.php index 64d6414..cb34915 100644 --- a/vendor/illuminate/support/Testing/Fakes/QueueFake.php +++ b/vendor/illuminate/support/Testing/Fakes/QueueFake.php @@ -272,7 +272,7 @@ class QueueFake extends QueueManager implements Queue /** * Push a new job onto the queue. * - * @param string $job + * @param string|object $job * @param mixed $data * @param string|null $queue * @return mixed @@ -299,10 +299,10 @@ class QueueFake extends QueueManager implements Queue } /** - * Push a new job onto the queue after a delay. + * Push a new job onto the queue after (n) seconds. * * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job + * @param string|object $job * @param mixed $data * @param string|null $queue * @return mixed @@ -316,7 +316,7 @@ class QueueFake extends QueueManager implements Queue * Push a new job onto the queue. * * @param string $queue - * @param string $job + * @param string|object $job * @param mixed $data * @return mixed */ @@ -326,11 +326,11 @@ class QueueFake extends QueueManager implements Queue } /** - * Push a new job onto the queue after a delay. + * Push a new job onto a specific queue after (n) seconds. * * @param string $queue * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job + * @param string|object $job * @param mixed $data * @return mixed */ diff --git a/vendor/illuminate/support/Traits/Conditionable.php b/vendor/illuminate/support/Traits/Conditionable.php deleted file mode 100644 index 7980827..0000000 --- a/vendor/illuminate/support/Traits/Conditionable.php +++ /dev/null @@ -1,44 +0,0 @@ -{$method}(...$parameters); - } catch (Error | BadMethodCallException $e) { + } catch (Error|BadMethodCallException $e) { $pattern = '~^Call to undefined method (?P[^:]+)::(?P[^\(]+)\(\)$~'; if (! preg_match($pattern, $e->getMessage(), $matches)) { @@ -37,6 +37,27 @@ trait ForwardsCalls } } + /** + * Forward a method call to the given object, returning $this if the forwarded call returned itself. + * + * @param mixed $object + * @param string $method + * @param array $parameters + * @return mixed + * + * @throws \BadMethodCallException + */ + protected function forwardDecoratedCallTo($object, $method, $parameters) + { + $result = $this->forwardCallTo($object, $method, $parameters); + + if ($result === $object) { + return $this; + } + + return $result; + } + /** * Throw a bad method call exception for the given method. * diff --git a/vendor/illuminate/support/Traits/Tappable.php b/vendor/illuminate/support/Traits/Tappable.php index e4a321c..9353451 100644 --- a/vendor/illuminate/support/Traits/Tappable.php +++ b/vendor/illuminate/support/Traits/Tappable.php @@ -8,7 +8,7 @@ trait Tappable * Call the given Closure with this instance then return the instance. * * @param callable|null $callback - * @return mixed + * @return $this|\Illuminate\Support\HigherOrderTapProxy */ public function tap($callback = null) { diff --git a/vendor/illuminate/support/ValidatedInput.php b/vendor/illuminate/support/ValidatedInput.php index 0b44252..084cb24 100644 --- a/vendor/illuminate/support/ValidatedInput.php +++ b/vendor/illuminate/support/ValidatedInput.php @@ -5,6 +5,7 @@ namespace Illuminate\Support; use ArrayIterator; use Illuminate\Contracts\Support\ValidatedData; use stdClass; +use Traversable; class ValidatedInput implements ValidatedData { @@ -68,6 +69,17 @@ class ValidatedInput implements ValidatedData return $results; } + /** + * Merge the validated input with the given array of additional data. + * + * @param array $items + * @return static + */ + public function merge(array $items) + { + return new static(array_merge($this->input, $items)); + } + /** * Get the input as a collection. * @@ -148,8 +160,7 @@ class ValidatedInput implements ValidatedData * @param mixed $key * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists($key): bool { return isset($this->input[$key]); } @@ -160,8 +171,7 @@ class ValidatedInput implements ValidatedData * @param mixed $key * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { return $this->input[$key]; } @@ -173,8 +183,7 @@ class ValidatedInput implements ValidatedData * @param mixed $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { if (is_null($key)) { $this->input[] = $value; @@ -189,8 +198,7 @@ class ValidatedInput implements ValidatedData * @param string $key * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { unset($this->input[$key]); } @@ -200,8 +208,7 @@ class ValidatedInput implements ValidatedData * * @return \ArrayIterator */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->input); } diff --git a/vendor/illuminate/support/ViewErrorBag.php b/vendor/illuminate/support/ViewErrorBag.php index d51bb53..ff9da4f 100644 --- a/vendor/illuminate/support/ViewErrorBag.php +++ b/vendor/illuminate/support/ViewErrorBag.php @@ -78,8 +78,7 @@ class ViewErrorBag implements Countable * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return $this->getBag('default')->count(); } diff --git a/vendor/illuminate/support/composer.json b/vendor/illuminate/support/composer.json index 4493dac..1e1681c 100644 --- a/vendor/illuminate/support/composer.json +++ b/vendor/illuminate/support/composer.json @@ -14,15 +14,16 @@ } ], "require": { - "php": "^7.3|^8.0", + "php": "^8.0.2", "ext-json": "*", "ext-mbstring": "*", - "doctrine/inflector": "^1.4|^2.0", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "nesbot/carbon": "^2.31", - "voku/portable-ascii": "^1.4.8" + "doctrine/inflector": "^2.0", + "illuminate/collections": "^9.0", + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "nesbot/carbon": "^2.53.1", + "voku/portable-ascii": "^2.0" }, "conflict": { "tightenco/collect": "<5.5.33" @@ -37,16 +38,16 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0).", - "ramsey/uuid": "Required to use Str::uuid() (^4.0).", - "symfony/process": "Required to use the composer class (^5.1.4).", - "symfony/var-dumper": "Required to use the dd function (^5.1.4).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." + "illuminate/filesystem": "Required to use the composer class (^9.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^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).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, "config": { "sort-packages": true diff --git a/vendor/illuminate/support/helpers.php b/vendor/illuminate/support/helpers.php index 0b82fe7..6928cc3 100755 --- a/vendor/illuminate/support/helpers.php +++ b/vendor/illuminate/support/helpers.php @@ -6,6 +6,7 @@ use Illuminate\Support\Arr; use Illuminate\Support\Env; use Illuminate\Support\HigherOrderTapProxy; use Illuminate\Support\Optional; +use Illuminate\Support\Str; if (! function_exists('append_config')) { /** @@ -203,7 +204,7 @@ if (! function_exists('preg_replace_array')) { function preg_replace_array($pattern, array $replacements, $subject) { return preg_replace_callback($pattern, function () use (&$replacements) { - foreach ($replacements as $key => $value) { + foreach ($replacements as $value) { return array_shift($replacements); } }, $subject); @@ -214,7 +215,7 @@ if (! function_exists('retry')) { /** * Retry an operation a given number of times. * - * @param int $times + * @param int|array $times * @param callable $callback * @param int|\Closure $sleepMilliseconds * @param callable|null $when @@ -226,6 +227,14 @@ if (! function_exists('retry')) { { $attempts = 0; + $backoff = []; + + if (is_array($times)) { + $backoff = $times; + + $times = count($times) + 1; + } + beginning: $attempts++; $times--; @@ -237,6 +246,8 @@ if (! function_exists('retry')) { throw $e; } + $sleepMilliseconds = $backoff[$attempts - 1] ?? $sleepMilliseconds; + if ($sleepMilliseconds) { usleep(value($sleepMilliseconds, $attempts) * 1000); } @@ -246,6 +257,34 @@ if (! function_exists('retry')) { } } +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. @@ -368,9 +407,11 @@ if (! function_exists('with')) { /** * Return the given value, optionally passed through the given callback. * - * @param mixed $value - * @param callable|null $callback - * @return mixed + * @template TValue + * + * @param TValue $value + * @param (callable(TValue): TValue)|null $callback + * @return TValue */ function with($value, callable $callback = null) { diff --git a/vendor/nesbot/carbon/bin/carbon b/vendor/nesbot/carbon/bin/carbon index fdcbb5c..b53ab73 100755 --- a/vendor/nesbot/carbon/bin/carbon +++ b/vendor/nesbot/carbon/bin/carbon @@ -1,6 +1,8 @@ #!/usr/bin/env php + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +if (!class_exists(LazyMacro::class, false)) { + abstract class LazyMacro extends AbstractMacro + { + /** + * {@inheritdoc} + */ + public function getFileName(): ?string + { + return $this->reflectionFunction->getFileName(); + } + + /** + * {@inheritdoc} + */ + public function getStartLine(): ?int + { + return $this->reflectionFunction->getStartLine(); + } + + /** + * {@inheritdoc} + */ + public function getEndLine(): ?int + { + return $this->reflectionFunction->getEndLine(); + } + } +} diff --git a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php new file mode 100644 index 0000000..3e9fcf4 --- /dev/null +++ b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +if (!class_exists(LazyMacro::class, false)) { + abstract class LazyMacro extends AbstractMacro + { + /** + * {@inheritdoc} + * + * @return string|false + */ + public function getFileName() + { + return $this->reflectionFunction->getFileName(); + } + + /** + * {@inheritdoc} + * + * @return int|false + */ + public function getStartLine() + { + return $this->reflectionFunction->getStartLine(); + } + + /** + * {@inheritdoc} + * + * @return int|false + */ + public function getEndLine() + { + return $this->reflectionFunction->getEndLine(); + } + } +} diff --git a/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php b/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php new file mode 100644 index 0000000..d35308a --- /dev/null +++ b/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +if (!class_exists(LazyTranslator::class, false)) { + class LazyTranslator extends AbstractTranslator implements TranslatorStrongTypeInterface + { + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + return $this->translate($id, $parameters, $domain, $locale); + } + + public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages') + { + $messages = $this->getPrivateProperty($catalogue, 'messages'); + + if (isset($messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id])) { + return $messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id]; + } + + if (isset($messages[$domain][$id])) { + return $messages[$domain][$id]; + } + + $fallbackCatalogue = $this->getPrivateProperty($catalogue, 'fallbackCatalogue'); + + if ($fallbackCatalogue !== null) { + return $this->getFromCatalogue($fallbackCatalogue, $id, $domain); + } + + return $id; + } + + private function getPrivateProperty($instance, string $field) + { + return (function (string $field) { + return $this->$field; + })->call($instance, $field); + } + } +} diff --git a/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php b/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php new file mode 100644 index 0000000..94dbdc3 --- /dev/null +++ b/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +if (!class_exists(LazyTranslator::class, false)) { + class LazyTranslator extends AbstractTranslator + { + /** + * Returns the translation. + * + * @param string|null $id + * @param array $parameters + * @param string|null $domain + * @param string|null $locale + * + * @return string + */ + public function trans($id, array $parameters = [], $domain = null, $locale = null) + { + return $this->translate($id, $parameters, $domain, $locale); + } + } +} diff --git a/vendor/nesbot/carbon/readme.md b/vendor/nesbot/carbon/readme.md index 70279c1..5d82721 100644 --- a/vendor/nesbot/carbon/readme.md +++ b/vendor/nesbot/carbon/readme.md @@ -3,9 +3,7 @@ [![Latest Stable Version](https://img.shields.io/packagist/v/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) [![Total Downloads](https://img.shields.io/packagist/dt/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) [![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fbriannesbitt%2FCarbon%2Fbadge&style=flat-square&label=Build&logo=none)](https://actions-badge.atrox.dev/briannesbitt/Carbon/goto) -[![StyleCI](https://github.styleci.io/repos/5724990/shield?style=flat-square)](https://github.styleci.io/repos/5724990) [![codecov.io](https://img.shields.io/codecov/c/github/briannesbitt/Carbon.svg?style=flat-square)](https://codecov.io/github/briannesbitt/Carbon?branch=master) -[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-44CC11.svg?longCache=true&style=flat-square)](https://github.com/phpstan/phpstan) [![Tidelift](https://tidelift.com/badges/github/briannesbitt/Carbon)](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme) An international PHP extension for DateTime. [https://carbon.nesbot.com](https://carbon.nesbot.com) diff --git a/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php b/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php new file mode 100644 index 0000000..48441e7 --- /dev/null +++ b/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php @@ -0,0 +1,401 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Closure; +use ReflectionException; +use ReflectionFunction; +use Symfony\Component\Translation; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; +use Symfony\Component\Translation\Loader\ArrayLoader; + +abstract class AbstractTranslator extends Translation\Translator +{ + /** + * Translator singletons for each language. + * + * @var array + */ + protected static $singletons = []; + + /** + * List of custom localized messages. + * + * @var array + */ + protected $messages = []; + + /** + * List of custom directories that contain translation files. + * + * @var string[] + */ + protected $directories = []; + + /** + * Set to true while constructing. + * + * @var bool + */ + protected $initializing = false; + + /** + * List of locales aliases. + * + * @var string[] + */ + protected $aliases = [ + 'me' => 'sr_Latn_ME', + 'scr' => 'sh', + ]; + + /** + * Return a singleton instance of Translator. + * + * @param string|null $locale optional initial locale ("en" - english by default) + * + * @return static + */ + public static function get($locale = null) + { + $locale = $locale ?: 'en'; + $key = static::class === Translator::class ? $locale : static::class.'|'.$locale; + + if (!isset(static::$singletons[$key])) { + static::$singletons[$key] = new static($locale); + } + + return static::$singletons[$key]; + } + + public function __construct($locale, MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) + { + parent::setLocale($locale); + $this->initializing = true; + $this->directories = [__DIR__.'/Lang']; + $this->addLoader('array', new ArrayLoader()); + parent::__construct($locale, $formatter, $cacheDir, $debug); + $this->initializing = false; + } + + /** + * Returns the list of directories translation files are searched in. + * + * @return array + */ + public function getDirectories(): array + { + return $this->directories; + } + + /** + * Set list of directories translation files are searched in. + * + * @param array $directories new directories list + * + * @return $this + */ + public function setDirectories(array $directories) + { + $this->directories = $directories; + + return $this; + } + + /** + * Add a directory to the list translation files are searched in. + * + * @param string $directory new directory + * + * @return $this + */ + public function addDirectory(string $directory) + { + $this->directories[] = $directory; + + return $this; + } + + /** + * Remove a directory from the list translation files are searched in. + * + * @param string $directory directory path + * + * @return $this + */ + public function removeDirectory(string $directory) + { + $search = rtrim(strtr($directory, '\\', '/'), '/'); + + return $this->setDirectories(array_filter($this->getDirectories(), function ($item) use ($search) { + return rtrim(strtr($item, '\\', '/'), '/') !== $search; + })); + } + + /** + * Reset messages of a locale (all locale if no locale passed). + * Remove custom messages and reload initial messages from matching + * file in Lang directory. + * + * @param string|null $locale + * + * @return bool + */ + public function resetMessages($locale = null) + { + if ($locale === null) { + $this->messages = []; + + return true; + } + + foreach ($this->getDirectories() as $directory) { + $data = @include sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale); + + if ($data !== false) { + $this->messages[$locale] = $data; + $this->addResource('array', $this->messages[$locale], $locale); + + return true; + } + } + + return false; + } + + /** + * Returns the list of files matching a given locale prefix (or all if empty). + * + * @param string $prefix prefix required to filter result + * + * @return array + */ + public function getLocalesFiles($prefix = '') + { + $files = []; + + foreach ($this->getDirectories() as $directory) { + $directory = rtrim($directory, '\\/'); + + foreach (glob("$directory/$prefix*.php") as $file) { + $files[] = $file; + } + } + + return array_unique($files); + } + + /** + * Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * + * @param string $prefix prefix required to filter result + * + * @return array + */ + public function getAvailableLocales($prefix = '') + { + $locales = []; + foreach ($this->getLocalesFiles($prefix) as $file) { + $locales[] = substr($file, strrpos($file, '/') + 1, -4); + } + + return array_unique(array_merge($locales, array_keys($this->messages))); + } + + protected function translate(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + if ($domain === null) { + $domain = 'messages'; + } + + $catalogue = $this->getCatalogue($locale); + $format = $this instanceof TranslatorStrongTypeInterface + ? $this->getFromCatalogue($catalogue, (string) $id, $domain) // @codeCoverageIgnore + : $this->getCatalogue($locale)->get((string) $id, $domain); + + if ($format instanceof Closure) { + // @codeCoverageIgnoreStart + try { + $count = (new ReflectionFunction($format))->getNumberOfRequiredParameters(); + } catch (ReflectionException $exception) { + $count = 0; + } + // @codeCoverageIgnoreEnd + + return $format( + ...array_values($parameters), + ...array_fill(0, max(0, $count - \count($parameters)), null) + ); + } + + return parent::trans($id, $parameters, $domain, $locale); + } + + /** + * Init messages language from matching file in Lang directory. + * + * @param string $locale + * + * @return bool + */ + protected function loadMessagesFromFile($locale) + { + if (isset($this->messages[$locale])) { + return true; + } + + return $this->resetMessages($locale); + } + + /** + * Set messages of a locale and take file first if present. + * + * @param string $locale + * @param array $messages + * + * @return $this + */ + public function setMessages($locale, $messages) + { + $this->loadMessagesFromFile($locale); + $this->addResource('array', $messages, $locale); + $this->messages[$locale] = array_merge( + $this->messages[$locale] ?? [], + $messages + ); + + return $this; + } + + /** + * Set messages of the current locale and take file first if present. + * + * @param array $messages + * + * @return $this + */ + public function setTranslations($messages) + { + return $this->setMessages($this->getLocale(), $messages); + } + + /** + * Get messages of a locale, if none given, return all the + * languages. + * + * @param string|null $locale + * + * @return array + */ + public function getMessages($locale = null) + { + return $locale === null ? $this->messages : $this->messages[$locale]; + } + + /** + * Set the current translator locale and indicate if the source locale file exists + * + * @param string $locale locale ex. en + * + * @return bool + */ + public function setLocale($locale) + { + $locale = preg_replace_callback('/[-_]([a-z]{2,}|[0-9]{2,})/', function ($matches) { + // _2-letters or YUE is a region, _3+-letters is a variant + $upper = strtoupper($matches[1]); + + if ($upper === 'YUE' || $upper === 'ISO' || \strlen($upper) < 3) { + return "_$upper"; + } + + return '_'.ucfirst($matches[1]); + }, strtolower($locale)); + + $previousLocale = $this->getLocale(); + + if ($previousLocale === $locale && isset($this->messages[$locale])) { + return true; + } + + unset(static::$singletons[$previousLocale]); + + if ($locale === 'auto') { + $completeLocale = setlocale(LC_TIME, '0'); + $locale = preg_replace('/^([^_.-]+).*$/', '$1', $completeLocale); + $locales = $this->getAvailableLocales($locale); + + $completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale); + + $getScore = function ($language) use ($completeLocaleChunks) { + return self::compareChunkLists($completeLocaleChunks, preg_split('/[_.-]+/', $language)); + }; + + usort($locales, function ($first, $second) use ($getScore) { + return $getScore($second) <=> $getScore($first); + }); + + $locale = $locales[0]; + } + + if (isset($this->aliases[$locale])) { + $locale = $this->aliases[$locale]; + } + + // If subtag (ex: en_CA) first load the macro (ex: en) to have a fallback + if (str_contains($locale, '_') && + $this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale)) + ) { + parent::setLocale($macroLocale); + } + + if ($this->loadMessagesFromFile($locale) || $this->initializing) { + parent::setLocale($locale); + + return true; + } + + return false; + } + + /** + * Show locale on var_dump(). + * + * @return array + */ + public function __debugInfo() + { + return [ + 'locale' => $this->getLocale(), + ]; + } + + private static function compareChunkLists($referenceChunks, $chunks) + { + $score = 0; + + foreach ($referenceChunks as $index => $chunk) { + if (!isset($chunks[$index])) { + $score++; + + continue; + } + + if (strtolower($chunks[$index]) === strtolower($chunk)) { + $score += 10; + } + } + + return $score; + } +} diff --git a/vendor/nesbot/carbon/src/Carbon/Carbon.php b/vendor/nesbot/carbon/src/Carbon/Carbon.php index 3b68759..e327590 100644 --- a/vendor/nesbot/carbon/src/Carbon/Carbon.php +++ b/vendor/nesbot/carbon/src/Carbon/Carbon.php @@ -8,9 +8,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Traits\Date; +use Carbon\Traits\DeprecatedProperties; use DateTime; use DateTimeInterface; use DateTimeZone; @@ -18,6 +20,8 @@ use DateTimeZone; /** * A simple API extension for DateTime. * + * @mixin DeprecatedProperties + * * * * @property int $year @@ -34,10 +38,6 @@ use DateTimeZone; * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English - * @property string $localeDayOfWeek the day of week in current locale LC_TIME - * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME - * @property string $localeMonth the month in current locale LC_TIME - * @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME * @property int $milliseconds * @property int $millisecond * @property int $milli diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php b/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php index eb0a709..1ce967b 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use DateTimeInterface; diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php b/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php index cb1c498..6d1194e 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php @@ -8,9 +8,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Traits\Date; +use Carbon\Traits\DeprecatedProperties; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; @@ -18,6 +20,8 @@ use DateTimeZone; /** * A simple API extension for DateTimeImmutable. * + * @mixin DeprecatedProperties + * * * * @property int $year @@ -34,10 +38,6 @@ use DateTimeZone; * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English - * @property string $localeDayOfWeek the day of week in current locale LC_TIME - * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME - * @property string $localeMonth the month in current locale LC_TIME - * @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME * @property int $milliseconds * @property int $millisecond * @property int $milli diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php index 8f09507..15e2061 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use BadMethodCallException; @@ -27,6 +28,7 @@ use DateTimeZone; use JsonSerializable; use ReflectionException; use ReturnTypeWillChange; +use Symfony\Component\Translation\TranslatorInterface; use Throwable; /** @@ -48,10 +50,6 @@ use Throwable; * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English - * @property string $localeDayOfWeek the day of week in current locale LC_TIME - * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME - * @property string $localeMonth the month in current locale LC_TIME - * @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME * @property int $milliseconds * @property int $millisecond * @property int $milli @@ -1270,7 +1268,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable /** * Get the difference as a CarbonInterval instance. - * Return absolute interval (always positive) unless you pass false to the second argument. + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference @@ -1312,6 +1311,10 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) + * - 'skip' entry, list of units to skip (array of strings or a single string, + * ` it can be the unit name (singular or plural) or its shortcut + * ` (y, m, w, d, h, min, s, ms, µs). + * - 'aUnit' entry, prefer "an hour" over "1 hour" if true * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string @@ -1320,6 +1323,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) + * - 'minimumUnit' entry determines the smallest unit of time to display can be long or + * ` short form of the units, e.g. 'hour' or 'h' (default value: s) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers @@ -1962,6 +1967,10 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * Format the instance with the current locale. You can set the current * locale using setlocale() https://php.net/setlocale. * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat() instead. + * Deprecated since 2.55.0 + * * @param string $format * * @return string @@ -2148,6 +2157,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable /** * {@inheritdoc} + * + * @return array */ #[ReturnTypeWillChange] public static function getLastErrors(); @@ -2259,6 +2270,13 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable */ public static function getTimeFormatByPrecision($unitPrecision); + /** + * Returns the timestamp with millisecond precision. + * + * @return int + */ + public function getTimestampMs(); + /** * Get the translation of the current week day name (with context for languages with multiple forms). * @@ -3332,6 +3350,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. * * @see https://php.net/manual/en/datetime.modify.php + * + * @return static|false */ #[ReturnTypeWillChange] public function modify($modify); @@ -3792,7 +3812,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * * @return $this */ - public function setLocalTranslator(\Symfony\Component\Translation\TranslatorInterface $translator); + public function setLocalTranslator(TranslatorInterface $translator); /** * Set the current translator locale and indicate if the source locale file exists. @@ -3832,6 +3852,9 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * Note the timezone parameter was left out of the examples above and * has no affect as the mock value will be returned regardless of its value. * + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * * To clear the test instance call this method using the default * parameter of null. * @@ -3841,6 +3864,27 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable */ public static function setTestNow($testNow = null); + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public static function setTestNowAndTimezone($testNow = null, $tz = null); + /** * Resets the current time of the DateTime object to a different time. * @@ -3917,7 +3961,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * * @return void */ - public static function setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator); + public static function setTranslator(TranslatorInterface $translator); /** * Set specified unit to new given value. @@ -4772,14 +4816,15 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable /** * Translate using translation string or callback available. * - * @param string $key - * @param array $parameters - * @param string|int|float|null $number - * @param \Symfony\Component\Translation\TranslatorInterface $translator + * @param string $key + * @param array $parameters + * @param string|int|float|null $number + * @param \Symfony\Component\Translation\TranslatorInterface|null $translator + * @param bool $altNumbers * * @return string */ - public function translate(string $key, array $parameters = [], $number = null, ?\Symfony\Component\Translation\TranslatorInterface $translator = null, bool $altNumbers = false): string; + public function translate(string $key, array $parameters = [], $number = null, ?TranslatorInterface $translator = null, bool $altNumbers = false): string; /** * Returns the alternative number for a given integer if available in the current locale. @@ -4828,7 +4873,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * * @return string */ - public static function translateWith(\Symfony\Component\Translation\TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string; + public static function translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string; /** * Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) @@ -5012,8 +5057,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * * /!\ Use this method for unit tests only. * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure|null $callback * * @return mixed */ diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php index 2eb1a03..d465bea 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Exceptions\BadFluentConstructorException; @@ -191,14 +192,14 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Interval spec period designators */ - const PERIOD_PREFIX = 'P'; - const PERIOD_YEARS = 'Y'; - const PERIOD_MONTHS = 'M'; - const PERIOD_DAYS = 'D'; - const PERIOD_TIME_PREFIX = 'T'; - const PERIOD_HOURS = 'H'; - const PERIOD_MINUTES = 'M'; - const PERIOD_SECONDS = 'S'; + public const PERIOD_PREFIX = 'P'; + public const PERIOD_YEARS = 'Y'; + public const PERIOD_MONTHS = 'M'; + public const PERIOD_DAYS = 'D'; + public const PERIOD_TIME_PREFIX = 'T'; + public const PERIOD_HOURS = 'H'; + public const PERIOD_MINUTES = 'M'; + public const PERIOD_SECONDS = 'S'; /** * A translator to ... er ... translate stuff @@ -364,7 +365,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface if ($years instanceof DateInterval) { parent::__construct(static::getDateIntervalSpec($years)); $this->f = $years->f; - static::copyNegativeUnits($years, $this); + self::copyNegativeUnits($years, $this); return; } @@ -415,7 +416,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface { $source = self::standardizeUnit($source); $target = self::standardizeUnit($target); - $factors = static::getFlipCascadeFactors(); + $factors = self::getFlipCascadeFactors(); if (isset($factors[$source])) { [$to, $factor] = $factors[$source]; @@ -430,6 +431,37 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface return null; } + /** + * Returns the factor for a given source-to-target couple if set, + * else try to find the appropriate constant as the factor, such as Carbon::DAYS_PER_WEEK. + * + * @param string $source + * @param string $target + * + * @return int|null + */ + public static function getFactorWithDefault($source, $target) + { + $factor = self::getFactor($source, $target); + + if ($factor) { + return $factor; + } + + static $defaults = [ + 'month' => ['year' => Carbon::MONTHS_PER_YEAR], + 'week' => ['month' => Carbon::WEEKS_PER_MONTH], + 'day' => ['week' => Carbon::DAYS_PER_WEEK], + 'hour' => ['day' => Carbon::HOURS_PER_DAY], + 'minute' => ['hour' => Carbon::MINUTES_PER_HOUR], + 'second' => ['minute' => Carbon::SECONDS_PER_MINUTE], + 'millisecond' => ['second' => Carbon::MILLISECONDS_PER_SECOND], + 'microsecond' => ['millisecond' => Carbon::MICROSECONDS_PER_MILLISECOND], + ]; + + return $defaults[$source][$target] ?? null; + } + /** * Returns current config for days per week. * @@ -522,10 +554,10 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface * echo Carboninterval::createFromFormat('H:i', '1:30'); * ``` * - * @param string $format Format of the $interval input string - * @param string $interval Input string to convert into an interval + * @param string $format Format of the $interval input string + * @param string|null $interval Input string to convert into an interval * - * @throws Exception when the $interval cannot be parsed as an interval. + * @throws \Carbon\Exceptions\ParseErrorException when the $interval cannot be parsed as an interval. * * @return static */ @@ -866,10 +898,10 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface } if ($interval instanceof self && is_a($className, self::class, true)) { - static::copyStep($interval, $instance); + self::copyStep($interval, $instance); } - static::copyNegativeUnits($interval, $instance); + self::copyNegativeUnits($interval, $instance); return $instance; } @@ -1376,7 +1408,11 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface $altNumbers = false; $aUnit = false; $minimumUnit = 's'; + $skip = []; extract($this->getForHumansInitialVariables($syntax, $short)); + $skip = array_filter((array) $skip, static function ($value) { + return \is_string($value) && $value !== ''; + }); if ($syntax === null) { $syntax = CarbonInterface::DIFF_ABSOLUTE; @@ -1439,7 +1475,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface ':optional-space' => $optionalSpace, ]; - return [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit]; + return [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip]; } protected static function getRoundingMethodFromOptions(int $options): ?string @@ -1543,6 +1579,9 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) + * - 'skip' entry, list of units to skip (array of strings or a single string, + * ` it can be the unit name (singular or plural) or its shortcut + * ` (y, m, w, d, h, min, s, ms, µs). * - 'aUnit' entry, prefer "an hour" over "1 hour" if true * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue @@ -1569,11 +1608,12 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface */ public function forHumans($syntax = null, $short = false, $parts = -1, $options = null) { - [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit] = $this->getForHumansParameters($syntax, $short, $parts, $options); + [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip] = $this + ->getForHumansParameters($syntax, $short, $parts, $options); $interval = []; - $syntax = (int) ($syntax === null ? CarbonInterface::DIFF_ABSOLUTE : $syntax); + $syntax = (int) ($syntax ?? CarbonInterface::DIFF_ABSOLUTE); $absolute = $syntax === CarbonInterface::DIFF_ABSOLUTE; $relativeToNow = $syntax === CarbonInterface::DIFF_RELATIVE_TO_NOW; $count = 1; @@ -1614,8 +1654,14 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface \count($intervalValues->getNonZeroValues()) > $parts && ($count = \count($keys = array_keys($intervalValues->getValuesSequence()))) > 1 ) { + $index = min($count, $previousCount - 1) - 2; + + if ($index < 0) { + break; + } + $intervalValues = $this->copy()->roundUnit( - $keys[min($count, $previousCount - 1) - 2], + $keys[$index], 1, $method ); @@ -1635,6 +1681,21 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface ['value' => $intervalValues->microExcludeMilli, 'unit' => 'microsecond', 'unitShort' => 'µs'], ]; + if (!empty($skip)) { + foreach ($diffIntervalArray as $index => &$unitData) { + $nextIndex = $index + 1; + + if ($unitData['value'] && + isset($diffIntervalArray[$nextIndex]) && + \count(array_intersect([$unitData['unit'], $unitData['unit'].'s', $unitData['unitShort']], $skip)) + ) { + $diffIntervalArray[$nextIndex]['value'] += $unitData['value'] * + self::getFactorWithDefault($diffIntervalArray[$nextIndex]['unit'], $unitData['unit']); + $unitData['value'] = 0; + } + } + } + $transChoice = function ($short, $unitData) use ($absolute, $handleDeclensions, $translator, $aUnit, $altNumbers, $interpolations) { $count = $unitData['value']; @@ -1660,6 +1721,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface }; $fallbackUnit = ['second', 's']; + foreach ($diffIntervalArray as $diffIntervalData) { if ($diffIntervalData['value'] > 0) { $unit = $short ? $diffIntervalData['unitShort'] : $diffIntervalData['unit']; @@ -1905,8 +1967,8 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Add given parameters to the current interval. * - * @param int $years - * @param int $months + * @param int $years + * @param int $months * @param int|float $weeks * @param int|float $days * @param int|float $hours @@ -1935,8 +1997,8 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Add given parameters to the current interval. * - * @param int $years - * @param int $months + * @param int $years + * @param int $months * @param int|float $weeks * @param int|float $days * @param int|float $hours @@ -2171,7 +2233,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface unset($originalData['days']); $newData = $originalData; - foreach (static::getFlipCascadeFactors() as $source => [$target, $factor]) { + foreach (self::getFlipCascadeFactors() as $source => [$target, $factor]) { foreach (['source', 'target'] as $key) { if ($$key === 'dayz') { $$key = 'daysExcludeWeeks'; @@ -2261,7 +2323,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface $result = 0; $cumulativeFactor = 0; $unitFound = false; - $factors = static::getFlipCascadeFactors(); + $factors = self::getFlipCascadeFactors(); $daysPerWeek = static::getDaysPerWeek(); $values = [ diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php index ae11026..0e81e75 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Exceptions\InvalidCastException; @@ -162,6 +163,8 @@ use RuntimeException; * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CarbonPeriod implements Iterator, Countable, JsonSerializable { @@ -172,17 +175,23 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable use Options; /** - * Built-in filters. + * Built-in filter for limit by recurrences. * - * @var string + * @var callable */ public const RECURRENCES_FILTER = [self::class, 'filterRecurrences']; + + /** + * Built-in filter for limit to an end. + * + * @var callable + */ public const END_DATE_FILTER = [self::class, 'filterEndDate']; /** * Special value which can be returned by filters to end iteration. Also a filter. * - * @var string + * @var callable */ public const END_ITERATION = [self::class, 'endIteration']; @@ -475,8 +484,8 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable $end = null; foreach (explode('/', $iso) as $key => $part) { - if ($key === 0 && preg_match('/^R([0-9]*)$/', $part, $match)) { - $parsed = \strlen($match[1]) ? (int) $match[1] : null; + if ($key === 0 && preg_match('/^R([0-9]*|INF)$/', $part, $match)) { + $parsed = \strlen($match[1]) ? (($match[1] !== 'INF') ? (int) $match[1] : INF) : null; } elseif ($interval === null && $parsed = CarbonInterval::make($part)) { $interval = $part; } elseif ($start === null && $parsed = Carbon::make($part)) { @@ -1310,6 +1319,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return bool */ + #[ReturnTypeWillChange] public function valid() { return $this->validateCurrentDate() === true; @@ -1320,6 +1330,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return int|null */ + #[ReturnTypeWillChange] public function key() { return $this->valid() @@ -1332,6 +1343,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return CarbonInterface|null */ + #[ReturnTypeWillChange] public function current() { return $this->valid() @@ -1346,6 +1358,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return void */ + #[ReturnTypeWillChange] public function next() { if ($this->current === null) { @@ -1372,6 +1385,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return void */ + #[ReturnTypeWillChange] public function rewind() { $this->key = 0; @@ -1545,6 +1559,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return int */ + #[ReturnTypeWillChange] public function count() { return \count($this->toArray()); @@ -1620,14 +1635,14 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable return $this->setStartDate($first, $second); case 'sinceNow': - return $this->setStartDate(new Carbon, $first); + return $this->setStartDate(new Carbon(), $first); case 'end': case 'until': return $this->setEndDate($first, $second); case 'untilNow': - return $this->setEndDate(new Carbon, $first); + return $this->setEndDate(new Carbon(), $first); case 'dates': case 'between': @@ -2166,7 +2181,10 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable */ public function round($precision = null, $function = 'round') { - return $this->roundWith($precision ?? (string) $this->getDateInterval(), $function); + return $this->roundWith( + $precision ?? $this->getDateInterval()->setLocalTranslator(TranslatorImmutable::get('en'))->forHumans(), + $function + ); } /** @@ -2398,11 +2416,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable } // Check after the first rewind to avoid repeating the initial validation. - if ($this->validationResult !== null) { - return $this->validationResult; - } - - return $this->validationResult = $this->checkFilters(); + return $this->validationResult ?? ($this->validationResult = $this->checkFilters()); } /** diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php b/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php index 2bd36c4..b4d16ba 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php @@ -8,12 +8,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Exceptions\InvalidCastException; use Carbon\Exceptions\InvalidTimeZoneException; use DateTimeInterface; use DateTimeZone; +use Throwable; class CarbonTimeZone extends DateTimeZone { @@ -198,7 +200,7 @@ class CarbonTimeZone extends DateTimeZone // @codeCoverageIgnoreStart try { $offset = @$this->getOffset($date) ?: 0; - } catch (\Throwable $e) { + } catch (Throwable $e) { $offset = 0; } // @codeCoverageIgnoreEnd diff --git a/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php b/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php index d53b1f4..4f35d6c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php +++ b/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\Cli; class Invoker diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php index 35c5558..ccc457f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php index 3239743..bf476a7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; @@ -12,6 +17,8 @@ class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrin { /** * {@inheritdoc} + * + * @return string */ public function getName() { @@ -20,6 +27,8 @@ class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrin /** * {@inheritdoc} + * + * @return bool */ public function requiresSQLCommentHint(AbstractPlatform $platform) { diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php index e5f52c7..9289d84 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; @@ -12,6 +17,8 @@ class CarbonType extends DateTimeType implements CarbonDoctrineType { /** * {@inheritdoc} + * + * @return string */ public function getName() { @@ -20,6 +27,8 @@ class CarbonType extends DateTimeType implements CarbonDoctrineType /** * {@inheritdoc} + * + * @return bool */ public function requiresSQLCommentHint(AbstractPlatform $platform) { diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php index fa0d5b0..ecfe17e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Carbon\Carbon; @@ -26,11 +31,21 @@ trait CarbonTypeConverter return Carbon::class; } + /** + * @return string + */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { - $precision = ($fieldDeclaration['precision'] ?: 10) === 10 - ? DateTimeDefaultPrecision::get() - : $fieldDeclaration['precision']; + $precision = $fieldDeclaration['precision'] ?: 10; + + if ($fieldDeclaration['secondPrecision'] ?? false) { + $precision = 0; + } + + if ($precision === 10) { + $precision = DateTimeDefaultPrecision::get(); + } + $type = parent::getSQLDeclaration($fieldDeclaration, $platform); if (!$precision) { diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php index f9744b8..642fd41 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; class DateTimeDefaultPrecision diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php index bc2aa79..b3a0871 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php index a9f453e..d5cd556 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php index 7a28f39..1d7ec54 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php index 307a4ee..73c2dd8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface BadMethodCallException extends Exception diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php index 86e8a15..3bbbd77 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface Exception diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php index 5fb1c68..a48d4f9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php index 60ed740..9739f4d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface InvalidArgumentException extends Exception diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php index 77466c7..d2f3701 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php index f5dbfe2..99bb91c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php index dd26a90..3341b49 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php index b4c76dc..5f9f142 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php index abe1aef..a37e3f5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php index b061ef1..ede4771 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php index 03bd8ac..892e16e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php index bc124a6..3fbe3fc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php index 78ce939..2b4c48e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Carbon\CarbonInterface; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php index 8bdda85..41bb629 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php index 8aab192..adbc36c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php index 33cd1b5..54822d9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php index 3510b40..0314c5d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php index 6ca5f5f..24bf5a6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface RuntimeException extends Exception diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php index 838847b..8bd8653 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php index 7f8ec9e..39ee12c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php index 4591d35..6c8c01b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php index 3646872..901db98 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php index 5020369..c9e9c9f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php index d2f76ee..d965c82 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php index b38ae12..6f8b39f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/vendor/nesbot/carbon/src/Carbon/Factory.php b/vendor/nesbot/carbon/src/Carbon/Factory.php index a614043..f8c7289 100644 --- a/vendor/nesbot/carbon/src/Carbon/Factory.php +++ b/vendor/nesbot/carbon/src/Carbon/Factory.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Closure; @@ -19,208 +20,222 @@ use ReflectionMethod; * * * - * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a - * new instance. - * @method Carbon|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * @method Carbon createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. - * @method Carbon|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method Carbon|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * @method Carbon|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. - * @method Carbon|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. - * @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. - * @method Carbon createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. - * @method Carbon createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. - * @method Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. - * @method Carbon disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method Carbon enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * @method Carbon fromSerialized($value) Create an instance from a serialized string. - * @method void genericMacro($macro, $priority = 0) Register a custom macro. - * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * @method array getDays() Get the days of the week - * @method string|null getFallbackLocale() Get the fallback locale. - * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). - * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). - * @method array getIsoUnits() Returns list of locale units for ISO formatting. - * @method Carbon getLastErrors() {@inheritdoc} - * @method string getLocale() Get the current translator locale. - * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. - * @method int getMidDayAt() get midday/noon hour - * @method Closure|Carbon getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. - * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. - * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. - * @method int getWeekEndsAt() Get the last day of week - * @method int getWeekStartsAt() Get the first day of week - * @method array getWeekendDays() Get weekend days - * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasMacro($name) Checks if macro is registered globally. - * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. - * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * @method Carbon instance($date) Create a Carbon instance from a DateTime one. - * @method bool isImmutable() Returns true if the current class/instance is immutable. - * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. - * @method bool isMutable() Returns true if the current class/instance is mutable. - * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * @method void macro($name, $macro) Register a custom macro. - * @method Carbon|null make($var) Make a Carbon instance from given variable if possible. - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * @method Carbon maxValue() Create a Carbon instance for the greatest supported date. - * @method Carbon minValue() Create a Carbon instance for the lowest supported date. - * @method void mixin($mixin) Mix another object into the class. - * @method Carbon now($tz = null) Get a Carbon instance for the current date and time. - * @method Carbon parse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method Carbon parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). - * @method Carbon|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method Carbon rawParse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method Carbon resetMacros() Remove all macros and generic macros. - * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string - * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * JSON serialize all Carbon instances using the given callback. - * @method Carbon setFallbackLocale($locale) Set the fallback locale. - * @method Carbon setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * Set midday/noon hour - * @method Carbon setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump an other string - * format. - * Set the default format used when type juggling a Carbon instance to a string - * @method void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) Set the default translator instance to use. - * @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * Set if UTF8 will be used for localized date/time. - * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * Set the last day of week - * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * Set the first day of week - * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * Set weekend days - * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). - * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). - * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). - * @method Carbon today($tz = null) Create a Carbon instance for today. - * @method Carbon tomorrow($tz = null) Create a Carbon instance for tomorrow. - * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. - * @method string translateWith(\Symfony\Component\Translation\TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. - * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method Carbon useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * /!\ Use this method for unit tests only. - * @method Carbon yesterday($tz = null) Create a Carbon instance for yesterday. + * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a + * new instance. + * @method Carbon|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * @method Carbon createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. + * @method Carbon|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method Carbon|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * @method Carbon|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. + * @method Carbon|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. + * @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. + * @method Carbon createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. + * @method Carbon createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. + * @method Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. + * @method Carbon disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method Carbon enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * @method Carbon fromSerialized($value) Create an instance from a serialized string. + * @method void genericMacro($macro, $priority = 0) Register a custom macro. + * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * @method array getDays() Get the days of the week + * @method string|null getFallbackLocale() Get the fallback locale. + * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). + * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). + * @method array getIsoUnits() Returns list of locale units for ISO formatting. + * @method array getLastErrors() {@inheritdoc} + * @method string getLocale() Get the current translator locale. + * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. + * @method int getMidDayAt() get midday/noon hour + * @method Closure|Carbon getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" + * instance is created. + * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. + * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. + * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. + * @method int getWeekEndsAt() Get the last day of week + * @method int getWeekStartsAt() Get the first day of week + * @method array getWeekendDays() Get weekend days + * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasMacro($name) Checks if macro is registered globally. + * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. + * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance + * is anything that is not null. + * @method Carbon instance($date) Create a Carbon instance from a DateTime one. + * @method bool isImmutable() Returns true if the current class/instance is immutable. + * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. + * @method bool isMutable() Returns true if the current class/instance is mutable. + * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. + * (It can be overridden in specific instances.) + * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * @method void macro($name, $macro) Register a custom macro. + * @method Carbon|null make($var) Make a Carbon instance from given variable if possible. + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * @method Carbon maxValue() Create a Carbon instance for the greatest supported date. + * @method Carbon minValue() Create a Carbon instance for the lowest supported date. + * @method void mixin($mixin) Mix another object into the class. + * @method Carbon now($tz = null) Get a Carbon instance for the current date and time. + * @method Carbon parse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method Carbon parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). + * @method Carbon|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method Carbon rawParse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method Carbon resetMacros() Remove all macros and generic macros. + * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string + * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather transform Carbon object before the serialization. + * JSON serialize all Carbon instances using the given callback. + * @method Carbon setFallbackLocale($locale) Set the fallback locale. + * @method Carbon setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use closest language from the current LC_TIME locale. + * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * Set midday/noon hour + * @method Carbon setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * Note the timezone parameter was left out of the examples above and + * has no affect as the mock value will be returned regardless of its value. + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method Carbon setTestNowAndTimezone($testNow = null, $tz = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and + * use other method or custom format passed to format() method if you need to dump an other string + * format. + * Set the default format used when type juggling a Carbon instance to a string + * @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use. + * @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use UTF-8 language packages on every machine. + * Set if UTF8 will be used for localized date/time. + * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek + * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the + * start of week according to current locale selected and implicitly the end of week. + * Set the last day of week + * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the + * 'first_day_of_week' locale setting to change the start of week according to current locale + * selected and implicitly the end of week. + * Set the first day of week + * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider week-end is always saturday and sunday, and if you have some custom + * week-end days to handle, give to those days an other name and create a macro for them: + * ``` + * Carbon::macro('isDayOff', function ($date) { + * return $date->isSunday() || $date->isMonday(); + * }); + * Carbon::macro('isNotDayOff', function ($date) { + * return !$date->isDayOff(); + * }); + * if ($someDate->isDayOff()) ... + * if ($someDate->isNotDayOff()) ... + * // Add 5 not-off days + * $count = 5; + * while ($someDate->isDayOff() || ($count-- > 0)) { + * $someDate->addDay(); + * } + * ``` + * Set weekend days + * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). + * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). + * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). + * @method Carbon today($tz = null) Create a Carbon instance for today. + * @method Carbon tomorrow($tz = null) Create a Carbon instance for tomorrow. + * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. + * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. + * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method Carbon useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. + * Using setTestNow to set the date, executing the callback, then + * clearing the test instance. + * /!\ Use this method for unit tests only. + * @method Carbon yesterday($tz = null) Create a Carbon instance for yesterday. * * */ diff --git a/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php b/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php index 3aa286c..596ee80 100644 --- a/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php +++ b/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Closure; @@ -17,208 +18,222 @@ use Closure; * * * - * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a - * new instance. - * @method CarbonImmutable|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. - * @method CarbonImmutable|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method CarbonImmutable|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * @method CarbonImmutable|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. - * @method CarbonImmutable|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. - * @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. - * @method CarbonImmutable createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. - * @method CarbonImmutable createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. - * @method CarbonImmutable|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. - * @method CarbonImmutable disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method CarbonImmutable enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string. - * @method void genericMacro($macro, $priority = 0) Register a custom macro. - * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * @method array getDays() Get the days of the week - * @method string|null getFallbackLocale() Get the fallback locale. - * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). - * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). - * @method array getIsoUnits() Returns list of locale units for ISO formatting. - * @method CarbonImmutable getLastErrors() {@inheritdoc} - * @method string getLocale() Get the current translator locale. - * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. - * @method int getMidDayAt() get midday/noon hour - * @method Closure|CarbonImmutable getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. - * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. - * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. - * @method int getWeekEndsAt() Get the last day of week - * @method int getWeekStartsAt() Get the first day of week - * @method array getWeekendDays() Get weekend days - * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasMacro($name) Checks if macro is registered globally. - * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. - * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * @method CarbonImmutable instance($date) Create a Carbon instance from a DateTime one. - * @method bool isImmutable() Returns true if the current class/instance is immutable. - * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. - * @method bool isMutable() Returns true if the current class/instance is mutable. - * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * @method void macro($name, $macro) Register a custom macro. - * @method CarbonImmutable|null make($var) Make a Carbon instance from given variable if possible. - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date. - * @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date. - * @method void mixin($mixin) Mix another object into the class. - * @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time. - * @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method CarbonImmutable parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). - * @method CarbonImmutable|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method CarbonImmutable rawParse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method CarbonImmutable resetMacros() Remove all macros and generic macros. - * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string - * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * JSON serialize all Carbon instances using the given callback. - * @method CarbonImmutable setFallbackLocale($locale) Set the fallback locale. - * @method CarbonImmutable setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * Set midday/noon hour - * @method CarbonImmutable setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump an other string - * format. - * Set the default format used when type juggling a Carbon instance to a string - * @method void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) Set the default translator instance to use. - * @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * Set if UTF8 will be used for localized date/time. - * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * Set the last day of week - * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * Set the first day of week - * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * Set weekend days - * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). - * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). - * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). - * @method CarbonImmutable today($tz = null) Create a Carbon instance for today. - * @method CarbonImmutable tomorrow($tz = null) Create a Carbon instance for tomorrow. - * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. - * @method string translateWith(\Symfony\Component\Translation\TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. - * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method CarbonImmutable useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * /!\ Use this method for unit tests only. - * @method CarbonImmutable yesterday($tz = null) Create a Carbon instance for yesterday. + * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a + * new instance. + * @method CarbonImmutable|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. + * @method CarbonImmutable|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method CarbonImmutable|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * @method CarbonImmutable|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. + * @method CarbonImmutable|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. + * @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. + * @method CarbonImmutable createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. + * @method CarbonImmutable createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. + * @method CarbonImmutable|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. + * @method CarbonImmutable disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method CarbonImmutable enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string. + * @method void genericMacro($macro, $priority = 0) Register a custom macro. + * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * @method array getDays() Get the days of the week + * @method string|null getFallbackLocale() Get the fallback locale. + * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). + * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). + * @method array getIsoUnits() Returns list of locale units for ISO formatting. + * @method array getLastErrors() {@inheritdoc} + * @method string getLocale() Get the current translator locale. + * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. + * @method int getMidDayAt() get midday/noon hour + * @method Closure|CarbonImmutable getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" + * instance is created. + * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. + * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. + * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. + * @method int getWeekEndsAt() Get the last day of week + * @method int getWeekStartsAt() Get the first day of week + * @method array getWeekendDays() Get weekend days + * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasMacro($name) Checks if macro is registered globally. + * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. + * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance + * is anything that is not null. + * @method CarbonImmutable instance($date) Create a Carbon instance from a DateTime one. + * @method bool isImmutable() Returns true if the current class/instance is immutable. + * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. + * @method bool isMutable() Returns true if the current class/instance is mutable. + * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. + * (It can be overridden in specific instances.) + * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * @method void macro($name, $macro) Register a custom macro. + * @method CarbonImmutable|null make($var) Make a Carbon instance from given variable if possible. + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date. + * @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date. + * @method void mixin($mixin) Mix another object into the class. + * @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time. + * @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method CarbonImmutable parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). + * @method CarbonImmutable|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method CarbonImmutable rawParse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method CarbonImmutable resetMacros() Remove all macros and generic macros. + * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string + * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather transform Carbon object before the serialization. + * JSON serialize all Carbon instances using the given callback. + * @method CarbonImmutable setFallbackLocale($locale) Set the fallback locale. + * @method CarbonImmutable setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use closest language from the current LC_TIME locale. + * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * Set midday/noon hour + * @method CarbonImmutable setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * Note the timezone parameter was left out of the examples above and + * has no affect as the mock value will be returned regardless of its value. + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method CarbonImmutable setTestNowAndTimezone($testNow = null, $tz = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and + * use other method or custom format passed to format() method if you need to dump an other string + * format. + * Set the default format used when type juggling a Carbon instance to a string + * @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use. + * @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use UTF-8 language packages on every machine. + * Set if UTF8 will be used for localized date/time. + * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek + * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the + * start of week according to current locale selected and implicitly the end of week. + * Set the last day of week + * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the + * 'first_day_of_week' locale setting to change the start of week according to current locale + * selected and implicitly the end of week. + * Set the first day of week + * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider week-end is always saturday and sunday, and if you have some custom + * week-end days to handle, give to those days an other name and create a macro for them: + * ``` + * Carbon::macro('isDayOff', function ($date) { + * return $date->isSunday() || $date->isMonday(); + * }); + * Carbon::macro('isNotDayOff', function ($date) { + * return !$date->isDayOff(); + * }); + * if ($someDate->isDayOff()) ... + * if ($someDate->isNotDayOff()) ... + * // Add 5 not-off days + * $count = 5; + * while ($someDate->isDayOff() || ($count-- > 0)) { + * $someDate->addDay(); + * } + * ``` + * Set weekend days + * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). + * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). + * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). + * @method CarbonImmutable today($tz = null) Create a Carbon instance for today. + * @method CarbonImmutable tomorrow($tz = null) Create a Carbon instance for tomorrow. + * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. + * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. + * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method CarbonImmutable useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. + * Using setTestNow to set the date, executing the callback, then + * clearing the test instance. + * /!\ Use this method for unit tests only. + * @method CarbonImmutable yesterday($tz = null) Create a Carbon instance for yesterday. * * */ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php b/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php index 40d8d86..f2fcf05 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/af.php', [ 'meridiem' => ['v', 'n'], 'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php index 93f4c83..27896bd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/af.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/agq.php b/vendor/nesbot/carbon/src/Carbon/Lang/agq.php index 58c7a11..7011464 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/agq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/agq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a.g', 'a.k'], 'weekdays' => ['tsuʔntsɨ', 'tsuʔukpà', 'tsuʔughɔe', 'tsuʔutɔ̀mlò', 'tsuʔumè', 'tsuʔughɨ̂m', 'tsuʔndzɨkɔʔɔ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php index 8d377ad..e790b99 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php index 8d377ad..e790b99 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php index 8d377ad..e790b99 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php index 8d377ad..e790b99 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php index 8d377ad..e790b99 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php index 8d377ad..e790b99 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php index 8d377ad..e790b99 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php index 8d377ad..e790b99 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php index 8d377ad..e790b99 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/asa.php b/vendor/nesbot/carbon/src/Carbon/Lang/asa.php index 8389757..03bb483 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/asa.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/asa.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['icheheavo', 'ichamthi'], 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php index d697918..28fc62f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/az.php', [ 'weekdays' => ['базар', 'базар ертәси', 'чәршәнбә ахшамы', 'чәршәнбә', 'ҹүмә ахшамы', 'ҹүмә', 'шәнбә'], 'weekdays_short' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php index 8346a5d..0be3391 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/az.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bas.php b/vendor/nesbot/carbon/src/Carbon/Lang/bas.php index 1b342bb..41bfa1d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bas.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bas.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['I bikɛ̂glà', 'I ɓugajɔp'], 'weekdays' => ['ŋgwà nɔ̂y', 'ŋgwà njaŋgumba', 'ŋgwà ûm', 'ŋgwà ŋgê', 'ŋgwà mbɔk', 'ŋgwà kɔɔ', 'ŋgwà jôn'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/be.php b/vendor/nesbot/carbon/src/Carbon/Lang/be.php index ce8dbe8..51b4d0c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/be.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/be.php @@ -8,9 +8,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + // @codeCoverageIgnoreStart + +use Carbon\CarbonInterface; +use Symfony\Component\Translation\PluralizationRules; + if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - \Symfony\Component\Translation\PluralizationRules::set(function ($number) { + PluralizationRules::set(function ($number) { return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); }, 'be'); } @@ -113,7 +118,7 @@ return [ 'nextDay' => '[Заўтра ў] LT', 'nextWeek' => '[У] dddd [ў] LT', 'lastDay' => '[Учора ў] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 1: case 2: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bez.php b/vendor/nesbot/carbon/src/Carbon/Lang/bez.php index 1facc9d..d59c5ef 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bez.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bez.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['pamilau', 'pamunyi'], 'weekdays' => ['pa mulungu', 'pa shahuviluha', 'pa hivili', 'pa hidatu', 'pa hitayi', 'pa hihanu', 'pa shahulembela'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bg.php b/vendor/nesbot/carbon/src/Carbon/Lang/bg.php index 0e17673..f768074 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bg.php @@ -17,6 +17,9 @@ * - JD Isaacks * - Glavić */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count година|:count години', 'a_year' => 'година|:count години', @@ -63,7 +66,7 @@ return [ 'nextDay' => '[Утре в] LT', 'nextWeek' => 'dddd [в] LT', 'lastDay' => '[Вчера в] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 0: case 3: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php b/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php index 85c0783..b53874d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/bg.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php b/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php index c3d9d8b..380abb1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/bo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php index a377fb5..ca50d04 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/bo.php', [ 'meridiem' => ['སྔ་དྲོ་', 'ཕྱི་དྲོ་'], 'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ་', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php index 9d939fd..7f54185 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/br.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs.php index d2fc5aa..e5d6808 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bs.php @@ -18,6 +18,9 @@ * - Serhan Apaydın * - JD Isaacks */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count godina|:count godine|:count godina', 'y' => ':count godina|:count godine|:count godina', @@ -55,7 +58,7 @@ return [ 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 0: return '[u] [nedjelju] [u] LT'; @@ -68,7 +71,7 @@ return [ } }, 'lastDay' => '[jučer u] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 0: case 3: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php index 4dd21ba..0a59117 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/bs.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php index 09221e0..e1a1744 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/bs.php', [ 'meridiem' => ['пре подне', 'поподне'], 'weekdays' => ['недјеља', 'понедјељак', 'уторак', 'сриједа', 'четвртак', 'петак', 'субота'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php index 91ed1cc..b4e363e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/bs.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca.php index 5c91439..b8b1994 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca.php @@ -21,6 +21,9 @@ * - Xavi * - qcardona */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count any|:count anys', 'a_year' => 'un any|:count anys', @@ -69,19 +72,19 @@ return [ 'LLLL' => 'dddd D MMMM [de] YYYY [a les] H:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $current) { + 'sameDay' => function (CarbonInterface $current) { return '[avui a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'nextDay' => function (\Carbon\CarbonInterface $current) { + 'nextDay' => function (CarbonInterface $current) { return '[demà a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { return 'dddd [a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'lastDay' => function (\Carbon\CarbonInterface $current) { + 'lastDay' => function (CarbonInterface $current) { return '[ahir a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { return '[el] dddd [passat a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, 'sameElse' => 'L', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php index f5718c3..861acd2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php index 8423606..5004978 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ca.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php index f5718c3..861acd2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php index f5718c3..861acd2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php index f5718c3..861acd2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php b/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php index ec616a7..99c1dca 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['𑄢𑄧𑄝𑄨𑄝𑄢𑄴', '𑄥𑄧𑄟𑄴𑄝𑄢𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴', '𑄝𑄪𑄖𑄴𑄝𑄢𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴', '𑄥𑄧𑄚𑄨𑄝𑄢𑄴'], 'weekdays_short' => ['𑄢𑄧𑄝𑄨', '𑄥𑄧𑄟𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴', '𑄝𑄪𑄖𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴', '𑄥𑄧𑄚𑄨'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php index 18bd122..c1fa8af 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ccp.php', [ 'weekend' => [0, 0], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php b/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php index e424408..09bcc1c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php index a16a346..ea2517e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/cs.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cu.php b/vendor/nesbot/carbon/src/Carbon/Lang/cu.php index 02c983a..d6d1312 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cv.php b/vendor/nesbot/carbon/src/Carbon/Lang/cv.php index cec1fc9..8aeb73a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cv.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cv.php @@ -32,7 +32,7 @@ return [ 'a_second' => '{1}пӗр-ик ҫеккунт|:count ҫеккунт', 'ago' => ':time каялла', 'from_now' => function ($time) { - return $time.(preg_match('/сехет$/', $time) ? 'рен' : (preg_match('/ҫул/', $time) ? 'тан' : 'ран')); + return $time.(preg_match('/сехет$/u', $time) ? 'рен' : (preg_match('/ҫул/u', $time) ? 'тан' : 'ран')); }, 'diff_yesterday' => 'Ӗнер', 'diff_today' => 'Паян', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php index ddff893..197bd8d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/cv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php b/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php index 541127c..2c8148d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/cy.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php b/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php index b3bac1a..392c484 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/da.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php b/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php index b2ba81f..ea5698b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/da.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dav.php b/vendor/nesbot/carbon/src/Carbon/Lang/dav.php index 79f021e..e95ec4b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dav.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dav.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Luma lwa K', 'luma lwa p'], 'weekdays' => ['Ituku ja jumwa', 'Kuramuka jimweri', 'Kuramuka kawi', 'Kuramuka kadadu', 'Kuramuka kana', 'Kuramuka kasanu', 'Kifula nguwo'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php b/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php index 82edfa1..03e606a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/de.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dje.php b/vendor/nesbot/carbon/src/Carbon/Lang/dje.php index 08ddbf1..74b7ac1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dje.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dje.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Subbaahi', 'Zaarikay b'], 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamisi', 'Alzuma', 'Asibti'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dua.php b/vendor/nesbot/carbon/src/Carbon/Lang/dua.php index 65d712f..55e5c7c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dua.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dua.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['idiɓa', 'ebyámu'], 'weekdays' => ['éti', 'mɔ́sú', 'kwasú', 'mukɔ́sú', 'ŋgisú', 'ɗónɛsú', 'esaɓasú'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dv.php b/vendor/nesbot/carbon/src/Carbon/Lang/dv.php index a2b60df..4b8d7e1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dv.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dv.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + $months = [ 'ޖެނުއަރީ', 'ފެބްރުއަރީ', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php b/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php index 208fb5a..2668d5b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php @@ -3,7 +3,7 @@ /** * This file is part of the Carbon package. * - * (c) Ahmed Ali + * (c) Brian Nesbitt * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php b/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php index ecb649b..33082e6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Dimas', 'Teneŋ', 'Talata', 'Alarbay', 'Aramisay', 'Arjuma', 'Sibiti'], 'weekdays_short' => ['Dim', 'Ten', 'Tal', 'Ala', 'Ara', 'Arj', 'Sib'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php b/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php index 5aab48d..f60bc6f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['KI', 'UT'], 'weekdays' => ['Kiumia', 'Njumatatu', 'Njumaine', 'Njumatano', 'Aramithi', 'Njumaa', 'NJumamothii'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ee.php b/vendor/nesbot/carbon/src/Carbon/Lang/ee.php index 2fd9dcd..f96c5c9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ee.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ee.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ŋ', 'ɣ'], 'weekdays' => ['kɔsiɖa', 'dzoɖa', 'blaɖa', 'kuɖa', 'yawoɖa', 'fiɖa', 'memleɖa'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php index 02d77e6..7a8b36c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ee.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/el.php b/vendor/nesbot/carbon/src/Carbon/Lang/el.php index 09cf7e8..7c40f9c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/el.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/el.php @@ -19,6 +19,9 @@ * - yiannisdesp * - Ilias Kasmeridis (iliaskasm) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count χρόνος|:count χρόνια', 'a_year' => 'ένας χρόνος|:count χρόνια', @@ -65,7 +68,7 @@ return [ 'nextDay' => '[Αύριο {}] LT', 'nextWeek' => 'dddd [{}] LT', 'lastDay' => '[Χθες {}] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 6: return '[το προηγούμενο] dddd [{}] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php index 6ae11c9..11457b0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php index 1d0d34f..67bceaa 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php index ce4780c..c4e2557 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php index ed0b3f9..5ee9524 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php index 9f2a3f7..e2dd81d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php b/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php index 31f60e1..f086dc6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es.php b/vendor/nesbot/carbon/src/Carbon/Lang/es.php index daaf257..f77ec39 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es.php @@ -27,6 +27,9 @@ * - Daniel Commesse Liévanos (danielcommesse) * - Pete Scopes (pdscopes) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count año|:count años', 'a_year' => 'un año|:count años', @@ -77,19 +80,19 @@ return [ 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $current) { + 'sameDay' => function (CarbonInterface $current) { return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'nextDay' => function (\Carbon\CarbonInterface $current) { + 'nextDay' => function (CarbonInterface $current) { return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'lastDay' => function (\Carbon\CarbonInterface $current) { + 'lastDay' => function (CarbonInterface $current) { return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, 'sameElse' => 'L', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php index e9dbe2b..378d054 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php index e9dbe2b..378d054 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php index 96391d4..f02e1a6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php index 96391d4..f02e1a6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php index 96391d4..f02e1a6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php index 96391d4..f02e1a6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php b/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php index ea345b2..deae06a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'formats' => [ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php b/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php index 3588f62..0f112b3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/et.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php index 442cca7..0d1e82a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/eu.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php b/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php index f5ae8cf..7808ab5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kíkíríg', 'ngəgógəle'], 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndi', 'sɔ́ndɔ məlú mə́bɛ̌', 'sɔ́ndɔ məlú mə́lɛ́', 'sɔ́ndɔ məlú mə́nyi', 'fúladé', 'séradé'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php index 06566fa..6947100 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fa.php', [ 'meridiem' => ['ق', 'ب'], 'weekend' => [4, 5], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php b/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php index 6d1832c..08d0182 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fa.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php index dafa98e..b797ac0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ff.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php index dafa98e..b797ac0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ff.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php index 65276d3..2f4c29f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ff.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php index 3597fa2..920f1ca 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php b/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php index e0f4537..657f2c5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fo.php', [ 'formats' => [ 'L' => 'DD.MM.yy', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php b/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php index 6a4bc31..6d73616 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php index 52b951c..67d3787 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'meridiem' => ['mat.', 'soir'], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php index 40579a4..2f06086 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'formats' => [ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php index 2c1ab85..ae8db5f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php index 7d2b1db..1bf034d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php index d177a7d..37cf83f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php index 2c1ab85..ae8db5f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php index d177a7d..37cf83f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php index d3e2656..6905e7a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'weekend' => [5, 6], 'formats' => [ diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php index d177a7d..37cf83f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php index f9801e8..ec3ee35 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php index d50630c..57b0c4f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ga.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php b/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php index 80da9c6..4fc26b3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gd.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gl.php b/vendor/nesbot/carbon/src/Carbon/Lang/gl.php index 58c1db1..088b0f2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gl.php @@ -17,6 +17,9 @@ * - Diego Vilariño * - Sebastian Thierer */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count ano|:count anos', 'a_year' => 'un ano|:count anos', @@ -65,19 +68,19 @@ return [ 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $current) { + 'sameDay' => function (CarbonInterface $current) { return '[hoxe '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, - 'nextDay' => function (\Carbon\CarbonInterface $current) { + 'nextDay' => function (CarbonInterface $current) { return '[mañá '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { return 'dddd ['.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, - 'lastDay' => function (\Carbon\CarbonInterface $current) { + 'lastDay' => function (CarbonInterface $current) { return '[onte '.($current->hour !== 1 ? 'á' : 'a').'] LT'; }, - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { return '[o] dddd [pasado '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, 'sameElse' => 'L', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php b/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php index 12a565f..9d6c1d9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php index 5e54a36..612bb88 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return [ 'year' => ':count voros|:count vorsam', 'y' => ':countv', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php index 0dba9c5..594eb25 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gsw.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php index e0e7b23..3581dcf 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/gsw.php', [ 'meridiem' => ['vorm.', 'nam.'], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php index e0e7b23..3581dcf 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/gsw.php', [ 'meridiem' => ['vorm.', 'nam.'], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gu.php b/vendor/nesbot/carbon/src/Carbon/Lang/gu.php index 7c7872b..8bc4311 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gu.php @@ -18,7 +18,7 @@ return [ 'year' => 'એક વર્ષ|:count વર્ષ', 'y' => ':countવર્ષ|:countવર્ષો', - 'month' => 'એક મહિનો|:count મહિનો', + 'month' => 'એક મહિનો|:count મહિના', 'm' => ':countમહિનો|:countમહિના', 'week' => ':count અઠવાડિયું|:count અઠવાડિયા', 'w' => ':countઅઠ.|:countઅઠ.', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php index c578440..02654b1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gu.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/guz.php b/vendor/nesbot/carbon/src/Carbon/Lang/guz.php index aa9769c..6230165 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/guz.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/guz.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Ma', 'Mo'], 'weekdays' => ['Chumapiri', 'Chumatato', 'Chumaine', 'Chumatano', 'Aramisi', 'Ichuma', 'Esabato'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php index bce5e41..f9f99a7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ha.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php index bce5e41..f9f99a7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ha.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php index bce5e41..f9f99a7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ha.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/haw.php b/vendor/nesbot/carbon/src/Carbon/Lang/haw.php index 51715d8..cdd3686 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/haw.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/haw.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['Ianuali', 'Pepeluali', 'Malaki', 'ʻApelila', 'Mei', 'Iune', 'Iulai', 'ʻAukake', 'Kepakemapa', 'ʻOkakopa', 'Nowemapa', 'Kekemapa'], 'months_short' => ['Ian.', 'Pep.', 'Mal.', 'ʻAp.', 'Mei', 'Iun.', 'Iul.', 'ʻAu.', 'Kep.', 'ʻOk.', 'Now.', 'Kek.'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php b/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php index 57c4fec..14fab3e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/he.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php index ac30299..749dd97 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/hi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hr.php b/vendor/nesbot/carbon/src/Carbon/Lang/hr.php index acb7e92..cfd85fd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hr.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hr.php @@ -27,6 +27,9 @@ * - Stjepan Majdak * - Vanja Retkovac (vr00) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count godinu|:count godine|:count godina', 'y' => ':count god.|:count god.|:count god.', @@ -67,7 +70,7 @@ return [ 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[u] [nedjelju] [u] LT'; @@ -80,7 +83,7 @@ return [ } }, 'lastDay' => '[jučer u] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: case 3: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php b/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php index 2ae141d..db74d8c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/hr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hu.php b/vendor/nesbot/carbon/src/Carbon/Lang/hu.php index 673f9dc..b2d2ac1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hu.php @@ -15,6 +15,9 @@ * - Brett Johnson * - balping */ + +use Carbon\CarbonInterface; + $huWeekEndings = ['vasárnap', 'hétfőn', 'kedden', 'szerdán', 'csütörtökön', 'pénteken', 'szombaton']; return [ @@ -99,11 +102,11 @@ return [ 'calendar' => [ 'sameDay' => '[ma] LT[-kor]', 'nextDay' => '[holnap] LT[-kor]', - 'nextWeek' => function (\Carbon\CarbonInterface $date) use ($huWeekEndings) { + 'nextWeek' => function (CarbonInterface $date) use ($huWeekEndings) { return '['.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; }, 'lastDay' => '[tegnap] LT[-kor]', - 'lastWeek' => function (\Carbon\CarbonInterface $date) use ($huWeekEndings) { + 'lastWeek' => function (CarbonInterface $date) use ($huWeekEndings) { return '[múlt '.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; }, 'sameElse' => 'L', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php b/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php index b33a631..b1c4854 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/hu.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php b/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php index d19e4f4..e65449b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php b/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php index 406112a..d5953a1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/id.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ii.php b/vendor/nesbot/carbon/src/Carbon/Lang/ii.php index 30f8374..a4246c2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ii.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ii.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ꎸꄑ', 'ꁯꋒ'], 'weekdays' => ['ꑭꆏꑍ', 'ꆏꊂꋍ', 'ꆏꊂꑍ', 'ꆏꊂꌕ', 'ꆏꊂꇖ', 'ꆏꊂꉬ', 'ꆏꊂꃘ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/in.php b/vendor/nesbot/carbon/src/Carbon/Lang/in.php index 406112a..d5953a1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/in.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/in.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/id.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php b/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php index 8b91bb2..4d35c44 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/is.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it.php b/vendor/nesbot/carbon/src/Carbon/Lang/it.php index c23d8db..605bcbb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/it.php @@ -22,6 +22,9 @@ * - Davide Casiraghi (davide-casiraghi) * - Pete Scopes (pdscopes) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count anno|:count anni', 'a_year' => 'un anno|:count anni', @@ -81,7 +84,7 @@ return [ 'nextDay' => '[Domani alle] LT', 'nextWeek' => 'dddd [alle] LT', 'lastDay' => '[Ieri alle] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[la scorsa] dddd [alle] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php b/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php index 57fab39..5e8fc92 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/it.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php b/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php index 57fab39..5e8fc92 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/it.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/iw.php b/vendor/nesbot/carbon/src/Carbon/Lang/iw.php index a8034e8..a26e350 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/iw.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/iw.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'], 'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ja.php b/vendor/nesbot/carbon/src/Carbon/Lang/ja.php index fa4cb36..1ca6751 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ja.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ja.php @@ -21,6 +21,9 @@ * - toyama satoshi * - atakigawa */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count年', 'y' => ':count年', @@ -56,7 +59,7 @@ return [ 'calendar' => [ 'sameDay' => '[今日] LT', 'nextDay' => '[明日] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($other->week !== $current->week) { return '[来週]dddd LT'; } @@ -64,7 +67,7 @@ return [ return 'dddd LT'; }, 'lastDay' => '[昨日] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'lastWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($other->week !== $current->week) { return '[先週]dddd LT'; } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php b/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php index 9e035fd..c283625 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ja.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php b/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php index bad6beb..6a1e77a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php b/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php index f8cc72c..ed92e8e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ka.php b/vendor/nesbot/carbon/src/Carbon/Lang/ka.php index 5ddb957..a5d563d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ka.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ka.php @@ -24,6 +24,9 @@ * - Avtandil Kikabidze (akalongman) * - Levan Velijanashvili (Stichoza) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count წელი', 'y' => ':count წელი', @@ -149,7 +152,7 @@ return [ 'calendar' => [ 'sameDay' => '[დღეს], LT[-ზე]', 'nextDay' => '[ხვალ], LT[-ზე]', - 'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { return ($current->isSameWeek($other) ? '' : '[შემდეგ] ').'dddd, LT[-ზე]'; }, 'lastDay' => '[გუშინ], LT[-ზე]', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php b/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php index dd77fa3..a26d930 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ka.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kam.php b/vendor/nesbot/carbon/src/Carbon/Lang/kam.php index 0fb6b2e..0fc70d7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kam.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kam.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Ĩyakwakya', 'Ĩyawĩoo'], 'weekdays' => ['Wa kyumwa', 'Wa kwambĩlĩlya', 'Wa kelĩ', 'Wa katatũ', 'Wa kana', 'Wa katano', 'Wa thanthatũ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kde.php b/vendor/nesbot/carbon/src/Carbon/Lang/kde.php index 8acdaba..fbcc9f3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kde.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kde.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Muhi', 'Chilo'], 'weekdays' => ['Liduva lyapili', 'Liduva lyatatu', 'Liduva lyanchechi', 'Liduva lyannyano', 'Liduva lyannyano na linji', 'Liduva lyannyano na mavili', 'Liduva litandi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kea.php b/vendor/nesbot/carbon/src/Carbon/Lang/kea.php index 8a334e2..8b6c21b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kea.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kea.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['dumingu', 'sigunda-fera', 'tersa-fera', 'kuarta-fera', 'kinta-fera', 'sesta-fera', 'sabadu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/khq.php b/vendor/nesbot/carbon/src/Carbon/Lang/khq.php index f0649e7..7a834cf 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/khq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/khq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Adduha', 'Aluula'], 'weekdays' => ['Alhadi', 'Atini', 'Atalata', 'Alarba', 'Alhamiisa', 'Aljuma', 'Assabdu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ki.php b/vendor/nesbot/carbon/src/Carbon/Lang/ki.php index 5754ffc..d86afc5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ki.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ki.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Kiroko', 'Hwaĩ-inĩ'], 'weekdays' => ['Kiumia', 'Njumatatũ', 'Njumaine', 'Njumatana', 'Aramithi', 'Njumaa', 'Njumamothi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php index af4a5b2..7dc5ebc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/kk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php b/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php index bad6beb..6a1e77a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kln.php b/vendor/nesbot/carbon/src/Carbon/Lang/kln.php index b034ba5..b9c3996 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kln.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kln.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['krn', 'koosk'], 'weekdays' => ['Kotisap', 'Kotaai', 'Koaeng’', 'Kosomok', 'Koang’wan', 'Komuut', 'Kolo'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php b/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php index ef3b415..92e5fdb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/km.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php index 7c6c909..30e3d88 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/kn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php index 55b40fa..4ba802b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ko.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php index d8eba2c..9d873a2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ko.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php b/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php index 424099d..aaa0061 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['makeo', 'nyiaghuo'], 'weekdays' => ['Jumaapii', 'Jumaatatu', 'Jumaane', 'Jumaatano', 'Alhamisi', 'Ijumaa', 'Jumaamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php b/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php index 8fb5598..84a5967 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['sárúwá', 'cɛɛ́nko'], 'weekdays' => ['sɔ́ndǝ', 'lǝndí', 'maadí', 'mɛkrɛdí', 'jǝǝdí', 'júmbá', 'samdí'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php b/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php index 44c60a4..95457e2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['v.M.', 'n.M.'], 'weekdays' => ['Sunndaach', 'Mohndaach', 'Dinnsdaach', 'Metwoch', 'Dunnersdaach', 'Friidaach', 'Samsdaach'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php b/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php index 11fce2d..4243a82 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ku.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php index 4426bea..9923a31 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ky.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lag.php b/vendor/nesbot/carbon/src/Carbon/Lang/lag.php index dc959c9..f3f57f6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lag.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lag.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['TOO', 'MUU'], 'weekdays' => ['Jumapíiri', 'Jumatátu', 'Jumaíne', 'Jumatáano', 'Alamíisi', 'Ijumáa', 'Jumamóosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lb.php b/vendor/nesbot/carbon/src/Carbon/Lang/lb.php index db04834..7636655 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lb.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lb.php @@ -16,6 +16,9 @@ * - dan-nl * - Simon Lelorrain (slelorrain) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count Joer', 'y' => ':countJ', @@ -57,7 +60,7 @@ return [ 'nextDay' => '[Muer um] LT', 'nextWeek' => 'dddd [um] LT', 'lastDay' => '[Gëschter um] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule switch ($date->dayOfWeek) { case 2: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php b/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php index c8625fe..414bd4d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lb.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php b/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php index 968b058..ae73a97 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'month' => ':count haŋwí', // less reliable diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php index e244096..7fdb7f1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php index e244096..7fdb7f1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php index e244096..7fdb7f1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php b/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php index c0a1d6b..9b7fd9b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php b/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php index 10661bb..546e679 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'minute' => ':count هنر', // less reliable diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php index 449d863..d42f5e9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/lrc.php', [ ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php b/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php index c3087f4..f772d38 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lu.php b/vendor/nesbot/carbon/src/Carbon/Lang/lu.php index 8dab541..c8cd83a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Dinda', 'Dilolo'], 'weekdays' => ['Lumingu', 'Nkodya', 'Ndàayà', 'Ndangù', 'Njòwa', 'Ngòvya', 'Lubingu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/luo.php b/vendor/nesbot/carbon/src/Carbon/Lang/luo.php index 201ca96..b55af73 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/luo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/luo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['OD', 'OT'], 'weekdays' => ['Jumapil', 'Wuok Tich', 'Tich Ariyo', 'Tich Adek', 'Tich Ang’wen', 'Tich Abich', 'Ngeso'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/luy.php b/vendor/nesbot/carbon/src/Carbon/Lang/luy.php index 5219125..2b37e3e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/luy.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/luy.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Jumapiri', 'Jumatatu', 'Jumanne', 'Jumatano', 'Murwa wa Kanne', 'Murwa wa Katano', 'Jumamosi'], 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lv.php b/vendor/nesbot/carbon/src/Carbon/Lang/lv.php index 724b58d..693eceb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lv.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lv.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Carbon\CarbonInterface; /** @@ -168,6 +177,6 @@ return [ 'weekdays_short' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], 'weekdays_min' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], 'months' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'], - 'months_short' => ['Janv', 'Feb', 'Mar', 'Apr', 'Mai', 'Jūn', 'Jūl', 'Aug', 'Sept', 'Okt', 'Nov', 'Dec'], + 'months_short' => ['janv.', 'febr.', 'martā', 'apr.', 'maijā', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.'], 'meridiem' => ['priekšpusdiena', 'pēcpusdiena'], ]; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php b/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php index 46c0f43..ee91c36 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mas.php b/vendor/nesbot/carbon/src/Carbon/Lang/mas.php index 723ae67..cbd610c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mas.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mas.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Ɛnkakɛnyá', 'Ɛndámâ'], 'weekdays' => ['Jumapílí', 'Jumatátu', 'Jumane', 'Jumatánɔ', 'Alaámisi', 'Jumáa', 'Jumamósi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php index aa382b7..56e2905 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/mas.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mer.php b/vendor/nesbot/carbon/src/Carbon/Lang/mer.php index cb7ba8d..2e14597 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mer.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mer.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['RŨ', 'ŨG'], 'weekdays' => ['Kiumia', 'Muramuko', 'Wairi', 'Wethatu', 'Wena', 'Wetano', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php b/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php index 65798a8..2a80960 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['wichishu', 'mchochil’l'], 'weekdays' => ['Sabato', 'Jumatatu', 'Jumanne', 'Jumatano', 'Arahamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php b/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php index a5a0754..a126c9f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], 'weekdays_short' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php index 123d229..6b964e3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php b/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php index b56783e..57faa31 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mk.php b/vendor/nesbot/carbon/src/Carbon/Lang/mk.php index 853bc96..d822de0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mk.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mk.php @@ -19,6 +19,9 @@ * - JD Isaacks * - Tomi Atanasoski */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count година|:count години', 'a_year' => 'година|:count години', @@ -65,7 +68,7 @@ return [ 'nextDay' => '[Утре во] LT', 'nextWeek' => '[Во] dddd [во] LT', 'lastDay' => '[Вчера во] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: case 3: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php b/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php index 06ff7d9..95e2ff9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php index 20878dc..000e795 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ml.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php b/vendor/nesbot/carbon/src/Carbon/Lang/mn.php index 25f65b3..717d199 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mn.php @@ -5,11 +5,8 @@ * * (c) Brian Nesbitt * - * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. - * - * @translator Batmandakh Erdenebileg */ /* diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php index b8fef24..e5ce426 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mo.php b/vendor/nesbot/carbon/src/Carbon/Lang/mo.php index dd7c8f0..102afcd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mo.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ro.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php index 556cefa..7bca919 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms.php index ed7d48f..36934ee 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ms.php @@ -75,12 +75,18 @@ return [ 'sameElse' => 'L', ], 'meridiem' => function ($hour) { + if ($hour < 1) { + return 'tengah malam'; + } + if ($hour < 12) { return 'pagi'; } - if ($hour < 15) { + + if ($hour < 13) { return 'tengah hari'; } + if ($hour < 19) { return 'petang'; } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php index ea2b453..ef837a2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ms.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php index 097a168..77cb83d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ms.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php b/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php index 6ec2b33..9534f68 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mua.php b/vendor/nesbot/carbon/src/Carbon/Lang/mua.php index 8f1f9dc..a3a3c6f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mua.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mua.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['comme', 'lilli'], 'weekdays' => ['Com’yakke', 'Comlaaɗii', 'Comzyiiɗii', 'Comkolle', 'Comkaldǝɓlii', 'Comgaisuu', 'Comzyeɓsuu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php b/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php index 1f27cca..a0108dd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/my.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php b/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php index 6ad3604..70f5f23 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fa.php', [ 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/naq.php b/vendor/nesbot/carbon/src/Carbon/Lang/naq.php index 614ced4..fbd9be9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/naq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/naq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ǁgoagas', 'ǃuias'], 'weekdays' => ['Sontaxtsees', 'Mantaxtsees', 'Denstaxtsees', 'Wunstaxtsees', 'Dondertaxtsees', 'Fraitaxtsees', 'Satertaxtsees'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php b/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php index bd643a8..31678c5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nb.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php index 93cbaef..ce0210b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/nb.php', [ 'formats' => [ 'LL' => 'D. MMM YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nd.php b/vendor/nesbot/carbon/src/Carbon/Lang/nd.php index d6fdaad..f75d9a7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nd.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nd.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sonto', 'Mvulo', 'Sibili', 'Sithathu', 'Sine', 'Sihlanu', 'Mgqibelo'], 'weekdays_short' => ['Son', 'Mvu', 'Sib', 'Sit', 'Sin', 'Sih', 'Mgq'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php b/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php index eb6e77e..a6c57a9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php @@ -20,36 +20,41 @@ return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['Jannuaar', 'Feberwaar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], 'weekdays' => ['Sünndag', 'Maandag', 'Dingsdag', 'Middeweek', 'Dunnersdag', 'Freedag', 'Sünnavend'], - 'weekdays_short' => ['Sdag', 'Maan', 'Ding', 'Migg', 'Dunn', 'Free', 'Svd.'], - 'weekdays_min' => ['Sdag', 'Maan', 'Ding', 'Migg', 'Dunn', 'Free', 'Svd.'], + 'weekdays_short' => ['Sdag', 'Maan', 'Ding', 'Midd', 'Dunn', 'Free', 'Svd.'], + 'weekdays_min' => ['Sd', 'Ma', 'Di', 'Mi', 'Du', 'Fr', 'Sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count Johr', - 'y' => ':count Johr', - 'a_year' => ':count Johr', + 'y' => ':countJ', + 'a_year' => '{1}een Johr|:count Johr', 'month' => ':count Maand', - 'm' => ':count Maand', - 'a_month' => ':count Maand', + 'm' => ':countM', + 'a_month' => '{1}een Maand|:count Maand', - 'week' => ':count Week', - 'w' => ':count Week', - 'a_week' => ':count Week', + 'week' => ':count Week|:count Weken', + 'w' => ':countW', + 'a_week' => '{1}een Week|:count Week|:count Weken', - 'day' => ':count Dag', - 'd' => ':count Dag', - 'a_day' => ':count Dag', + 'day' => ':count Dag|:count Daag', + 'd' => ':countD', + 'a_day' => '{1}een Dag|:count Dag|:count Daag', - 'hour' => ':count Stünn', - 'h' => ':count Stünn', - 'a_hour' => ':count Stünn', + 'hour' => ':count Stünn|:count Stünnen', + 'h' => ':countSt', + 'a_hour' => '{1}een Stünn|:count Stünn|:count Stünnen', - 'minute' => ':count Minuut', - 'min' => ':count Minuut', - 'a_minute' => ':count Minuut', + 'minute' => ':count Minuut|:count Minuten', + 'min' => ':countm', + 'a_minute' => '{1}een Minuut|:count Minuut|:count Minuten', - 'second' => ':count sekunn', - 's' => ':count sekunn', - 'a_second' => ':count sekunn', + 'second' => ':count Sekunn|:count Sekunnen', + 's' => ':counts', + 'a_second' => 'en poor Sekunnen|:count Sekunn|:count Sekunnen', + + 'ago' => 'vör :time', + 'from_now' => 'in :time', + 'before' => ':time vörher', + 'after' => ':time later', ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php index 2583bcf..f68d00e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ne.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php b/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php index 38caa1e..27840c0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ne.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl.php index fc8b5d9..2d73770 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nl.php @@ -71,9 +71,9 @@ return [ 'period_recurrences' => ':count keer', 'period_interval' => function (string $interval = '') { /** @var string $output */ - $output = preg_replace('/^(een|één|1)\s+/', '', $interval); + $output = preg_replace('/^(een|één|1)\s+/u', '', $interval); - if (preg_match('/^(een|één|1)( jaar|j| uur|u)/', $interval)) { + if (preg_match('/^(een|één|1)( jaar|j| uur|u)/u', $interval)) { return "elk $output"; } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php index 521d2d6..c269197 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php index 521d2d6..c269197 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php index 521d2d6..c269197 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php index 521d2d6..c269197 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php b/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php index f8850e2..4d1df6e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['maná', 'kugú'], 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndɔ', 'sɔ́ndɔ mafú mába', 'sɔ́ndɔ mafú málal', 'sɔ́ndɔ mafú mána', 'mabágá má sukul', 'sásadi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php b/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php index ebbe0b7..8e16871 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nn.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php b/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php index fa6a448..007d239 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['mbaʼámbaʼ', 'ncwònzém'], 'weekdays' => null, diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nus.php b/vendor/nesbot/carbon/src/Carbon/Lang/nus.php index 033e975..789bc39 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nus.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nus.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['RW', 'TŊ'], 'weekdays' => ['Cäŋ kuɔth', 'Jiec la̱t', 'Rɛw lätni', 'Diɔ̱k lätni', 'Ŋuaan lätni', 'Dhieec lätni', 'Bäkɛl lätni'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php b/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php index fdc2ff4..8660ea4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/oc.php b/vendor/nesbot/carbon/src/Carbon/Lang/oc.php index 94c3e04..89693e6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/oc.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/oc.php @@ -14,8 +14,10 @@ * - Quentí */ // @codeCoverageIgnoreStart +use Symfony\Component\Translation\PluralizationRules; + if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - \Symfony\Component\Translation\PluralizationRules::set(function ($number) { + PluralizationRules::set(function ($number) { return $number == 1 ? 0 : 1; }, 'oc'); } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php b/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php index fde859f..01eb5c1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/oc.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php b/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php index 4648343..044760e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/om.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php index b29a40f..f5a4d1c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/om.php', [ 'day_of_first_week_of_year' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php index 8b04dee..39b0653 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ur.php', [ 'weekdays' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], 'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php index c0d35ec..7adff5c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/pa.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pl.php b/vendor/nesbot/carbon/src/Carbon/Lang/pl.php index ec3f52e..f0196c0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pl.php @@ -27,6 +27,9 @@ * - Jan (aso824) * - diverpl */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count rok|:count lata|:count lat', 'a_year' => 'rok|:count lata|:count lat', @@ -50,7 +53,13 @@ return [ 'a_second' => '{1}kilka sekund|:count sekunda|:count sekundy|:count sekund', 's' => ':count sek.', 'ago' => ':time temu', - 'from_now' => 'za :time', + 'from_now' => static function ($time) { + return 'za '.strtr($time, [ + 'godzina' => 'godzinę', + 'minuta' => 'minutę', + 'sekunda' => 'sekundę', + ]); + }, 'after' => ':time po', 'before' => ':time przed', 'diff_now' => 'przed chwilą', @@ -73,7 +82,7 @@ return [ 'calendar' => [ 'sameDay' => '[Dziś o] LT', 'nextDay' => '[Jutro o] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[W niedzielę o] LT'; @@ -88,7 +97,7 @@ return [ } }, 'lastDay' => '[Wczoraj o] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[W zeszłą niedzielę o] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php b/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php index 69cd697..222bcdb 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/prg.php b/vendor/nesbot/carbon/src/Carbon/Lang/prg.php index d0fd2f0..6e63f4a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/prg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/prg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php b/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php index e63121e..6ec5180 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ps.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt.php index e36ca4c..0af8949 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt.php @@ -23,6 +23,9 @@ * - Sebastian Thierer * - Claudson Martins (claudsonm) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count ano|:count anos', 'a_year' => 'um ano|:count anos', @@ -81,7 +84,7 @@ return [ 'nextDay' => '[Amanhã às] LT', 'nextWeek' => 'dddd [às] LT', 'lastDay' => '[Ontem às] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: case 6: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php index 3d13bca..22c01ec 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php index 3d13bca..22c01ec 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php index 3d13bca..22c01ec 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php index 3d13bca..22c01ec 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php index 3d13bca..22c01ec 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php index 3d13bca..22c01ec 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php index 331fa5c..f2b5eab 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/pt.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php index 93bac23..fbc0c97 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/pt.php', [ 'first_day_of_week' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php index 3d13bca..22c01ec 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php index 3d13bca..22c01ec 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/qu.php b/vendor/nesbot/carbon/src/Carbon/Lang/qu.php index 5f3a392..65278cd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/qu.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/qu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es_UY.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php b/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php index 91635d5..d5db6bf 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/qu.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php b/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php index 91635d5..d5db6bf 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/qu.php', [ 'first_day_of_week' => 1, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rn.php b/vendor/nesbot/carbon/src/Carbon/Lang/rn.php index 637d4e5..8ab958e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/rn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Z.MU.', 'Z.MW.'], 'weekdays' => ['Ku w’indwi', 'Ku wa mbere', 'Ku wa kabiri', 'Ku wa gatatu', 'Ku wa kane', 'Ku wa gatanu', 'Ku wa gatandatu'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php index 0ba6f68..ad1d2fa 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ro.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php b/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php index dd7c8f0..102afcd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ro.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rof.php b/vendor/nesbot/carbon/src/Carbon/Lang/rof.php index 80ab454..205fc26 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rof.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/rof.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kang’ama', 'kingoto'], 'weekdays' => ['Ijumapili', 'Ijumatatu', 'Ijumanne', 'Ijumatano', 'Alhamisi', 'Ijumaa', 'Ijumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru.php index 93e0e01..673b043 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru.php @@ -35,6 +35,9 @@ * - Vladislav UnsealedOne * - dima-bzz */ + +use Carbon\CarbonInterface; + $transformDiff = function ($input) { return strtr($input, [ 'неделя' => 'неделю', @@ -97,7 +100,7 @@ return [ 'calendar' => [ 'sameDay' => '[Сегодня, в] LT', 'nextDay' => '[Завтра, в] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($current->week !== $other->week) { switch ($current->dayOfWeek) { case 0: @@ -120,7 +123,7 @@ return [ return '[В] dddd, [в] LT'; }, 'lastDay' => '[Вчера, в] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'lastWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($current->week !== $other->week) { switch ($current->dayOfWeek) { case 0: diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php index 2c8d78f..8ca7df3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php index 2c8d78f..8ca7df3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php index 2c8d78f..8ca7df3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php index 2c8d78f..8ca7df3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php index 2c8d78f..8ca7df3 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php b/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php index f8cc72c..ed92e8e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/saq.php b/vendor/nesbot/carbon/src/Carbon/Lang/saq.php index eebfac9..ff8bf60 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/saq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/saq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Tesiran', 'Teipa'], 'weekdays' => ['Mderot ee are', 'Mderot ee kuni', 'Mderot ee ong’wan', 'Mderot ee inet', 'Mderot ee ile', 'Mderot ee sapa', 'Mderot ee kwe'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php b/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php index 9b73783..e29ca37 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Lwamilawu', 'Pashamihe'], 'weekdays' => ['Mulungu', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alahamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sd.php b/vendor/nesbot/carbon/src/Carbon/Lang/sd.php index ad8c000..0022c5a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sd.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sd.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + $months = [ 'جنوري', 'فيبروري', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php index b2b967e..cf01805 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/se.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php b/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php index 83bbf78..177c7e9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/se.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php b/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php index 83bbf78..177c7e9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/se.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/seh.php b/vendor/nesbot/carbon/src/Carbon/Lang/seh.php index 3ad889a..babf9af 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/seh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/seh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Dimingu', 'Chiposi', 'Chipiri', 'Chitatu', 'Chinai', 'Chishanu', 'Sabudu'], 'weekdays_short' => ['Dim', 'Pos', 'Pir', 'Tat', 'Nai', 'Sha', 'Sab'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ses.php b/vendor/nesbot/carbon/src/Carbon/Lang/ses.php index 9355184..e1099e6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ses.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ses.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Adduha', 'Aluula'], 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamiisa', 'Alzuma', 'Asibti'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sg.php b/vendor/nesbot/carbon/src/Carbon/Lang/sg.php index 7f8e9da..9264e89 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sg.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ND', 'LK'], 'weekdays' => ['Bikua-ôko', 'Bïkua-ûse', 'Bïkua-ptâ', 'Bïkua-usïö', 'Bïkua-okü', 'Lâpôsö', 'Lâyenga'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sh.php b/vendor/nesbot/carbon/src/Carbon/Lang/sh.php index a953df4..e4aa5a1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sh.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sh.php @@ -8,9 +8,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + // @codeCoverageIgnoreStart +use Symfony\Component\Translation\PluralizationRules; + if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - \Symfony\Component\Translation\PluralizationRules::set(function ($number) { + PluralizationRules::set(function ($number) { return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); }, 'sh'); } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shi.php b/vendor/nesbot/carbon/src/Carbon/Lang/shi.php index ee5aa0b..7815186 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shi.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/shi.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'], 'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵕⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php index a5580c3..cddfb24 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/shi.php', [ 'meridiem' => ['tifawt', 'tadggʷat'], 'weekdays' => ['asamas', 'aynas', 'asinas', 'akṛas', 'akwas', 'asimwas', 'asiḍyas'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php index e51ed13..f3df1f2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/shi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/si.php b/vendor/nesbot/carbon/src/Carbon/Lang/si.php index 289d4d5..636bf69 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/si.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/si.php @@ -33,7 +33,7 @@ return [ 'a_second' => '{1}තත්පර කිහිපයකට|තත්පර :count', 'ago' => ':time කට පෙර', 'from_now' => function ($time) { - if (preg_match('/දින \d+/', $time)) { + if (preg_match('/දින \d/u', $time)) { return $time.' න්'; } @@ -41,7 +41,7 @@ return [ }, 'before' => ':time කට පෙර', 'after' => function ($time) { - if (preg_match('/දින \d+/', $time)) { + if (preg_match('/දින \d/u', $time)) { return $time.' න්'; } diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php b/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php index 6c5be97..81c44e0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/si.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php index be3d1f2..0515601 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sl.php b/vendor/nesbot/carbon/src/Carbon/Lang/sl.php index 56d0f1b..2e19721 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sl.php @@ -29,6 +29,9 @@ * - Lovro Tramšek (Lovro1107) * - burut13 */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count leto|:count leti|:count leta|:count let', 'y' => ':count leto|:count leti|:count leta|:count let', @@ -96,7 +99,7 @@ return [ 'nextDay' => '[jutri ob] LT', 'nextWeek' => 'dddd [ob] LT', 'lastDay' => '[včeraj ob] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[preteklo] [nedeljo] [ob] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php b/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php index da9fef0..5dad8c8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sl.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/smn.php b/vendor/nesbot/carbon/src/Carbon/Lang/smn.php index b252ebb..20add02 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/smn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/smn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ip.', 'ep.'], 'weekdays' => ['pasepeeivi', 'vuossaargâ', 'majebaargâ', 'koskoho', 'tuorâstuv', 'vástuppeeivi', 'lávurduv'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sn.php b/vendor/nesbot/carbon/src/Carbon/Lang/sn.php index 62c82b1..4f25028 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['Svondo', 'Muvhuro', 'Chipiri', 'Chitatu', 'China', 'Chishanu', 'Mugovera'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php index 0bfbdf3..ea5df3f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sq.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php index c844fe0..62f752c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sq.php', [ 'formats' => [ 'L' => 'D.M.YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php index c844fe0..62f752c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sq.php', [ 'formats' => [ 'L' => 'D.M.YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr.php index 6ecf2d0..68ba663 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr.php @@ -19,6 +19,9 @@ * - Glavić * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count godina|:count godine|:count godina', 'y' => ':count g.', @@ -64,7 +67,7 @@ return [ 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[u nedelju u] LT'; @@ -77,7 +80,7 @@ return [ } }, 'lastDay' => '[juče u] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[prošle nedelje u] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php index 8540742..c09df19 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php @@ -20,6 +20,9 @@ * - Nikola Zeravcic * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return [ 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', 'y' => ':count г.', @@ -63,7 +66,7 @@ return [ 'calendar' => [ 'sameDay' => '[данас у] LT', 'nextDay' => '[сутра у] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[у недељу у] LT'; @@ -76,7 +79,7 @@ return [ } }, 'lastDay' => '[јуче у] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[прошле недеље у] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php index 36405d3..0fb63d7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Cyrl.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php index fb6179e..d13229a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php @@ -14,6 +14,9 @@ * - Glavić * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return [ 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', 'y' => ':count г.', @@ -60,7 +63,7 @@ return [ 'calendar' => [ 'sameDay' => '[данас у] LT', 'nextDay' => '[сутра у] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[у недељу у] LT'; @@ -73,7 +76,7 @@ return [ } }, 'lastDay' => '[јуче у] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[прошле недеље у] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php index 0643a41..492baf0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Cyrl_BA.php', [ 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php index 8ae8c41..9971674 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php index c25a507..897c674 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Latn.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php index de20f21..e2133ef 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php @@ -14,6 +14,9 @@ * - Glavić * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return array_replace_recursive(require __DIR__.'/sr.php', [ 'month' => ':count mjesec|:count mjeseca|:count mjeseci', 'week' => ':count nedjelja|:count nedjelje|:count nedjelja', @@ -27,7 +30,7 @@ return array_replace_recursive(require __DIR__.'/sr.php', [ 'diff_tomorrow' => 'sjutra', 'calendar' => [ 'nextDay' => '[sjutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[u nedjelju u] LT'; @@ -39,7 +42,7 @@ return array_replace_recursive(require __DIR__.'/sr.php', [ return '[u] dddd [u] LT'; } }, - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[prošle nedjelje u] LT'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php index ba7cc09..d0b9d10 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Latn_BA.php', [ 'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php index b668ee1..d7c65b9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sr_Latn_ME.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php index 8ae8c41..9971674 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php b/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php index 48d970a..ba89527 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ss.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php index 56425b4..70cc558 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sv.php', [ 'formats' => [ 'L' => 'YYYY-MM-dd', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php index 1b73ecb..d7182c8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php index 1b73ecb..d7182c8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sv.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php index f6927f4..ec9117b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php index f6927f4..ec9117b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php b/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php index 4b0b541..9adddcf 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php @@ -33,9 +33,9 @@ return array_replace_recursive(require __DIR__.'/en.php', [ 'm' => ':count mjeśůnc', 'a_month' => ':count mjeśůnc', - 'week' => ':count Tydźyń', - 'w' => ':count Tydźyń', - 'a_week' => ':count Tydźyń', + 'week' => ':count tydźyń', + 'w' => ':count tydźyń', + 'a_week' => ':count tydźyń', 'day' => ':count dźyń', 'd' => ':count dźyń', @@ -45,11 +45,11 @@ return array_replace_recursive(require __DIR__.'/en.php', [ 'h' => ':count godzina', 'a_hour' => ':count godzina', - 'minute' => ':count Minuta', - 'min' => ':count Minuta', - 'a_minute' => ':count Minuta', + 'minute' => ':count minuta', + 'min' => ':count minuta', + 'a_minute' => ':count minuta', - 'second' => ':count Sekůnda', - 's' => ':count Sekůnda', - 'a_second' => ':count Sekůnda', + 'second' => ':count sekůnda', + 's' => ':count sekůnda', + 'a_second' => ':count sekůnda', ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php b/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php index 291d6c8..a6cd8b5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'LT' => 'a h:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php index fe1cc06..7dbedee 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'LT' => 'a h:mm', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php b/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php index 6f81c40..3963f8d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/te.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/teo.php b/vendor/nesbot/carbon/src/Carbon/Lang/teo.php index 950235e..ca30c37 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/teo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/teo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ta.php', [ 'meridiem' => ['Taparachu', 'Ebongi'], 'weekdays' => ['Nakaejuma', 'Nakaebarasa', 'Nakaare', 'Nakauni', 'Nakaung’on', 'Nakakany', 'Nakasabiti'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php b/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php index 024d272..010a04f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/teo.php', [ 'first_day_of_week' => 0, ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php index c6591e3..badc7d1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/tg.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php b/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php index f11dc1b..b9f94b2 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/th.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php b/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php index 1937fec..23f1144 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/tr.php', [ 'weekdays_short' => ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'], 'weekdays_min' => ['Pa', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php b/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php index dc8e935..9e99482 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/tr.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/twq.php b/vendor/nesbot/carbon/src/Carbon/Lang/twq.php index e8ff278..5cbb46e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/twq.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/twq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ses.php', [ 'meridiem' => ['Subbaahi', 'Zaarikay b'], ]); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uk.php b/vendor/nesbot/carbon/src/Carbon/Lang/uk.php index ab2d867..b267b00 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uk.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/uk.php @@ -8,7 +8,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -$processHoursFunction = function (\Carbon\CarbonInterface $date, string $format) { + +use Carbon\CarbonInterface; + +$processHoursFunction = function (CarbonInterface $date, string $format) { return $format.'о'.($date->hour === 11 ? 'б' : '').'] LT'; }; @@ -127,19 +130,19 @@ return [ 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'sameDay' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[Сьогодні '); }, - 'nextDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'nextDay' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[Завтра '); }, - 'nextWeek' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'nextWeek' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[У] dddd ['); }, - 'lastDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'lastDay' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[Вчора '); }, - 'lastWeek' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'lastWeek' => function (CarbonInterface $date) use ($processHoursFunction) { switch ($date->dayOfWeek) { case 0: case 3: @@ -183,17 +186,17 @@ return [ 'months_standalone' => ['січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'], 'months_short' => ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру'], 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => function (\Carbon\CarbonInterface $date, $format, $index) { + 'weekdays' => function (CarbonInterface $date, $format, $index) { static $words = [ 'nominative' => ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'], 'accusative' => ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'], 'genitive' => ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи'], ]; - $nounCase = preg_match('/(\[(В|в|У|у)\])\s+dddd/', $format) + $nounCase = preg_match('/(\[(В|в|У|у)\])\s+dddd/u', $format) ? 'accusative' : ( - preg_match('/\[?(?:минулої|наступної)?\s*\]\s+dddd/', $format) + preg_match('/\[?(?:минулої|наступної)?\s*\]\s+dddd/u', $format) ? 'genitive' : 'nominative' ); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php b/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php index 5fc4317..bd11d86 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/uk.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ur.php b/vendor/nesbot/carbon/src/Carbon/Lang/ur.php index e55aff2..dc16c2c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ur.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ur.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + $months = [ 'جنوری', 'فروری', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php index 6871911..ffb5131 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fa.php', [ 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], 'weekdays_short' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php index e875469..89e9971 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/uz.php', [ 'formats' => [ 'L' => 'DD/MM/yy', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vai.php b/vendor/nesbot/carbon/src/Carbon/Lang/vai.php index 3e6fce2..3c378df 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vai.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vai.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], 'weekdays_short' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php index b76c4bc..51e83cc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], 'weekdays_short' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php index 7b029a8..b4bb533 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/vai.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php b/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php index 77b2dce..18d8987 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/vi.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vo.php b/vendor/nesbot/carbon/src/Carbon/Lang/vo.php index a956a78..e273033 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vo.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vun.php b/vendor/nesbot/carbon/src/Carbon/Lang/vun.php index f8cc72c..ed92e8e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vun.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/vun.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/xog.php b/vendor/nesbot/carbon/src/Carbon/Lang/xog.php index 063977c..eb55b4a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/xog.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/xog.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Munkyo', 'Eigulo'], 'weekdays' => ['Sabiiti', 'Balaza', 'Owokubili', 'Owokusatu', 'Olokuna', 'Olokutaanu', 'Olomukaaga'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yav.php b/vendor/nesbot/carbon/src/Carbon/Lang/yav.php index e44cde6..225a20d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yav.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yav.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kiɛmɛ́ɛm', 'kisɛ́ndɛ'], 'weekdays' => ['sɔ́ndiɛ', 'móndie', 'muányáŋmóndie', 'metúkpíápɛ', 'kúpélimetúkpiapɛ', 'feléte', 'séselé'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php b/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php index f06bb99..12b9e81 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/yo.php', [ 'meridiem' => ['Àárɔ̀', 'Ɔ̀sán'], 'weekdays' => ['Ɔjɔ́ Àìkú', 'Ɔjɔ́ Ajé', 'Ɔjɔ́ Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɔjɔ́ Ɛtì', 'Ɔjɔ́ Àbámɛ́ta'], diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php b/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php index 92934bc..6860bc1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/yo.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php index 007d071..db913ca 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php index 24797f9..e2526f1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php index 007d071..db913ca 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php index 007d071..db913ca 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php index 007d071..db913ca 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php index 24797f9..e2526f1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php index 24797f9..e2526f1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php index 24797f9..e2526f1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Language.php b/vendor/nesbot/carbon/src/Carbon/Language.php index 3790285..1fb5baf 100644 --- a/vendor/nesbot/carbon/src/Carbon/Language.php +++ b/vendor/nesbot/carbon/src/Carbon/Language.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use JsonSerializable; diff --git a/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php b/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php index d71c888..8be0569 100644 --- a/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php +++ b/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\Laravel; use Carbon\Carbon; diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php new file mode 100644 index 0000000..fc6fd2a --- /dev/null +++ b/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php @@ -0,0 +1,222 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +use Closure; +use PHPStan\Reflection\Php\BuiltinMethodReflection; +use PHPStan\TrinaryLogic; +use ReflectionClass; +use ReflectionFunction; +use ReflectionMethod; +use ReflectionParameter; +use ReflectionType; +use stdClass; +use Throwable; + +abstract class AbstractMacro implements BuiltinMethodReflection +{ + /** + * The reflection function/method. + * + * @var ReflectionFunction|ReflectionMethod + */ + protected $reflectionFunction; + + /** + * The class name. + * + * @var class-string + */ + private $className; + + /** + * The method name. + * + * @var string + */ + private $methodName; + + /** + * The parameters. + * + * @var ReflectionParameter[] + */ + private $parameters; + + /** + * The is static. + * + * @var bool + */ + private $static = false; + + /** + * Macro constructor. + * + * @param string $className + * @phpstan-param class-string $className + * + * @param string $methodName + * @param callable $macro + */ + public function __construct(string $className, string $methodName, $macro) + { + $this->className = $className; + $this->methodName = $methodName; + $this->reflectionFunction = \is_array($macro) + ? new ReflectionMethod($macro[0], $macro[1]) + : new ReflectionFunction($macro); + $this->parameters = $this->reflectionFunction->getParameters(); + + if ($this->reflectionFunction->isClosure()) { + try { + $closure = $this->reflectionFunction->getClosure(); + $boundClosure = Closure::bind($closure, new stdClass()); + $this->static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); + } catch (Throwable $e) { + $this->static = true; + } + } + } + + /** + * {@inheritdoc} + */ + public function getDeclaringClass(): ReflectionClass + { + return new ReflectionClass($this->className); + } + + /** + * {@inheritdoc} + */ + public function isPrivate(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isPublic(): bool + { + return true; + } + + /** + * {@inheritdoc} + */ + public function isFinal(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isInternal(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isAbstract(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isStatic(): bool + { + return $this->static; + } + + /** + * {@inheritdoc} + */ + public function getDocComment(): ?string + { + return $this->reflectionFunction->getDocComment() ?: null; + } + + /** + * {@inheritdoc} + */ + public function getName(): string + { + return $this->methodName; + } + + /** + * {@inheritdoc} + */ + public function getParameters(): array + { + return $this->parameters; + } + + /** + * {@inheritdoc} + */ + public function getReturnType(): ?ReflectionType + { + return $this->reflectionFunction->getReturnType(); + } + + /** + * {@inheritdoc} + */ + public function isDeprecated(): TrinaryLogic + { + return TrinaryLogic::createFromBoolean( + $this->reflectionFunction->isDeprecated() || + preg_match('/@deprecated/i', $this->getDocComment() ?: '') + ); + } + + /** + * {@inheritdoc} + */ + public function isVariadic(): bool + { + return $this->reflectionFunction->isVariadic(); + } + + /** + * {@inheritdoc} + */ + public function getPrototype(): BuiltinMethodReflection + { + return $this; + } + + /** + * {@inheritdoc} + */ + public function getReflection(): ?ReflectionMethod + { + return $this->reflectionFunction instanceof ReflectionMethod + ? $this->reflectionFunction + : null; + } + + public function getTentativeReturnType(): ?ReflectionType + { + return null; + } +} diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php index 7dab190..8392587 100644 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php +++ b/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php @@ -2,232 +2,26 @@ declare(strict_types=1); +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\PHPStan; -use Closure; use PHPStan\Reflection\Php\BuiltinMethodReflection; -use PHPStan\TrinaryLogic; -use ReflectionClass; -use ReflectionFunction; use ReflectionMethod; -use ReflectionParameter; -use ReflectionType; -use stdClass; -use Throwable; -final class Macro implements BuiltinMethodReflection +$method = new ReflectionMethod(BuiltinMethodReflection::class, 'getFileName'); + +require $method->hasReturnType() + ? __DIR__.'/../../../lazy/Carbon/PHPStan/MacroStrongType.php' + : __DIR__.'/../../../lazy/Carbon/PHPStan/MacroWeakType.php'; + +final class Macro extends LazyMacro { - /** - * The class name. - * - * @var class-string - */ - private $className; - - /** - * The method name. - * - * @var string - */ - private $methodName; - - /** - * The reflection function/method. - * - * @var ReflectionFunction|ReflectionMethod - */ - private $reflectionFunction; - - /** - * The parameters. - * - * @var ReflectionParameter[] - */ - private $parameters; - - /** - * The is static. - * - * @var bool - */ - private $static = false; - - /** - * Macro constructor. - * - * @param string $className - * @phpstan-param class-string $className - * - * @param string $methodName - * @param callable $macro - */ - public function __construct(string $className, string $methodName, $macro) - { - $this->className = $className; - $this->methodName = $methodName; - $this->reflectionFunction = \is_array($macro) - ? new ReflectionMethod($macro[0], $macro[1]) - : new ReflectionFunction($macro); - $this->parameters = $this->reflectionFunction->getParameters(); - - if ($this->reflectionFunction->isClosure()) { - try { - /** @var Closure $closure */ - $closure = $this->reflectionFunction->getClosure(); - $boundClosure = Closure::bind($closure, new stdClass); - $this->static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); - } catch (Throwable $e) { - $this->static = true; - } - } - } - - /** - * {@inheritdoc} - */ - public function getDeclaringClass(): ReflectionClass - { - return new ReflectionClass($this->className); - } - - /** - * {@inheritdoc} - */ - public function isPrivate(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isPublic(): bool - { - return true; - } - - /** - * {@inheritdoc} - */ - public function isFinal(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isInternal(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isAbstract(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isStatic(): bool - { - return $this->static; - } - - /** - * {@inheritdoc} - */ - public function getDocComment(): ?string - { - return $this->reflectionFunction->getDocComment() ?: null; - } - - /** - * {@inheritdoc} - */ - public function getFileName() - { - return $this->reflectionFunction->getFileName(); - } - - /** - * {@inheritdoc} - */ - public function getName(): string - { - return $this->methodName; - } - - /** - * {@inheritdoc} - */ - public function getParameters(): array - { - return $this->parameters; - } - - /** - * {@inheritdoc} - */ - public function getReturnType(): ?ReflectionType - { - return $this->reflectionFunction->getReturnType(); - } - - /** - * {@inheritdoc} - */ - public function getStartLine() - { - return $this->reflectionFunction->getStartLine(); - } - - /** - * {@inheritdoc} - */ - public function getEndLine() - { - return $this->reflectionFunction->getEndLine(); - } - - /** - * {@inheritdoc} - */ - public function isDeprecated(): TrinaryLogic - { - return TrinaryLogic::createFromBoolean( - $this->reflectionFunction->isDeprecated() || - preg_match('/@deprecated/i', $this->getDocComment() ?: '') - ); - } - - /** - * {@inheritdoc} - */ - public function isVariadic(): bool - { - return $this->reflectionFunction->isVariadic(); - } - - /** - * {@inheritdoc} - */ - public function getPrototype(): BuiltinMethodReflection - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function getReflection(): ?ReflectionMethod - { - return $this->reflectionFunction instanceof ReflectionMethod - ? $this->reflectionFunction - : null; - } } diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php index 5a3d694..8e2524c 100644 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php +++ b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\PHPStan; use PHPStan\Reflection\ClassReflection; diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php index 97cf0b8..d169939 100644 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php +++ b/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\PHPStan; use Carbon\CarbonInterface; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php b/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php index 7fbb1a3..71bbb72 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Exceptions\UnknownUnitException; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php b/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php index 44caf0b..5f7c7c0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\Traits; use Carbon\Exceptions\InvalidCastException; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php b/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php index ee00666..a23e6ed 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use BadMethodCallException; @@ -74,7 +75,7 @@ trait Comparison */ public function equalTo($date): bool { - return $this == $date; + return $this == $this->resolveCarbon($date); } /** @@ -154,7 +155,7 @@ trait Comparison */ public function greaterThan($date): bool { - return $this > $date; + return $this > $this->resolveCarbon($date); } /** @@ -255,7 +256,7 @@ trait Comparison */ public function lessThan($date): bool { - return $this < $date; + return $this < $this->resolveCarbon($date); } /** diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php b/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php index 7ba6225..8fe008a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php b/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php index 4f44f1d..f2adee5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; @@ -94,7 +95,7 @@ trait Creator setlocale(LC_NUMERIC, $locale); } - static::setLastErrors(parent::getLastErrors()); + self::setLastErrors(parent::getLastErrors()); } /** @@ -338,7 +339,7 @@ trait Creator return $now(static::now($tz)); } - return $now; + return $now->avoidMutation()->tz($tz); } /** @@ -389,12 +390,12 @@ trait Creator return $defaults[$unit]; }; - $year = $year === null ? $getDefault('year') : $year; - $month = $month === null ? $getDefault('month') : $month; - $day = $day === null ? $getDefault('day') : $day; - $hour = $hour === null ? $getDefault('hour') : $hour; - $minute = $minute === null ? $getDefault('minute') : $minute; - $second = (float) ($second === null ? $getDefault('second') : $second); + $year = $year ?? $getDefault('year'); + $month = $month ?? $getDefault('month'); + $day = $day ?? $getDefault('day'); + $hour = $hour ?? $getDefault('hour'); + $minute = $minute ?? $getDefault('minute'); + $second = (float) ($second ?? $getDefault('second')); self::assertBetween('month', $month, 0, 99); self::assertBetween('day', $day, 0, 99); @@ -931,6 +932,8 @@ trait Creator /** * {@inheritdoc} + * + * @return array */ #[ReturnTypeWillChange] public static function getLastErrors() diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/vendor/nesbot/carbon/src/Carbon/Traits/Date.php index e7762fa..8c8af6f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Date.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use BadMethodCallException; @@ -38,6 +39,8 @@ use Throwable; /** * A simple API extension for DateTime. * + * @mixin DeprecatedProperties + * * * * @property int $year @@ -54,10 +57,6 @@ use Throwable; * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English - * @property string $localeDayOfWeek the day of week in current locale LC_TIME - * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME - * @property string $localeMonth the month in current locale LC_TIME - * @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME * @property int $milliseconds * @property int $millisecond * @property int $milli @@ -874,12 +873,28 @@ trait Date // @property string the abbreviated month in English 'shortEnglishMonth' => 'M', // @property string the day of week in current locale LC_TIME + // @deprecated + // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. + // replacement: Use ->isoFormat('MMM') instead. + // since: 2.55.0 'localeDayOfWeek' => '%A', // @property string the abbreviated day of week in current locale LC_TIME + // @deprecated + // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. + // replacement: Use ->isoFormat('dddd') instead. + // since: 2.55.0 'shortLocaleDayOfWeek' => '%a', // @property string the month in current locale LC_TIME + // @deprecated + // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. + // replacement: Use ->isoFormat('ddd') instead. + // since: 2.55.0 'localeMonth' => '%B', // @property string the abbreviated month in current locale LC_TIME + // @deprecated + // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. + // replacement: Use ->isoFormat('MMMM') instead. + // since: 2.55.0 'shortLocaleMonth' => '%b', // @property-read string $timezoneAbbreviatedName the current timezone abbreviated name 'timezoneAbbreviatedName' => 'T', @@ -1572,7 +1587,13 @@ trait Date #[ReturnTypeWillChange] public function setTimezone($value) { - return parent::setTimezone(static::safeCreateDateTimeZone($value)); + $tz = static::safeCreateDateTimeZone($value); + + if ($tz === false && !self::isStrictModeEnabled()) { + $tz = new CarbonTimeZone(); + } + + return parent::setTimezone($tz); } /** @@ -1673,7 +1694,7 @@ trait Date public static function getWeekStartsAt() { if (static::$weekStartsAt === static::WEEK_DAY_AUTO) { - return static::getFirstDayOfWeek(); + return self::getFirstDayOfWeek(); } return static::$weekStartsAt; @@ -1704,7 +1725,7 @@ trait Date public static function getWeekEndsAt() { if (static::$weekStartsAt === static::WEEK_DAY_AUTO) { - return (int) (static::DAYS_PER_WEEK - 1 + static::getFirstDayOfWeek()) % static::DAYS_PER_WEEK; + return (int) (static::DAYS_PER_WEEK - 1 + self::getFirstDayOfWeek()) % static::DAYS_PER_WEEK; } return static::$weekEndsAt; @@ -1812,6 +1833,10 @@ trait Date * Format the instance with the current locale. You can set the current * locale using setlocale() https://php.net/setlocale. * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat() instead. + * Deprecated since 2.55.0 + * * @param string $format * * @return string diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedProperties.php b/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedProperties.php new file mode 100644 index 0000000..5acc6f5 --- /dev/null +++ b/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedProperties.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +trait DeprecatedProperties +{ + /** + * the day of week in current locale LC_TIME + * + * @var string + * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat('MMM') instead. + * Deprecated since 2.55.0 + */ + public $localeDayOfWeek; + + /** + * the abbreviated day of week in current locale LC_TIME + * + * @var string + * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat('dddd') instead. + * Deprecated since 2.55.0 + */ + public $shortLocaleDayOfWeek; + + /** + * the month in current locale LC_TIME + * + * @var string + * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat('ddd') instead. + * Deprecated since 2.55.0 + */ + public $localeMonth; + + /** + * the abbreviated month in current locale LC_TIME + * + * @var string + * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat('MMMM') instead. + * Deprecated since 2.55.0 + */ + public $shortLocaleMonth; +} diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php b/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php index b1cdd6e..cce1d2c 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; @@ -111,7 +112,8 @@ trait Difference /** * Get the difference as a DateInterval instance. - * Return relative interval (negative if + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference @@ -123,8 +125,10 @@ trait Difference { $other = $this->resolveCarbon($date); - // Can be removed if https://github.com/derickr/timelib/pull/110 - // is merged + // Work-around for https://bugs.php.net/bug.php?id=81458 + // It was initially introduced for https://bugs.php.net/bug.php?id=80998 + // The very specific case of 80998 was fixed in PHP 8.1beta3, but it introduced 81458 + // So we still need to keep this for now // @codeCoverageIgnoreStart if (version_compare(PHP_VERSION, '8.1.0-dev', '>=') && $other->tz !== $this->tz) { $other = $other->avoidMutation()->tz($this->tz); @@ -136,7 +140,8 @@ trait Difference /** * Get the difference as a CarbonInterval instance. - * Return absolute interval (always positive) unless you pass false to the second argument. + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference @@ -212,7 +217,7 @@ trait Difference */ public function diffInDays($date = null, $absolute = true) { - return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%a'); + return $this->getIntervalDayDiff($this->diff($this->resolveCarbon($date), $absolute)); } /** @@ -513,7 +518,7 @@ trait Difference return $hoursDiff / static::HOURS_PER_DAY; } - $daysDiff = (int) $interval->format('%r%a'); + $daysDiff = $this->getIntervalDayDiff($interval); return $daysDiff + fmod($hoursDiff, static::HOURS_PER_DAY) / static::HOURS_PER_DAY; } @@ -781,6 +786,10 @@ trait Difference * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) + * - 'skip' entry, list of units to skip (array of strings or a single string, + * ` it can be the unit name (singular or plural) or its shortcut + * ` (y, m, w, d, h, min, s, ms, µs). + * - 'aUnit' entry, prefer "an hour" over "1 hour" if true * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string @@ -789,6 +798,8 @@ trait Difference * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) + * - 'minimumUnit' entry determines the smallest unit of time to display can be long or + * ` short form of the units, e.g. 'hour' or 'h' (default value: s) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers @@ -815,7 +826,7 @@ trait Difference $syntax['syntax'] = $syntax['syntax'] ?? null; $intSyntax = &$syntax['syntax']; } - $intSyntax = (int) ($intSyntax === null ? static::DIFF_RELATIVE_AUTO : $intSyntax); + $intSyntax = (int) ($intSyntax ?? static::DIFF_RELATIVE_AUTO); $intSyntax = $intSyntax === static::DIFF_RELATIVE_AUTO && $other === null ? static::DIFF_RELATIVE_TO_NOW : $intSyntax; $parts = min(7, max(1, (int) $parts)); @@ -1138,4 +1149,21 @@ trait Difference return $this->isoFormat((string) $format); } + + private function getIntervalDayDiff(DateInterval $interval): int + { + $daysDiff = (int) $interval->format('%a'); + $sign = $interval->format('%r') === '-' ? -1 : 1; + + if (\is_int($interval->days) && + $interval->y === 0 && + $interval->m === 0 && + version_compare(PHP_VERSION, '8.1.0-dev', '<') && + abs($interval->d - $daysDiff) === 1 + ) { + $daysDiff = abs($interval->d); + } + + return $daysDiff * $sign; + } } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php index 6f6c9d1..4cd66b6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterval; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php index 4882eef..82d7c32 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php index 9162dc9..ddd2b4e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; @@ -15,6 +16,7 @@ use Carbon\Exceptions\InvalidTypeException; use Carbon\Exceptions\NotLocaleAwareException; use Carbon\Language; use Carbon\Translator; +use Carbon\TranslatorStrongTypeInterface; use Closure; use Symfony\Component\Translation\TranslatorBagInterface; use Symfony\Component\Translation\TranslatorInterface; @@ -181,7 +183,7 @@ trait Localization $locale = $translator->getLocale(); } - $result = $translator->getCatalogue($locale)->get($key); + $result = self::getFromCatalogue($translator, $translator->getCatalogue($locale), $key); return $result === $key ? $default : $result; } @@ -237,10 +239,11 @@ trait Localization /** * Translate using translation string or callback available. * - * @param string $key - * @param array $parameters - * @param string|int|float|null $number - * @param \Symfony\Component\Translation\TranslatorInterface $translator + * @param string $key + * @param array $parameters + * @param string|int|float|null $number + * @param \Symfony\Component\Translation\TranslatorInterface|null $translator + * @param bool $altNumbers * * @return string */ @@ -582,7 +585,9 @@ trait Localization } foreach (['ago', 'from_now', 'before', 'after'] as $key) { - if ($translator instanceof TranslatorBagInterface && $translator->getCatalogue($newLocale)->get($key) instanceof Closure) { + if ($translator instanceof TranslatorBagInterface && + self::getFromCatalogue($translator, $translator->getCatalogue($newLocale), $key) instanceof Closure + ) { continue; } @@ -735,6 +740,19 @@ trait Localization return $translator; } + /** + * @param mixed $translator + * @param \Symfony\Component\Translation\MessageCatalogueInterface $catalogue + * + * @return mixed + */ + private static function getFromCatalogue($translator, $catalogue, string $id, string $domain = 'messages') + { + return $translator instanceof TranslatorStrongTypeInterface + ? $translator->getFromCatalogue($catalogue, $id, $domain) // @codeCoverageIgnore + : $catalogue->get($id, $domain); + } + /** * Return the word cleaned from its translation codes. * @@ -774,7 +792,7 @@ trait Localization $parts = explode('|', $message); return $key === 'to' - ? static::cleanWordFromTranslationString(end($parts)) + ? self::cleanWordFromTranslationString(end($parts)) : '(?:'.implode('|', array_map([static::class, 'cleanWordFromTranslationString'], $parts)).')'; }, $keys); } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php b/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php index d413526..92b6c9d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; /** diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php b/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php index b9c868d..88b251d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Closure; @@ -65,8 +66,8 @@ trait Mixin public static function mixin($mixin) { \is_string($mixin) && trait_exists($mixin) - ? static::loadMixinTrait($mixin) - : static::loadMixinClass($mixin); + ? self::loadMixinTrait($mixin) + : self::loadMixinClass($mixin); } /** @@ -114,7 +115,7 @@ trait Mixin } // in case of errors not converted into exceptions - $closure = $closure ?? $closureBase; + $closure = $closure ?: $closureBase; return $closure(...\func_get_args()); }); diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php b/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php index 2fd6426..164dbbd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; @@ -429,6 +430,8 @@ trait Modifiers * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. * * @see https://php.net/manual/en/datetime.modify.php + * + * @return static|false */ #[ReturnTypeWillChange] public function modify($modify) diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php b/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php index 66eaa12..561c867 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php b/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php index 252df3a..c77a102 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; trait ObjectInitialisation diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Options.php b/vendor/nesbot/carbon/src/Carbon/Traits/Options.php index 5a27d81..0ddee8d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Options.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Options.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php index 03d3fe6..3306239 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php index a27e4e3..eebc69b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Exceptions\InvalidFormatException; @@ -135,6 +136,8 @@ trait Serialization /** * Set locale if specified on unserialize() called. + * + * @return void */ #[ReturnTypeWillChange] public function __wakeup() diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Test.php b/vendor/nesbot/carbon/src/Carbon/Traits/Test.php index d998974..c86faa7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Test.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Test.php @@ -8,10 +8,16 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; +use Carbon\CarbonInterface; +use Carbon\CarbonTimeZone; use Closure; use DateTimeImmutable; +use DateTimeInterface; +use InvalidArgumentException; +use Throwable; trait Test { @@ -26,6 +32,13 @@ trait Test */ protected static $testNow; + /** + * The timezone to resto to when clearing the time mock. + * + * @var string|null + */ + protected static $testDefaultTimezone; + /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned @@ -38,6 +51,9 @@ trait Test * Note the timezone parameter was left out of the examples above and * has no affect as the mock value will be returned regardless of its value. * + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * * To clear the test instance call this method using the default * parameter of null. * @@ -54,6 +70,50 @@ trait Test static::$testNow = \is_string($testNow) ? static::parse($testNow) : $testNow; } + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public static function setTestNowAndTimezone($testNow = null, $tz = null) + { + if ($testNow) { + self::$testDefaultTimezone = self::$testDefaultTimezone ?? date_default_timezone_get(); + } + + $useDateInstanceTimezone = $testNow instanceof DateTimeInterface; + + if ($useDateInstanceTimezone) { + self::setDefaultTimezone($testNow->getTimezone()->getName(), $testNow); + } + + static::setTestNow($testNow); + + if (!$useDateInstanceTimezone) { + $now = static::getMockedTestNow(\func_num_args() === 1 ? null : $tz); + $tzName = $now ? $now->tzName : null; + self::setDefaultTimezone($tzName ?? self::$testDefaultTimezone ?? 'UTC', $now); + } + + if (!$testNow) { + self::$testDefaultTimezone = null; + } + } + /** * Temporarily sets a static date to be used within the callback. * Using setTestNow to set the date, executing the callback, then @@ -61,8 +121,8 @@ trait Test * * /!\ Use this method for unit tests only. * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure|null $callback * * @return mixed */ @@ -97,27 +157,6 @@ trait Test return static::getTestNow() !== null; } - /** - * Return the given timezone and set it to the test instance if not null. - * If null, get the timezone from the test instance and return it. - * - * @param string|\DateTimeZone $tz - * @param \Carbon\CarbonInterface $testInstance - * - * @return string|\DateTimeZone - */ - protected static function handleMockTimezone($tz, &$testInstance) - { - //shift the time according to the given time zone - if ($tz !== null && $tz !== static::getMockedTestNow($tz)->getTimezone()) { - $testInstance = $testInstance->setTimezone($tz); - - return $tz; - } - - return $testInstance->getTimezone(); - } - /** * Get the mocked date passed in setTestNow() and if it's a Closure, execute it. * @@ -138,20 +177,48 @@ trait Test } /* @var \Carbon\CarbonImmutable|\Carbon\Carbon|null $testNow */ - return $testNow; + return $testNow instanceof CarbonInterface + ? $testNow->avoidMutation()->tz($tz) + : $testNow; } - protected static function mockConstructorParameters(&$time, &$tz) + protected static function mockConstructorParameters(&$time, $tz) { /** @var \Carbon\CarbonImmutable|\Carbon\Carbon $testInstance */ $testInstance = clone static::getMockedTestNow($tz); - $tz = static::handleMockTimezone($tz, $testInstance); - if (static::hasRelativeKeywords($time)) { $testInstance = $testInstance->modify($time); } - $time = $testInstance instanceof self ? $testInstance->rawFormat(static::MOCK_DATETIME_FORMAT) : $testInstance->format(static::MOCK_DATETIME_FORMAT); + $time = $testInstance instanceof self + ? $testInstance->rawFormat(static::MOCK_DATETIME_FORMAT) + : $testInstance->format(static::MOCK_DATETIME_FORMAT); + } + + private static function setDefaultTimezone($timezone, DateTimeInterface $date = null) + { + $previous = null; + $success = false; + + try { + $success = date_default_timezone_set($timezone); + } catch (Throwable $exception) { + $previous = $exception; + } + + if (!$success) { + $suggestion = @CarbonTimeZone::create($timezone)->toRegionName($date); + + throw new InvalidArgumentException( + "Timezone ID '$timezone' is invalid". + ($suggestion && $suggestion !== $timezone ? ", did you mean '$suggestion'?" : '.')."\n". + "It must be one of the IDs from DateTimeZone::listIdentifiers(),\n". + 'For the record, hours/minutes offset are relevant only for a particular moment, '. + 'but not as a default timezone.', + 0, + $previous + ); + } } } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php b/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php index 35d45aa..2cb5c48 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; /** diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Units.php b/vendor/nesbot/carbon/src/Carbon/Traits/Units.php index 1e4f10b..2902a8b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Units.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Units.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonConverterInterface; @@ -201,21 +202,6 @@ trait Units $unit = CarbonInterval::make($unit); } - // Can be removed if https://bugs.php.net/bug.php?id=81106 - // is fixed - // @codeCoverageIgnoreStart - if ( - $unit instanceof DateInterval && - version_compare(PHP_VERSION, '8.1.0-dev', '>=') && - ($unit->f < 0 || $unit->f >= 1) - ) { - $unit = clone $unit; - $seconds = floor($unit->f); - $unit->f -= $seconds; - $unit->s += (int) $seconds; - } - // @codeCoverageIgnoreEnd - if ($unit instanceof CarbonConverterInterface) { return $this->resolveCarbon($unit->convertDate($this, false)); } @@ -321,11 +307,13 @@ trait Units $date = $date->modify("$value $unit"); if (isset($timeString)) { - return $date->setTimeFromTimeString($timeString); + $date = $date->setTimeFromTimeString($timeString); + } elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) { + $date = $date->modify('last day of previous month'); } - if (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) { - $date = $date->modify('last day of previous month'); + if (!$date) { + throw new UnitException('Unable to add unit '.var_export(\func_get_args(), true)); } return $date; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Week.php b/vendor/nesbot/carbon/src/Carbon/Traits/Week.php index 64cece7..6f14814 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Week.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Week.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; /** diff --git a/vendor/nesbot/carbon/src/Carbon/Translator.php b/vendor/nesbot/carbon/src/Carbon/Translator.php index 9af48eb..491c9e7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Translator.php +++ b/vendor/nesbot/carbon/src/Carbon/Translator.php @@ -8,396 +8,25 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; -use Closure; -use ReflectionException; -use ReflectionFunction; +use ReflectionMethod; use Symfony\Component\Translation; +use Symfony\Contracts\Translation\TranslatorInterface; -class Translator extends Translation\Translator +$transMethod = new ReflectionMethod( + class_exists(TranslatorInterface::class) + ? TranslatorInterface::class + : Translation\Translator::class, + 'trans' +); + +require $transMethod->hasReturnType() + ? __DIR__.'/../../lazy/Carbon/TranslatorStrongType.php' + : __DIR__.'/../../lazy/Carbon/TranslatorWeakType.php'; + +class Translator extends LazyTranslator { - /** - * Translator singletons for each language. - * - * @var array - */ - protected static $singletons = []; - - /** - * List of custom localized messages. - * - * @var array - */ - protected $messages = []; - - /** - * List of custom directories that contain translation files. - * - * @var string[] - */ - protected $directories = []; - - /** - * Set to true while constructing. - * - * @var bool - */ - protected $initializing = false; - - /** - * List of locales aliases. - * - * @var string[] - */ - protected $aliases = [ - 'me' => 'sr_Latn_ME', - 'scr' => 'sh', - ]; - - /** - * Return a singleton instance of Translator. - * - * @param string|null $locale optional initial locale ("en" - english by default) - * - * @return static - */ - public static function get($locale = null) - { - $locale = $locale ?: 'en'; - - if (!isset(static::$singletons[$locale])) { - static::$singletons[$locale] = new static($locale ?: 'en'); - } - - return static::$singletons[$locale]; - } - - public function __construct($locale, Translation\Formatter\MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) - { - $this->initializing = true; - $this->directories = [__DIR__.'/Lang']; - $this->addLoader('array', new Translation\Loader\ArrayLoader()); - parent::__construct($locale, $formatter, $cacheDir, $debug); - $this->initializing = false; - } - - /** - * Returns the list of directories translation files are searched in. - * - * @return array - */ - public function getDirectories(): array - { - return $this->directories; - } - - /** - * Set list of directories translation files are searched in. - * - * @param array $directories new directories list - * - * @return $this - */ - public function setDirectories(array $directories) - { - $this->directories = $directories; - - return $this; - } - - /** - * Add a directory to the list translation files are searched in. - * - * @param string $directory new directory - * - * @return $this - */ - public function addDirectory(string $directory) - { - $this->directories[] = $directory; - - return $this; - } - - /** - * Remove a directory from the list translation files are searched in. - * - * @param string $directory directory path - * - * @return $this - */ - public function removeDirectory(string $directory) - { - $search = rtrim(strtr($directory, '\\', '/'), '/'); - - return $this->setDirectories(array_filter($this->getDirectories(), function ($item) use ($search) { - return rtrim(strtr($item, '\\', '/'), '/') !== $search; - })); - } - - /** - * Returns the translation. - * - * @param string $id - * @param array $parameters - * @param string $domain - * @param string $locale - * - * @return string - */ - public function trans($id, array $parameters = [], $domain = null, $locale = null) - { - if ($domain === null) { - $domain = 'messages'; - } - - $format = $this->getCatalogue($locale)->get((string) $id, $domain); - - if ($format instanceof Closure) { - // @codeCoverageIgnoreStart - try { - $count = (new ReflectionFunction($format))->getNumberOfRequiredParameters(); - } catch (ReflectionException $exception) { - $count = 0; - } - // @codeCoverageIgnoreEnd - - return $format( - ...array_values($parameters), - ...array_fill(0, max(0, $count - \count($parameters)), null) - ); - } - - return parent::trans($id, $parameters, $domain, $locale); - } - - /** - * Reset messages of a locale (all locale if no locale passed). - * Remove custom messages and reload initial messages from matching - * file in Lang directory. - * - * @param string|null $locale - * - * @return bool - */ - public function resetMessages($locale = null) - { - if ($locale === null) { - $this->messages = []; - - return true; - } - - foreach ($this->getDirectories() as $directory) { - $data = @include sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale); - - if ($data !== false) { - $this->messages[$locale] = $data; - $this->addResource('array', $this->messages[$locale], $locale); - - return true; - } - } - - return false; - } - - /** - * Returns the list of files matching a given locale prefix (or all if empty). - * - * @param string $prefix prefix required to filter result - * - * @return array - */ - public function getLocalesFiles($prefix = '') - { - $files = []; - - foreach ($this->getDirectories() as $directory) { - $directory = rtrim($directory, '\\/'); - - foreach (glob("$directory/$prefix*.php") as $file) { - $files[] = $file; - } - } - - return array_unique($files); - } - - /** - * Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * - * @param string $prefix prefix required to filter result - * - * @return array - */ - public function getAvailableLocales($prefix = '') - { - $locales = []; - foreach ($this->getLocalesFiles($prefix) as $file) { - $locales[] = substr($file, strrpos($file, '/') + 1, -4); - } - - return array_unique(array_merge($locales, array_keys($this->messages))); - } - - /** - * Init messages language from matching file in Lang directory. - * - * @param string $locale - * - * @return bool - */ - protected function loadMessagesFromFile($locale) - { - if (isset($this->messages[$locale])) { - return true; - } - - return $this->resetMessages($locale); - } - - /** - * Set messages of a locale and take file first if present. - * - * @param string $locale - * @param array $messages - * - * @return $this - */ - public function setMessages($locale, $messages) - { - $this->loadMessagesFromFile($locale); - $this->addResource('array', $messages, $locale); - $this->messages[$locale] = array_merge( - isset($this->messages[$locale]) ? $this->messages[$locale] : [], - $messages - ); - - return $this; - } - - /** - * Set messages of the current locale and take file first if present. - * - * @param array $messages - * - * @return $this - */ - public function setTranslations($messages) - { - return $this->setMessages($this->getLocale(), $messages); - } - - /** - * Get messages of a locale, if none given, return all the - * languages. - * - * @param string|null $locale - * - * @return array - */ - public function getMessages($locale = null) - { - return $locale === null ? $this->messages : $this->messages[$locale]; - } - - /** - * Set the current translator locale and indicate if the source locale file exists - * - * @param string $locale locale ex. en - * - * @return bool - */ - public function setLocale($locale) - { - $locale = preg_replace_callback('/[-_]([a-z]{2,}|[0-9]{2,})/', function ($matches) { - // _2-letters or YUE is a region, _3+-letters is a variant - $upper = strtoupper($matches[1]); - - if ($upper === 'YUE' || $upper === 'ISO' || \strlen($upper) < 3) { - return "_$upper"; - } - - return '_'.ucfirst($matches[1]); - }, strtolower($locale)); - - $previousLocale = $this->getLocale(); - - if ($previousLocale === $locale && isset($this->messages[$locale])) { - return true; - } - - unset(static::$singletons[$previousLocale]); - - if ($locale === 'auto') { - $completeLocale = setlocale(LC_TIME, '0'); - $locale = preg_replace('/^([^_.-]+).*$/', '$1', $completeLocale); - $locales = $this->getAvailableLocales($locale); - - $completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale); - - $getScore = function ($language) use ($completeLocaleChunks) { - return static::compareChunkLists($completeLocaleChunks, preg_split('/[_.-]+/', $language)); - }; - - usort($locales, function ($first, $second) use ($getScore) { - return $getScore($second) <=> $getScore($first); - }); - - $locale = $locales[0]; - } - - if (isset($this->aliases[$locale])) { - $locale = $this->aliases[$locale]; - } - - // If subtag (ex: en_CA) first load the macro (ex: en) to have a fallback - if (str_contains($locale, '_') && - $this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale)) - ) { - parent::setLocale($macroLocale); - } - - if ($this->loadMessagesFromFile($locale) || $this->initializing) { - parent::setLocale($locale); - - return true; - } - - return false; - } - - /** - * Show locale on var_dump(). - * - * @return array - */ - public function __debugInfo() - { - return [ - 'locale' => $this->getLocale(), - ]; - } - - private static function compareChunkLists($referenceChunks, $chunks) - { - $score = 0; - - foreach ($referenceChunks as $index => $chunk) { - if (!isset($chunks[$index])) { - $score++; - - continue; - } - - if (strtolower($chunks[$index]) === strtolower($chunk)) { - $score += 10; - } - } - - return $score; - } + // Proxy dynamically loaded LazyTranslator in a static way } diff --git a/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php b/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php new file mode 100644 index 0000000..ad36c67 --- /dev/null +++ b/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Exceptions\ImmutableException; +use Symfony\Component\Config\ConfigCacheFactoryInterface; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; + +class TranslatorImmutable extends Translator +{ + /** @var bool */ + private $constructed = false; + + public function __construct($locale, MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) + { + parent::__construct($locale, $formatter, $cacheDir, $debug); + $this->constructed = true; + } + + /** + * @codeCoverageIgnore + */ + public function setDirectories(array $directories) + { + $this->disallowMutation(__METHOD__); + + return parent::setDirectories($directories); + } + + public function setLocale($locale) + { + $this->disallowMutation(__METHOD__); + + return parent::setLocale($locale); + } + + /** + * @codeCoverageIgnore + */ + public function setMessages($locale, $messages) + { + $this->disallowMutation(__METHOD__); + + return parent::setMessages($locale, $messages); + } + + /** + * @codeCoverageIgnore + */ + public function setTranslations($messages) + { + $this->disallowMutation(__METHOD__); + + return parent::setTranslations($messages); + } + + /** + * @codeCoverageIgnore + */ + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) + { + $this->disallowMutation(__METHOD__); + + parent::setConfigCacheFactory($configCacheFactory); + } + + public function resetMessages($locale = null) + { + $this->disallowMutation(__METHOD__); + + return parent::resetMessages($locale); + } + + /** + * @codeCoverageIgnore + */ + public function setFallbackLocales(array $locales) + { + $this->disallowMutation(__METHOD__); + + parent::setFallbackLocales($locales); + } + + private function disallowMutation($method) + { + if ($this->constructed) { + throw new ImmutableException($method.' not allowed on '.static::class); + } + } +} diff --git a/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php b/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php new file mode 100644 index 0000000..ef4dee8 --- /dev/null +++ b/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +/** + * Mark translator using strong type from symfony/translation >= 6. + */ +interface TranslatorStrongTypeInterface +{ + public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages'); +} diff --git a/vendor/psr/container/composer.json b/vendor/psr/container/composer.json index 3797a25..baf6cd1 100644 --- a/vendor/psr/container/composer.json +++ b/vendor/psr/container/composer.json @@ -12,11 +12,16 @@ } ], "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" } + }, + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } } } diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php index cf10b8b..0f213f2 100644 --- a/vendor/psr/container/src/ContainerExceptionInterface.php +++ b/vendor/psr/container/src/ContainerExceptionInterface.php @@ -2,9 +2,11 @@ namespace Psr\Container; +use Throwable; + /** * Base interface representing a generic exception in a container. */ -interface ContainerExceptionInterface +interface ContainerExceptionInterface extends Throwable { } diff --git a/vendor/psr/container/src/ContainerInterface.php b/vendor/psr/container/src/ContainerInterface.php index cf8e7fd..b2cad40 100644 --- a/vendor/psr/container/src/ContainerInterface.php +++ b/vendor/psr/container/src/ContainerInterface.php @@ -32,5 +32,5 @@ interface ContainerInterface * * @return bool */ - public function has(string $id); + public function has(string $id): bool; } diff --git a/vendor/psr/simple-cache/composer.json b/vendor/psr/simple-cache/composer.json index 2978fa5..f307a84 100644 --- a/vendor/psr/simple-cache/composer.json +++ b/vendor/psr/simple-cache/composer.json @@ -6,11 +6,11 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "autoload": { "psr-4": { @@ -19,7 +19,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } } } diff --git a/vendor/psr/simple-cache/src/CacheException.php b/vendor/psr/simple-cache/src/CacheException.php index eba5381..f61b24c 100644 --- a/vendor/psr/simple-cache/src/CacheException.php +++ b/vendor/psr/simple-cache/src/CacheException.php @@ -5,6 +5,6 @@ namespace Psr\SimpleCache; /** * Interface used for all types of exceptions thrown by the implementing library. */ -interface CacheException +interface CacheException extends \Throwable { } diff --git a/vendor/psr/simple-cache/src/CacheInterface.php b/vendor/psr/simple-cache/src/CacheInterface.php index 99e8d95..671e340 100644 --- a/vendor/psr/simple-cache/src/CacheInterface.php +++ b/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($key, $default = null); + public function get(string $key, mixed $default = null): mixed; /** * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. @@ -31,7 +31,7 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function set($key, $value, $ttl = null); + public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool; /** * Delete an item from the cache by its unique key. @@ -43,28 +43,28 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function delete($key); + public function delete(string $key): bool; /** * Wipes clean the entire cache's keys. * * @return bool True on success and false on failure. */ - public function clear(); + public function clear(): bool; /** * Obtains multiple cache items by their unique keys. * - * @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. + * @param iterable $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. * - * @return iterable 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($keys, $default = null); + public function getMultiple(iterable $keys, mixed $default = null): iterable; /** * Persists a set of key => value pairs in the cache, with an optional TTL. @@ -80,12 +80,12 @@ interface CacheInterface * 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($values, $ttl = null); + public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool; /** * Deletes multiple cache items in a single operation. * - * @param iterable $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 @@ interface CacheInterface * 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($keys); + public function deleteMultiple(iterable $keys): bool; /** * Determines whether an item is present in the cache. @@ -110,5 +110,5 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function has($key); + public function has(string $key): bool; } diff --git a/vendor/symfony/console/Application.php b/vendor/symfony/console/Application.php index 769c65d..5a2323d 100644 --- a/vendor/symfony/console/Application.php +++ b/vendor/symfony/console/Application.php @@ -12,11 +12,15 @@ namespace Symfony\Component\Console; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Command\CompleteCommand; +use Symfony\Component\Console\Command\DumpCompletionCommand; use Symfony\Component\Console\Command\HelpCommand; use Symfony\Component\Console\Command\LazyCommand; use Symfony\Component\Console\Command\ListCommand; use Symfony\Component\Console\Command\SignalableCommandInterface; use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Event\ConsoleCommandEvent; use Symfony\Component\Console\Event\ConsoleErrorEvent; use Symfony\Component\Console\Event\ConsoleSignalEvent; @@ -66,23 +70,23 @@ use Symfony\Contracts\Service\ResetInterface; */ class Application implements ResetInterface { - private $commands = []; - private $wantHelps = false; - private $runningCommand; - private $name; - private $version; - private $commandLoader; - private $catchExceptions = true; - private $autoExit = true; + 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 $definition; private $helperSet; - private $dispatcher; + private $dispatcher = null; private $terminal; - private $defaultCommand; - private $singleCommand = false; - private $initialized; + private string $defaultCommand; + private bool $singleCommand = false; + private bool $initialized = false; private $signalRegistry; - private $signalsToDispatchEvent = []; + private array $signalsToDispatchEvent = []; public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') { @@ -130,7 +134,7 @@ class Application implements ResetInterface * * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. */ - public function run(InputInterface $input = null, OutputInterface $output = null) + public function run(InputInterface $input = null, OutputInterface $output = null): int { if (\function_exists('putenv')) { @putenv('LINES='.$this->terminal->getHeight()); @@ -312,16 +316,10 @@ class Application implements ResetInterface /** * Get the helper set associated with the command. - * - * @return HelperSet The HelperSet instance associated with this command */ - public function getHelperSet() + public function getHelperSet(): HelperSet { - if (!$this->helperSet) { - $this->helperSet = $this->getDefaultHelperSet(); - } - - return $this->helperSet; + return $this->helperSet ??= $this->getDefaultHelperSet(); } public function setDefinition(InputDefinition $definition) @@ -331,14 +329,10 @@ class Application implements ResetInterface /** * Gets the InputDefinition related to this Application. - * - * @return InputDefinition The InputDefinition instance */ - public function getDefinition() + public function getDefinition(): InputDefinition { - if (!$this->definition) { - $this->definition = $this->getDefaultInputDefinition(); - } + $this->definition ??= $this->getDefaultInputDefinition(); if ($this->singleCommand) { $inputDefinition = $this->definition; @@ -351,21 +345,40 @@ class Application implements ResetInterface } /** - * Gets the help message. - * - * @return string A help message + * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). */ - public function getHelp() + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ( + CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() + && 'command' === $input->getCompletionName() + ) { + $suggestions->suggestValues(array_filter(array_map(function (Command $command) { + return $command->isHidden() ? null : $command->getName(); + }, $this->all()))); + + return; + } + + if (CompletionInput::TYPE_OPTION_NAME === $input->getCompletionType()) { + $suggestions->suggestOptions($this->getDefinition()->getOptions()); + + return; + } + } + + /** + * Gets the help message. + */ + public function getHelp(): string { return $this->getLongVersion(); } /** * Gets whether to catch exceptions or not during commands execution. - * - * @return bool Whether to catch exceptions or not during commands execution */ - public function areExceptionsCaught() + public function areExceptionsCaught(): bool { return $this->catchExceptions; } @@ -380,10 +393,8 @@ class Application implements ResetInterface /** * Gets whether to automatically exit after a command execution or not. - * - * @return bool Whether to automatically exit after a command execution or not */ - public function isAutoExitEnabled() + public function isAutoExitEnabled(): bool { return $this->autoExit; } @@ -398,10 +409,8 @@ class Application implements ResetInterface /** * Gets the name of the application. - * - * @return string The application name */ - public function getName() + public function getName(): string { return $this->name; } @@ -416,10 +425,8 @@ class Application implements ResetInterface /** * Gets the application version. - * - * @return string The application version */ - public function getVersion() + public function getVersion(): string { return $this->version; } @@ -435,7 +442,7 @@ class Application implements ResetInterface /** * Returns the long version of the application. * - * @return string The long application version + * @return string */ public function getLongVersion() { @@ -452,10 +459,8 @@ class Application implements ResetInterface /** * Registers a new command. - * - * @return Command The newly created command */ - public function register(string $name) + public function register(string $name): Command { return $this->add(new Command($name)); } @@ -480,7 +485,7 @@ class Application implements ResetInterface * If a command with the same name already exists, it will be overridden. * If the command is not enabled it will not be added. * - * @return Command|null The registered command if enabled or null + * @return Command|null */ public function add(Command $command) { @@ -515,7 +520,7 @@ class Application implements ResetInterface /** * Returns a registered command by name or alias. * - * @return Command A Command object + * @return Command * * @throws CommandNotFoundException When given command name does not exist */ @@ -548,10 +553,8 @@ class Application implements ResetInterface /** * Returns true if the command exists, false otherwise. - * - * @return bool true if the command exists, false otherwise */ - public function has(string $name) + public function has(string $name): bool { $this->init(); @@ -563,9 +566,9 @@ class Application implements ResetInterface * * It does not return the global namespace which always exists. * - * @return string[] An array of namespaces + * @return string[] */ - public function getNamespaces() + public function getNamespaces(): array { $namespaces = []; foreach ($this->all() as $command) { @@ -573,24 +576,22 @@ class Application implements ResetInterface continue; } - $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName())); + $namespaces[] = $this->extractAllNamespaces($command->getName()); foreach ($command->getAliases() as $alias) { - $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias)); + $namespaces[] = $this->extractAllNamespaces($alias); } } - return array_values(array_unique(array_filter($namespaces))); + return array_values(array_unique(array_filter(array_merge([], ...$namespaces)))); } /** * Finds a registered namespace by a name or an abbreviation. * - * @return string A registered namespace - * * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous */ - public function findNamespace(string $namespace) + public function findNamespace(string $namespace): string { $allNamespaces = $this->getNamespaces(); $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; @@ -626,7 +627,7 @@ class Application implements ResetInterface * Contrary to get, this command tries to find the best * match if you give it an abbreviation of a name or alias. * - * @return Command A Command instance + * @return Command * * @throws CommandNotFoundException When command name is incorrect or ambiguous */ @@ -738,7 +739,7 @@ class Application implements ResetInterface * * The array keys are the full names and the values the command instances. * - * @return Command[] An array of Command instances + * @return Command[] */ public function all(string $namespace = null) { @@ -780,9 +781,9 @@ class Application implements ResetInterface /** * Returns an array of possible abbreviations given a set of names. * - * @return string[][] An array of abbreviations + * @return string[][] */ - public static function getAbbreviations(array $names) + public static function getAbbreviations(array $names): array { $abbrevs = []; foreach ($names as $name) { @@ -952,6 +953,16 @@ class Application implements ResetInterface throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); } + if (Terminal::hasSttyAvailable()) { + $sttyMode = shell_exec('stty -g'); + + foreach ([\SIGINT, \SIGTERM] as $signal) { + $this->signalRegistry->register($signal, static function () use ($sttyMode) { + shell_exec('stty '.$sttyMode); + }); + } + } + if ($this->dispatcher) { foreach ($this->signalsToDispatchEvent as $signal) { $event = new ConsoleSignalEvent($command, $input, $output, $signal); @@ -1019,20 +1030,16 @@ class Application implements ResetInterface /** * Gets the name of the command based on input. - * - * @return string|null */ - protected function getCommandName(InputInterface $input) + protected function getCommandName(InputInterface $input): ?string { return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument(); } /** * Gets the default input definition. - * - * @return InputDefinition An InputDefinition instance */ - protected function getDefaultInputDefinition() + protected function getDefaultInputDefinition(): InputDefinition { return new InputDefinition([ new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), @@ -1040,7 +1047,7 @@ class Application implements ResetInterface new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), - new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', false), + new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null), new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), ]); } @@ -1048,19 +1055,17 @@ class Application implements ResetInterface /** * Gets the default commands that should always be available. * - * @return Command[] An array of default Command instances + * @return Command[] */ - protected function getDefaultCommands() + protected function getDefaultCommands(): array { - return [new HelpCommand(), new ListCommand()]; + return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()]; } /** * Gets the default helper set with the helpers that should always be available. - * - * @return HelperSet A HelperSet instance */ - protected function getDefaultHelperSet() + protected function getDefaultHelperSet(): HelperSet { return new HelperSet([ new FormatterHelper(), @@ -1082,10 +1087,8 @@ class Application implements ResetInterface * Returns the namespace part of the command name. * * This method is not part of public API and should not be used directly. - * - * @return string The namespace of the command */ - public function extractNamespace(string $name, int $limit = null) + public function extractNamespace(string $name, int $limit = null): string { $parts = explode(':', $name, -1); @@ -1096,7 +1099,7 @@ class Application implements ResetInterface * Finds alternative of $name among $collection, * if nothing is found in $collection, try in $abbrevs. * - * @return string[] A sorted array of similar string + * @return string[] */ private function findAlternatives(string $name, iterable $collection): array { @@ -1143,9 +1146,9 @@ class Application implements ResetInterface /** * Sets the default Command name. * - * @return self + * @return $this */ - public function setDefaultCommand(string $commandName, bool $isSingleCommand = false) + public function setDefaultCommand(string $commandName, bool $isSingleCommand = false): static { $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0]; @@ -1206,7 +1209,7 @@ class Application implements ResetInterface /** * Returns all namespaces of the command name. * - * @return string[] The namespaces of the command + * @return string[] */ private function extractAllNamespaces(string $name): array { diff --git a/vendor/symfony/console/CHANGELOG.md b/vendor/symfony/console/CHANGELOG.md index 8808563..9a93c79 100644 --- a/vendor/symfony/console/CHANGELOG.md +++ b/vendor/symfony/console/CHANGELOG.md @@ -1,6 +1,21 @@ 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 +--- + + * Add `TesterTrait::assertCommandIsSuccessful()` to test command + * Deprecate `HelperSet::setCommand()` and `getCommand()` without replacement + 5.3 --- @@ -12,6 +27,7 @@ CHANGELOG * Add support for bright colors * Add `#[AsCommand]` attribute for declaring commands on PHP 8 * Add `Helper::width()` and `Helper::length()` + * The `--ansi` and `--no-ansi` options now default to `null`. 5.2.0 ----- diff --git a/vendor/symfony/console/Color.php b/vendor/symfony/console/Color.php index 22a4ce9..7fcc507 100644 --- a/vendor/symfony/console/Color.php +++ b/vendor/symfony/console/Color.php @@ -49,9 +49,9 @@ final class Color 'conceal' => ['set' => 8, 'unset' => 28], ]; - private $foreground; - private $background; - private $options = []; + private string $foreground; + private string $background; + private array $options = []; public function __construct(string $foreground = '', string $background = '', array $options = []) { diff --git a/vendor/symfony/console/Command/Command.php b/vendor/symfony/console/Command/Command.php index 3b09d99..e69bae0 100644 --- a/vendor/symfony/console/Command/Command.php +++ b/vendor/symfony/console/Command/Command.php @@ -13,6 +13,8 @@ namespace Symfony\Component\Console\Command; use Symfony\Component\Console\Application; use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Exception\ExceptionInterface; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Exception\LogicException; @@ -45,29 +47,26 @@ class Command */ protected static $defaultDescription; - private $application; - private $name; - private $processTitle; - private $aliases = []; + private $application = null; + private ?string $name = null; + private ?string $processTitle = null; + private array $aliases = []; private $definition; - private $hidden = false; - private $help = ''; - private $description = ''; - private $fullDefinition; - private $ignoreValidationErrors = false; - private $code; - private $synopsis = []; - private $usages = []; - private $helperSet; + 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; - /** - * @return string|null The default command name or null when no default name is set - */ - public static function getDefaultName() + public static function getDefaultName(): ?string { $class = static::class; - if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { + if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { return $attribute[0]->newInstance()->name; } @@ -76,14 +75,11 @@ class Command return $class === $r->class ? static::$defaultName : null; } - /** - * @return string|null The default command description or null when no default description is set - */ public static function getDefaultDescription(): ?string { $class = static::class; - if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { + if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { return $attribute[0]->newInstance()->description; } @@ -152,20 +148,16 @@ class Command /** * Gets the helper set. - * - * @return HelperSet|null A HelperSet instance */ - public function getHelperSet() + public function getHelperSet(): ?HelperSet { return $this->helperSet; } /** * Gets the application instance for this command. - * - * @return Application|null An Application instance */ - public function getApplication() + public function getApplication(): ?Application { return $this->application; } @@ -173,7 +165,7 @@ class Command /** * Checks whether the command is enabled or not in the current environment. * - * Override this to check for x or y and return false if the command can not + * Override this to check for x or y and return false if the command cannot * run properly under the current conditions. * * @return bool @@ -248,7 +240,7 @@ class Command * @see setCode() * @see execute() */ - public function run(InputInterface $input, OutputInterface $output) + public function run(InputInterface $input, OutputInterface $output): int { // add the application arguments and options $this->mergeApplicationDefinition(); @@ -306,6 +298,13 @@ class Command return is_numeric($statusCode) ? (int) $statusCode : 0; } + /** + * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). + */ + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + } + /** * Sets the code to execute when running this command. * @@ -320,7 +319,7 @@ class Command * * @see execute() */ - public function setCode(callable $code) + public function setCode(callable $code): static { if ($code instanceof \Closure) { $r = new \ReflectionFunction($code); @@ -334,6 +333,8 @@ class Command restore_error_handler(); } } + } else { + $code = \Closure::fromCallable($code); } $this->code = $code; @@ -371,11 +372,9 @@ class Command /** * 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($definition) + public function setDefinition(array|InputDefinition $definition): static { if ($definition instanceof InputDefinition) { $this->definition = $definition; @@ -390,10 +389,8 @@ class Command /** * Gets the InputDefinition attached to this Command. - * - * @return InputDefinition An InputDefinition instance */ - public function getDefinition() + public function getDefinition(): InputDefinition { return $this->fullDefinition ?? $this->getNativeDefinition(); } @@ -405,16 +402,10 @@ class Command * be changed by merging with the application InputDefinition. * * This method is not part of public API and should not be used directly. - * - * @return InputDefinition An InputDefinition instance */ - public function getNativeDefinition() + public function getNativeDefinition(): InputDefinition { - 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; + return $this->definition ?? throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); } /** @@ -427,7 +418,7 @@ class Command * * @return $this */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null) + public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null): static { $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); if (null !== $this->fullDefinition) { @@ -440,15 +431,15 @@ class Command /** * Adds an option. * - * @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) + * @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) * * @throws InvalidArgumentException If option mode is invalid or incompatible * * @return $this */ - public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) + public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null): static { $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); if (null !== $this->fullDefinition) { @@ -470,7 +461,7 @@ class Command * * @throws InvalidArgumentException When the name is invalid */ - public function setName(string $name) + public function setName(string $name): static { $this->validateName($name); @@ -487,7 +478,7 @@ class Command * * @return $this */ - public function setProcessTitle(string $title) + public function setProcessTitle(string $title): static { $this->processTitle = $title; @@ -496,23 +487,18 @@ class Command /** * Returns the command name. - * - * @return string|null */ - public function getName() + public function getName(): ?string { 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*/) + public function setHidden(bool $hidden = true): static { $this->hidden = $hidden; @@ -522,7 +508,7 @@ class Command /** * @return bool whether the command should be publicly shown or not */ - public function isHidden() + public function isHidden(): bool { return $this->hidden; } @@ -532,7 +518,7 @@ class Command * * @return $this */ - public function setDescription(string $description) + public function setDescription(string $description): static { $this->description = $description; @@ -541,10 +527,8 @@ class Command /** * Returns the description for the command. - * - * @return string The description for the command */ - public function getDescription() + public function getDescription(): string { return $this->description; } @@ -554,7 +538,7 @@ class Command * * @return $this */ - public function setHelp(string $help) + public function setHelp(string $help): static { $this->help = $help; @@ -563,10 +547,8 @@ class Command /** * Returns the help for the command. - * - * @return string The help for the command */ - public function getHelp() + public function getHelp(): string { return $this->help; } @@ -574,10 +556,8 @@ class Command /** * Returns the processed help for the command replacing the %command.name% and * %command.full_name% patterns with the real values dynamically. - * - * @return string The processed help for the command */ - public function getProcessedHelp() + public function getProcessedHelp(): string { $name = $this->name; $isSingleCommand = $this->application && $this->application->isSingleCommand(); @@ -603,7 +583,7 @@ class Command * * @throws InvalidArgumentException When an alias is invalid */ - public function setAliases(iterable $aliases) + public function setAliases(iterable $aliases): static { $list = []; @@ -619,10 +599,8 @@ class Command /** * Returns the aliases for the command. - * - * @return array An array of aliases for the command */ - public function getAliases() + public function getAliases(): array { return $this->aliases; } @@ -631,10 +609,8 @@ class Command * 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 The synopsis */ - public function getSynopsis(bool $short = false) + public function getSynopsis(bool $short = false): string { $key = $short ? 'short' : 'long'; @@ -650,7 +626,7 @@ class Command * * @return $this */ - public function addUsage(string $usage) + public function addUsage(string $usage): static { if (!str_starts_with($usage, $this->name)) { $usage = sprintf('%s %s', $this->name, $usage); @@ -663,10 +639,8 @@ class Command /** * Returns alternative usages of the command. - * - * @return array */ - public function getUsages() + public function getUsages(): array { return $this->usages; } @@ -674,12 +648,10 @@ class Command /** * Gets a helper instance by name. * - * @return mixed The helper value - * * @throws LogicException if no HelperSet is defined * @throws InvalidArgumentException if the helper is not defined */ - public function getHelper(string $name) + public function getHelper(string $name): mixed { 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/vendor/symfony/console/Command/CompleteCommand.php b/vendor/symfony/console/Command/CompleteCommand.php new file mode 100644 index 0000000..97357d6 --- /dev/null +++ b/vendor/symfony/console/Command/CompleteCommand.php @@ -0,0 +1,204 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Completion\Output\BashCompletionOutput; +use Symfony\Component\Console\Completion\Output\CompletionOutputInterface; +use Symfony\Component\Console\Exception\CommandNotFoundException; +use Symfony\Component\Console\Exception\ExceptionInterface; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Responsible for providing the values to the shell completion. + * + * @author Wouter de Jong + */ +final class CompleteCommand extends Command +{ + protected static $defaultName = '|_complete'; + protected static $defaultDescription = 'Internal command to provide shell completion suggestions'; + + private $completionOutputs; + + private $isDebug = false; + + /** + * @param array> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value + */ + public function __construct(array $completionOutputs = []) + { + // must be set before the parent constructor, as the property value is used in configure() + $this->completionOutputs = $completionOutputs + ['bash' => BashCompletionOutput::class]; + + parent::__construct(); + } + + protected function configure(): void + { + $this + ->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("'.implode('", "', array_keys($this->completionOutputs)).'")') + ->addOption('input', 'i', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An array of input tokens (e.g. COMP_WORDS or argv)') + ->addOption('current', 'c', InputOption::VALUE_REQUIRED, 'The index of the "input" array that the cursor is in (e.g. COMP_CWORD)') + ->addOption('symfony', 'S', InputOption::VALUE_REQUIRED, 'The version of the completion script') + ; + } + + protected function initialize(InputInterface $input, OutputInterface $output) + { + $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOLEAN); + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + try { + // uncomment when a bugfix or BC break has been introduced in the shell completion scripts + //$version = $input->getOption('symfony'); + //if ($version && version_compare($version, 'x.y', '>=')) { + // $message = sprintf('Completion script version is not supported ("%s" given, ">=x.y" required).', $version); + // $this->log($message); + + // $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.'); + + // return 126; + //} + + $shell = $input->getOption('shell'); + if (!$shell) { + throw new \RuntimeException('The "--shell" option must be set.'); + } + + if (!$completionOutput = $this->completionOutputs[$shell] ?? false) { + throw new \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); + } + + $completionInput = $this->createCompletionInput($input); + $suggestions = new CompletionSuggestions(); + + $this->log([ + '', + ''.date('Y-m-d H:i:s').'', + 'Input: ("|" indicates the cursor position)', + ' '.(string) $completionInput, + 'Command:', + ' '.(string) implode(' ', $_SERVER['argv']), + 'Messages:', + ]); + + $command = $this->findCommand($completionInput, $output); + if (null === $command) { + $this->log(' No command found, completing using the Application class.'); + + $this->getApplication()->complete($completionInput, $suggestions); + } elseif ( + $completionInput->mustSuggestArgumentValuesFor('command') + && $command->getName() !== $completionInput->getCompletionValue() + ) { + $this->log(' No command found, completing using the Application class.'); + + // expand shortcut names ("cache:cl") into their full name ("cache:clear") + $suggestions->suggestValue($command->getName()); + } else { + $command->mergeApplicationDefinition(); + $completionInput->bind($command->getDefinition()); + + if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { + $this->log(' Completing option names for the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' command.'); + + $suggestions->suggestOptions($command->getDefinition()->getOptions()); + } else { + $this->log([ + ' Completing using the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' class.', + ' Completing '.$completionInput->getCompletionType().' for '.$completionInput->getCompletionName().'', + ]); + if (null !== $compval = $completionInput->getCompletionValue()) { + $this->log(' Current value: '.$compval.''); + } + + $command->complete($completionInput, $suggestions); + } + } + + /** @var CompletionOutputInterface $completionOutput */ + $completionOutput = new $completionOutput(); + + $this->log('Suggestions:'); + if ($options = $suggestions->getOptionSuggestions()) { + $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options))); + } elseif ($values = $suggestions->getValueSuggestions()) { + $this->log(' '.implode(' ', $values)); + } else { + $this->log(' No suggestions were provided'); + } + + $completionOutput->write($suggestions, $output); + } catch (\Throwable $e) { + $this->log([ + 'Error!', + (string) $e, + ]); + + if ($output->isDebug()) { + throw $e; + } + + return self::FAILURE; + } + + return self::SUCCESS; + } + + private function createCompletionInput(InputInterface $input): CompletionInput + { + $currentIndex = $input->getOption('current'); + if (!$currentIndex || !ctype_digit($currentIndex)) { + throw new \RuntimeException('The "--current" option must be set and it must be an integer.'); + } + + $completionInput = CompletionInput::fromTokens($input->getOption('input'), (int) $currentIndex); + + try { + $completionInput->bind($this->getApplication()->getDefinition()); + } catch (ExceptionInterface $e) { + } + + return $completionInput; + } + + private function findCommand(CompletionInput $completionInput, OutputInterface $output): ?Command + { + try { + $inputName = $completionInput->getFirstArgument(); + if (null === $inputName) { + return null; + } + + return $this->getApplication()->find($inputName); + } catch (CommandNotFoundException $e) { + } + + return null; + } + + private function log($messages): void + { + if (!$this->isDebug) { + return; + } + + $commandName = basename($_SERVER['argv'][0]); + file_put_contents(sys_get_temp_dir().'/sf_'.$commandName.'.log', implode(\PHP_EOL, (array) $messages).\PHP_EOL, \FILE_APPEND); + } +} diff --git a/vendor/symfony/console/Command/DumpCompletionCommand.php b/vendor/symfony/console/Command/DumpCompletionCommand.php new file mode 100644 index 0000000..64a8005 --- /dev/null +++ b/vendor/symfony/console/Command/DumpCompletionCommand.php @@ -0,0 +1,133 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Command; + +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\ConsoleOutputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Process\Process; + +/** + * Dumps the completion script for the current shell. + * + * @author Wouter de Jong + */ +final class DumpCompletionCommand extends Command +{ + protected static $defaultName = 'completion'; + protected static $defaultDescription = 'Dump the shell completion script'; + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('shell')) { + $suggestions->suggestValues($this->getSupportedShells()); + } + } + + protected function configure() + { + $fullCommand = $_SERVER['PHP_SELF']; + $commandName = basename($fullCommand); + $fullCommand = realpath($fullCommand) ?: $fullCommand; + + $this + ->setHelp(<<%command.name% command dumps the shell completion script required +to use shell autocompletion (currently only bash completion is supported). + +Static installation +------------------- + +Dump the script to a global completion file and restart your shell: + + %command.full_name% bash | sudo tee /etc/bash_completion.d/${commandName} + +Or dump the script to a local file and source it: + + %command.full_name% bash > completion.sh + + # source the file whenever you use the project + source completion.sh + + # or add this line at the end of your "~/.bashrc" file: + source /path/to/completion.sh + +Dynamic installation +-------------------- + +Add this to the end of your shell configuration file (e.g. "~/.bashrc"): + + eval "$(${fullCommand} completion bash)" +EOH + ) + ->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given') + ->addOption('debug', null, InputOption::VALUE_NONE, 'Tail the completion debug log') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $commandName = basename($_SERVER['argv'][0]); + + if ($input->getOption('debug')) { + $this->tailDebugLog($commandName, $output); + + return self::SUCCESS; + } + + $shell = $input->getArgument('shell') ?? self::guessShell(); + $completionFile = __DIR__.'/../Resources/completion.'.$shell; + if (!file_exists($completionFile)) { + $supportedShells = $this->getSupportedShells(); + + ($output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output) + ->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); + + return self::INVALID; + } + + $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, $this->getApplication()->getVersion()], file_get_contents($completionFile))); + + return self::SUCCESS; + } + + private static function guessShell(): string + { + return basename($_SERVER['SHELL'] ?? ''); + } + + private function tailDebugLog(string $commandName, OutputInterface $output): void + { + $debugFile = sys_get_temp_dir().'/sf_'.$commandName.'.log'; + if (!file_exists($debugFile)) { + touch($debugFile); + } + $process = new Process(['tail', '-f', $debugFile], null, null, null, 0); + $process->run(function (string $type, string $line) use ($output): void { + $output->write($line); + }); + } + + /** + * @return string[] + */ + private function getSupportedShells(): array + { + return array_map(function ($f) { + return pathinfo($f, \PATHINFO_EXTENSION); + }, glob(__DIR__.'/../Resources/completion.*')); + } +} diff --git a/vendor/symfony/console/Command/HelpCommand.php b/vendor/symfony/console/Command/HelpCommand.php index 9bcd776..66f8593 100644 --- a/vendor/symfony/console/Command/HelpCommand.php +++ b/vendor/symfony/console/Command/HelpCommand.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Console\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Descriptor\ApplicationDescription; use Symfony\Component\Console\Helper\DescriptorHelper; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -64,11 +67,9 @@ EOF /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { - if (null === $this->command) { - $this->command = $this->getApplication()->find($input->getArgument('command_name')); - } + $this->command ??= $this->getApplication()->find($input->getArgument('command_name')); $helper = new DescriptorHelper(); $helper->describe($output, $this->command, [ @@ -76,8 +77,23 @@ EOF 'raw_text' => $input->getOption('raw'), ]); - $this->command = null; + unset($this->command); return 0; } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('command_name')) { + $descriptor = new ApplicationDescription($this->getApplication()); + $suggestions->suggestValues(array_keys($descriptor->getCommands())); + + return; + } + + if ($input->mustSuggestOptionValuesFor('format')) { + $helper = new DescriptorHelper(); + $suggestions->suggestValues($helper->getFormats()); + } + } } diff --git a/vendor/symfony/console/Command/LazyCommand.php b/vendor/symfony/console/Command/LazyCommand.php index 763133e..aec4126 100644 --- a/vendor/symfony/console/Command/LazyCommand.php +++ b/vendor/symfony/console/Command/LazyCommand.php @@ -12,6 +12,8 @@ namespace Symfony\Component\Console\Command; use Symfony\Component\Console\Application; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputInterface; @@ -23,7 +25,7 @@ use Symfony\Component\Console\Output\OutputInterface; final class LazyCommand extends Command { private $command; - private $isEnabled; + private ?bool $isEnabled; public function __construct(string $name, array $aliases, string $description, bool $isHidden, \Closure $commandFactory, ?bool $isEnabled = true) { @@ -69,10 +71,12 @@ final class LazyCommand extends Command return $this->getCommand()->run($input, $output); } - /** - * @return $this - */ - public function setCode(callable $code): self + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + $this->getCommand()->complete($input, $suggestions); + } + + public function setCode(callable $code): static { $this->getCommand()->setCode($code); @@ -87,10 +91,7 @@ final class LazyCommand extends Command $this->getCommand()->mergeApplicationDefinition($mergeArgs); } - /** - * @return $this - */ - public function setDefinition($definition): self + public function setDefinition(array|InputDefinition $definition): static { $this->getCommand()->setDefinition($definition); @@ -107,40 +108,28 @@ final class LazyCommand extends Command return $this->getCommand()->getNativeDefinition(); } - /** - * @return $this - */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null): self + public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null): static { $this->getCommand()->addArgument($name, $mode, $description, $default); return $this; } - /** - * @return $this - */ - public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null): self + public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null): static { $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default); return $this; } - /** - * @return $this - */ - public function setProcessTitle(string $title): self + public function setProcessTitle(string $title): static { $this->getCommand()->setProcessTitle($title); return $this; } - /** - * @return $this - */ - public function setHelp(string $help): self + public function setHelp(string $help): static { $this->getCommand()->setHelp($help); @@ -162,10 +151,7 @@ final class LazyCommand extends Command return $this->getCommand()->getSynopsis($short); } - /** - * @return $this - */ - public function addUsage(string $usage): self + public function addUsage(string $usage): static { $this->getCommand()->addUsage($usage); @@ -177,10 +163,7 @@ final class LazyCommand extends Command return $this->getCommand()->getUsages(); } - /** - * @return mixed - */ - public function getHelper(string $name) + public function getHelper(string $name): mixed { return $this->getCommand()->getHelper($name); } diff --git a/vendor/symfony/console/Command/ListCommand.php b/vendor/symfony/console/Command/ListCommand.php index a192285..5c7260f 100644 --- a/vendor/symfony/console/Command/ListCommand.php +++ b/vendor/symfony/console/Command/ListCommand.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Console\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Descriptor\ApplicationDescription; use Symfony\Component\Console\Helper\DescriptorHelper; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -62,7 +65,7 @@ EOF /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $helper = new DescriptorHelper(); $helper->describe($output, $this->getApplication(), [ @@ -74,4 +77,19 @@ EOF return 0; } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('namespace')) { + $descriptor = new ApplicationDescription($this->getApplication()); + $suggestions->suggestValues(array_keys($descriptor->getNamespaces())); + + return; + } + + if ($input->mustSuggestOptionValuesFor('format')) { + $helper = new DescriptorHelper(); + $suggestions->suggestValues($helper->getFormats()); + } + } } diff --git a/vendor/symfony/console/Command/LockableTrait.php b/vendor/symfony/console/Command/LockableTrait.php index 60cfe36..7969551 100644 --- a/vendor/symfony/console/Command/LockableTrait.php +++ b/vendor/symfony/console/Command/LockableTrait.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Console\Command; use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Lock\Lock; use Symfony\Component\Lock\LockFactory; use Symfony\Component\Lock\Store\FlockStore; use Symfony\Component\Lock\Store\SemaphoreStore; @@ -24,8 +23,7 @@ use Symfony\Component\Lock\Store\SemaphoreStore; */ trait LockableTrait { - /** @var Lock */ - private $lock; + private $lock = null; /** * Locks a command. diff --git a/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php index d4f44e8..b6b637c 100644 --- a/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php +++ b/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php @@ -22,21 +22,17 @@ interface CommandLoaderInterface /** * Loads a command. * - * @return Command - * * @throws CommandNotFoundException */ - public function get(string $name); + public function get(string $name): Command; /** * Checks if a command exists. - * - * @return bool */ - public function has(string $name); + public function has(string $name): bool; /** - * @return string[] All registered command names + * @return string[] */ - public function getNames(); + public function getNames(): array; } diff --git a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php index ddccb3d..9b26577 100644 --- a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ b/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Console\CommandLoader; use Psr\Container\ContainerInterface; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\CommandNotFoundException; /** @@ -22,7 +23,7 @@ use Symfony\Component\Console\Exception\CommandNotFoundException; class ContainerCommandLoader implements CommandLoaderInterface { private $container; - private $commandMap; + private array $commandMap; /** * @param array $commandMap An array with command names as keys and service ids as values @@ -36,7 +37,7 @@ class ContainerCommandLoader implements CommandLoaderInterface /** * {@inheritdoc} */ - public function get(string $name) + public function get(string $name): Command { if (!$this->has($name)) { throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); @@ -48,7 +49,7 @@ class ContainerCommandLoader implements CommandLoaderInterface /** * {@inheritdoc} */ - public function has(string $name) + public function has(string $name): bool { return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]); } @@ -56,7 +57,7 @@ class ContainerCommandLoader implements CommandLoaderInterface /** * {@inheritdoc} */ - public function getNames() + public function getNames(): array { return array_keys($this->commandMap); } diff --git a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php index 7e2db34..c55dc1d 100644 --- a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ b/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Console\CommandLoader; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\CommandNotFoundException; /** @@ -20,7 +21,7 @@ use Symfony\Component\Console\Exception\CommandNotFoundException; */ class FactoryCommandLoader implements CommandLoaderInterface { - private $factories; + private array $factories; /** * @param callable[] $factories Indexed by command names @@ -33,7 +34,7 @@ class FactoryCommandLoader implements CommandLoaderInterface /** * {@inheritdoc} */ - public function has(string $name) + public function has(string $name): bool { return isset($this->factories[$name]); } @@ -41,7 +42,7 @@ class FactoryCommandLoader implements CommandLoaderInterface /** * {@inheritdoc} */ - public function get(string $name) + public function get(string $name): Command { if (!isset($this->factories[$name])) { throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); @@ -55,7 +56,7 @@ class FactoryCommandLoader implements CommandLoaderInterface /** * {@inheritdoc} */ - public function getNames() + public function getNames(): array { return array_keys($this->factories); } diff --git a/vendor/symfony/console/Completion/CompletionInput.php b/vendor/symfony/console/Completion/CompletionInput.php new file mode 100644 index 0000000..368b945 --- /dev/null +++ b/vendor/symfony/console/Completion/CompletionInput.php @@ -0,0 +1,249 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion; + +use Symfony\Component\Console\Exception\RuntimeException; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\InputDefinition; +use Symfony\Component\Console\Input\InputOption; + +/** + * An input specialized for shell completion. + * + * This input allows unfinished option names or values and exposes what kind of + * completion is expected. + * + * @author Wouter de Jong + */ +final class CompletionInput extends ArgvInput +{ + public const TYPE_ARGUMENT_VALUE = 'argument_value'; + public const TYPE_OPTION_VALUE = 'option_value'; + public const TYPE_OPTION_NAME = 'option_name'; + public const TYPE_NONE = 'none'; + + private $tokens; + private $currentIndex; + private $completionType; + private $completionName = null; + private $completionValue = ''; + + /** + * Converts a terminal string into tokens. + * + * This is required for shell completions without COMP_WORDS support. + */ + public static function fromString(string $inputStr, int $currentIndex): self + { + preg_match_all('/(?<=^|\s)([\'"]?)(.+?)(?tokens = $tokens; + $input->currentIndex = $currentIndex; + + return $input; + } + + /** + * {@inheritdoc} + */ + public function bind(InputDefinition $definition): void + { + parent::bind($definition); + + $relevantToken = $this->getRelevantToken(); + if ('-' === $relevantToken[0]) { + // the current token is an input option: complete either option name or option value + [$optionToken, $optionValue] = explode('=', $relevantToken, 2) + ['', '']; + + $option = $this->getOptionFromToken($optionToken); + if (null === $option && !$this->isCursorFree()) { + $this->completionType = self::TYPE_OPTION_NAME; + $this->completionValue = $relevantToken; + + return; + } + + if (null !== $option && $option->acceptValue()) { + $this->completionType = self::TYPE_OPTION_VALUE; + $this->completionName = $option->getName(); + $this->completionValue = $optionValue ?: (!str_starts_with($optionToken, '--') ? substr($optionToken, 2) : ''); + + return; + } + } + + $previousToken = $this->tokens[$this->currentIndex - 1]; + if ('-' === $previousToken[0] && '' !== trim($previousToken, '-')) { + // check if previous option accepted a value + $previousOption = $this->getOptionFromToken($previousToken); + if (null !== $previousOption && $previousOption->acceptValue()) { + $this->completionType = self::TYPE_OPTION_VALUE; + $this->completionName = $previousOption->getName(); + $this->completionValue = $relevantToken; + + return; + } + } + + // complete argument value + $this->completionType = self::TYPE_ARGUMENT_VALUE; + + foreach ($this->definition->getArguments() as $argumentName => $argument) { + if (!isset($this->arguments[$argumentName])) { + break; + } + + $argumentValue = $this->arguments[$argumentName]; + $this->completionName = $argumentName; + if (\is_array($argumentValue)) { + $this->completionValue = $argumentValue ? $argumentValue[array_key_last($argumentValue)] : null; + } else { + $this->completionValue = $argumentValue; + } + } + + if ($this->currentIndex >= \count($this->tokens)) { + if (!isset($this->arguments[$argumentName]) || $this->definition->getArgument($argumentName)->isArray()) { + $this->completionName = $argumentName; + $this->completionValue = ''; + } else { + // we've reached the end + $this->completionType = self::TYPE_NONE; + $this->completionName = null; + $this->completionValue = ''; + } + } + } + + /** + * Returns the type of completion required. + * + * TYPE_ARGUMENT_VALUE when completing the value of an input argument + * TYPE_OPTION_VALUE when completing the value of an input option + * TYPE_OPTION_NAME when completing the name of an input option + * TYPE_NONE when nothing should be completed + * + * @return string One of self::TYPE_* constants. TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component + */ + public function getCompletionType(): string + { + return $this->completionType; + } + + /** + * The name of the input option or argument when completing a value. + * + * @return string|null returns null when completing an option name + */ + public function getCompletionName(): ?string + { + return $this->completionName; + } + + /** + * The value already typed by the user (or empty string). + */ + public function getCompletionValue(): string + { + return $this->completionValue; + } + + public function mustSuggestOptionValuesFor(string $optionName): bool + { + return self::TYPE_OPTION_VALUE === $this->getCompletionType() && $optionName === $this->getCompletionName(); + } + + public function mustSuggestArgumentValuesFor(string $argumentName): bool + { + return self::TYPE_ARGUMENT_VALUE === $this->getCompletionType() && $argumentName === $this->getCompletionName(); + } + + protected function parseToken(string $token, bool $parseOptions): bool + { + try { + return parent::parseToken($token, $parseOptions); + } catch (RuntimeException $e) { + // suppress errors, completed input is almost never valid + } + + return $parseOptions; + } + + private function getOptionFromToken(string $optionToken): ?InputOption + { + $optionName = ltrim($optionToken, '-'); + if (!$optionName) { + return null; + } + + if ('-' === ($optionToken[1] ?? ' ')) { + // long option name + return $this->definition->hasOption($optionName) ? $this->definition->getOption($optionName) : null; + } + + // short option name + return $this->definition->hasShortcut($optionName[0]) ? $this->definition->getOptionForShortcut($optionName[0]) : null; + } + + /** + * The token of the cursor, or the last token if the cursor is at the end of the input. + */ + private function getRelevantToken(): string + { + return $this->tokens[$this->isCursorFree() ? $this->currentIndex - 1 : $this->currentIndex]; + } + + /** + * Whether the cursor is "free" (i.e. at the end of the input preceded by a space). + */ + private function isCursorFree(): bool + { + $nrOfTokens = \count($this->tokens); + if ($this->currentIndex > $nrOfTokens) { + throw new \LogicException('Current index is invalid, it must be the number of input tokens or one more.'); + } + + return $this->currentIndex >= $nrOfTokens; + } + + public function __toString() + { + $str = ''; + foreach ($this->tokens as $i => $token) { + $str .= $token; + + if ($this->currentIndex === $i) { + $str .= '|'; + } + + $str .= ' '; + } + + if ($this->currentIndex > $i) { + $str .= '|'; + } + + return rtrim($str); + } +} diff --git a/vendor/symfony/console/Completion/CompletionSuggestions.php b/vendor/symfony/console/Completion/CompletionSuggestions.php new file mode 100644 index 0000000..7191181 --- /dev/null +++ b/vendor/symfony/console/Completion/CompletionSuggestions.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion; + +use Symfony\Component\Console\Input\InputOption; + +/** + * Stores all completion suggestions for the current input. + * + * @author Wouter de Jong + */ +final class CompletionSuggestions +{ + private $valueSuggestions = []; + private $optionSuggestions = []; + + /** + * Add a suggested value for an input option or argument. + * + * @return $this + */ + public function suggestValue(string|Suggestion $value): static + { + $this->valueSuggestions[] = !$value instanceof Suggestion ? new Suggestion($value) : $value; + + return $this; + } + + /** + * Add multiple suggested values at once for an input option or argument. + * + * @param list $values + * + * @return $this + */ + public function suggestValues(array $values): static + { + foreach ($values as $value) { + $this->suggestValue($value); + } + + return $this; + } + + /** + * Add a suggestion for an input option name. + * + * @return $this + */ + public function suggestOption(InputOption $option): static + { + $this->optionSuggestions[] = $option; + + return $this; + } + + /** + * Add multiple suggestions for input option names at once. + * + * @param InputOption[] $options + * + * @return $this + */ + public function suggestOptions(array $options): static + { + foreach ($options as $option) { + $this->suggestOption($option); + } + + return $this; + } + + /** + * @return InputOption[] + */ + public function getOptionSuggestions(): array + { + return $this->optionSuggestions; + } + + /** + * @return Suggestion[] + */ + public function getValueSuggestions(): array + { + return $this->valueSuggestions; + } +} diff --git a/vendor/symfony/console/Completion/Output/BashCompletionOutput.php b/vendor/symfony/console/Completion/Output/BashCompletionOutput.php new file mode 100644 index 0000000..8d5ffa6 --- /dev/null +++ b/vendor/symfony/console/Completion/Output/BashCompletionOutput.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion\Output; + +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author Wouter de Jong + */ +class BashCompletionOutput implements CompletionOutputInterface +{ + public function write(CompletionSuggestions $suggestions, OutputInterface $output): void + { + $values = $suggestions->getValueSuggestions(); + foreach ($suggestions->getOptionSuggestions() as $option) { + $values[] = '--'.$option->getName(); + } + $output->writeln(implode("\n", $values)); + } +} diff --git a/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php b/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php new file mode 100644 index 0000000..659e596 --- /dev/null +++ b/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion\Output; + +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Transforms the {@see CompletionSuggestions} object into output readable by the shell completion. + * + * @author Wouter de Jong + */ +interface CompletionOutputInterface +{ + public function write(CompletionSuggestions $suggestions, OutputInterface $output): void; +} diff --git a/vendor/symfony/console/Completion/Suggestion.php b/vendor/symfony/console/Completion/Suggestion.php new file mode 100644 index 0000000..ff156f8 --- /dev/null +++ b/vendor/symfony/console/Completion/Suggestion.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Completion; + +/** + * Represents a single suggested value. + * + * @author Wouter de Jong + */ +class Suggestion +{ + private string $value; + + public function __construct(string $value) + { + $this->value = $value; + } + + public function getValue(): string + { + return $this->value; + } + + public function __toString(): string + { + return $this->getValue(); + } +} diff --git a/vendor/symfony/console/Cursor.php b/vendor/symfony/console/Cursor.php index dcb5b5a..995e3d7 100644 --- a/vendor/symfony/console/Cursor.php +++ b/vendor/symfony/console/Cursor.php @@ -21,76 +21,109 @@ final class Cursor private $output; private $input; + /** + * @param resource|null $input + */ public function __construct(OutputInterface $output, $input = null) { $this->output = $output; $this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+')); } - public function moveUp(int $lines = 1): self + /** + * @return $this + */ + public function moveUp(int $lines = 1): static { $this->output->write(sprintf("\x1b[%dA", $lines)); return $this; } - public function moveDown(int $lines = 1): self + /** + * @return $this + */ + public function moveDown(int $lines = 1): static { $this->output->write(sprintf("\x1b[%dB", $lines)); return $this; } - public function moveRight(int $columns = 1): self + /** + * @return $this + */ + public function moveRight(int $columns = 1): static { $this->output->write(sprintf("\x1b[%dC", $columns)); return $this; } - public function moveLeft(int $columns = 1): self + /** + * @return $this + */ + public function moveLeft(int $columns = 1): static { $this->output->write(sprintf("\x1b[%dD", $columns)); return $this; } - public function moveToColumn(int $column): self + /** + * @return $this + */ + public function moveToColumn(int $column): static { $this->output->write(sprintf("\x1b[%dG", $column)); return $this; } - public function moveToPosition(int $column, int $row): self + /** + * @return $this + */ + public function moveToPosition(int $column, int $row): static { $this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column)); return $this; } - public function savePosition(): self + /** + * @return $this + */ + public function savePosition(): static { $this->output->write("\x1b7"); return $this; } - public function restorePosition(): self + /** + * @return $this + */ + public function restorePosition(): static { $this->output->write("\x1b8"); return $this; } - public function hide(): self + /** + * @return $this + */ + public function hide(): static { $this->output->write("\x1b[?25l"); return $this; } - public function show(): self + /** + * @return $this + */ + public function show(): static { $this->output->write("\x1b[?25h\x1b[?0c"); @@ -99,8 +132,10 @@ final class Cursor /** * Clears all the output from the current line. + * + * @return $this */ - public function clearLine(): self + public function clearLine(): static { $this->output->write("\x1b[2K"); @@ -119,8 +154,10 @@ final class Cursor /** * Clears all the output from the cursors' current position to the end of the screen. + * + * @return $this */ - public function clearOutput(): self + public function clearOutput(): static { $this->output->write("\x1b[0J"); @@ -129,8 +166,10 @@ final class Cursor /** * Clears the entire screen. + * + * @return $this */ - public function clearScreen(): self + public function clearScreen(): static { $this->output->write("\x1b[2J"); diff --git a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php index 743e306..efaf39a 100644 --- a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ b/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php @@ -29,33 +29,16 @@ use Symfony\Component\DependencyInjection\TypedReference; */ 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($this->commandTag, true); + $commandServices = $container->findTaggedServiceIds('console.command', true); $lazyCommandMap = []; $lazyCommandRefs = []; $serviceIds = []; foreach ($commandServices as $id => $tags) { $definition = $container->getDefinition($id); - $definition->addTag($this->noPreloadTag); + $definition->addTag('container.no_preload'); $class = $container->getParameterBag()->resolveValue($definition->getClass()); if (isset($tags[0]['command'])) { @@ -65,7 +48,7 @@ class AddConsoleCommandPass implements CompilerPassInterface 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, $this->commandTag, Command::class)); + throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); } $aliases = $class::getDefaultName(); } @@ -78,7 +61,7 @@ class AddConsoleCommandPass implements CompilerPassInterface } if (null === $commandName) { - if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag($this->privateTagName)) { + if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag('container.private')) { $commandId = 'console.command.public_alias.'.$id; $container->setAlias($commandId, $id)->setPublic(true); $id = $commandId; @@ -122,7 +105,7 @@ class AddConsoleCommandPass implements CompilerPassInterface 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, $this->commandTag, Command::class)); + throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); } $description = $class::getDefaultDescription(); } @@ -138,9 +121,9 @@ class AddConsoleCommandPass implements CompilerPassInterface } $container - ->register($this->commandLoaderServiceId, ContainerCommandLoader::class) + ->register('console.command_loader', ContainerCommandLoader::class) ->setPublic(true) - ->addTag($this->noPreloadTag) + ->addTag('container.no_preload') ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); $container->setParameter('console.command.ids', $serviceIds); diff --git a/vendor/symfony/console/Descriptor/ApplicationDescription.php b/vendor/symfony/console/Descriptor/ApplicationDescription.php index 3970b90..0802f1b 100644 --- a/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -25,23 +25,19 @@ class ApplicationDescription public const GLOBAL_NAMESPACE = '_global'; private $application; - private $namespace; - private $showHidden; + private ?string $namespace; + private bool $showHidden; + private array $namespaces; /** - * @var array + * @var array */ - private $namespaces; + private array $commands; /** - * @var Command[] + * @var array */ - private $commands; - - /** - * @var Command[] - */ - private $aliases; + private array $aliases = []; public function __construct(Application $application, string $namespace = null, bool $showHidden = false) { @@ -52,7 +48,7 @@ class ApplicationDescription public function getNamespaces(): array { - if (null === $this->namespaces) { + if (!isset($this->namespaces)) { $this->inspectApplication(); } @@ -64,7 +60,7 @@ class ApplicationDescription */ public function getCommands(): array { - if (null === $this->commands) { + if (!isset($this->commands)) { $this->inspectApplication(); } diff --git a/vendor/symfony/console/Descriptor/TextDescriptor.php b/vendor/symfony/console/Descriptor/TextDescriptor.php index fbb140a..3f309f5 100644 --- a/vendor/symfony/console/Descriptor/TextDescriptor.php +++ b/vendor/symfony/console/Descriptor/TextDescriptor.php @@ -273,10 +273,8 @@ class TextDescriptor extends Descriptor /** * Formats input option/argument default value. - * - * @param mixed $default */ - private function formatDefaultValue($default): string + private function formatDefaultValue(mixed $default): string { if (\INF === $default) { return 'INF'; diff --git a/vendor/symfony/console/Event/ConsoleCommandEvent.php b/vendor/symfony/console/Event/ConsoleCommandEvent.php index 08bd18f..31c9ee9 100644 --- a/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ b/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 $commandShouldRun = true; + private bool $commandShouldRun = true; /** * Disables the command, so it won't be run. diff --git a/vendor/symfony/console/Event/ConsoleErrorEvent.php b/vendor/symfony/console/Event/ConsoleErrorEvent.php index 57d9b38..19bd4bf 100644 --- a/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ b/vendor/symfony/console/Event/ConsoleErrorEvent.php @@ -22,8 +22,8 @@ use Symfony\Component\Console\Output\OutputInterface; */ final class ConsoleErrorEvent extends ConsoleEvent { - private $error; - private $exitCode; + private \Throwable $error; + private int $exitCode; public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) { diff --git a/vendor/symfony/console/Event/ConsoleEvent.php b/vendor/symfony/console/Event/ConsoleEvent.php index 89ab645..56b8a9a 100644 --- a/vendor/symfony/console/Event/ConsoleEvent.php +++ b/vendor/symfony/console/Event/ConsoleEvent.php @@ -28,7 +28,7 @@ class ConsoleEvent extends Event private $input; private $output; - public function __construct(Command $command = null, InputInterface $input, OutputInterface $output) + public function __construct(?Command $command, InputInterface $input, OutputInterface $output) { $this->command = $command; $this->input = $input; @@ -37,30 +37,24 @@ class ConsoleEvent extends Event /** * Gets the command that is executed. - * - * @return Command|null A Command instance */ - public function getCommand() + public function getCommand(): ?Command { return $this->command; } /** * Gets the input instance. - * - * @return InputInterface An InputInterface instance */ - public function getInput() + public function getInput(): InputInterface { return $this->input; } /** * Gets the output instance. - * - * @return OutputInterface An OutputInterface instance */ - public function getOutput() + public function getOutput(): OutputInterface { return $this->output; } diff --git a/vendor/symfony/console/Event/ConsoleSignalEvent.php b/vendor/symfony/console/Event/ConsoleSignalEvent.php index ef13ed2..766af69 100644 --- a/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ b/vendor/symfony/console/Event/ConsoleSignalEvent.php @@ -20,7 +20,7 @@ use Symfony\Component\Console\Output\OutputInterface; */ final class ConsoleSignalEvent extends ConsoleEvent { - private $handlingSignal; + private int $handlingSignal; public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) { diff --git a/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/vendor/symfony/console/Event/ConsoleTerminateEvent.php index 190038d..de63c8f 100644 --- a/vendor/symfony/console/Event/ConsoleTerminateEvent.php +++ b/vendor/symfony/console/Event/ConsoleTerminateEvent.php @@ -22,7 +22,7 @@ use Symfony\Component\Console\Output\OutputInterface; */ final class ConsoleTerminateEvent extends ConsoleEvent { - private $exitCode; + private int $exitCode; public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) { diff --git a/vendor/symfony/console/EventListener/ErrorListener.php b/vendor/symfony/console/EventListener/ErrorListener.php index 897d985..61bd9d3 100644 --- a/vendor/symfony/console/EventListener/ErrorListener.php +++ b/vendor/symfony/console/EventListener/ErrorListener.php @@ -69,7 +69,7 @@ class ErrorListener implements EventSubscriberInterface $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ ConsoleEvents::ERROR => ['onConsoleError', -128], @@ -82,7 +82,7 @@ class ErrorListener implements EventSubscriberInterface $commandName = $event->getCommand() ? $event->getCommand()->getName() : null; $input = $event->getInput(); - if (method_exists($input, '__toString')) { + if ($input instanceof \Stringable) { if ($commandName) { return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input); } diff --git a/vendor/symfony/console/Exception/CommandNotFoundException.php b/vendor/symfony/console/Exception/CommandNotFoundException.php index 590a71c..1e9f1c7 100644 --- a/vendor/symfony/console/Exception/CommandNotFoundException.php +++ b/vendor/symfony/console/Exception/CommandNotFoundException.php @@ -18,7 +18,7 @@ namespace Symfony\Component\Console\Exception; */ class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface { - private $alternatives; + private array $alternatives; /** * @param string $message Exception message to throw @@ -34,9 +34,9 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce } /** - * @return string[] A list of similar defined names + * @return string[] */ - public function getAlternatives() + public function getAlternatives(): array { return $this->alternatives; } diff --git a/vendor/symfony/console/Formatter/NullOutputFormatter.php b/vendor/symfony/console/Formatter/NullOutputFormatter.php index 0aa0a5c..d770e14 100644 --- a/vendor/symfony/console/Formatter/NullOutputFormatter.php +++ b/vendor/symfony/console/Formatter/NullOutputFormatter.php @@ -21,9 +21,9 @@ final class NullOutputFormatter implements OutputFormatterInterface /** * {@inheritdoc} */ - public function format(?string $message): void + public function format(?string $message): ?string { - // do nothing + return null; } /** @@ -31,11 +31,8 @@ final class NullOutputFormatter implements OutputFormatterInterface */ public function getStyle(string $name): OutputFormatterStyleInterface { - if ($this->style) { - return $this->style; - } // to comply with the interface we must return a OutputFormatterStyleInterface - return $this->style = new NullOutputFormatterStyle(); + return $this->style ?? $this->style = new NullOutputFormatterStyle(); } /** diff --git a/vendor/symfony/console/Formatter/OutputFormatter.php b/vendor/symfony/console/Formatter/OutputFormatter.php index 80d59b3..4a6ae91 100644 --- a/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/vendor/symfony/console/Formatter/OutputFormatter.php @@ -21,8 +21,8 @@ use Symfony\Component\Console\Exception\InvalidArgumentException; */ class OutputFormatter implements WrappableOutputFormatterInterface { - private $decorated; - private $styles = []; + private bool $decorated; + private array $styles = []; private $styleStack; public function __clone() @@ -34,13 +34,11 @@ class OutputFormatter implements WrappableOutputFormatterInterface } /** - * Escapes "<" special char in given text. - * - * @return string Escaped text + * Escapes "<" and ">" special chars in given text. */ - public static function escape(string $text) + public static function escape(string $text): string { - $text = preg_replace('/([^\\\\]?)])/', '$1\\\\$2', $text); return self::escapeTrailingBackslash($text); } @@ -94,7 +92,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface /** * {@inheritdoc} */ - public function isDecorated() + public function isDecorated(): bool { return $this->decorated; } @@ -110,7 +108,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface /** * {@inheritdoc} */ - public function hasStyle(string $name) + public function hasStyle(string $name): bool { return isset($this->styles[strtolower($name)]); } @@ -118,7 +116,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface /** * {@inheritdoc} */ - public function getStyle(string $name) + public function getStyle(string $name): OutputFormatterStyleInterface { if (!$this->hasStyle($name)) { throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); @@ -130,7 +128,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface /** * {@inheritdoc} */ - public function format(?string $message) + public function format(?string $message): ?string { return $this->formatAndWrap($message, 0); } @@ -140,11 +138,16 @@ class OutputFormatter implements WrappableOutputFormatterInterface */ public function formatAndWrap(?string $message, int $width) { + if (null === $message) { + return ''; + } + $offset = 0; $output = ''; - $tagRegex = '[a-z][^<>]*+'; + $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; + $closeTagRegex = '[a-z][^<>]*+'; $currentLineLength = 0; - preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE); + preg_match_all("#<(($openTagRegex) | /($closeTagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE); foreach ($matches[0] as $i => $match) { $pos = $match[1]; $text = $match[0]; @@ -178,17 +181,10 @@ class OutputFormatter implements WrappableOutputFormatterInterface $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); - if (str_contains($output, "\0")) { - return strtr($output, ["\0" => '\\', '\\<' => '<']); - } - - return str_replace('\\<', '<', $output); + return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']); } - /** - * @return OutputFormatterStyleStack - */ - public function getStyleStack() + public function getStyleStack(): OutputFormatterStyleStack { return $this->styleStack; } @@ -216,7 +212,8 @@ class OutputFormatter implements WrappableOutputFormatterInterface } elseif ('bg' == $match[0]) { $style->setBackground(strtolower($match[1])); } elseif ('href' === $match[0]) { - $style->setHref($match[1]); + $url = preg_replace('{\\\\([<>])}', '$1', $match[1]); + $style->setHref($url); } elseif ('options' === $match[0]) { preg_match_all('([^,;]+)', strtolower($match[1]), $options); $options = array_shift($options); diff --git a/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/vendor/symfony/console/Formatter/OutputFormatterInterface.php index 8c50d41..b94e51d 100644 --- a/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ b/vendor/symfony/console/Formatter/OutputFormatterInterface.php @@ -24,11 +24,9 @@ interface OutputFormatterInterface public function setDecorated(bool $decorated); /** - * Gets the decorated flag. - * - * @return bool true if the output will decorate messages, false otherwise + * Whether the output will decorate messages. */ - public function isDecorated(); + public function isDecorated(): bool; /** * Sets a new style. @@ -37,22 +35,18 @@ interface OutputFormatterInterface /** * Checks if output formatter has style with specified name. - * - * @return bool */ - public function hasStyle(string $name); + public function hasStyle(string $name): bool; /** * Gets style options from style with specified name. * - * @return OutputFormatterStyleInterface - * * @throws \InvalidArgumentException When style isn't defined */ - public function getStyle(string $name); + public function getStyle(string $name): OutputFormatterStyleInterface; /** * Formats a message according to the given styles. */ - public function format(?string $message); + public function format(?string $message): ?string; } diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Formatter/OutputFormatterStyle.php index 0fb36ac..0a009e9 100644 --- a/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -21,11 +21,11 @@ use Symfony\Component\Console\Color; class OutputFormatterStyle implements OutputFormatterStyleInterface { private $color; - private $foreground; - private $background; - private $options; - private $href; - private $handlesHrefGracefully; + private string $foreground; + private string $background; + private array $options; + private ?string $href = null; + private bool $handlesHrefGracefully; /** * Initializes output formatter style. @@ -92,12 +92,10 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface /** * {@inheritdoc} */ - public function apply(string $text) + public function apply(string $text): string { - if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); - } + $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/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php index b30560d..91d50aa 100644 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ b/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php @@ -45,8 +45,6 @@ interface OutputFormatterStyleInterface /** * Applies the style to a given text. - * - * @return string */ - public function apply(string $text); + public function apply(string $text): string; } diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php index fc48dc0..b425449 100644 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @@ -22,7 +22,7 @@ class OutputFormatterStyleStack implements ResetInterface /** * @var OutputFormatterStyleInterface[] */ - private $styles; + private array $styles = []; private $emptyStyle; @@ -51,11 +51,9 @@ class OutputFormatterStyleStack implements ResetInterface /** * Pops a style from the stack. * - * @return OutputFormatterStyleInterface - * * @throws InvalidArgumentException When style tags incorrectly nested */ - public function pop(OutputFormatterStyleInterface $style = null) + public function pop(OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface { if (empty($this->styles)) { return $this->emptyStyle; @@ -78,10 +76,8 @@ class OutputFormatterStyleStack implements ResetInterface /** * Computes current style with stacks top codes. - * - * @return OutputFormatterStyle */ - public function getCurrent() + public function getCurrent(): OutputFormatterStyle { if (empty($this->styles)) { return $this->emptyStyle; @@ -93,17 +89,14 @@ class OutputFormatterStyleStack implements ResetInterface /** * @return $this */ - public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) + public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle): static { $this->emptyStyle = $emptyStyle; return $this; } - /** - * @return OutputFormatterStyleInterface - */ - public function getEmptyStyle() + public function getEmptyStyle(): OutputFormatterStyleInterface { return $this->emptyStyle; } diff --git a/vendor/symfony/console/Helper/DebugFormatterHelper.php b/vendor/symfony/console/Helper/DebugFormatterHelper.php index 9d07ec2..64c7cff 100644 --- a/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ b/vendor/symfony/console/Helper/DebugFormatterHelper.php @@ -20,28 +20,24 @@ namespace Symfony\Component\Console\Helper; */ class DebugFormatterHelper extends Helper { - private $colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; - private $started = []; - private $count = -1; + private const COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; + private array $started = []; + private int $count = -1; /** * Starts a debug formatting session. - * - * @return string */ - public function start(string $id, string $message, string $prefix = 'RUN') + public function start(string $id, string $message, string $prefix = 'RUN'): string { - $this->started[$id] = ['border' => ++$this->count % \count($this->colors)]; + $this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)]; return sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); } /** * Adds progress to a formatting session. - * - * @return string */ - public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR') + public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR'): string { $message = ''; @@ -74,10 +70,8 @@ class DebugFormatterHelper extends Helper /** * Stops a formatting session. - * - * @return string */ - public function stop(string $id, string $message, bool $successful, string $prefix = 'RES') + public function stop(string $id, string $message, bool $successful, string $prefix = 'RES'): string { $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; @@ -94,13 +88,13 @@ class DebugFormatterHelper extends Helper private function getBorder(string $id): string { - return sprintf(' ', $this->colors[$this->started[$id]['border']]); + return sprintf(' ', self::COLORS[$this->started[$id]['border']]); } /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'debug_formatter'; } diff --git a/vendor/symfony/console/Helper/DescriptorHelper.php b/vendor/symfony/console/Helper/DescriptorHelper.php index f2ad9db..63597c6 100644 --- a/vendor/symfony/console/Helper/DescriptorHelper.php +++ b/vendor/symfony/console/Helper/DescriptorHelper.php @@ -29,7 +29,7 @@ class DescriptorHelper extends Helper /** * @var DescriptorInterface[] */ - private $descriptors = []; + private array $descriptors = []; public function __construct() { @@ -70,7 +70,7 @@ class DescriptorHelper extends Helper * * @return $this */ - public function register(string $format, DescriptorInterface $descriptor) + public function register(string $format, DescriptorInterface $descriptor): static { $this->descriptors[$format] = $descriptor; @@ -80,8 +80,13 @@ class DescriptorHelper extends Helper /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'descriptor'; } + + public function getFormats(): array + { + return array_keys($this->descriptors); + } } diff --git a/vendor/symfony/console/Helper/Dumper.php b/vendor/symfony/console/Helper/Dumper.php index b013b6c..5019095 100644 --- a/vendor/symfony/console/Helper/Dumper.php +++ b/vendor/symfony/console/Helper/Dumper.php @@ -24,7 +24,7 @@ final class Dumper private $output; private $dumper; private $cloner; - private $handler; + private \Closure $handler; public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null) { @@ -57,7 +57,7 @@ final class Dumper } } - public function __invoke($var): string + public function __invoke(mixed $var): string { return ($this->handler)($var); } diff --git a/vendor/symfony/console/Helper/FormatterHelper.php b/vendor/symfony/console/Helper/FormatterHelper.php index a1c33c2..2d7d1fa 100644 --- a/vendor/symfony/console/Helper/FormatterHelper.php +++ b/vendor/symfony/console/Helper/FormatterHelper.php @@ -22,22 +22,16 @@ class FormatterHelper extends Helper { /** * Formats a message within a section. - * - * @return string The format section */ - public function formatSection(string $section, string $message, string $style = 'info') + public function formatSection(string $section, string $message, string $style = 'info'): string { return sprintf('<%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 The formatter message */ - public function formatBlock($messages, string $style, bool $large = false) + public function formatBlock(string|array $messages, string $style, bool $large = false): string { if (!\is_array($messages)) { $messages = [$messages]; @@ -68,10 +62,8 @@ class FormatterHelper extends Helper /** * Truncates a message to the given length. - * - * @return string */ - public function truncate(string $message, int $length, string $suffix = '...') + public function truncate(string $message, int $length, string $suffix = '...'): string { $computedLength = $length - self::width($suffix); @@ -85,7 +77,7 @@ class FormatterHelper extends Helper /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'formatter'; } diff --git a/vendor/symfony/console/Helper/Helper.php b/vendor/symfony/console/Helper/Helper.php index 881b4dc..01e39a9 100644 --- a/vendor/symfony/console/Helper/Helper.php +++ b/vendor/symfony/console/Helper/Helper.php @@ -34,25 +34,11 @@ abstract class Helper implements HelperInterface /** * {@inheritdoc} */ - public function getHelperSet() + public function getHelperSet(): ?HelperSet { return $this->helperSet; } - /** - * Returns the length of a string, using mb_strwidth if it is available. - * - * @deprecated since 5.3 - * - * @return int The length of the string - */ - 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. @@ -93,10 +79,8 @@ abstract class Helper implements HelperInterface /** * Returns the subset of a string, using mb_substr if it is available. - * - * @return string The string subset */ - public static function substr(?string $string, int $from, int $length = null) + public static function substr(?string $string, int $from, int $length = null): string { $string ?? $string = ''; @@ -107,7 +91,7 @@ abstract class Helper implements HelperInterface return mb_substr($string, $from, $length, $encoding); } - public static function formatTime($secs) + public static function formatTime(int|float $secs) { static $timeFormats = [ [0, '< 1 sec'], @@ -153,16 +137,6 @@ abstract class Helper implements HelperInterface return sprintf('%d B', $memory); } - /** - * @deprecated since 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(); @@ -170,7 +144,7 @@ abstract class Helper implements HelperInterface // remove <...> formatting $string = $formatter->format($string ?? ''); // remove already formatted characters - $string = preg_replace("/\033\[[^m]*m/", '', $string); + $string = preg_replace("/\033\[[^m]*m/", '', $string ?? ''); $formatter->setDecorated($isDecorated); return $string; diff --git a/vendor/symfony/console/Helper/HelperInterface.php b/vendor/symfony/console/Helper/HelperInterface.php index 1ce8235..1d2b7bf 100644 --- a/vendor/symfony/console/Helper/HelperInterface.php +++ b/vendor/symfony/console/Helper/HelperInterface.php @@ -25,15 +25,13 @@ interface HelperInterface /** * Gets the helper set associated with this helper. - * - * @return HelperSet A HelperSet instance */ - public function getHelperSet(); + public function getHelperSet(): ?HelperSet; /** * Returns the canonical name of this helper. * - * @return string The canonical name + * @return string */ public function getName(); } diff --git a/vendor/symfony/console/Helper/HelperSet.php b/vendor/symfony/console/Helper/HelperSet.php index 5c08a76..be0beca 100644 --- a/vendor/symfony/console/Helper/HelperSet.php +++ b/vendor/symfony/console/Helper/HelperSet.php @@ -11,21 +11,19 @@ namespace Symfony\Component\Console\Helper; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\InvalidArgumentException; /** * HelperSet represents a set of helpers to be used with a command. * * @author Fabien Potencier + * + * @implements \IteratorAggregate */ class HelperSet implements \IteratorAggregate { - /** - * @var Helper[] - */ - private $helpers = []; - private $command; + /** @var array */ + private array $helpers = []; /** * @param Helper[] $helpers An array of helper @@ -49,10 +47,8 @@ class HelperSet implements \IteratorAggregate /** * Returns true if the helper if defined. - * - * @return bool true if the helper is defined, false otherwise */ - public function has(string $name) + public function has(string $name): bool { return isset($this->helpers[$name]); } @@ -60,11 +56,9 @@ class HelperSet implements \IteratorAggregate /** * Gets a helper value. * - * @return HelperInterface The helper instance - * * @throws InvalidArgumentException if the helper is not defined */ - public function get(string $name) + public function get(string $name): HelperInterface { if (!$this->has($name)) { throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); @@ -73,25 +67,7 @@ class HelperSet implements \IteratorAggregate return $this->helpers[$name]; } - public function setCommand(Command $command = null) - { - $this->command = $command; - } - - /** - * Gets the command associated with this helper set. - * - * @return Command A Command instance - */ - public function getCommand() - { - return $this->command; - } - - /** - * @return Helper[] - */ - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->helpers); } diff --git a/vendor/symfony/console/Helper/ProcessHelper.php b/vendor/symfony/console/Helper/ProcessHelper.php index f82c16b..e5ba4db 100644 --- a/vendor/symfony/console/Helper/ProcessHelper.php +++ b/vendor/symfony/console/Helper/ProcessHelper.php @@ -31,10 +31,8 @@ class ProcessHelper extends Helper * @param array|Process $cmd An instance of Process or an array of the command and arguments * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR - * - * @return Process The process that ran */ - public function run(OutputInterface $output, $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process + public function run(OutputInterface $output, array|Process $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".'); @@ -50,10 +48,6 @@ class ProcessHelper extends Helper $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 = []; @@ -92,17 +86,15 @@ class ProcessHelper extends Helper * This is identical to run() except that an exception is thrown if the process * exits with a non-zero exit code. * - * @param string|Process $cmd An instance of Process or a command to run - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @return Process The process that ran + * @param array|Process $cmd An instance of Process or a command to run + * @param callable|null $callback A PHP callback to run whenever there is some + * output available on STDOUT or STDERR * * @throws ProcessFailedException * * @see run() */ - public function mustRun(OutputInterface $output, $cmd, string $error = null, callable $callback = null): Process + public function mustRun(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null): Process { $process = $this->run($output, $cmd, $error, $callback); diff --git a/vendor/symfony/console/Helper/ProgressBar.php b/vendor/symfony/console/Helper/ProgressBar.php index 91fba2b..72c26f2 100644 --- a/vendor/symfony/console/Helper/ProgressBar.php +++ b/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 $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 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 $output; - private $step = 0; - private $max; - private $startTime; - private $stepWidth; - private $percent = 0.0; - private $formatLineCount; - private $messages = []; - private $overwrite = true; + 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 $terminal; - private $previousMessage; + private ?string $previousMessage = null; private $cursor; - private static $formatters; - private static $formats; + private static array $formatters; + private static array $formats; /** * @param int $max Maximum steps (0 if unknown) @@ -103,9 +103,7 @@ final class ProgressBar */ public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } + self::$formatters ??= self::initPlaceholderFormatters(); self::$formatters[$name] = $callable; } @@ -114,14 +112,10 @@ final class ProgressBar * Gets the placeholder formatter for a given name. * * @param string $name The placeholder name (including the delimiter char like %) - * - * @return callable|null A PHP callable */ public static function getPlaceholderFormatterDefinition(string $name): ?callable { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } + self::$formatters ??= self::initPlaceholderFormatters(); return self::$formatters[$name] ?? null; } @@ -136,9 +130,7 @@ final class ProgressBar */ public static function setFormatDefinition(string $name, string $format): void { - if (!self::$formats) { - self::$formats = self::initFormats(); - } + self::$formats ??= self::initFormats(); self::$formats[$name] = $format; } @@ -147,14 +139,10 @@ final class ProgressBar * Gets the format for a given name. * * @param string $name The format name - * - * @return string|null A format string */ public static function getFormatDefinition(string $name): ?string { - if (!self::$formats) { - self::$formats = self::initFormats(); - } + self::$formats ??= self::initFormats(); return self::$formats[$name] ?? null; } @@ -244,11 +232,7 @@ final class ProgressBar public function getBarCharacter(): string { - if (null === $this->barChar) { - return $this->max ? '=' : $this->emptyBarChar; - } - - return $this->barChar; + return $this->barChar ?? ($this->max ? '=' : $this->emptyBarChar); } public function setEmptyBarCharacter(string $char) @@ -482,8 +466,10 @@ final class ProgressBar } $this->output->clear($lineCount); } else { - if ($this->formatLineCount > 0) { - $this->cursor->moveUp($this->formatLineCount); + for ($i = 0; $i < $this->formatLineCount; ++$i) { + $this->cursor->moveToColumn(1); + $this->cursor->clearLine(); + $this->cursor->moveUp(); } $this->cursor->moveToColumn(1); @@ -580,6 +566,8 @@ final class ProgressBar private function buildLine(): string { + \assert(null !== $this->format); + $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; $callback = function ($matches) { if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { diff --git a/vendor/symfony/console/Helper/ProgressIndicator.php b/vendor/symfony/console/Helper/ProgressIndicator.php index 2d87742..c746f9b 100644 --- a/vendor/symfony/console/Helper/ProgressIndicator.php +++ b/vendor/symfony/console/Helper/ProgressIndicator.php @@ -20,18 +20,31 @@ use Symfony\Component\Console\Output\OutputInterface; */ class ProgressIndicator { - private $output; - private $startTime; - private $format; - private $message; - private $indicatorValues; - private $indicatorCurrent; - private $indicatorChangeInterval; - private $indicatorUpdateTime; - private $started = false; + private const FORMATS = [ + 'normal' => ' %indicator% %message%', + 'normal_no_ansi' => ' %message%', - private static $formatters; - private static $formats; + 'verbose' => ' %indicator% %message% (%elapsed:6s%)', + 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', + + 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', + 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', + ]; + + 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; + + /** + * @var array + */ + private static array $formatters; /** * @param int $indicatorChangeInterval Change interval in milliseconds @@ -133,16 +146,10 @@ class ProgressIndicator /** * Gets the format for a given name. - * - * @return string|null A format string */ - public static function getFormatDefinition(string $name) + public static function getFormatDefinition(string $name): ?string { - if (!self::$formats) { - self::$formats = self::initFormats(); - } - - return self::$formats[$name] ?? null; + return self::FORMATS[$name] ?? null; } /** @@ -152,23 +159,17 @@ class ProgressIndicator */ public static function setPlaceholderFormatterDefinition(string $name, callable $callable) { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } + self::$formatters ??= self::initPlaceholderFormatters(); self::$formatters[$name] = $callable; } /** * Gets the placeholder formatter for a given name (including the delimiter char like %). - * - * @return callable|null A PHP callable */ - public static function getPlaceholderFormatterDefinition(string $name) + public static function getPlaceholderFormatterDefinition(string $name): ?callable { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } + self::$formatters ??= self::initPlaceholderFormatters(); return self::$formatters[$name] ?? null; } @@ -220,6 +221,9 @@ class ProgressIndicator return round(microtime(true) * 1000); } + /** + * @return array + */ private static function initPlaceholderFormatters(): array { return [ @@ -237,18 +241,4 @@ class ProgressIndicator }, ]; } - - private static function initFormats(): array - { - return [ - 'normal' => ' %indicator% %message%', - 'normal_no_ansi' => ' %message%', - - 'verbose' => ' %indicator% %message% (%elapsed:6s%)', - 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', - - 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', - 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', - ]; - } } diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php index fd90959..2e1ccb2 100644 --- a/vendor/symfony/console/Helper/QuestionHelper.php +++ b/vendor/symfony/console/Helper/QuestionHelper.php @@ -33,10 +33,13 @@ use function Symfony\Component\String\s; */ class QuestionHelper extends Helper { + /** + * @var resource|null + */ private $inputStream; - private static $shell; - private static $stty = true; - private static $stdinIsInteractive; + + private static bool $stty = true; + private static bool $stdinIsInteractive; /** * Asks a question to the user. @@ -45,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) + public function ask(InputInterface $input, OutputInterface $output, Question $question): mixed { if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); @@ -83,7 +86,7 @@ class QuestionHelper extends Helper /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'question'; } @@ -99,11 +102,9 @@ class QuestionHelper extends Helper /** * 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) + private function doAsk(OutputInterface $output, Question $question): mixed { $this->writePrompt($output, $question); @@ -150,10 +151,7 @@ class QuestionHelper extends Helper return $ret; } - /** - * @return mixed - */ - private function getDefaultAnswer(Question $question) + private function getDefaultAnswer(Question $question): mixed { $default = $question->getDefault(); @@ -201,11 +199,11 @@ class QuestionHelper extends Helper /** * @return string[] */ - protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag) + protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag): array { $messages = []; - $maxWidth = max(array_map('self::width', array_keys($choices = $question->getChoices()))); + $maxWidth = max(array_map([__CLASS__, 'width'], array_keys($choices = $question->getChoices()))); foreach ($choices as $key => $value) { $padding = str_repeat(' ', $maxWidth - self::width($key)); @@ -248,6 +246,9 @@ class QuestionHelper extends Helper $numMatches = \count($matches); $sttyMode = shell_exec('stty -g'); + $isStdin = 'php://stdin' === (stream_get_meta_data($inputStream)['uri'] ?? null); + $r = [$inputStream]; + $w = []; // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) shell_exec('stty -icanon -echo'); @@ -257,11 +258,15 @@ class QuestionHelper extends Helper // Read a keypress while (!feof($inputStream)) { + while ($isStdin && 0 === @stream_select($r, $w, $w, 0, 100)) { + // Give signal handlers a chance to run + $r = [$inputStream]; + } $c = fread($inputStream, 1); // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { - shell_exec(sprintf('stty %s', $sttyMode)); + shell_exec('stty '.$sttyMode); throw new MissingInputException('Aborted.'); } elseif ("\177" === $c) { // Backspace Character if (0 === $numMatches && 0 !== $i) { @@ -366,7 +371,7 @@ class QuestionHelper extends Helper } // Reset stty so it behaves normally again - shell_exec(sprintf('stty %s', $sttyMode)); + shell_exec('stty '.$sttyMode); return $fullChoice; } @@ -427,7 +432,7 @@ class QuestionHelper extends Helper $value = fgets($inputStream, 4096); if (self::$stty && Terminal::hasSttyAvailable()) { - shell_exec(sprintf('stty %s', $sttyMode)); + shell_exec('stty '.$sttyMode); } if (false === $value) { @@ -446,11 +451,9 @@ class QuestionHelper extends Helper * * @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) + private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question): mixed { $error = null; $attempts = $question->getMaxAttempts(); @@ -477,16 +480,16 @@ class QuestionHelper extends Helper return false; } - if (null !== self::$stdinIsInteractive) { + if (isset(self::$stdinIsInteractive)) { return self::$stdinIsInteractive; } if (\function_exists('stream_isatty')) { - return self::$stdinIsInteractive = stream_isatty(fopen('php://stdin', 'r')); + return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); } if (\function_exists('posix_isatty')) { - return self::$stdinIsInteractive = posix_isatty(fopen('php://stdin', 'r')); + return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r')); } if (!\function_exists('exec')) { @@ -503,10 +506,8 @@ class QuestionHelper extends Helper * * @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) + private function readInput($inputStream, Question $question): string|false { if (!$question->isMultiline()) { $cp = $this->setIOCodepage(); @@ -532,11 +533,6 @@ class QuestionHelper extends Helper 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')) { @@ -551,12 +547,8 @@ class QuestionHelper extends Helper /** * 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, $input) + private function resetIOCodepage(int $cp, string|false $input): string|false { if (0 !== $cp) { sapi_windows_cp_set($cp); diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php index 15c515e..2e87ed9 100644 --- a/vendor/symfony/console/Helper/Table.php +++ b/vendor/symfony/console/Helper/Table.php @@ -36,66 +36,27 @@ class Table private const BORDER_OUTSIDE = 0; private const BORDER_INSIDE = 1; - 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 ?string $headerTitle = null; + private ?string $footerTitle = null; + private array $headers = []; + private array $rows = []; + private bool $horizontal = false; + private array $effectiveColumnWidths = []; + private int $numberOfColumns; private $output; - - /** - * @var TableStyle - */ private $style; + private array $columnStyles = []; + private array $columnWidths = []; + private array $columnMaxWidths = []; + private bool $rendered = false; - /** - * @var array - */ - private $columnStyles = []; - - /** - * User set column widths. - * - * @var array - */ - private $columnWidths = []; - private $columnMaxWidths = []; - - private static $styles; - - private $rendered = false; + private static array $styles; public function __construct(OutputInterface $output) { $this->output = $output; - if (!self::$styles) { - self::$styles = self::initStyles(); - } + self::$styles ??= self::initStyles(); $this->setStyle('default'); } @@ -105,39 +66,27 @@ class Table */ public static function setStyleDefinition(string $name, TableStyle $style) { - if (!self::$styles) { - self::$styles = self::initStyles(); - } + self::$styles ??= self::initStyles(); self::$styles[$name] = $style; } /** * Gets a style definition by name. - * - * @return TableStyle */ - public static function getStyleDefinition(string $name) + public static function getStyleDefinition(string $name): TableStyle { - if (!self::$styles) { - self::$styles = self::initStyles(); - } + self::$styles ??= self::initStyles(); - if (isset(self::$styles[$name])) { - return self::$styles[$name]; - } - - throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $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($name) + public function setStyle(TableStyle|string $name): static { $this->style = $this->resolveStyle($name); @@ -146,10 +95,8 @@ class Table /** * Gets the current table style. - * - * @return TableStyle */ - public function getStyle() + public function getStyle(): TableStyle { return $this->style; } @@ -161,7 +108,7 @@ class Table * * @return $this */ - public function setColumnStyle(int $columnIndex, $name) + public function setColumnStyle(int $columnIndex, TableStyle|string $name): static { $this->columnStyles[$columnIndex] = $this->resolveStyle($name); @@ -172,10 +119,8 @@ class Table * 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) + public function getColumnStyle(int $columnIndex): TableStyle { return $this->columnStyles[$columnIndex] ?? $this->getStyle(); } @@ -185,7 +130,7 @@ class Table * * @return $this */ - public function setColumnWidth(int $columnIndex, int $width) + public function setColumnWidth(int $columnIndex, int $width): static { $this->columnWidths[$columnIndex] = $width; @@ -197,7 +142,7 @@ class Table * * @return $this */ - public function setColumnWidths(array $widths) + public function setColumnWidths(array $widths): static { $this->columnWidths = []; foreach ($widths as $index => $width) { @@ -215,7 +160,7 @@ class Table * * @return $this */ - public function setColumnMaxWidth(int $columnIndex, int $width): self + public function setColumnMaxWidth(int $columnIndex, int $width): static { 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()))); @@ -226,7 +171,10 @@ class Table return $this; } - public function setHeaders(array $headers) + /** + * @return $this + */ + public function setHeaders(array $headers): static { $headers = array_values($headers); if (!empty($headers) && !\is_array($headers[0])) { @@ -245,7 +193,10 @@ class Table return $this->addRows($rows); } - public function addRows(array $rows) + /** + * @return $this + */ + public function addRows(array $rows): static { foreach ($rows as $row) { $this->addRow($row); @@ -254,7 +205,10 @@ class Table return $this; } - public function addRow($row) + /** + * @return $this + */ + public function addRow(TableSeparator|array $row): static { if ($row instanceof TableSeparator) { $this->rows[] = $row; @@ -262,10 +216,6 @@ class Table 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; @@ -273,8 +223,10 @@ class Table /** * Adds a row to the table, and re-renders the table. + * + * @return $this */ - public function appendRow($row): self + public function appendRow(TableSeparator|array $row): static { if (!$this->output instanceof ConsoleSectionOutput) { throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); @@ -290,28 +242,40 @@ class Table return $this; } - public function setRow($column, array $row) + /** + * @return $this + */ + public function setRow(int|string $column, array $row): static { $this->rows[$column] = $row; return $this; } - public function setHeaderTitle(?string $title): self + /** + * @return $this + */ + public function setHeaderTitle(?string $title): static { $this->headerTitle = $title; return $this; } - public function setFooterTitle(?string $title): self + /** + * @return $this + */ + public function setFooterTitle(?string $title): static { $this->footerTitle = $title; return $this; } - public function setHorizontal(bool $horizontal = true): self + /** + * @return $this + */ + public function setHorizontal(bool $horizontal = true): static { $this->horizontal = $horizontal; @@ -633,7 +597,7 @@ class Table { $unmergedRows = []; foreach ($rows[$line] as $column => $cell) { - if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { + if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !$cell instanceof \Stringable) { 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) { @@ -800,9 +764,12 @@ class Table private function cleanup() { $this->effectiveColumnWidths = []; - $this->numberOfColumns = null; + unset($this->numberOfColumns); } + /** + * @return array + */ private static function initStyles(): array { $borderless = new TableStyle(); @@ -850,16 +817,12 @@ class Table ]; } - private function resolveStyle($name): TableStyle + private function resolveStyle(TableStyle|string $name): TableStyle { if ($name instanceof TableStyle) { return $name; } - if (isset(self::$styles[$name])) { - return self::$styles[$name]; - } - - throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + return self::$styles[$name] ?? throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); } } diff --git a/vendor/symfony/console/Helper/TableCell.php b/vendor/symfony/console/Helper/TableCell.php index 1a7bc6e..394b2bc 100644 --- a/vendor/symfony/console/Helper/TableCell.php +++ b/vendor/symfony/console/Helper/TableCell.php @@ -18,8 +18,8 @@ use Symfony\Component\Console\Exception\InvalidArgumentException; */ class TableCell { - private $value; - private $options = [ + private string $value; + private array $options = [ 'rowspan' => 1, 'colspan' => 1, 'style' => null, @@ -43,30 +43,24 @@ class TableCell /** * Returns the cell value. - * - * @return string */ - public function __toString() + public function __toString(): string { return $this->value; } /** * Gets number of colspan. - * - * @return int */ - public function getColspan() + public function getColspan(): int { return (int) $this->options['colspan']; } /** * Gets number of rowspan. - * - * @return int */ - public function getRowspan() + public function getRowspan(): int { return (int) $this->options['rowspan']; } diff --git a/vendor/symfony/console/Helper/TableCellStyle.php b/vendor/symfony/console/Helper/TableCellStyle.php index ad9aea8..65ae9e7 100644 --- a/vendor/symfony/console/Helper/TableCellStyle.php +++ b/vendor/symfony/console/Helper/TableCellStyle.php @@ -20,34 +20,34 @@ class TableCellStyle { public const DEFAULT_ALIGN = 'left'; - private $options = [ - 'fg' => 'default', - 'bg' => 'default', - 'options' => null, - 'align' => self::DEFAULT_ALIGN, - 'cellFormat' => null, - ]; - - private $tagOptions = [ + private const TAG_OPTIONS = [ 'fg', 'bg', 'options', ]; - private $alignMap = [ + private const ALIGN_MAP = [ 'left' => \STR_PAD_RIGHT, 'center' => \STR_PAD_BOTH, 'right' => \STR_PAD_LEFT, ]; + private array $options = [ + 'fg' => 'default', + 'bg' => 'default', + 'options' => null, + 'align' => self::DEFAULT_ALIGN, + 'cellFormat' => null, + ]; + public function __construct(array $options = []) { if ($diff = array_diff(array_keys($options), array_keys($this->options))) { throw new InvalidArgumentException(sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); } - if (isset($options['align']) && !\array_key_exists($options['align'], $this->alignMap)) { - throw new InvalidArgumentException(sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys($this->alignMap)))); + if (isset($options['align']) && !\array_key_exists($options['align'], self::ALIGN_MAP)) { + throw new InvalidArgumentException(sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); } $this->options = array_merge($this->options, $options); @@ -63,20 +63,20 @@ class TableCellStyle * * @return string[] */ - public function getTagOptions() + public function getTagOptions(): array { return array_filter( $this->getOptions(), function ($key) { - return \in_array($key, $this->tagOptions) && isset($this->options[$key]); + return \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]); }, \ARRAY_FILTER_USE_KEY ); } - public function getPadByAlign() + public function getPadByAlign(): int { - return $this->alignMap[$this->getOptions()['align']]; + return self::ALIGN_MAP[$this->getOptions()['align']]; } public function getCellFormat(): ?string diff --git a/vendor/symfony/console/Helper/TableRows.php b/vendor/symfony/console/Helper/TableRows.php index 16aabb3..97d0772 100644 --- a/vendor/symfony/console/Helper/TableRows.php +++ b/vendor/symfony/console/Helper/TableRows.php @@ -16,17 +16,15 @@ namespace Symfony\Component\Console\Helper; */ class TableRows implements \IteratorAggregate { - private $generator; + private \Closure $generator; - public function __construct(callable $generator) + public function __construct(\Closure $generator) { $this->generator = $generator; } public function getIterator(): \Traversable { - $g = $this->generator; - - return $g(); + return ($this->generator)(); } } diff --git a/vendor/symfony/console/Helper/TableStyle.php b/vendor/symfony/console/Helper/TableStyle.php index 07265b4..bbad98e 100644 --- a/vendor/symfony/console/Helper/TableStyle.php +++ b/vendor/symfony/console/Helper/TableStyle.php @@ -23,37 +23,37 @@ use Symfony\Component\Console\Exception\LogicException; */ class TableStyle { - 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 = ' %s '; - private $footerTitleFormat = ' %s '; - private $cellHeaderFormat = '%s'; - private $cellRowFormat = '%s'; - private $cellRowContentFormat = ' %s '; - private $borderFormat = '%s'; - private $padType = \STR_PAD_RIGHT; + 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 = ' %s '; + private string $footerTitleFormat = ' %s '; + private string $cellHeaderFormat = '%s'; + private string $cellRowFormat = '%s'; + private string $cellRowContentFormat = ' %s '; + private string $borderFormat = '%s'; + private int $padType = \STR_PAD_RIGHT; /** * Sets padding character, used for cell padding. * * @return $this */ - public function setPaddingChar(string $paddingChar) + public function setPaddingChar(string $paddingChar): static { if (!$paddingChar) { throw new LogicException('The padding char must not be empty.'); @@ -66,10 +66,8 @@ class TableStyle /** * Gets padding character, used for cell padding. - * - * @return string */ - public function getPaddingChar() + public function getPaddingChar(): string { return $this->paddingChar; } @@ -87,8 +85,10 @@ class TableStyle * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ * ╚═══════════════╧══════════════════════════╧══════════════════╝ * + * + * @return $this */ - public function setHorizontalBorderChars(string $outside, string $inside = null): self + public function setHorizontalBorderChars(string $outside, string $inside = null): static { $this->horizontalOutsideBorderChar = $outside; $this->horizontalInsideBorderChar = $inside ?? $outside; @@ -110,8 +110,10 @@ class TableStyle * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ * ╚═══════════════╧══════════════════════════╧══════════════════╝ * + * + * @return $this */ - public function setVerticalBorderChars(string $outside, string $inside = null): self + public function setVerticalBorderChars(string $outside, string $inside = null): static { $this->verticalOutsideBorderChar = $outside; $this->verticalInsideBorderChar = $inside ?? $outside; @@ -162,8 +164,10 @@ class TableStyle * @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null * @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null * @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null + * + * @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): self + 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 { $this->crossingChar = $cross; $this->crossingTopLeftChar = $topLeft; @@ -193,10 +197,8 @@ class TableStyle /** * Gets crossing character. - * - * @return string */ - public function getCrossingChar() + public function getCrossingChar(): string { return $this->crossingChar; } @@ -229,7 +231,7 @@ class TableStyle * * @return $this */ - public function setCellHeaderFormat(string $cellHeaderFormat) + public function setCellHeaderFormat(string $cellHeaderFormat): static { $this->cellHeaderFormat = $cellHeaderFormat; @@ -238,10 +240,8 @@ class TableStyle /** * Gets header cell format. - * - * @return string */ - public function getCellHeaderFormat() + public function getCellHeaderFormat(): string { return $this->cellHeaderFormat; } @@ -251,7 +251,7 @@ class TableStyle * * @return $this */ - public function setCellRowFormat(string $cellRowFormat) + public function setCellRowFormat(string $cellRowFormat): static { $this->cellRowFormat = $cellRowFormat; @@ -260,10 +260,8 @@ class TableStyle /** * Gets row cell format. - * - * @return string */ - public function getCellRowFormat() + public function getCellRowFormat(): string { return $this->cellRowFormat; } @@ -273,7 +271,7 @@ class TableStyle * * @return $this */ - public function setCellRowContentFormat(string $cellRowContentFormat) + public function setCellRowContentFormat(string $cellRowContentFormat): static { $this->cellRowContentFormat = $cellRowContentFormat; @@ -282,10 +280,8 @@ class TableStyle /** * Gets row cell content format. - * - * @return string */ - public function getCellRowContentFormat() + public function getCellRowContentFormat(): string { return $this->cellRowContentFormat; } @@ -295,7 +291,7 @@ class TableStyle * * @return $this */ - public function setBorderFormat(string $borderFormat) + public function setBorderFormat(string $borderFormat): static { $this->borderFormat = $borderFormat; @@ -304,10 +300,8 @@ class TableStyle /** * Gets table border format. - * - * @return string */ - public function getBorderFormat() + public function getBorderFormat(): string { return $this->borderFormat; } @@ -317,7 +311,7 @@ class TableStyle * * @return $this */ - public function setPadType(int $padType) + public function setPadType(int $padType): static { 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).'); @@ -330,10 +324,8 @@ class TableStyle /** * Gets cell padding type. - * - * @return int */ - public function getPadType() + public function getPadType(): int { return $this->padType; } @@ -343,7 +335,10 @@ class TableStyle return $this->headerTitleFormat; } - public function setHeaderTitleFormat(string $format): self + /** + * @return $this + */ + public function setHeaderTitleFormat(string $format): static { $this->headerTitleFormat = $format; @@ -355,7 +350,10 @@ class TableStyle return $this->footerTitleFormat; } - public function setFooterTitleFormat(string $format): self + /** + * @return $this + */ + public function setFooterTitleFormat(string $format): static { $this->footerTitleFormat = $format; diff --git a/vendor/symfony/console/Input/ArgvInput.php b/vendor/symfony/console/Input/ArgvInput.php index a33ca35..4e90c81 100644 --- a/vendor/symfony/console/Input/ArgvInput.php +++ b/vendor/symfony/console/Input/ArgvInput.php @@ -40,8 +40,8 @@ use Symfony\Component\Console\Exception\RuntimeException; */ class ArgvInput extends Input { - private $tokens; - private $parsed; + private array $tokens; + private array $parsed; public function __construct(array $argv = null, InputDefinition $definition = null) { @@ -68,20 +68,27 @@ class ArgvInput extends Input $parseOptions = true; $this->parsed = $this->tokens; while (null !== $token = array_shift($this->parsed)) { - if ($parseOptions && '' == $token) { - $this->parseArgument($token); - } elseif ($parseOptions && '--' == $token) { - $parseOptions = false; - } elseif ($parseOptions && str_starts_with($token, '--')) { - $this->parseLongOption($token); - } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { - $this->parseShortOption($token); - } else { - $this->parseArgument($token); - } + $parseOptions = $this->parseToken($token, $parseOptions); } } + protected function parseToken(string $token, bool $parseOptions): bool + { + if ($parseOptions && '' == $token) { + $this->parseArgument($token); + } elseif ($parseOptions && '--' == $token) { + return false; + } elseif ($parseOptions && str_starts_with($token, '--')) { + $this->parseLongOption($token); + } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { + $this->parseShortOption($token); + } else { + $this->parseArgument($token); + } + + return $parseOptions; + } + /** * Parses a short option. */ @@ -134,7 +141,7 @@ class ArgvInput extends Input $name = substr($token, 2); if (false !== $pos = strpos($name, '=')) { - if (0 === \strlen($value = substr($name, $pos + 1))) { + if ('' === $value = substr($name, $pos + 1)) { array_unshift($this->parsed, $value); } $this->addLongOption(substr($name, 0, $pos), $value); @@ -192,7 +199,7 @@ class ArgvInput extends Input * * @throws RuntimeException When option given doesn't exist */ - private function addShortOption(string $shortcut, $value) + private function addShortOption(string $shortcut, mixed $value) { if (!$this->definition->hasShortcut($shortcut)) { throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); @@ -206,7 +213,7 @@ class ArgvInput extends Input * * @throws RuntimeException When option given doesn't exist */ - private function addLongOption(string $name, $value) + private function addLongOption(string $name, mixed $value) { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { @@ -259,7 +266,7 @@ class ArgvInput extends Input /** * {@inheritdoc} */ - public function getFirstArgument() + public function getFirstArgument(): ?string { $isOption = false; foreach ($this->tokens as $i => $token) { @@ -294,7 +301,7 @@ class ArgvInput extends Input /** * {@inheritdoc} */ - public function hasParameterOption($values, bool $onlyParams = false) + public function hasParameterOption(string|array $values, bool $onlyParams = false): bool { $values = (array) $values; @@ -319,7 +326,7 @@ class ArgvInput extends Input /** * {@inheritdoc} */ - public function getParameterOption($values, $default = false, bool $onlyParams = false) + public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed { $values = (array) $values; $tokens = $this->tokens; @@ -349,10 +356,8 @@ class ArgvInput extends Input /** * Returns a stringified representation of the args passed to the command. - * - * @return string */ - public function __toString() + public function __toString(): string { $tokens = array_map(function ($token) { if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { diff --git a/vendor/symfony/console/Input/ArrayInput.php b/vendor/symfony/console/Input/ArrayInput.php index c651614..fdb47df 100644 --- a/vendor/symfony/console/Input/ArrayInput.php +++ b/vendor/symfony/console/Input/ArrayInput.php @@ -25,7 +25,7 @@ use Symfony\Component\Console\Exception\InvalidOptionException; */ class ArrayInput extends Input { - private $parameters; + private array $parameters; public function __construct(array $parameters, InputDefinition $definition = null) { @@ -37,7 +37,7 @@ class ArrayInput extends Input /** * {@inheritdoc} */ - public function getFirstArgument() + public function getFirstArgument(): ?string { foreach ($this->parameters as $param => $value) { if ($param && \is_string($param) && '-' === $param[0]) { @@ -53,7 +53,7 @@ class ArrayInput extends Input /** * {@inheritdoc} */ - public function hasParameterOption($values, bool $onlyParams = false) + public function hasParameterOption(string|array $values, bool $onlyParams = false): bool { $values = (array) $values; @@ -77,7 +77,7 @@ class ArrayInput extends Input /** * {@inheritdoc} */ - public function getParameterOption($values, $default = false, bool $onlyParams = false) + public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed { $values = (array) $values; @@ -100,10 +100,8 @@ class ArrayInput extends Input /** * Returns a stringified representation of the args passed to the command. - * - * @return string */ - public function __toString() + public function __toString(): string { $params = []; foreach ($this->parameters as $param => $val) { @@ -148,7 +146,7 @@ class ArrayInput extends Input * * @throws InvalidOptionException When option given doesn't exist */ - private function addShortOption(string $shortcut, $value) + private function addShortOption(string $shortcut, mixed $value) { if (!$this->definition->hasShortcut($shortcut)) { throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); @@ -163,7 +161,7 @@ class ArrayInput extends Input * @throws InvalidOptionException When option given doesn't exist * @throws InvalidOptionException When a required value is missing */ - private function addLongOption(string $name, $value) + private function addLongOption(string $name, mixed $value) { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { @@ -194,12 +192,9 @@ class ArrayInput extends Input /** * 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($name, $value) + private function addArgument(string|int $name, mixed $value) { if (!$this->definition->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); diff --git a/vendor/symfony/console/Input/Input.php b/vendor/symfony/console/Input/Input.php index d37460e..1db503c 100644 --- a/vendor/symfony/console/Input/Input.php +++ b/vendor/symfony/console/Input/Input.php @@ -80,7 +80,7 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * {@inheritdoc} */ - public function isInteractive() + public function isInteractive(): bool { return $this->interactive; } @@ -96,7 +96,7 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * {@inheritdoc} */ - public function getArguments() + public function getArguments(): array { return array_merge($this->definition->getArgumentDefaults(), $this->arguments); } @@ -104,7 +104,7 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * {@inheritdoc} */ - public function getArgument(string $name) + public function getArgument(string $name): mixed { if (!$this->definition->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); @@ -116,7 +116,7 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * {@inheritdoc} */ - public function setArgument(string $name, $value) + public function setArgument(string $name, mixed $value) { if (!$this->definition->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); @@ -128,7 +128,7 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * {@inheritdoc} */ - public function hasArgument(string $name) + public function hasArgument(string $name): bool { return $this->definition->hasArgument($name); } @@ -136,7 +136,7 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * {@inheritdoc} */ - public function getOptions() + public function getOptions(): array { return array_merge($this->definition->getOptionDefaults(), $this->options); } @@ -144,7 +144,7 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * {@inheritdoc} */ - public function getOption(string $name) + public function getOption(string $name): mixed { if ($this->definition->hasNegation($name)) { if (null === $value = $this->getOption($this->definition->negationToName($name))) { @@ -164,7 +164,7 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * {@inheritdoc} */ - public function setOption(string $name, $value) + public function setOption(string $name, mixed $value) { if ($this->definition->hasNegation($name)) { $this->options[$this->definition->negationToName($name)] = !$value; @@ -180,17 +180,15 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * {@inheritdoc} */ - public function hasOption(string $name) + public function hasOption(string $name): bool { 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) + public function escapeToken(string $token): string { return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); } diff --git a/vendor/symfony/console/Input/InputArgument.php b/vendor/symfony/console/Input/InputArgument.php index 085aca5..143e4b1 100644 --- a/vendor/symfony/console/Input/InputArgument.php +++ b/vendor/symfony/console/Input/InputArgument.php @@ -25,10 +25,10 @@ class InputArgument public const OPTIONAL = 2; public const IS_ARRAY = 4; - private $name; - private $mode; - private $default; - private $description; + private string $name; + private int $mode; + private string|int|bool|array|null|float $default; + private string $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 = '', $default = null) + public function __construct(string $name, int $mode = null, string $description = '', string|bool|int|float|array $default = null) { if (null === $mode) { $mode = self::OPTIONAL; @@ -55,10 +55,8 @@ class InputArgument /** * Returns the argument name. - * - * @return string The argument name */ - public function getName() + public function getName(): string { return $this->name; } @@ -68,7 +66,7 @@ class InputArgument * * @return bool true if parameter mode is self::REQUIRED, false otherwise */ - public function isRequired() + public function isRequired(): bool { return self::REQUIRED === (self::REQUIRED & $this->mode); } @@ -78,7 +76,7 @@ class InputArgument * * @return bool true if mode is self::IS_ARRAY, false otherwise */ - public function isArray() + public function isArray(): bool { return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); } @@ -86,11 +84,9 @@ class InputArgument /** * Sets the default value. * - * @param string|bool|int|float|array|null $default - * * @throws LogicException When incorrect default value is given */ - public function setDefault($default = null) + public function setDefault(string|bool|int|float|array $default = null) { if (self::REQUIRED === $this->mode && null !== $default) { throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); @@ -109,20 +105,16 @@ class InputArgument /** * Returns the default value. - * - * @return string|bool|int|float|array|null */ - public function getDefault() + public function getDefault(): string|bool|int|float|array|null { return $this->default; } /** * Returns the description text. - * - * @return string The description text */ - public function getDescription() + public function getDescription(): string { return $this->description; } diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php index fcbfd52..cb270d8 100644 --- a/vendor/symfony/console/Input/InputDefinition.php +++ b/vendor/symfony/console/Input/InputDefinition.php @@ -28,13 +28,13 @@ use Symfony\Component\Console\Exception\LogicException; */ class InputDefinition { - private $arguments; - private $requiredCount; - private $lastArrayArgument; - private $lastOptionalArgument; - private $options; - private $negations; - private $shortcuts; + private array $arguments = []; + private int $requiredCount = 0; + private $lastArrayArgument = null; + private $lastOptionalArgument = null; + private array $options = []; + private array $negations = []; + private array $shortcuts = []; /** * @param array $definition An array of InputArgument and InputOption instance @@ -124,13 +124,9 @@ class InputDefinition /** * Returns an InputArgument by name or by position. * - * @param string|int $name The InputArgument name or position - * - * @return InputArgument An InputArgument object - * * @throws InvalidArgumentException When argument given doesn't exist */ - public function getArgument($name) + public function getArgument(string|int $name): InputArgument { if (!$this->hasArgument($name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); @@ -143,12 +139,8 @@ class InputDefinition /** * Returns true if an InputArgument object exists by name or position. - * - * @param string|int $name The InputArgument name or position - * - * @return bool true if the InputArgument object exists, false otherwise */ - public function hasArgument($name) + public function hasArgument(string|int $name): bool { $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; @@ -158,29 +150,25 @@ class InputDefinition /** * Gets the array of InputArgument objects. * - * @return InputArgument[] An array of InputArgument objects + * @return InputArgument[] */ - public function getArguments() + public function getArguments(): array { return $this->arguments; } /** * Returns the number of InputArguments. - * - * @return int The number of InputArguments */ - public function getArgumentCount() + public function getArgumentCount(): int { return null !== $this->lastArrayArgument ? \PHP_INT_MAX : \count($this->arguments); } /** * Returns the number of required InputArguments. - * - * @return int The number of required InputArguments */ - public function getArgumentRequiredCount() + public function getArgumentRequiredCount(): int { return $this->requiredCount; } @@ -188,7 +176,7 @@ class InputDefinition /** * @return array */ - public function getArgumentDefaults() + public function getArgumentDefaults(): array { $values = []; foreach ($this->arguments as $argument) { @@ -262,11 +250,9 @@ class InputDefinition /** * Returns an InputOption by name. * - * @return InputOption A InputOption object - * * @throws InvalidArgumentException When option given doesn't exist */ - public function getOption(string $name) + public function getOption(string $name): InputOption { if (!$this->hasOption($name)) { throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); @@ -280,10 +266,8 @@ class InputDefinition * * This method can't be used to check if the user included the option when * executing the command (use getOption() instead). - * - * @return bool true if the InputOption object exists, false otherwise */ - public function hasOption(string $name) + public function hasOption(string $name): bool { return isset($this->options[$name]); } @@ -291,19 +275,17 @@ class InputDefinition /** * Gets the array of InputOption objects. * - * @return InputOption[] An array of InputOption objects + * @return InputOption[] */ - public function getOptions() + public function getOptions(): array { return $this->options; } /** * Returns true if an InputOption object exists by shortcut. - * - * @return bool true if the InputOption object exists, false otherwise */ - public function hasShortcut(string $name) + public function hasShortcut(string $name): bool { return isset($this->shortcuts[$name]); } @@ -318,10 +300,8 @@ class InputDefinition /** * Gets an InputOption by shortcut. - * - * @return InputOption An InputOption object */ - public function getOptionForShortcut(string $shortcut) + public function getOptionForShortcut(string $shortcut): InputOption { return $this->getOption($this->shortcutToName($shortcut)); } @@ -329,7 +309,7 @@ class InputDefinition /** * @return array */ - public function getOptionDefaults() + public function getOptionDefaults(): array { $values = []; foreach ($this->options as $option) { @@ -373,10 +353,8 @@ class InputDefinition /** * Gets the synopsis. - * - * @return string The synopsis */ - public function getSynopsis(bool $short = false) + public function getSynopsis(bool $short = false): string { $elements = []; diff --git a/vendor/symfony/console/Input/InputInterface.php b/vendor/symfony/console/Input/InputInterface.php index d01da85..024da18 100644 --- a/vendor/symfony/console/Input/InputInterface.php +++ b/vendor/symfony/console/Input/InputInterface.php @@ -23,10 +23,8 @@ interface InputInterface { /** * Returns the first argument from the raw parameters (not parsed). - * - * @return string|null The value of the first argument or null otherwise */ - public function getFirstArgument(); + public function getFirstArgument(): ?string; /** * Returns true if the raw parameters (not parsed) contain a value. @@ -38,10 +36,8 @@ interface InputInterface * * @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 true if the value is contained in the raw parameters */ - public function hasParameterOption($values, bool $onlyParams = false); + public function hasParameterOption(string|array $values, bool $onlyParams = false): bool; /** * Returns the value of a raw option (not parsed). @@ -55,9 +51,9 @@ interface InputInterface * @param string|bool|int|float|array|null $default The default value to return if no result is found * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal * - * @return mixed The option value + * @return mixed */ - public function getParameterOption($values, $default = false, bool $onlyParams = false); + public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false); /** * Binds the current Input instance with the given arguments and options. @@ -78,7 +74,7 @@ interface InputInterface * * @return array */ - public function getArguments(); + public function getArguments(): array; /** * Returns the argument value for a given argument name. @@ -92,25 +88,21 @@ interface InputInterface /** * 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, $value); + public function setArgument(string $name, mixed $value); /** * Returns true if an InputArgument object exists by name or position. - * - * @return bool true if the InputArgument object exists, false otherwise */ - public function hasArgument(string $name); + public function hasArgument(string $name): bool; /** * Returns all the given options merged with the default values. * * @return array */ - public function getOptions(); + public function getOptions(): array; /** * Returns the option value for a given option name. @@ -124,25 +116,19 @@ interface InputInterface /** * 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, $value); + public function setOption(string $name, mixed $value); /** * Returns true if an InputOption object exists by name. - * - * @return bool true if the InputOption object exists, false otherwise */ - public function hasOption(string $name); + public function hasOption(string $name): bool; /** * Is this input means interactive? - * - * @return bool */ - public function isInteractive(); + public function isInteractive(): bool; /** * Sets the input interactivity. diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php index 72b1b74..f9d74a8 100644 --- a/vendor/symfony/console/Input/InputOption.php +++ b/vendor/symfony/console/Input/InputOption.php @@ -46,22 +46,20 @@ class InputOption */ public const VALUE_NEGATABLE = 16; - private $name; - private $shortcut; - private $mode; - private $default; - private $description; + private string $name; + private string|array|null $shortcut; + private int $mode; + private string|int|bool|array|null|float $default; + private string $description; /** - * @param string $name The option name - * @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 VALUE_* constants - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (must be null for self::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 VALUE_* constants + * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) + public function __construct(string $name, string|array $shortcut = null, int $mode = null, string $description = '', string|bool|int|float|array $default = null) { if (str_starts_with($name, '--')) { $name = substr($name, 2); @@ -111,20 +109,16 @@ class InputOption /** * Returns the option shortcut. - * - * @return string|null The shortcut */ - public function getShortcut() + public function getShortcut(): ?string { return $this->shortcut; } /** * Returns the option name. - * - * @return string The name */ - public function getName() + public function getName(): string { return $this->name; } @@ -134,7 +128,7 @@ class InputOption * * @return bool true if value mode is not self::VALUE_NONE, false otherwise */ - public function acceptValue() + public function acceptValue(): bool { return $this->isValueRequired() || $this->isValueOptional(); } @@ -144,7 +138,7 @@ class InputOption * * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise */ - public function isValueRequired() + public function isValueRequired(): bool { return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); } @@ -154,7 +148,7 @@ class InputOption * * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise */ - public function isValueOptional() + public function isValueOptional(): bool { return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); } @@ -164,7 +158,7 @@ class InputOption * * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise */ - public function isArray() + public function isArray(): bool { return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); } @@ -174,10 +168,7 @@ class InputOption return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); } - /** - * @param string|bool|int|float|array|null $default - */ - public function setDefault($default = null) + public function setDefault(string|bool|int|float|array $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.'); @@ -196,30 +187,24 @@ class InputOption /** * Returns the default value. - * - * @return string|bool|int|float|array|null */ - public function getDefault() + public function getDefault(): string|bool|int|float|array|null { return $this->default; } /** * Returns the description text. - * - * @return string The description text */ - public function getDescription() + public function getDescription(): string { return $this->description; } /** * Checks whether the given option equals this one. - * - * @return bool */ - public function equals(self $option) + public function equals(self $option): bool { return $option->getName() === $this->getName() && $option->getShortcut() === $this->getShortcut() diff --git a/vendor/symfony/console/Input/StringInput.php b/vendor/symfony/console/Input/StringInput.php index eb5c07f..56bb66c 100644 --- a/vendor/symfony/console/Input/StringInput.php +++ b/vendor/symfony/console/Input/StringInput.php @@ -25,6 +25,7 @@ use Symfony\Component\Console\Exception\InvalidArgumentException; class StringInput extends ArgvInput { public const REGEX_STRING = '([^\s]+?)(?:\s|(? 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 $formatLevelMap = [ + private array $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 $errored = false; + private bool $errored = false; public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = []) { @@ -61,10 +61,8 @@ class ConsoleLogger extends AbstractLogger /** * {@inheritdoc} - * - * @return void */ - public function log($level, $message, array $context = []) + public function log($level, $message, array $context = []): void { if (!isset($this->verbosityLevelMap[$level])) { throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); @@ -89,10 +87,8 @@ class ConsoleLogger extends AbstractLogger /** * Returns true when any messages have been logged at error levels. - * - * @return bool */ - public function hasErrored() + public function hasErrored(): bool { return $this->errored; } @@ -110,7 +106,7 @@ class ConsoleLogger extends AbstractLogger $replacements = []; foreach ($context as $key => $val) { - if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { + if (null === $val || is_scalar($val) || $val instanceof \Stringable) { $replacements["{{$key}}"] = $val; } elseif ($val instanceof \DateTimeInterface) { $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); diff --git a/vendor/symfony/console/Output/BufferedOutput.php b/vendor/symfony/console/Output/BufferedOutput.php index d37c6e3..784e309 100644 --- a/vendor/symfony/console/Output/BufferedOutput.php +++ b/vendor/symfony/console/Output/BufferedOutput.php @@ -16,14 +16,12 @@ namespace Symfony\Component\Console\Output; */ class BufferedOutput extends Output { - private $buffer = ''; + private string $buffer = ''; /** * Empties buffer and returns its content. - * - * @return string */ - public function fetch() + public function fetch(): string { $content = $this->buffer; $this->buffer = ''; diff --git a/vendor/symfony/console/Output/ConsoleOutput.php b/vendor/symfony/console/Output/ConsoleOutput.php index 2cda213..c6ba068 100644 --- a/vendor/symfony/console/Output/ConsoleOutput.php +++ b/vendor/symfony/console/Output/ConsoleOutput.php @@ -30,7 +30,7 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface; class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface { private $stderr; - private $consoleSectionOutputs = []; + private array $consoleSectionOutputs = []; /** * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) @@ -94,7 +94,7 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface /** * {@inheritdoc} */ - public function getErrorOutput() + public function getErrorOutput(): OutputInterface { return $this->stderr; } @@ -110,10 +110,8 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface /** * Returns true if current environment supports writing console output to * STDOUT. - * - * @return bool */ - protected function hasStdoutSupport() + protected function hasStdoutSupport(): bool { return false === $this->isRunningOS400(); } @@ -121,10 +119,8 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface /** * Returns true if current environment supports writing console output to * STDERR. - * - * @return bool */ - protected function hasStderrSupport() + protected function hasStderrSupport(): bool { return false === $this->isRunningOS400(); } @@ -153,7 +149,8 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface return fopen('php://output', 'w'); } - return @fopen('php://stdout', 'w') ?: fopen('php://output', 'w'); + // Use STDOUT when possible to prevent from opening too many file descriptors + return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w')); } /** @@ -161,6 +158,11 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface */ private function openErrorStream() { - return fopen($this->hasStderrSupport() ? 'php://stderr' : 'php://output', 'w'); + if (!$this->hasStderrSupport()) { + return fopen('php://output', 'w'); + } + + // Use STDERR when possible to prevent from opening too many file descriptors + return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w')); } } diff --git a/vendor/symfony/console/Output/ConsoleOutputInterface.php b/vendor/symfony/console/Output/ConsoleOutputInterface.php index 6b6635f..6b4babc 100644 --- a/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ b/vendor/symfony/console/Output/ConsoleOutputInterface.php @@ -21,10 +21,8 @@ interface ConsoleOutputInterface extends OutputInterface { /** * Gets the OutputInterface for errors. - * - * @return OutputInterface */ - public function getErrorOutput(); + public function getErrorOutput(): OutputInterface; public function setErrorOutput(OutputInterface $error); diff --git a/vendor/symfony/console/Output/ConsoleSectionOutput.php b/vendor/symfony/console/Output/ConsoleSectionOutput.php index 8f16497..92dca79 100644 --- a/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ b/vendor/symfony/console/Output/ConsoleSectionOutput.php @@ -21,9 +21,9 @@ use Symfony\Component\Console\Terminal; */ class ConsoleSectionOutput extends StreamOutput { - private $content = []; - private $lines = 0; - private $sections; + private array $content = []; + private int $lines = 0; + private array $sections; private $terminal; /** @@ -63,10 +63,8 @@ class ConsoleSectionOutput extends StreamOutput /** * Overwrites the previous output with a new message. - * - * @param array|string $message */ - public function overwrite($message) + public function overwrite(string|iterable $message) { $this->clear(); $this->writeln($message); diff --git a/vendor/symfony/console/Output/NullOutput.php b/vendor/symfony/console/Output/NullOutput.php index 3bbe63e..87214ec 100644 --- a/vendor/symfony/console/Output/NullOutput.php +++ b/vendor/symfony/console/Output/NullOutput.php @@ -37,13 +37,10 @@ class NullOutput implements OutputInterface /** * {@inheritdoc} */ - public function getFormatter() + public function getFormatter(): OutputFormatterInterface { - 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(); } /** @@ -57,7 +54,7 @@ class NullOutput implements OutputInterface /** * {@inheritdoc} */ - public function isDecorated() + public function isDecorated(): bool { return false; } @@ -73,7 +70,7 @@ class NullOutput implements OutputInterface /** * {@inheritdoc} */ - public function getVerbosity() + public function getVerbosity(): int { return self::VERBOSITY_QUIET; } @@ -81,7 +78,7 @@ class NullOutput implements OutputInterface /** * {@inheritdoc} */ - public function isQuiet() + public function isQuiet(): bool { return true; } @@ -89,7 +86,7 @@ class NullOutput implements OutputInterface /** * {@inheritdoc} */ - public function isVerbose() + public function isVerbose(): bool { return false; } @@ -97,7 +94,7 @@ class NullOutput implements OutputInterface /** * {@inheritdoc} */ - public function isVeryVerbose() + public function isVeryVerbose(): bool { return false; } @@ -105,7 +102,7 @@ class NullOutput implements OutputInterface /** * {@inheritdoc} */ - public function isDebug() + public function isDebug(): bool { return false; } @@ -113,7 +110,7 @@ class NullOutput implements OutputInterface /** * {@inheritdoc} */ - public function writeln($messages, int $options = self::OUTPUT_NORMAL) + public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) { // do nothing } @@ -121,7 +118,7 @@ class NullOutput implements OutputInterface /** * {@inheritdoc} */ - public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) { // do nothing } diff --git a/vendor/symfony/console/Output/Output.php b/vendor/symfony/console/Output/Output.php index f939f06..58c1837 100644 --- a/vendor/symfony/console/Output/Output.php +++ b/vendor/symfony/console/Output/Output.php @@ -29,17 +29,17 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface; */ abstract class Output implements OutputInterface { - private $verbosity; + private int $verbosity; private $formatter; /** - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) + * @param int|null $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) * @param bool $decorated Whether to decorate messages * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) */ public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) { - $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity; + $this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL; $this->formatter = $formatter ?? new OutputFormatter(); $this->formatter->setDecorated($decorated); } @@ -55,7 +55,7 @@ abstract class Output implements OutputInterface /** * {@inheritdoc} */ - public function getFormatter() + public function getFormatter(): OutputFormatterInterface { return $this->formatter; } @@ -71,7 +71,7 @@ abstract class Output implements OutputInterface /** * {@inheritdoc} */ - public function isDecorated() + public function isDecorated(): bool { return $this->formatter->isDecorated(); } @@ -87,7 +87,7 @@ abstract class Output implements OutputInterface /** * {@inheritdoc} */ - public function getVerbosity() + public function getVerbosity(): int { return $this->verbosity; } @@ -95,7 +95,7 @@ abstract class Output implements OutputInterface /** * {@inheritdoc} */ - public function isQuiet() + public function isQuiet(): bool { return self::VERBOSITY_QUIET === $this->verbosity; } @@ -103,7 +103,7 @@ abstract class Output implements OutputInterface /** * {@inheritdoc} */ - public function isVerbose() + public function isVerbose(): bool { return self::VERBOSITY_VERBOSE <= $this->verbosity; } @@ -111,7 +111,7 @@ abstract class Output implements OutputInterface /** * {@inheritdoc} */ - public function isVeryVerbose() + public function isVeryVerbose(): bool { return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity; } @@ -119,7 +119,7 @@ abstract class Output implements OutputInterface /** * {@inheritdoc} */ - public function isDebug() + public function isDebug(): bool { return self::VERBOSITY_DEBUG <= $this->verbosity; } @@ -127,7 +127,7 @@ abstract class Output implements OutputInterface /** * {@inheritdoc} */ - public function writeln($messages, int $options = self::OUTPUT_NORMAL) + public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) { $this->write($messages, true, $options); } @@ -135,7 +135,7 @@ abstract class Output implements OutputInterface /** * {@inheritdoc} */ - public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { $messages = [$messages]; diff --git a/vendor/symfony/console/Output/OutputInterface.php b/vendor/symfony/console/Output/OutputInterface.php index 99ba755..beb9218 100644 --- a/vendor/symfony/console/Output/OutputInterface.php +++ b/vendor/symfony/console/Output/OutputInterface.php @@ -33,19 +33,17 @@ interface OutputInterface /** * Writes a message to the output. * - * @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 + * @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 */ - public function write($messages, bool $newline = false, int $options = 0); + public function write(string|iterable $messages, bool $newline = false, int $options = 0); /** * Writes a message to the output and adds a newline at the end. * - * @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 + * @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 */ - public function writeln($messages, int $options = 0); + public function writeln(string|iterable $messages, int $options = 0); /** * Sets the verbosity of the output. @@ -54,38 +52,28 @@ interface OutputInterface /** * Gets the current verbosity of the output. - * - * @return int The current level of verbosity (one of the VERBOSITY constants) */ - public function getVerbosity(); + public function getVerbosity(): int; /** * Returns whether verbosity is quiet (-q). - * - * @return bool true if verbosity is set to VERBOSITY_QUIET, false otherwise */ - public function isQuiet(); + public function isQuiet(): bool; /** * Returns whether verbosity is verbose (-v). - * - * @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise */ - public function isVerbose(); + public function isVerbose(): bool; /** * Returns whether verbosity is very verbose (-vv). - * - * @return bool true if verbosity is set to VERBOSITY_VERY_VERBOSE, false otherwise */ - public function isVeryVerbose(); + public function isVeryVerbose(): bool; /** * Returns whether verbosity is debug (-vvv). - * - * @return bool true if verbosity is set to VERBOSITY_DEBUG, false otherwise */ - public function isDebug(); + public function isDebug(): bool; /** * Sets the decorated flag. @@ -94,17 +82,13 @@ interface OutputInterface /** * Gets the decorated flag. - * - * @return bool true if the output will decorate messages, false otherwise */ - public function isDecorated(); + public function isDecorated(): bool; public function setFormatter(OutputFormatterInterface $formatter); /** * Returns current output formatter instance. - * - * @return OutputFormatterInterface */ - public function getFormatter(); + public function getFormatter(): OutputFormatterInterface; } diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php index ea43452..ac58e41 100644 --- a/vendor/symfony/console/Output/StreamOutput.php +++ b/vendor/symfony/console/Output/StreamOutput.php @@ -57,7 +57,7 @@ class StreamOutput extends Output /** * Gets the stream attached to this StreamOutput instance. * - * @return resource A stream resource + * @return resource */ public function getStream() { @@ -91,7 +91,7 @@ class StreamOutput extends Output * * @return bool true if the stream supports colorization, false otherwise */ - protected function hasColorSupport() + protected function hasColorSupport(): bool { // Follow https://no-color.org/ if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { diff --git a/vendor/symfony/console/Output/TrimmedBufferOutput.php b/vendor/symfony/console/Output/TrimmedBufferOutput.php index 5455c5b..0d375e0 100644 --- a/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ b/vendor/symfony/console/Output/TrimmedBufferOutput.php @@ -21,10 +21,11 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface; */ class TrimmedBufferOutput extends Output { - private $maxLength; - private $buffer = ''; + private int $maxLength; + private string $buffer = ''; - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) { + public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) + { if ($maxLength <= 0) { throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); } @@ -35,10 +36,8 @@ class TrimmedBufferOutput extends Output /** * Empties buffer and returns its content. - * - * @return string */ - public function fetch() + public function fetch(): string { $content = $this->buffer; $this->buffer = ''; diff --git a/vendor/symfony/console/Question/ChoiceQuestion.php b/vendor/symfony/console/Question/ChoiceQuestion.php index 92b6e86..e449ff6 100644 --- a/vendor/symfony/console/Question/ChoiceQuestion.php +++ b/vendor/symfony/console/Question/ChoiceQuestion.php @@ -20,17 +20,17 @@ use Symfony\Component\Console\Exception\InvalidArgumentException; */ class ChoiceQuestion extends Question { - private $choices; - private $multiselect = false; - private $prompt = ' > '; - private $errorMessage = 'Value "%s" is invalid'; + private array $choices; + private bool $multiselect = false; + private string $prompt = ' > '; + private string $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, $default = null) + public function __construct(string $question, array $choices, mixed $default = null) { if (!$choices) { throw new \LogicException('Choice question must have at least 1 choice available.'); @@ -45,10 +45,8 @@ class ChoiceQuestion extends Question /** * Returns available choices. - * - * @return array */ - public function getChoices() + public function getChoices(): array { return $this->choices; } @@ -60,7 +58,7 @@ class ChoiceQuestion extends Question * * @return $this */ - public function setMultiselect(bool $multiselect) + public function setMultiselect(bool $multiselect): static { $this->multiselect = $multiselect; $this->setValidator($this->getDefaultValidator()); @@ -70,20 +68,16 @@ class ChoiceQuestion extends Question /** * Returns whether the choices are multiselect. - * - * @return bool */ - public function isMultiselect() + public function isMultiselect(): bool { return $this->multiselect; } /** * Gets the prompt for choices. - * - * @return string */ - public function getPrompt() + public function getPrompt(): string { return $this->prompt; } @@ -93,7 +87,7 @@ class ChoiceQuestion extends Question * * @return $this */ - public function setPrompt(string $prompt) + public function setPrompt(string $prompt): static { $this->prompt = $prompt; @@ -107,7 +101,7 @@ class ChoiceQuestion extends Question * * @return $this */ - public function setErrorMessage(string $errorMessage) + public function setErrorMessage(string $errorMessage): static { $this->errorMessage = $errorMessage; $this->setValidator($this->getDefaultValidator()); @@ -125,18 +119,18 @@ class ChoiceQuestion extends Question return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { if ($multiselect) { // Check for a separated comma values - if (!preg_match('/^[^,]+(?:,[^,]+)*$/', $selected, $matches)) { + if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) { throw new InvalidArgumentException(sprintf($errorMessage, $selected)); } - $selectedChoices = explode(',', $selected); + $selectedChoices = explode(',', (string) $selected); } else { $selectedChoices = [$selected]; } if ($this->isTrimmable()) { foreach ($selectedChoices as $k => $v) { - $selectedChoices[$k] = trim($v); + $selectedChoices[$k] = trim((string) $v); } } diff --git a/vendor/symfony/console/Question/ConfirmationQuestion.php b/vendor/symfony/console/Question/ConfirmationQuestion.php index 4228521..40eab24 100644 --- a/vendor/symfony/console/Question/ConfirmationQuestion.php +++ b/vendor/symfony/console/Question/ConfirmationQuestion.php @@ -18,7 +18,7 @@ namespace Symfony\Component\Console\Question; */ class ConfirmationQuestion extends Question { - private $trueAnswerRegex; + private string $trueAnswerRegex; /** * @param string $question The question to ask to the user diff --git a/vendor/symfony/console/Question/Question.php b/vendor/symfony/console/Question/Question.php index 04d2d41..f99e685 100644 --- a/vendor/symfony/console/Question/Question.php +++ b/vendor/symfony/console/Question/Question.php @@ -21,22 +21,22 @@ use Symfony\Component\Console\Exception\LogicException; */ class Question { - private $question; - private $attempts; - private $hidden = false; - private $hiddenFallback = true; - private $autocompleterCallback; - private $validator; - private $default; - private $normalizer; - private $trimmable = true; - private $multiline = false; + 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; /** * @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, $default = null) + public function __construct(string $question, string|bool|int|float $default = null) { $this->question = $question; $this->default = $default; @@ -44,20 +44,16 @@ class Question /** * Returns the question. - * - * @return string */ - public function getQuestion() + public function getQuestion(): string { return $this->question; } /** * Returns the default answer. - * - * @return string|bool|int|float|null */ - public function getDefault() + public function getDefault(): string|bool|int|float|null { return $this->default; } @@ -75,7 +71,7 @@ class Question * * @return $this */ - public function setMultiline(bool $multiline): self + public function setMultiline(bool $multiline): static { $this->multiline = $multiline; @@ -84,10 +80,8 @@ class Question /** * Returns whether the user response must be hidden. - * - * @return bool */ - public function isHidden() + public function isHidden(): bool { return $this->hidden; } @@ -99,45 +93,41 @@ class Question * * @throws LogicException In case the autocompleter is also used */ - public function setHidden(bool $hidden) + public function setHidden(bool $hidden): static { if ($this->autocompleterCallback) { throw new LogicException('A hidden question cannot use the autocompleter.'); } - $this->hidden = (bool) $hidden; + $this->hidden = $hidden; return $this; } /** - * In case the response can not be hidden, whether to fallback on non-hidden question or not. - * - * @return bool + * In case the response cannot be hidden, whether to fallback on non-hidden question or not. */ - public function isHiddenFallback() + public function isHiddenFallback(): bool { return $this->hiddenFallback; } /** - * Sets whether to fallback on non-hidden question if the response can not be hidden. + * Sets whether to fallback on non-hidden question if the response cannot be hidden. * * @return $this */ - public function setHiddenFallback(bool $fallback) + public function setHiddenFallback(bool $fallback): static { - $this->hiddenFallback = (bool) $fallback; + $this->hiddenFallback = $fallback; return $this; } /** * Gets values for the autocompleter. - * - * @return iterable|null */ - public function getAutocompleterValues() + public function getAutocompleterValues(): ?iterable { $callback = $this->getAutocompleterCallback(); @@ -151,7 +141,7 @@ class Question * * @throws LogicException */ - public function setAutocompleterValues(?iterable $values) + public function setAutocompleterValues(?iterable $values): static { if (\is_array($values)) { $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); @@ -186,13 +176,13 @@ class Question * * @return $this */ - public function setAutocompleterCallback(callable $callback = null): self + public function setAutocompleterCallback(callable $callback = null): static { if ($this->hidden && null !== $callback) { throw new LogicException('A hidden question cannot use the autocompleter.'); } - $this->autocompleterCallback = $callback; + $this->autocompleterCallback = null === $callback || $callback instanceof \Closure ? $callback : \Closure::fromCallable($callback); return $this; } @@ -202,19 +192,17 @@ class Question * * @return $this */ - public function setValidator(callable $validator = null) + public function setValidator(callable $validator = null): static { - $this->validator = $validator; + $this->validator = null === $validator || $validator instanceof \Closure ? $validator : \Closure::fromCallable($validator); return $this; } /** * Gets the validator for the question. - * - * @return callable|null */ - public function getValidator() + public function getValidator(): ?callable { return $this->validator; } @@ -228,13 +216,10 @@ class Question * * @throws InvalidArgumentException in case the number of attempts is invalid */ - public function setMaxAttempts(?int $attempts) + public function setMaxAttempts(?int $attempts): static { - if (null !== $attempts) { - $attempts = (int) $attempts; - if ($attempts < 1) { - throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); - } + if (null !== $attempts && $attempts < 1) { + throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); } $this->attempts = $attempts; @@ -246,10 +231,8 @@ class Question * Gets the maximum number of attempts. * * Null means an unlimited number of attempts. - * - * @return int|null */ - public function getMaxAttempts() + public function getMaxAttempts(): ?int { return $this->attempts; } @@ -261,9 +244,9 @@ class Question * * @return $this */ - public function setNormalizer(callable $normalizer) + public function setNormalizer(callable $normalizer): static { - $this->normalizer = $normalizer; + $this->normalizer = $normalizer instanceof \Closure ? $normalizer : \Closure::fromCallable($normalizer); return $this; } @@ -272,10 +255,8 @@ class Question * 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() + public function getNormalizer(): ?callable { return $this->normalizer; } @@ -293,7 +274,7 @@ class Question /** * @return $this */ - public function setTrimmable(bool $trimmable): self + public function setTrimmable(bool $trimmable): static { $this->trimmable = $trimmable; diff --git a/vendor/symfony/console/README.md b/vendor/symfony/console/README.md index c89b4a1..c4c1299 100644 --- a/vendor/symfony/console/README.md +++ b/vendor/symfony/console/README.md @@ -4,6 +4,18 @@ Console Component The Console component eases the creation of beautiful and testable command line interfaces. +Sponsor +------- + +The Console component for Symfony 5.4/6.0 is [backed][1] by [Les-Tilleuls.coop][2]. + +Les-Tilleuls.coop is a team of 50+ Symfony experts who can help you design, develop and +fix your projects. We provide a wide range of professional services including development, +consulting, coaching, training and audits. We also are highly skilled in JS, Go and DevOps. +We are a worker cooperative! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -18,3 +30,7 @@ Credits `Resources/bin/hiddeninput.exe` is a third party binary provided within this component. Find sources and license at https://github.com/Seldaek/hidden-input. + +[1]: https://symfony.com/backers +[2]: https://les-tilleuls.coop +[3]: https://symfony.com/sponsor diff --git a/vendor/symfony/console/Resources/completion.bash b/vendor/symfony/console/Resources/completion.bash new file mode 100644 index 0000000..c5e89c3 --- /dev/null +++ b/vendor/symfony/console/Resources/completion.bash @@ -0,0 +1,81 @@ +# This file is part of the Symfony package. +# +# (c) Fabien Potencier +# +# For the full copyright and license information, please view +# https://symfony.com/doc/current/contributing/code/license.html + +_sf_{{ COMMAND_NAME }}() { + # Use newline as only separator to allow space in completion values + IFS=$'\n' + local sf_cmd="${COMP_WORDS[0]}" + + # for an alias, get the real script behind it + if [[ $(type -t $sf_cmd) == "alias" ]]; then + sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/") + fi + + if [ ! -f "$sf_cmd" ]; then + return 1 + fi + + local cur prev words cword + _get_comp_words_by_ref -n := cur prev words cword + + local completecmd=("$sf_cmd" "_complete" "-sbash" "-c$cword" "-S{{ VERSION }}") + for w in ${words[@]}; do + w=$(printf -- '%b' "$w") + # remove quotes from typed values + quote="${w:0:1}" + if [ "$quote" == \' ]; then + w="${w%\'}" + w="${w#\'}" + elif [ "$quote" == \" ]; then + w="${w%\"}" + w="${w#\"}" + fi + # empty values are ignored + if [ ! -z "$w" ]; then + completecmd+=("-i$w") + fi + done + + local sfcomplete + if sfcomplete=$(${completecmd[@]} 2>&1); then + local quote suggestions + quote=${cur:0:1} + + # Use single quotes by default if suggestions contains backslash (FQCN) + if [ "$quote" == '' ] && [[ "$sfcomplete" =~ \\ ]]; then + quote=\' + fi + + if [ "$quote" == \' ]; then + # single quotes: no additional escaping (does not accept ' in values) + suggestions=$(for s in $sfcomplete; do printf $'%q%q%q\n' "$quote" "$s" "$quote"; done) + elif [ "$quote" == \" ]; then + # double quotes: double escaping for \ $ ` " + suggestions=$(for s in $sfcomplete; do + s=${s//\\/\\\\} + s=${s//\$/\\\$} + s=${s//\`/\\\`} + s=${s//\"/\\\"} + printf $'%q%q%q\n' "$quote" "$s" "$quote"; + done) + else + # no quotes: double escaping + suggestions=$(for s in $sfcomplete; do printf $'%q\n' $(printf '%q' "$s"); done) + fi + COMPREPLY=($(IFS=$'\n' compgen -W "$suggestions" -- $(printf -- "%q" "$cur"))) + __ltrim_colon_completions "$cur" + else + if [[ "$sfcomplete" != *"Command \"_complete\" is not defined."* ]]; then + >&2 echo + >&2 echo $sfcomplete + fi + + return 1 + fi +} + +complete -F _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }} diff --git a/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/vendor/symfony/console/SignalRegistry/SignalRegistry.php index ed93dd0..15978fe 100644 --- a/vendor/symfony/console/SignalRegistry/SignalRegistry.php +++ b/vendor/symfony/console/SignalRegistry/SignalRegistry.php @@ -13,7 +13,7 @@ namespace Symfony\Component\Console\SignalRegistry; final class SignalRegistry { - private $signalHandlers = []; + private array $signalHandlers = []; public function __construct() { diff --git a/vendor/symfony/console/SingleCommandApplication.php b/vendor/symfony/console/SingleCommandApplication.php index c1831d1..4f0b5ba 100644 --- a/vendor/symfony/console/SingleCommandApplication.php +++ b/vendor/symfony/console/SingleCommandApplication.php @@ -20,11 +20,14 @@ use Symfony\Component\Console\Output\OutputInterface; */ class SingleCommandApplication extends Command { - private $version = 'UNKNOWN'; - private $autoExit = true; - private $running = false; + private string $version = 'UNKNOWN'; + private bool $autoExit = true; + private bool $running = false; - public function setVersion(string $version): self + /** + * @return $this + */ + public function setVersion(string $version): static { $this->version = $version; @@ -33,8 +36,10 @@ class SingleCommandApplication extends Command /** * @final + * + * @return $this */ - public function setAutoExit(bool $autoExit): self + public function setAutoExit(bool $autoExit): static { $this->autoExit = $autoExit; diff --git a/vendor/symfony/console/Style/OutputStyle.php b/vendor/symfony/console/Style/OutputStyle.php index 67a98ff..0b2ded3 100644 --- a/vendor/symfony/console/Style/OutputStyle.php +++ b/vendor/symfony/console/Style/OutputStyle.php @@ -38,10 +38,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface $this->output->write(str_repeat(\PHP_EOL, $count)); } - /** - * @return ProgressBar - */ - public function createProgressBar(int $max = 0) + public function createProgressBar(int $max = 0): ProgressBar { return new ProgressBar($this->output, $max); } @@ -49,7 +46,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface /** * {@inheritdoc} */ - public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) { $this->output->write($messages, $newline, $type); } @@ -57,7 +54,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface /** * {@inheritdoc} */ - public function writeln($messages, int $type = self::OUTPUT_NORMAL) + public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) { $this->output->writeln($messages, $type); } @@ -73,7 +70,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface /** * {@inheritdoc} */ - public function getVerbosity() + public function getVerbosity(): int { return $this->output->getVerbosity(); } @@ -89,7 +86,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface /** * {@inheritdoc} */ - public function isDecorated() + public function isDecorated(): bool { return $this->output->isDecorated(); } @@ -105,7 +102,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface /** * {@inheritdoc} */ - public function getFormatter() + public function getFormatter(): OutputFormatterInterface { return $this->output->getFormatter(); } @@ -113,7 +110,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface /** * {@inheritdoc} */ - public function isQuiet() + public function isQuiet(): bool { return $this->output->isQuiet(); } @@ -121,7 +118,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface /** * {@inheritdoc} */ - public function isVerbose() + public function isVerbose(): bool { return $this->output->isVerbose(); } @@ -129,7 +126,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface /** * {@inheritdoc} */ - public function isVeryVerbose() + public function isVeryVerbose(): bool { return $this->output->isVeryVerbose(); } @@ -137,7 +134,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface /** * {@inheritdoc} */ - public function isDebug() + public function isDebug(): bool { return $this->output->isDebug(); } diff --git a/vendor/symfony/console/Style/StyleInterface.php b/vendor/symfony/console/Style/StyleInterface.php index 38d23b7..0bb1233 100644 --- a/vendor/symfony/console/Style/StyleInterface.php +++ b/vendor/symfony/console/Style/StyleInterface.php @@ -35,45 +35,33 @@ interface StyleInterface /** * Formats informational text. - * - * @param string|array $message */ - public function text($message); + public function text(string|array $message); /** * Formats a success result bar. - * - * @param string|array $message */ - public function success($message); + public function success(string|array $message); /** * Formats an error result bar. - * - * @param string|array $message */ - public function error($message); + public function error(string|array $message); /** * Formats an warning result bar. - * - * @param string|array $message */ - public function warning($message); + public function warning(string|array $message); /** * Formats a note admonition. - * - * @param string|array $message */ - public function note($message); + public function note(string|array $message); /** * Formats a caution admonition. - * - * @param string|array $message */ - public function caution($message); + public function caution(string|array $message); /** * Formats a table. @@ -82,33 +70,23 @@ interface StyleInterface /** * Asks a question. - * - * @return mixed */ - public function ask(string $question, string $default = null, callable $validator = null); + public function ask(string $question, string $default = null, callable $validator = null): mixed; /** * Asks a question with the user input hidden. - * - * @return mixed */ - public function askHidden(string $question, callable $validator = null); + public function askHidden(string $question, callable $validator = null): mixed; /** * Asks for confirmation. - * - * @return bool */ - public function confirm(string $question, bool $default = true); + public function confirm(string $question, bool $default = true): bool; /** * Asks a choice question. - * - * @param string|int|null $default - * - * @return mixed */ - public function choice(string $question, array $choices, $default = null); + public function choice(string $question, array $choices, mixed $default = null): mixed; /** * Add newline(s). diff --git a/vendor/symfony/console/Style/SymfonyStyle.php b/vendor/symfony/console/Style/SymfonyStyle.php index 3e67213..56ad30a 100644 --- a/vendor/symfony/console/Style/SymfonyStyle.php +++ b/vendor/symfony/console/Style/SymfonyStyle.php @@ -21,6 +21,7 @@ use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Helper\TableCell; use Symfony\Component\Console\Helper\TableSeparator; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\TrimmedBufferOutput; use Symfony\Component\Console\Question\ChoiceQuestion; @@ -38,9 +39,10 @@ class SymfonyStyle extends OutputStyle public const MAX_LINE_LENGTH = 120; private $input; + private $output; private $questionHelper; private $progressBar; - private $lineLength; + private int $lineLength; private $bufferedOutput; public function __construct(InputInterface $input, OutputInterface $output) @@ -51,15 +53,13 @@ class SymfonyStyle extends OutputStyle $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); - parent::__construct($output); + parent::__construct($this->output = $output); } /** * Formats a message as a block of text. - * - * @param string|array $messages The message to write in the block */ - public function block($messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) + public function block(string|array $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 +111,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function text($message) + public function text(string|array $message) { $this->autoPrependText(); @@ -123,10 +123,8 @@ class SymfonyStyle extends OutputStyle /** * Formats a command comment. - * - * @param string|array $message */ - public function comment($message) + public function comment(string|array $message) { $this->block($message, null, null, ' // ', false, false); } @@ -134,7 +132,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function success($message) + public function success(string|array $message) { $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); } @@ -142,7 +140,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function error($message) + public function error(string|array $message) { $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); } @@ -150,7 +148,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function warning($message) + public function warning(string|array $message) { $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); } @@ -158,17 +156,15 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function note($message) + public function note(string|array $message) { $this->block($message, 'NOTE', 'fg=yellow', ' ! '); } /** * Formats an info message. - * - * @param string|array $message */ - public function info($message) + public function info(string|array $message) { $this->block($message, 'INFO', 'fg=green', ' ', true); } @@ -176,7 +172,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function caution($message) + public function caution(string|array $message) { $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); } @@ -186,15 +182,12 @@ class SymfonyStyle extends OutputStyle */ public function table(array $headers, array $rows) { - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); + $this->createTable() + ->setHeaders($headers) + ->setRows($rows) + ->render() + ; - $table = new Table($this); - $table->setHeaders($headers); - $table->setRows($rows); - $table->setStyle($style); - - $table->render(); $this->newLine(); } @@ -203,16 +196,13 @@ class SymfonyStyle extends OutputStyle */ public function horizontalTable(array $headers, array $rows) { - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); + $this->createTable() + ->setHorizontal(true) + ->setHeaders($headers) + ->setRows($rows) + ->render() + ; - $table = new Table($this); - $table->setHeaders($headers); - $table->setRows($rows); - $table->setStyle($style); - $table->setHorizontal(true); - - $table->render(); $this->newLine(); } @@ -223,15 +213,9 @@ class SymfonyStyle extends OutputStyle * * 'A title' * * ['key' => 'value'] * * new TableSeparator() - * - * @param string|array|TableSeparator ...$list */ - public function definitionList(...$list) + public function definitionList(string|array|TableSeparator ...$list) { - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - $table = new Table($this); $headers = []; $row = []; foreach ($list as $value) { @@ -252,19 +236,13 @@ class SymfonyStyle extends OutputStyle $row[] = current($value); } - $table->setHeaders($headers); - $table->setRows([$row]); - $table->setHorizontal(); - $table->setStyle($style); - - $table->render(); - $this->newLine(); + $this->horizontalTable($headers, [$row]); } /** * {@inheritdoc} */ - public function ask(string $question, string $default = null, callable $validator = null) + public function ask(string $question, string $default = null, callable $validator = null): mixed { $question = new Question($question, $default); $question->setValidator($validator); @@ -275,7 +253,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function askHidden(string $question, callable $validator = null) + public function askHidden(string $question, callable $validator = null): mixed { $question = new Question($question); @@ -288,7 +266,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function confirm(string $question, bool $default = true) + public function confirm(string $question, bool $default = true): bool { return $this->askQuestion(new ConfirmationQuestion($question, $default)); } @@ -296,7 +274,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function choice(string $question, array $choices, $default = null) + public function choice(string $question, array $choices, mixed $default = null): mixed { if (null !== $default) { $values = array_flip($choices); @@ -330,13 +308,13 @@ class SymfonyStyle extends OutputStyle { $this->getProgressBar()->finish(); $this->newLine(2); - $this->progressBar = null; + unset($this->progressBar); } /** * {@inheritdoc} */ - public function createProgressBar(int $max = 0) + public function createProgressBar(int $max = 0): ProgressBar { $progressBar = parent::createProgressBar($max); @@ -350,17 +328,22 @@ class SymfonyStyle extends OutputStyle } /** - * @return mixed + * @see ProgressBar::iterate() */ - public function askQuestion(Question $question) + public function progressIterate(iterable $iterable, int $max = null): iterable + { + yield from $this->createProgressBar()->iterate($iterable, $max); + + $this->newLine(2); + } + + public function askQuestion(Question $question): mixed { if ($this->input->isInteractive()) { $this->autoPrependBlock(); } - if (!$this->questionHelper) { - $this->questionHelper = new SymfonyQuestionHelper(); - } + $this->questionHelper ??= new SymfonyQuestionHelper(); $answer = $this->questionHelper->ask($this->input, $this, $question); @@ -375,7 +358,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function writeln($messages, int $type = self::OUTPUT_NORMAL) + public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { $messages = [$messages]; @@ -390,7 +373,7 @@ class SymfonyStyle extends OutputStyle /** * {@inheritdoc} */ - public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) + public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { $messages = [$messages]; @@ -413,21 +396,25 @@ class SymfonyStyle extends OutputStyle /** * Returns a new instance which makes use of stderr if available. - * - * @return self */ - public function getErrorStyle() + public function getErrorStyle(): self { return new self($this->input, $this->getErrorOutput()); } + public function createTable(): Table + { + $output = $this->output instanceof ConsoleOutputInterface ? $this->output->section() : $this->output; + $style = clone Table::getStyleDefinition('symfony-style-guide'); + $style->setCellHeaderFormat('%s'); + + return (new Table($output))->setStyle($style); + } + private function getProgressBar(): ProgressBar { - if (!$this->progressBar) { - throw new RuntimeException('The ProgressBar is not started.'); - } - - return $this->progressBar; + return $this->progressBar + ?? throw new RuntimeException('The ProgressBar is not started.'); } private function autoPrependBlock(): void diff --git a/vendor/symfony/console/Terminal.php b/vendor/symfony/console/Terminal.php index 5e5a3c2..80020c9 100644 --- a/vendor/symfony/console/Terminal.php +++ b/vendor/symfony/console/Terminal.php @@ -13,16 +13,14 @@ namespace Symfony\Component\Console; class Terminal { - private static $width; - private static $height; - private static $stty; + private static ?int $width = null; + private static ?int $height = null; + private static ?bool $stty = null; /** * Gets the terminal width. - * - * @return int */ - public function getWidth() + public function getWidth(): int { $width = getenv('COLUMNS'); if (false !== $width) { @@ -38,10 +36,8 @@ class Terminal /** * Gets the terminal height. - * - * @return int */ - public function getHeight() + public function getHeight(): int { $height = getenv('LINES'); if (false !== $height) { @@ -57,10 +53,8 @@ class Terminal /** * @internal - * - * @return bool */ - public static function hasSttyAvailable() + public static function hasSttyAvailable(): bool { if (null !== self::$stty) { return self::$stty; diff --git a/vendor/symfony/console/Tester/ApplicationTester.php b/vendor/symfony/console/Tester/ApplicationTester.php index d021c14..0404020 100644 --- a/vendor/symfony/console/Tester/ApplicationTester.php +++ b/vendor/symfony/console/Tester/ApplicationTester.php @@ -29,8 +29,6 @@ class ApplicationTester use TesterTrait; private $application; - private $input; - private $statusCode; public function __construct(Application $application) { @@ -49,7 +47,7 @@ class ApplicationTester * * @return int The command exit code */ - public function run(array $input, array $options = []) + public function run(array $input, array $options = []): int { $this->input = new ArrayInput($input); if (isset($options['interactive'])) { diff --git a/vendor/symfony/console/Tester/CommandCompletionTester.php b/vendor/symfony/console/Tester/CommandCompletionTester.php new file mode 100644 index 0000000..ade7327 --- /dev/null +++ b/vendor/symfony/console/Tester/CommandCompletionTester.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tester; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; + +/** + * Eases the testing of command completion. + * + * @author Jérôme Tamarelle + */ +class CommandCompletionTester +{ + private $command; + + public function __construct(Command $command) + { + $this->command = $command; + } + + /** + * Create completion suggestions from input tokens. + */ + public function complete(array $input): array + { + $currentIndex = \count($input); + if ('' === end($input)) { + array_pop($input); + } + array_unshift($input, $this->command->getName()); + + $completionInput = CompletionInput::fromTokens($input, $currentIndex); + $completionInput->bind($this->command->getDefinition()); + $suggestions = new CompletionSuggestions(); + + $this->command->complete($completionInput, $suggestions); + + $options = []; + foreach ($suggestions->getOptionSuggestions() as $option) { + $options[] = '--'.$option->getName(); + } + + return array_map('strval', array_merge($options, $suggestions->getValueSuggestions())); + } +} diff --git a/vendor/symfony/console/Tester/CommandTester.php b/vendor/symfony/console/Tester/CommandTester.php index 57efc9a..f6ee4b7 100644 --- a/vendor/symfony/console/Tester/CommandTester.php +++ b/vendor/symfony/console/Tester/CommandTester.php @@ -25,8 +25,6 @@ class CommandTester use TesterTrait; private $command; - private $input; - private $statusCode; public function __construct(Command $command) { @@ -48,7 +46,7 @@ class CommandTester * * @return int The command exit code */ - public function execute(array $input, array $options = []) + public function execute(array $input, array $options = []): int { // set the command name automatically if the application requires // this argument and no command name was passed diff --git a/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php b/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php new file mode 100644 index 0000000..a473242 --- /dev/null +++ b/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Tester\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\Console\Command\Command; + +final class CommandIsSuccessful extends Constraint +{ + /** + * {@inheritdoc} + */ + public function toString(): string + { + return 'is successful'; + } + + /** + * {@inheritdoc} + */ + protected function matches($other): bool + { + return Command::SUCCESS === $other; + } + + /** + * {@inheritdoc} + */ + protected function failureDescription($other): string + { + return 'the command '.$this->toString(); + } + + /** + * {@inheritdoc} + */ + protected function additionalFailureDescription($other): string + { + $mapping = [ + Command::FAILURE => 'Command failed.', + Command::INVALID => 'Command was invalid.', + ]; + + return $mapping[$other] ?? sprintf('Command returned exit status %d.', $other); + } +} diff --git a/vendor/symfony/console/Tester/TesterTrait.php b/vendor/symfony/console/Tester/TesterTrait.php index 358341b..b238f95 100644 --- a/vendor/symfony/console/Tester/TesterTrait.php +++ b/vendor/symfony/console/Tester/TesterTrait.php @@ -11,31 +11,32 @@ namespace Symfony\Component\Console\Tester; +use PHPUnit\Framework\Assert; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\StreamOutput; +use Symfony\Component\Console\Tester\Constraint\CommandIsSuccessful; /** * @author Amrouche Hamza */ trait TesterTrait { - /** @var StreamOutput */ private $output; - private $inputs = []; - private $captureStreamsIndependently = false; + private array $inputs = []; + private bool $captureStreamsIndependently = false; + private $input; + private int $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 The display */ - public function getDisplay(bool $normalize = false) + public function getDisplay(bool $normalize = false): string { - if (null === $this->output) { + if (!isset($this->output)) { throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); } @@ -54,10 +55,8 @@ trait TesterTrait * 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) + public function getErrorOutput(bool $normalize = false): string { if (!$this->captureStreamsIndependently) { throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); @@ -76,20 +75,16 @@ trait TesterTrait /** * Gets the input instance used by the last execution of the command or application. - * - * @return InputInterface The current input instance */ - public function getInput() + public function getInput(): InputInterface { return $this->input; } /** * Gets the output instance used by the last execution of the command or application. - * - * @return OutputInterface The current output instance */ - public function getOutput() + public function getOutput(): OutputInterface { return $this->output; } @@ -98,16 +93,15 @@ trait TesterTrait * 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 The status code */ - public function getStatusCode() + public function getStatusCode(): int { - if (null === $this->statusCode) { - throw new \RuntimeException('Status code not initialized, did you execute the command before requesting the status code?'); - } + return $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 + { + Assert::assertThat($this->statusCode, new CommandIsSuccessful(), $message); } /** @@ -118,7 +112,7 @@ trait TesterTrait * * @return $this */ - public function setInputs(array $inputs) + public function setInputs(array $inputs): static { $this->inputs = $inputs; diff --git a/vendor/symfony/console/composer.json b/vendor/symfony/console/composer.json index 7598179..7d3947f 100644 --- a/vendor/symfony/console/composer.json +++ b/vendor/symfony/console/composer.json @@ -16,25 +16,22 @@ } ], "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.4|^6.0" }, "require-dev": { - "symfony/config": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0", - "psr/log": "^1|^2" + "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" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "suggest": { "symfony/event-dispatcher": "", @@ -43,12 +40,11 @@ "psr/log": "For using the console logger" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" }, diff --git a/vendor/symfony/deprecation-contracts/.gitignore b/vendor/symfony/deprecation-contracts/.gitignore deleted file mode 100644 index c49a5d8..0000000 --- a/vendor/symfony/deprecation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e26..0000000 --- a/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/deprecation-contracts/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE deleted file mode 100644 index ad85e17..0000000 --- a/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-2021 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: - -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, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 4957933..0000000 --- a/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Symfony Deprecation Contracts -============================= - -A generic function and convention to trigger deprecation notices. - -This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. - -By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, -the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. - -The function requires at least 3 arguments: - - the name of the Composer package that is triggering the deprecation - - the version of the package that introduced the deprecation - - the message of the deprecation - - more arguments can be provided: they will be inserted in the message using `printf()` formatting - -Example: -```php -trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); -``` - -This will generate the following message: -`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` - -While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index 3884889..0000000 --- a/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "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": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index d437150..0000000 --- a/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @param string $package The name of the Composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string $message The message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas - */ - function trigger_deprecation(string $package, string $version, string $message, ...$args): void - { - @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); - } -} diff --git a/vendor/symfony/polyfill-ctype/Ctype.php b/vendor/symfony/polyfill-ctype/Ctype.php index 58414dc..ba75a2c 100644 --- a/vendor/symfony/polyfill-ctype/Ctype.php +++ b/vendor/symfony/polyfill-ctype/Ctype.php @@ -25,13 +25,13 @@ final class Ctype * * @see https://php.net/ctype-alnum * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alnum($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); } @@ -41,13 +41,13 @@ final class Ctype * * @see https://php.net/ctype-alpha * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alpha($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); } @@ -57,13 +57,13 @@ final class Ctype * * @see https://php.net/ctype-cntrl * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_cntrl($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); } @@ -73,13 +73,13 @@ final class Ctype * * @see https://php.net/ctype-digit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_digit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); } @@ -89,13 +89,13 @@ final class Ctype * * @see https://php.net/ctype-graph * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_graph($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); } @@ -105,13 +105,13 @@ final class Ctype * * @see https://php.net/ctype-lower * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_lower($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); } @@ -121,13 +121,13 @@ final class Ctype * * @see https://php.net/ctype-print * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_print($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); } @@ -137,13 +137,13 @@ final class Ctype * * @see https://php.net/ctype-punct * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_punct($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); } @@ -153,13 +153,13 @@ final class Ctype * * @see https://php.net/ctype-space * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_space($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); } @@ -169,13 +169,13 @@ final class Ctype * * @see https://php.net/ctype-upper * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_upper($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); } @@ -185,13 +185,13 @@ final class Ctype * * @see https://php.net/ctype-xdigit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_xdigit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); } @@ -204,11 +204,12 @@ final class Ctype * (negative values have 256 added in order to allow characters in the Extended ASCII range). * Any other integer is interpreted as a string containing the decimal digits of the integer. * - * @param string|int $int + * @param mixed $int + * @param string $function * * @return mixed */ - private static function convert_int_to_char_for_ctype($int) + private static function convert_int_to_char_for_ctype($int, $function) { if (!\is_int($int)) { return $int; @@ -218,6 +219,10 @@ final class Ctype return (string) $int; } + if (\PHP_VERSION_ID >= 80100) { + @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); + } + if ($int < 0) { $int += 256; } diff --git a/vendor/symfony/polyfill-ctype/composer.json b/vendor/symfony/polyfill-ctype/composer.json index f0621a3..ccb8e57 100644 --- a/vendor/symfony/polyfill-ctype/composer.json +++ b/vendor/symfony/polyfill-ctype/composer.json @@ -18,6 +18,9 @@ "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, "files": [ "bootstrap.php" ] diff --git a/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/vendor/symfony/polyfill-intl-grapheme/Grapheme.php index 572da5d..6f7c0c7 100644 --- a/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ b/vendor/symfony/polyfill-intl-grapheme/Grapheme.php @@ -11,7 +11,7 @@ namespace Symfony\Polyfill\Intl\Grapheme; -\define('SYMFONY_GRAPHEME_CLUSTER_RX', \PCRE_VERSION >= '8.32' ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); +\define('SYMFONY_GRAPHEME_CLUSTER_RX', ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39) ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); /** * Partial intl implementation in pure PHP. diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php index b599095..b65c54a 100644 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -80,7 +80,7 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { + if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -602,6 +602,9 @@ final class Mbstring if (80000 > \PHP_VERSION_ID) { return false; } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); } diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json index 2ed7a74..1fa21ca 100644 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ b/vendor/symfony/polyfill-mbstring/composer.json @@ -18,6 +18,9 @@ "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" ] diff --git a/vendor/symfony/polyfill-php73/Php73.php b/vendor/symfony/polyfill-php73/Php73.php deleted file mode 100644 index 65c35a6..0000000 --- a/vendor/symfony/polyfill-php73/Php73.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * 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 - * @author Ion Bazan - * - * @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/vendor/symfony/polyfill-php73/README.md b/vendor/symfony/polyfill-php73/README.md deleted file mode 100644 index b3ebbce..0000000 --- a/vendor/symfony/polyfill-php73/README.md +++ /dev/null @@ -1,18 +0,0 @@ -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/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php deleted file mode 100644 index 673d100..0000000 --- a/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class JsonException extends Exception -{ -} diff --git a/vendor/symfony/polyfill-php73/bootstrap.php b/vendor/symfony/polyfill-php73/bootstrap.php deleted file mode 100644 index d6b2153..0000000 --- a/vendor/symfony/polyfill-php73/bootstrap.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * 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/vendor/symfony/polyfill-php73/composer.json b/vendor/symfony/polyfill-php73/composer.json deleted file mode 100644 index a7fe478..0000000 --- a/vendor/symfony/polyfill-php73/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "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/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php index 5fef511..362dd1a 100644 --- a/vendor/symfony/polyfill-php80/Php80.php +++ b/vendor/symfony/polyfill-php80/Php80.php @@ -100,6 +100,16 @@ final class Php80 public static function str_ends_with(string $haystack, string $needle): bool { - return '' === $needle || ('' !== $haystack && 0 === substr_compare($haystack, $needle, -\strlen($needle))); + if ('' === $needle || $needle === $haystack) { + return true; + } + + if ('' === $haystack) { + return false; + } + + $needleLength = \strlen($needle); + + return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); } } diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php new file mode 100644 index 0000000..fe6e691 --- /dev/null +++ b/vendor/symfony/polyfill-php80/PhpToken.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton + * + * @internal + */ +class PhpToken implements \Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var int + */ + public $line; + + /** + * @var int + */ + public $pos; + + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 0000000..72f1081 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,7 @@ + + * + * 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 + */ +#[\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/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/vendor/symfony/service-contracts/ServiceLocatorTrait.php index 74dfa43..19d3e80 100644 --- a/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ b/vendor/symfony/service-contracts/ServiceLocatorTrait.php @@ -26,9 +26,9 @@ class_exists(NotFoundExceptionInterface::class); */ trait ServiceLocatorTrait { - private $factories; - private $loading = []; - private $providedTypes; + private array $factories; + private array $loading = []; + private array $providedTypes; /** * @param callable[] $factories @@ -40,20 +40,16 @@ trait ServiceLocatorTrait /** * {@inheritdoc} - * - * @return bool */ - public function has(string $id) + public function has(string $id): bool { return isset($this->factories[$id]); } /** * {@inheritdoc} - * - * @return mixed */ - public function get(string $id) + public function get(string $id): mixed { if (!isset($this->factories[$id])) { throw $this->createNotFoundException($id); @@ -80,7 +76,7 @@ trait ServiceLocatorTrait */ public function getProvidedServices(): array { - if (null === $this->providedTypes) { + if (!isset($this->providedTypes)) { $this->providedTypes = []; foreach ($this->factories as $name => $factory) { diff --git a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php index 098ab90..881ab97 100644 --- a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php +++ b/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(); + public static function getSubscribedServices(): array; } diff --git a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php index 243e103..f7db036 100644 --- a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php @@ -12,10 +12,11 @@ namespace Symfony\Contracts\Service; use Psr\Container\ContainerInterface; +use Symfony\Contracts\Service\Attribute\SubscribedService; /** * Implementation of ServiceSubscriberInterface that determines subscribed services from - * private method return types. Service ids are available as "ClassName::methodName". + * method return types. Service ids are available as "ClassName::methodName". * * @author Kevin Bond */ @@ -38,13 +39,29 @@ trait ServiceSubscriberTrait $services = \is_callable(['parent', __FUNCTION__]) ? parent::getSubscribedServices() : []; foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { + if (self::class !== $method->getDeclaringClass()->name) { continue; } - if (self::class === $method->getDeclaringClass()->name && ($returnType = $method->getReturnType()) && !$returnType->isBuiltin()) { - $services[self::class.'::'.$method->name] = '?'.($returnType instanceof \ReflectionNamedType ? $returnType->getName() : $returnType); + if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { + 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)); + } + + $serviceId = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; + + if ($returnType->allowsNull()) { + $serviceId = '?'.$serviceId; + } + + $services[$attribute->newInstance()->key ?? self::class.'::'.$method->name] = $serviceId; } return $services; @@ -53,7 +70,7 @@ trait ServiceSubscriberTrait /** * @required */ - public function setContainer(ContainerInterface $container) + public function setContainer(ContainerInterface $container): ?ContainerInterface { $this->container = $container; diff --git a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php index d5b8267..88f6a06 100644 --- a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php @@ -17,7 +17,7 @@ use Symfony\Contracts\Service\ServiceLocatorTrait; abstract class ServiceLocatorTest extends TestCase { - protected function getServiceLocator(array $factories) + protected function getServiceLocator(array $factories): ContainerInterface { return new class($factories) implements ContainerInterface { use ServiceLocatorTrait; diff --git a/vendor/symfony/service-contracts/composer.json b/vendor/symfony/service-contracts/composer.json index 353413f..d3b047f 100644 --- a/vendor/symfony/service-contracts/composer.json +++ b/vendor/symfony/service-contracts/composer.json @@ -16,8 +16,11 @@ } ], "require": { - "php": ">=7.2.5", - "psr/container": "^1.1" + "php": ">=8.0.2", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" @@ -28,7 +31,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/vendor/symfony/string/AbstractString.php b/vendor/symfony/string/AbstractString.php index d3d95d4..8564430 100644 --- a/vendor/symfony/string/AbstractString.php +++ b/vendor/symfony/string/AbstractString.php @@ -92,15 +92,17 @@ abstract class AbstractString implements \Stringable, \JsonSerializable /** * @param string|string[] $needle - * - * @return static */ - public function after($needle, bool $includeNeedle = false, int $offset = 0): self + public function after(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static { $str = clone $this; $i = \PHP_INT_MAX; - foreach ((array) $needle as $n) { + if (\is_string($needle)) { + $needle = [$needle]; + } + + foreach ($needle as $n) { $n = (string) $n; $j = $this->indexOf($n, $offset); @@ -123,15 +125,17 @@ abstract class AbstractString implements \Stringable, \JsonSerializable /** * @param string|string[] $needle - * - * @return static */ - public function afterLast($needle, bool $includeNeedle = false, int $offset = 0): self + public function afterLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static { $str = clone $this; $i = null; - foreach ((array) $needle as $n) { + if (\is_string($needle)) { + $needle = [$needle]; + } + + foreach ($needle as $n) { $n = (string) $n; $j = $this->indexOfLast($n, $offset); @@ -152,22 +156,21 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return $this->slice($i); } - /** - * @return static - */ - abstract public function append(string ...$suffix): self; + abstract public function append(string ...$suffix): static; /** * @param string|string[] $needle - * - * @return static */ - public function before($needle, bool $includeNeedle = false, int $offset = 0): self + public function before(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static { $str = clone $this; $i = \PHP_INT_MAX; - foreach ((array) $needle as $n) { + if (\is_string($needle)) { + $needle = [$needle]; + } + + foreach ($needle as $n) { $n = (string) $n; $j = $this->indexOf($n, $offset); @@ -190,15 +193,17 @@ abstract class AbstractString implements \Stringable, \JsonSerializable /** * @param string|string[] $needle - * - * @return static */ - public function beforeLast($needle, bool $includeNeedle = false, int $offset = 0): self + public function beforeLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static { $str = clone $this; $i = null; - foreach ((array) $needle as $n) { + if (\is_string($needle)) { + $needle = [$needle]; + } + + foreach ($needle as $n) { $n = (string) $n; $j = $this->indexOfLast($n, $offset); @@ -229,20 +234,14 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return '' === $str->string ? [] : array_values(unpack('C*', $str->string)); } - /** - * @return static - */ - abstract public function camel(): self; + abstract public function camel(): static; /** * @return static[] */ abstract public function chunk(int $length = 1): array; - /** - * @return static - */ - public function collapseWhitespace(): self + public function collapseWhitespace(): static { $str = clone $this; $str->string = trim(preg_replace('/(?:\s{2,}+|[^\S ])/', ' ', $str->string)); @@ -253,7 +252,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable /** * @param string|string[] $needle */ - public function containsAny($needle): bool + public function containsAny(string|iterable $needle): bool { return null !== $this->indexOf($needle); } @@ -261,9 +260,9 @@ abstract class AbstractString implements \Stringable, \JsonSerializable /** * @param string|string[] $suffix */ - public function endsWith($suffix): bool + public function endsWith(string|iterable $suffix): bool { - if (!\is_array($suffix) && !$suffix instanceof \Traversable) { + if (\is_string($suffix)) { throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } @@ -276,10 +275,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return false; } - /** - * @return static - */ - public function ensureEnd(string $suffix): self + public function ensureEnd(string $suffix): static { if (!$this->endsWith($suffix)) { return $this->append($suffix); @@ -291,10 +287,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return $this->replaceMatches($regex.($this->ignoreCase ? 'i' : ''), '$1'); } - /** - * @return static - */ - public function ensureStart(string $prefix): self + public function ensureStart(string $prefix): static { $prefix = new static($prefix); @@ -316,9 +309,9 @@ abstract class AbstractString implements \Stringable, \JsonSerializable /** * @param string|string[] $string */ - public function equalsTo($string): bool + public function equalsTo(string|iterable $string): bool { - if (!\is_array($string) && !$string instanceof \Traversable) { + if (\is_string($string)) { throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } @@ -331,15 +324,9 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return false; } - /** - * @return static - */ - abstract public function folded(): self; + abstract public function folded(): static; - /** - * @return static - */ - public function ignoreCase(): self + public function ignoreCase(): static { $str = clone $this; $str->ignoreCase = true; @@ -350,9 +337,9 @@ abstract class AbstractString implements \Stringable, \JsonSerializable /** * @param string|string[] $needle */ - public function indexOf($needle, int $offset = 0): ?int + public function indexOf(string|iterable $needle, int $offset = 0): ?int { - if (!\is_array($needle) && !$needle instanceof \Traversable) { + if (\is_string($needle)) { throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } @@ -372,9 +359,9 @@ abstract class AbstractString implements \Stringable, \JsonSerializable /** * @param string|string[] $needle */ - public function indexOfLast($needle, int $offset = 0): ?int + public function indexOfLast(string|iterable $needle, int $offset = 0): ?int { - if (!\is_array($needle) && !$needle instanceof \Traversable) { + if (\is_string($needle)) { throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } @@ -396,10 +383,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return '' === $this->string; } - /** - * @return static - */ - abstract public function join(array $strings, string $lastGlue = null): self; + abstract public function join(array $strings, string $lastGlue = null): static; public function jsonSerialize(): string { @@ -408,10 +392,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable abstract public function length(): int; - /** - * @return static - */ - abstract public function lower(): self; + abstract public function lower(): static; /** * Matches the string using a regular expression. @@ -422,30 +403,15 @@ abstract class AbstractString implements \Stringable, \JsonSerializable */ abstract public function match(string $regexp, int $flags = 0, int $offset = 0): array; - /** - * @return static - */ - abstract public function padBoth(int $length, string $padStr = ' '): self; + abstract public function padBoth(int $length, string $padStr = ' '): static; - /** - * @return static - */ - abstract public function padEnd(int $length, string $padStr = ' '): self; + abstract public function padEnd(int $length, string $padStr = ' '): static; - /** - * @return static - */ - abstract public function padStart(int $length, string $padStr = ' '): self; + abstract public function padStart(int $length, string $padStr = ' '): static; - /** - * @return static - */ - abstract public function prepend(string ...$prefix): self; + abstract public function prepend(string ...$prefix): static; - /** - * @return static - */ - public function repeat(int $multiplier): self + public function repeat(int $multiplier): static { if (0 > $multiplier) { throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier)); @@ -457,37 +423,17 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return $str; } - /** - * @return static - */ - abstract public function replace(string $from, string $to): self; + abstract public function replace(string $from, string $to): static; - /** - * @param string|callable $to - * - * @return static - */ - abstract public function replaceMatches(string $fromRegexp, $to): self; + abstract public function replaceMatches(string $fromRegexp, string|callable $to): static; - /** - * @return static - */ - abstract public function reverse(): self; + abstract public function reverse(): static; - /** - * @return static - */ - abstract public function slice(int $start = 0, int $length = null): self; + abstract public function slice(int $start = 0, int $length = null): static; - /** - * @return static - */ - abstract public function snake(): self; + abstract public function snake(): static; - /** - * @return static - */ - abstract public function splice(string $replacement, int $start = 0, int $length = null): self; + abstract public function splice(string $replacement, int $start = 0, int $length = null): static; /** * @return static[] @@ -540,9 +486,9 @@ abstract class AbstractString implements \Stringable, \JsonSerializable /** * @param string|string[] $prefix */ - public function startsWith($prefix): bool + public function startsWith(string|iterable $prefix): bool { - if (!\is_array($prefix) && !$prefix instanceof \Traversable) { + if (\is_string($prefix)) { throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } @@ -555,10 +501,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return false; } - /** - * @return static - */ - abstract public function title(bool $allWords = false): self; + abstract public function title(bool $allWords = false): static; public function toByteString(string $toEncoding = null): ByteString { @@ -606,25 +549,77 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return new UnicodeString($this->string); } - /** - * @return static - */ - abstract public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self; + abstract public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; + + abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; /** - * @return static + * @param string|string[] $prefix */ - abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self; + public function trimPrefix($prefix): static + { + if (\is_array($prefix) || $prefix instanceof \Traversable) { + foreach ($prefix as $s) { + $t = $this->trimPrefix($s); + + if ($t->string !== $this->string) { + return $t; + } + } + + return clone $this; + } + + $str = clone $this; + + if ($prefix instanceof self) { + $prefix = $prefix->string; + } else { + $prefix = (string) $prefix; + } + + if ('' !== $prefix && \strlen($this->string) >= \strlen($prefix) && 0 === substr_compare($this->string, $prefix, 0, \strlen($prefix), $this->ignoreCase)) { + $str->string = substr($this->string, \strlen($prefix)); + } + + return $str; + } + + abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; /** - * @return static + * @param string|string[] $suffix */ - abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): self; + public function trimSuffix($suffix): static + { + if (\is_array($suffix) || $suffix instanceof \Traversable) { + foreach ($suffix as $s) { + $t = $this->trimSuffix($s); - /** - * @return static - */ - public function truncate(int $length, string $ellipsis = '', bool $cut = true): self + if ($t->string !== $this->string) { + return $t; + } + } + + return clone $this; + } + + $str = clone $this; + + if ($suffix instanceof self) { + $suffix = $suffix->string; + } else { + $suffix = (string) $suffix; + } + + if ('' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase)) { + $str->string = substr($this->string, 0, -\strlen($suffix)); + } + + return $str; + } + + public function truncate(int $length, string $ellipsis = '', bool $cut = true): static { $stringLength = $this->length(); @@ -651,20 +646,14 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return $ellipsisLength ? $str->trimEnd()->append($ellipsis) : $str; } - /** - * @return static - */ - abstract public function upper(): self; + abstract public function upper(): static; /** * Returns the printable length on a terminal. */ abstract public function width(bool $ignoreAnsiDecoration = true): int; - /** - * @return static - */ - public function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): self + public function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): static { $lines = '' !== $break ? $this->split($break) : [clone $this]; $chars = []; diff --git a/vendor/symfony/string/AbstractUnicodeString.php b/vendor/symfony/string/AbstractUnicodeString.php index 8af75a1..2d4abab 100644 --- a/vendor/symfony/string/AbstractUnicodeString.php +++ b/vendor/symfony/string/AbstractUnicodeString.php @@ -49,11 +49,10 @@ abstract class AbstractUnicodeString extends AbstractString private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; private static $transliterators = []; + private static $tableZero; + private static $tableWide; - /** - * @return static - */ - public static function fromCodePoints(int ...$codes): self + public static function fromCodePoints(int ...$codes): static { $string = ''; @@ -157,7 +156,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function camel(): parent + public function camel(): static { $str = clone $this; $str->string = str_replace(' ', '', preg_replace_callback('/\b./u', static function ($m) use (&$i) { @@ -187,11 +186,11 @@ abstract class AbstractUnicodeString extends AbstractString return $codePoints; } - public function folded(bool $compat = true): parent + public function folded(bool $compat = true): static { $str = clone $this; - if (!$compat || \PHP_VERSION_ID < 70300 || !\defined('Normalizer::NFKC_CF')) { + if (!$compat || !\defined('Normalizer::NFKC_CF')) { $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8'); } else { @@ -201,7 +200,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function join(array $strings, string $lastGlue = null): parent + public function join(array $strings, string $lastGlue = null): static { $str = clone $this; @@ -215,7 +214,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function lower(): parent + public function lower(): static { $str = clone $this; $str->string = mb_strtolower(str_replace('İ', 'i̇', $str->string), 'UTF-8'); @@ -252,10 +251,7 @@ abstract class AbstractUnicodeString extends AbstractString return $matches; } - /** - * @return static - */ - public function normalize(int $form = self::NFC): self + public function normalize(int $form = self::NFC): static { if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD])) { throw new InvalidArgumentException('Unsupported normalization form.'); @@ -267,7 +263,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function padBoth(int $length, string $padStr = ' '): parent + public function padBoth(int $length, string $padStr = ' '): static { if ('' === $padStr || !preg_match('//u', $padStr)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); @@ -279,7 +275,7 @@ abstract class AbstractUnicodeString extends AbstractString return $this->pad($length, $pad, \STR_PAD_BOTH); } - public function padEnd(int $length, string $padStr = ' '): parent + public function padEnd(int $length, string $padStr = ' '): static { if ('' === $padStr || !preg_match('//u', $padStr)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); @@ -291,7 +287,7 @@ abstract class AbstractUnicodeString extends AbstractString return $this->pad($length, $pad, \STR_PAD_RIGHT); } - public function padStart(int $length, string $padStr = ' '): parent + public function padStart(int $length, string $padStr = ' '): static { if ('' === $padStr || !preg_match('//u', $padStr)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); @@ -303,17 +299,13 @@ abstract class AbstractUnicodeString extends AbstractString return $this->pad($length, $pad, \STR_PAD_LEFT); } - public function replaceMatches(string $fromRegexp, $to): parent + public function replaceMatches(string $fromRegexp, string|callable $to): static { if ($this->ignoreCase) { $fromRegexp .= 'i'; } if (\is_array($to) || $to instanceof \Closure) { - if (!\is_callable($to)) { - throw new \TypeError(sprintf('Argument 2 passed to "%s::replaceMatches()" must be callable, array given.', static::class)); - } - $replace = 'preg_replace_callback'; $to = static function (array $m) use ($to): string { $to = $to($m); @@ -354,7 +346,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function reverse(): parent + public function reverse(): static { $str = clone $this; $str->string = implode('', array_reverse(preg_split('/(\X)/u', $str->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY))); @@ -362,7 +354,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function snake(): parent + public function snake(): static { $str = $this->camel()->title(); $str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8'); @@ -370,7 +362,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function title(bool $allWords = false): parent + public function title(bool $allWords = false): static { $str = clone $this; @@ -383,7 +375,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): parent + public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static { if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { throw new InvalidArgumentException('Invalid UTF-8 chars.'); @@ -396,7 +388,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): parent + public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static { if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { throw new InvalidArgumentException('Invalid UTF-8 chars.'); @@ -409,7 +401,27 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): parent + public function trimPrefix($prefix): static + { + if (!$this->ignoreCase) { + return parent::trimPrefix($prefix); + } + + $str = clone $this; + + if ($prefix instanceof \Traversable) { + $prefix = iterator_to_array($prefix, false); + } elseif ($prefix instanceof parent) { + $prefix = $prefix->string; + } + + $prefix = implode('|', array_map('preg_quote', (array) $prefix)); + $str->string = preg_replace("{^(?:$prefix)}iuD", '', $this->string); + + return $str; + } + + public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static { if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { throw new InvalidArgumentException('Invalid UTF-8 chars.'); @@ -422,15 +434,31 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function upper(): parent + public function trimSuffix($suffix): static + { + if (!$this->ignoreCase) { + return parent::trimSuffix($suffix); + } + + $str = clone $this; + + if ($suffix instanceof \Traversable) { + $suffix = iterator_to_array($suffix, false); + } elseif ($suffix instanceof parent) { + $suffix = $suffix->string; + } + + $suffix = implode('|', array_map('preg_quote', (array) $suffix)); + $str->string = preg_replace("{(?:$suffix)$}iuD", '', $this->string); + + return $str; + } + + public function upper(): static { $str = clone $this; $str->string = mb_strtoupper($str->string, 'UTF-8'); - if (\PHP_VERSION_ID < 70300) { - $str->string = str_replace(self::UPPER_FROM, self::UPPER_TO, $str->string); - } - return $str; } @@ -463,10 +491,7 @@ abstract class AbstractUnicodeString extends AbstractString return $width; } - /** - * @return static - */ - private function pad(int $len, self $pad, int $type): parent + private function pad(int $len, self $pad, int $type): static { $sLen = $this->length(); @@ -530,19 +555,18 @@ abstract class AbstractUnicodeString extends AbstractString return -1; } - static $tableZero; - if (null === $tableZero) { - $tableZero = require __DIR__.'/Resources/data/wcswidth_table_zero.php'; + if (null === self::$tableZero) { + self::$tableZero = require __DIR__.'/Resources/data/wcswidth_table_zero.php'; } - if ($codePoint >= $tableZero[0][0] && $codePoint <= $tableZero[$ubound = \count($tableZero) - 1][1]) { + if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) { $lbound = 0; while ($ubound >= $lbound) { $mid = floor(($lbound + $ubound) / 2); - if ($codePoint > $tableZero[$mid][1]) { + if ($codePoint > self::$tableZero[$mid][1]) { $lbound = $mid + 1; - } elseif ($codePoint < $tableZero[$mid][0]) { + } elseif ($codePoint < self::$tableZero[$mid][0]) { $ubound = $mid - 1; } else { continue 2; @@ -550,19 +574,18 @@ abstract class AbstractUnicodeString extends AbstractString } } - static $tableWide; - if (null === $tableWide) { - $tableWide = require __DIR__.'/Resources/data/wcswidth_table_wide.php'; + if (null === self::$tableWide) { + self::$tableWide = require __DIR__.'/Resources/data/wcswidth_table_wide.php'; } - if ($codePoint >= $tableWide[0][0] && $codePoint <= $tableWide[$ubound = \count($tableWide) - 1][1]) { + if ($codePoint >= self::$tableWide[0][0] && $codePoint <= self::$tableWide[$ubound = \count(self::$tableWide) - 1][1]) { $lbound = 0; while ($ubound >= $lbound) { $mid = floor(($lbound + $ubound) / 2); - if ($codePoint > $tableWide[$mid][1]) { + if ($codePoint > self::$tableWide[$mid][1]) { $lbound = $mid + 1; - } elseif ($codePoint < $tableWide[$mid][0]) { + } elseif ($codePoint < self::$tableWide[$mid][0]) { $ubound = $mid - 1; } else { $width += 2; diff --git a/vendor/symfony/string/ByteString.php b/vendor/symfony/string/ByteString.php index bbf8614..b3649b6 100644 --- a/vendor/symfony/string/ByteString.php +++ b/vendor/symfony/string/ByteString.php @@ -92,7 +92,7 @@ class ByteString extends AbstractString return '' === $str ? [] : [\ord($str)]; } - public function append(string ...$suffix): parent + public function append(string ...$suffix): static { $str = clone $this; $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); @@ -100,7 +100,7 @@ class ByteString extends AbstractString return $str; } - public function camel(): parent + public function camel(): static { $str = clone $this; $str->string = lcfirst(str_replace(' ', '', ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); @@ -129,27 +129,23 @@ class ByteString extends AbstractString return $chunks; } - public function endsWith($suffix): bool + public function endsWith(string|iterable|AbstractString $suffix): bool { - if ($suffix instanceof parent) { + if ($suffix instanceof AbstractString) { $suffix = $suffix->string; - } elseif (\is_array($suffix) || $suffix instanceof \Traversable) { + } elseif (!\is_string($suffix)) { return parent::endsWith($suffix); - } else { - $suffix = (string) $suffix; } return '' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase); } - public function equalsTo($string): bool + public function equalsTo(string|iterable|AbstractString $string): bool { - if ($string instanceof parent) { + if ($string instanceof AbstractString) { $string = $string->string; - } elseif (\is_array($string) || $string instanceof \Traversable) { + } elseif (!\is_string($string)) { return parent::equalsTo($string); - } else { - $string = (string) $string; } if ('' !== $string && $this->ignoreCase) { @@ -159,7 +155,7 @@ class ByteString extends AbstractString return $string === $this->string; } - public function folded(): parent + public function folded(): static { $str = clone $this; $str->string = strtolower($str->string); @@ -167,14 +163,12 @@ class ByteString extends AbstractString return $str; } - public function indexOf($needle, int $offset = 0): ?int + public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int { - if ($needle instanceof parent) { + if ($needle instanceof AbstractString) { $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { + } elseif (!\is_string($needle)) { return parent::indexOf($needle, $offset); - } else { - $needle = (string) $needle; } if ('' === $needle) { @@ -186,14 +180,12 @@ class ByteString extends AbstractString return false === $i ? null : $i; } - public function indexOfLast($needle, int $offset = 0): ?int + public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int { - if ($needle instanceof parent) { + if ($needle instanceof AbstractString) { $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { + } elseif (!\is_string($needle)) { return parent::indexOfLast($needle, $offset); - } else { - $needle = (string) $needle; } if ('' === $needle) { @@ -210,7 +202,7 @@ class ByteString extends AbstractString return '' === $this->string || preg_match('//u', $this->string); } - public function join(array $strings, string $lastGlue = null): parent + public function join(array $strings, string $lastGlue = null): static { $str = clone $this; @@ -225,7 +217,7 @@ class ByteString extends AbstractString return \strlen($this->string); } - public function lower(): parent + public function lower(): static { $str = clone $this; $str->string = strtolower($str->string); @@ -262,7 +254,7 @@ class ByteString extends AbstractString return $matches; } - public function padBoth(int $length, string $padStr = ' '): parent + public function padBoth(int $length, string $padStr = ' '): static { $str = clone $this; $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_BOTH); @@ -270,7 +262,7 @@ class ByteString extends AbstractString return $str; } - public function padEnd(int $length, string $padStr = ' '): parent + public function padEnd(int $length, string $padStr = ' '): static { $str = clone $this; $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_RIGHT); @@ -278,7 +270,7 @@ class ByteString extends AbstractString return $str; } - public function padStart(int $length, string $padStr = ' '): parent + public function padStart(int $length, string $padStr = ' '): static { $str = clone $this; $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_LEFT); @@ -286,7 +278,7 @@ class ByteString extends AbstractString return $str; } - public function prepend(string ...$prefix): parent + public function prepend(string ...$prefix): static { $str = clone $this; $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$str->string; @@ -294,7 +286,7 @@ class ByteString extends AbstractString return $str; } - public function replace(string $from, string $to): parent + public function replace(string $from, string $to): static { $str = clone $this; @@ -305,21 +297,13 @@ class ByteString extends AbstractString return $str; } - public function replaceMatches(string $fromRegexp, $to): parent + public function replaceMatches(string $fromRegexp, string|callable $to): static { if ($this->ignoreCase) { $fromRegexp .= 'i'; } - if (\is_array($to)) { - if (!\is_callable($to)) { - throw new \TypeError(sprintf('Argument 2 passed to "%s::replaceMatches()" must be callable, array given.', static::class)); - } - - $replace = 'preg_replace_callback'; - } else { - $replace = $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; - } + $replace = \is_array($to) || $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); @@ -345,7 +329,7 @@ class ByteString extends AbstractString return $str; } - public function reverse(): parent + public function reverse(): static { $str = clone $this; $str->string = strrev($str->string); @@ -353,7 +337,7 @@ class ByteString extends AbstractString return $str; } - public function slice(int $start = 0, int $length = null): parent + public function slice(int $start = 0, int $length = null): static { $str = clone $this; $str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX); @@ -361,7 +345,7 @@ class ByteString extends AbstractString return $str; } - public function snake(): parent + public function snake(): static { $str = $this->camel()->title(); $str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string)); @@ -369,7 +353,7 @@ class ByteString extends AbstractString return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): parent + public function splice(string $replacement, int $start = 0, int $length = null): static { $str = clone $this; $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); @@ -404,9 +388,9 @@ class ByteString extends AbstractString return $chunks; } - public function startsWith($prefix): bool + public function startsWith(string|iterable|AbstractString $prefix): bool { - if ($prefix instanceof parent) { + if ($prefix instanceof AbstractString) { $prefix = $prefix->string; } elseif (!\is_string($prefix)) { return parent::startsWith($prefix); @@ -415,7 +399,7 @@ class ByteString extends AbstractString return '' !== $prefix && 0 === ($this->ignoreCase ? strncasecmp($this->string, $prefix, \strlen($prefix)) : strncmp($this->string, $prefix, \strlen($prefix))); } - public function title(bool $allWords = false): parent + public function title(bool $allWords = false): static { $str = clone $this; $str->string = $allWords ? ucwords($str->string) : ucfirst($str->string); @@ -465,7 +449,7 @@ class ByteString extends AbstractString return $u; } - public function trim(string $chars = " \t\n\r\0\x0B\x0C"): parent + public function trim(string $chars = " \t\n\r\0\x0B\x0C"): static { $str = clone $this; $str->string = trim($str->string, $chars); @@ -473,7 +457,7 @@ class ByteString extends AbstractString return $str; } - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C"): parent + public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C"): static { $str = clone $this; $str->string = rtrim($str->string, $chars); @@ -481,7 +465,7 @@ class ByteString extends AbstractString return $str; } - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C"): parent + public function trimStart(string $chars = " \t\n\r\0\x0B\x0C"): static { $str = clone $this; $str->string = ltrim($str->string, $chars); @@ -489,7 +473,7 @@ class ByteString extends AbstractString return $str; } - public function upper(): parent + public function upper(): static { $str = clone $this; $str->string = strtoupper($str->string); diff --git a/vendor/symfony/string/CHANGELOG.md b/vendor/symfony/string/CHANGELOG.md index 700d214..53af364 100644 --- a/vendor/symfony/string/CHANGELOG.md +++ b/vendor/symfony/string/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +5.4 +--- + + * Add `trimSuffix()` and `trimPrefix()` methods + 5.3 --- diff --git a/vendor/symfony/string/CodePointString.php b/vendor/symfony/string/CodePointString.php index 8ab9209..926ff79 100644 --- a/vendor/symfony/string/CodePointString.php +++ b/vendor/symfony/string/CodePointString.php @@ -33,7 +33,7 @@ class CodePointString extends AbstractUnicodeString $this->string = $string; } - public function append(string ...$suffix): AbstractString + public function append(string ...$suffix): static { $str = clone $this; $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); @@ -80,14 +80,12 @@ class CodePointString extends AbstractUnicodeString return '' === $str->string ? [] : [mb_ord($str->string, 'UTF-8')]; } - public function endsWith($suffix): bool + public function endsWith(string|iterable|AbstractString $suffix): bool { if ($suffix instanceof AbstractString) { $suffix = $suffix->string; - } elseif (\is_array($suffix) || $suffix instanceof \Traversable) { + } elseif (!\is_string($suffix)) { return parent::endsWith($suffix); - } else { - $suffix = (string) $suffix; } if ('' === $suffix || !preg_match('//u', $suffix)) { @@ -101,14 +99,12 @@ class CodePointString extends AbstractUnicodeString return \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix)); } - public function equalsTo($string): bool + public function equalsTo(string|iterable|AbstractString $string): bool { if ($string instanceof AbstractString) { $string = $string->string; - } elseif (\is_array($string) || $string instanceof \Traversable) { + } elseif (!\is_string($string)) { return parent::equalsTo($string); - } else { - $string = (string) $string; } if ('' !== $string && $this->ignoreCase) { @@ -118,14 +114,12 @@ class CodePointString extends AbstractUnicodeString return $string === $this->string; } - public function indexOf($needle, int $offset = 0): ?int + public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int { if ($needle instanceof AbstractString) { $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { + } elseif (!\is_string($needle)) { return parent::indexOf($needle, $offset); - } else { - $needle = (string) $needle; } if ('' === $needle) { @@ -137,14 +131,12 @@ class CodePointString extends AbstractUnicodeString return false === $i ? null : $i; } - public function indexOfLast($needle, int $offset = 0): ?int + public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int { if ($needle instanceof AbstractString) { $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { + } elseif (!\is_string($needle)) { return parent::indexOfLast($needle, $offset); - } else { - $needle = (string) $needle; } if ('' === $needle) { @@ -161,7 +153,7 @@ class CodePointString extends AbstractUnicodeString return mb_strlen($this->string, 'UTF-8'); } - public function prepend(string ...$prefix): AbstractString + public function prepend(string ...$prefix): static { $str = clone $this; $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; @@ -173,7 +165,7 @@ class CodePointString extends AbstractUnicodeString return $str; } - public function replace(string $from, string $to): AbstractString + public function replace(string $from, string $to): static { $str = clone $this; @@ -194,7 +186,7 @@ class CodePointString extends AbstractUnicodeString return $str; } - public function slice(int $start = 0, int $length = null): AbstractString + public function slice(int $start = 0, int $length = null): static { $str = clone $this; $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); @@ -202,7 +194,7 @@ class CodePointString extends AbstractUnicodeString return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): AbstractString + public function splice(string $replacement, int $start = 0, int $length = null): static { if (!preg_match('//u', $replacement)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); @@ -247,14 +239,12 @@ class CodePointString extends AbstractUnicodeString return $chunks; } - public function startsWith($prefix): bool + public function startsWith(string|iterable|AbstractString $prefix): bool { if ($prefix instanceof AbstractString) { $prefix = $prefix->string; - } elseif (\is_array($prefix) || $prefix instanceof \Traversable) { + } elseif (!\is_string($prefix)) { return parent::startsWith($prefix); - } else { - $prefix = (string) $prefix; } if ('' === $prefix || !preg_match('//u', $prefix)) { diff --git a/vendor/symfony/string/Inflector/EnglishInflector.php b/vendor/symfony/string/Inflector/EnglishInflector.php index 39b8e9a..9f2fac6 100644 --- a/vendor/symfony/string/Inflector/EnglishInflector.php +++ b/vendor/symfony/string/Inflector/EnglishInflector.php @@ -58,6 +58,9 @@ final class EnglishInflector implements InflectorInterface // selfies (selfie) ['seifles', 7, true, true, 'selfie'], + // zombies (zombie) + ['seibmoz', 7, true, true, 'zombie'], + // movies (movie) ['seivom', 6, true, true, 'movie'], diff --git a/vendor/symfony/string/Inflector/InflectorInterface.php b/vendor/symfony/string/Inflector/InflectorInterface.php index ad78070..67f2834 100644 --- a/vendor/symfony/string/Inflector/InflectorInterface.php +++ b/vendor/symfony/string/Inflector/InflectorInterface.php @@ -18,7 +18,7 @@ interface InflectorInterface * * If the method can't determine the form with certainty, several possible singulars are returned. * - * @return string[] An array of possible singular forms + * @return string[] */ public function singularize(string $plural): array; @@ -27,7 +27,7 @@ interface InflectorInterface * * If the method can't determine the form with certainty, several possible plurals are returned. * - * @return string[] An array of possible plural forms + * @return string[] */ public function pluralize(string $singular): array; } diff --git a/vendor/symfony/string/LICENSE b/vendor/symfony/string/LICENSE index 383e7a5..9c907a4 100644 --- a/vendor/symfony/string/LICENSE +++ b/vendor/symfony/string/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019-2021 Fabien Potencier +Copyright (c) 2019-2022 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 diff --git a/vendor/symfony/string/LazyString.php b/vendor/symfony/string/LazyString.php index b3801db..15b8d72 100644 --- a/vendor/symfony/string/LazyString.php +++ b/vendor/symfony/string/LazyString.php @@ -18,17 +18,15 @@ namespace Symfony\Component\String; */ class LazyString implements \Stringable, \JsonSerializable { - private $value; + private \Closure|string $value; /** * @param callable|array $callback A callable or a [Closure, method] lazy-callable - * - * @return static */ - public static function fromCallable($callback, ...$arguments): self + public static function fromCallable(callable|array $callback, mixed ...$arguments): static { - if (!\is_callable($callback) && !(\is_array($callback) && isset($callback[0]) && $callback[0] instanceof \Closure && 2 >= \count($callback))) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, get_debug_type($callback))); + if (\is_array($callback) && !\is_callable($callback) && !(($callback[0] ?? null) instanceof \Closure || 2 < \count($callback))) { + throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); } $lazyString = new static(); @@ -49,17 +47,8 @@ class LazyString implements \Stringable, \JsonSerializable return $lazyString; } - /** - * @param string|int|float|bool|\Stringable $value - * - * @return static - */ - public static function fromStringable($value): self + public static function fromStringable(string|int|float|bool|\Stringable $value): static { - if (!self::isStringable($value)) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a scalar or a stringable object, "%s" given.', __METHOD__, get_debug_type($value))); - } - if (\is_object($value)) { return static::fromCallable([$value, '__toString']); } @@ -73,27 +62,22 @@ class LazyString implements \Stringable, \JsonSerializable /** * Tells whether the provided value can be cast to string. */ - final public static function isStringable($value): bool + final public static function isStringable(mixed $value): bool { - return \is_string($value) || $value instanceof self || (\is_object($value) ? method_exists($value, '__toString') : is_scalar($value)); + return \is_string($value) || $value instanceof \Stringable || is_scalar($value); } /** * Casts scalars and stringable objects to strings. * - * @param object|string|int|float|bool $value - * * @throws \TypeError When the provided value is not stringable */ - final public static function resolve($value): string + final public static function resolve(\Stringable|string|int|float|bool $value): string { return $value; } - /** - * @return string - */ - public function __toString() + public function __toString(): string { if (\is_string($this->value)) { return $this->value; @@ -111,11 +95,6 @@ class LazyString implements \Stringable, \JsonSerializable $e = new \TypeError(sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); } - if (\PHP_VERSION_ID < 70400) { - // leverage the ErrorHandler component with graceful fallback when it's not available - return trigger_error($e, \E_USER_ERROR); - } - throw $e; } } diff --git a/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/vendor/symfony/string/Resources/data/wcswidth_table_wide.php index e3a41cd..43c802d 100644 --- a/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ b/vendor/symfony/string/Resources/data/wcswidth_table_wide.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 13.0.0 - * Date: 2020-03-12T08:04:33+00:00 + * Unicode version: 14.0.0 + * Date: 2021-09-17T09:20:30+02:00 */ return [ @@ -450,10 +450,6 @@ return [ ], [ 19968, - 40956, - ], - [ - 40957, 40959, ], [ @@ -840,13 +836,25 @@ return [ 101632, 101640, ], + [ + 110576, + 110579, + ], + [ + 110581, + 110587, + ], + [ + 110589, + 110590, + ], [ 110592, 110847, ], [ 110848, - 110878, + 110882, ], [ 110928, @@ -996,6 +1004,10 @@ return [ 128725, 128727, ], + [ + 128733, + 128735, + ], [ 128747, 128748, @@ -1008,6 +1020,10 @@ return [ 128992, 129003, ], + [ + 129008, + 129008, + ], [ 129292, 129338, @@ -1018,14 +1034,6 @@ return [ ], [ 129351, - 129400, - ], - [ - 129402, - 129483, - ], - [ - 129485, 129535, ], [ @@ -1034,7 +1042,7 @@ return [ ], [ 129656, - 129658, + 129660, ], [ 129664, @@ -1042,34 +1050,42 @@ return [ ], [ 129680, - 129704, + 129708, ], [ 129712, - 129718, + 129722, ], [ 129728, - 129730, + 129733, ], [ 129744, - 129750, + 129753, + ], + [ + 129760, + 129767, + ], + [ + 129776, + 129782, ], [ 131072, - 173789, + 173791, ], [ - 173790, + 173792, 173823, ], [ 173824, - 177972, + 177976, ], [ - 177973, + 177977, 177983, ], [ diff --git a/vendor/symfony/string/Resources/data/wcswidth_table_zero.php b/vendor/symfony/string/Resources/data/wcswidth_table_zero.php index 5a33bab..63b0824 100644 --- a/vendor/symfony/string/Resources/data/wcswidth_table_zero.php +++ b/vendor/symfony/string/Resources/data/wcswidth_table_zero.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 13.0.0 - * Date: 2020-03-12T08:04:34+00:00 + * Unicode version: 14.0.0 + * Date: 2021-09-17T09:20:30+02:00 */ return [ @@ -109,7 +109,11 @@ return [ 2139, ], [ - 2259, + 2200, + 2207, + ], + [ + 2250, 2273, ], [ @@ -272,6 +276,10 @@ return [ 3076, 3076, ], + [ + 3132, + 3132, + ], [ 3134, 3136, @@ -470,7 +478,7 @@ return [ ], [ 5938, - 5940, + 5939, ], [ 5970, @@ -504,6 +512,10 @@ return [ 6155, 6157, ], + [ + 6159, + 6159, + ], [ 6277, 6278, @@ -574,7 +586,7 @@ return [ ], [ 6847, - 6848, + 6862, ], [ 6912, @@ -666,10 +678,6 @@ return [ ], [ 7616, - 7673, - ], - [ - 7675, 7679, ], [ @@ -916,6 +924,10 @@ return [ 69446, 69456, ], + [ + 69506, + 69509, + ], [ 69633, 69633, @@ -924,6 +936,14 @@ return [ 69688, 69702, ], + [ + 69744, + 69744, + ], + [ + 69747, + 69748, + ], [ 69759, 69761, @@ -936,6 +956,10 @@ return [ 69817, 69818, ], + [ + 69826, + 69826, + ], [ 69888, 69890, @@ -1252,6 +1276,14 @@ return [ 113821, 113822, ], + [ + 118528, + 118573, + ], + [ + 118576, + 118598, + ], [ 119143, 119145, @@ -1320,6 +1352,10 @@ return [ 123184, 123190, ], + [ + 123566, + 123566, + ], [ 123628, 123631, diff --git a/vendor/symfony/string/Slugger/AsciiSlugger.php b/vendor/symfony/string/Slugger/AsciiSlugger.php index 5aecfeb..548a6b9 100644 --- a/vendor/symfony/string/Slugger/AsciiSlugger.php +++ b/vendor/symfony/string/Slugger/AsciiSlugger.php @@ -54,8 +54,8 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface 'zh' => 'Han-Latin', ]; - private $defaultLocale; - private $symbolsMap = [ + private ?string $defaultLocale; + private \Closure|array $symbolsMap = [ 'en' => ['@' => 'at', '&' => 'and'], ]; @@ -64,17 +64,10 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface * * @var \Transliterator[] */ - private $transliterators = []; + private array $transliterators = []; - /** - * @param array|\Closure|null $symbolsMap - */ - public function __construct(string $defaultLocale = null, $symbolsMap = null) + public function __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null) { - if (null !== $symbolsMap && !\is_array($symbolsMap) && !$symbolsMap instanceof \Closure) { - throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be array, Closure or null, "%s" given.', __METHOD__, \gettype($symbolsMap))); - } - $this->defaultLocale = $defaultLocale; $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; } @@ -82,7 +75,7 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface /** * {@inheritdoc} */ - public function setLocale($locale) + public function setLocale(string $locale) { $this->defaultLocale = $locale; } @@ -90,7 +83,7 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface /** * {@inheritdoc} */ - public function getLocale() + public function getLocale(): string { return $this->defaultLocale; } diff --git a/vendor/symfony/string/UnicodeString.php b/vendor/symfony/string/UnicodeString.php index 9b906c6..70cf4c5 100644 --- a/vendor/symfony/string/UnicodeString.php +++ b/vendor/symfony/string/UnicodeString.php @@ -41,7 +41,7 @@ class UnicodeString extends AbstractUnicodeString } } - public function append(string ...$suffix): AbstractString + public function append(string ...$suffix): static { $str = clone $this; $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); @@ -82,14 +82,12 @@ class UnicodeString extends AbstractUnicodeString return $chunks; } - public function endsWith($suffix): bool + public function endsWith(string|iterable|AbstractString $suffix): bool { if ($suffix instanceof AbstractString) { $suffix = $suffix->string; - } elseif (\is_array($suffix) || $suffix instanceof \Traversable) { + } elseif (!\is_string($suffix)) { return parent::endsWith($suffix); - } else { - $suffix = (string) $suffix; } $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; @@ -106,14 +104,12 @@ class UnicodeString extends AbstractUnicodeString return $suffix === grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)); } - public function equalsTo($string): bool + public function equalsTo(string|iterable|AbstractString $string): bool { if ($string instanceof AbstractString) { $string = $string->string; - } elseif (\is_array($string) || $string instanceof \Traversable) { + } elseif (!\is_string($string)) { return parent::equalsTo($string); - } else { - $string = (string) $string; } $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; @@ -126,14 +122,12 @@ class UnicodeString extends AbstractUnicodeString return $string === $this->string; } - public function indexOf($needle, int $offset = 0): ?int + public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int { if ($needle instanceof AbstractString) { $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { + } elseif (!\is_string($needle)) { return parent::indexOf($needle, $offset); - } else { - $needle = (string) $needle; } $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; @@ -152,14 +146,12 @@ class UnicodeString extends AbstractUnicodeString return false === $i ? null : $i; } - public function indexOfLast($needle, int $offset = 0): ?int + public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int { if ($needle instanceof AbstractString) { $needle = $needle->string; - } elseif (\is_array($needle) || $needle instanceof \Traversable) { + } elseif (!\is_string($needle)) { return parent::indexOfLast($needle, $offset); - } else { - $needle = (string) $needle; } $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; @@ -184,7 +176,7 @@ class UnicodeString extends AbstractUnicodeString return false === $i ? null : $i; } - public function join(array $strings, string $lastGlue = null): AbstractString + public function join(array $strings, string $lastGlue = null): static { $str = parent::join($strings, $lastGlue); normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); @@ -197,10 +189,7 @@ class UnicodeString extends AbstractUnicodeString return grapheme_strlen($this->string); } - /** - * @return static - */ - public function normalize(int $form = self::NFC): parent + public function normalize(int $form = self::NFC): static { $str = clone $this; @@ -216,7 +205,7 @@ class UnicodeString extends AbstractUnicodeString return $str; } - public function prepend(string ...$prefix): AbstractString + public function prepend(string ...$prefix): static { $str = clone $this; $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; @@ -229,7 +218,7 @@ class UnicodeString extends AbstractUnicodeString return $str; } - public function replace(string $from, string $to): AbstractString + public function replace(string $from, string $to): static { $str = clone $this; normalizer_is_normalized($from) ?: $from = normalizer_normalize($from); @@ -256,7 +245,7 @@ class UnicodeString extends AbstractUnicodeString return $str; } - public function replaceMatches(string $fromRegexp, $to): AbstractString + public function replaceMatches(string $fromRegexp, string|callable $to): static { $str = parent::replaceMatches($fromRegexp, $to); normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); @@ -264,25 +253,19 @@ class UnicodeString extends AbstractUnicodeString return $str; } - public function slice(int $start = 0, int $length = null): AbstractString + public function slice(int $start = 0, int $length = null): static { $str = clone $this; - if (\PHP_VERSION_ID < 80000 && 0 > $start && grapheme_strlen($this->string) < -$start) { - $start = 0; - } $str->string = (string) grapheme_substr($this->string, $start, $length ?? 2147483647); return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): AbstractString + public function splice(string $replacement, int $start = 0, int $length = null): static { $str = clone $this; - if (\PHP_VERSION_ID < 80000 && 0 > $start && grapheme_strlen($this->string) < -$start) { - $start = 0; - } $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); @@ -333,14 +316,12 @@ class UnicodeString extends AbstractUnicodeString return $chunks; } - public function startsWith($prefix): bool + public function startsWith(string|iterable|AbstractString $prefix): bool { if ($prefix instanceof AbstractString) { $prefix = $prefix->string; - } elseif (\is_array($prefix) || $prefix instanceof \Traversable) { + } elseif (!\is_string($prefix)) { return parent::startsWith($prefix); - } else { - $prefix = (string) $prefix; } $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; diff --git a/vendor/symfony/string/composer.json b/vendor/symfony/string/composer.json index bfb03cd..187323f 100644 --- a/vendor/symfony/string/composer.json +++ b/vendor/symfony/string/composer.json @@ -16,18 +16,20 @@ } ], "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "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" + "symfony/polyfill-mbstring": "~1.0" }, "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" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" }, "autoload": { "psr-4": { "Symfony\\Component\\String\\": "" }, diff --git a/vendor/symfony/translation-contracts/LocaleAwareInterface.php b/vendor/symfony/translation-contracts/LocaleAwareInterface.php index 922ec1d..6923b97 100644 --- a/vendor/symfony/translation-contracts/LocaleAwareInterface.php +++ b/vendor/symfony/translation-contracts/LocaleAwareInterface.php @@ -16,16 +16,12 @@ interface LocaleAwareInterface /** * Sets the current locale. * - * @param string $locale The locale - * * @throws \InvalidArgumentException If the locale contains invalid characters */ public function setLocale(string $locale); /** * Returns the current locale. - * - * @return string The locale */ - public function getLocale(); + public function getLocale(): string; } diff --git a/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/vendor/symfony/translation-contracts/Test/TranslatorTest.php index aac9d68..c2c30a9 100644 --- a/vendor/symfony/translation-contracts/Test/TranslatorTest.php +++ b/vendor/symfony/translation-contracts/Test/TranslatorTest.php @@ -30,7 +30,20 @@ use Symfony\Contracts\Translation\TranslatorTrait; */ class TranslatorTest extends TestCase { - public function getTranslator() + private $defaultLocale; + + protected function setUp(): void + { + $this->defaultLocale = \Locale::getDefault(); + \Locale::setDefault('en'); + } + + protected function tearDown(): void + { + \Locale::setDefault($this->defaultLocale); + } + + public function getTranslator(): TranslatorInterface { return new class() implements TranslatorInterface { use TranslatorTrait; @@ -53,7 +66,6 @@ class TranslatorTest extends TestCase public function testTransChoiceWithExplicitLocale($expected, $id, $number) { $translator = $this->getTranslator(); - $translator->setLocale('en'); $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); } @@ -65,17 +77,25 @@ class TranslatorTest extends TestCase */ public function testTransChoiceWithDefaultLocale($expected, $id, $number) { - \Locale::setDefault('en'); - $translator = $this->getTranslator(); $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); } + /** + * @dataProvider getTransChoiceTests + */ + public function testTransChoiceWithEnUsPosix($expected, $id, $number) + { + $translator = $this->getTranslator(); + $translator->setLocale('en_US_POSIX'); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); + } + public function testGetSetLocale() { $translator = $this->getTranslator(); - $translator->setLocale('en'); $this->assertEquals('en', $translator->getLocale()); } @@ -294,14 +314,12 @@ class TranslatorTest extends TestCase * This array should contain all currently known langcodes. * * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. - * - * @return array */ - public function successLangcodes() + public function successLangcodes(): array { return [ ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']], - ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM']], + ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM', 'en_US_POSIX']], ['3', ['be', 'bs', 'cs', 'hr']], ['4', ['cy', 'mt', 'sl']], ['6', ['ar']], @@ -316,7 +334,7 @@ class TranslatorTest extends TestCase * * @return array with nplural together with langcodes */ - public function failingLangcodes() + public function failingLangcodes(): array { return [ ['1', ['fa']], @@ -330,11 +348,10 @@ class TranslatorTest extends TestCase /** * We validate only on the plural coverage. Thus the real rules is not tested. * - * @param string $nplural Plural expected - * @param array $matrix Containing langcodes and their plural index values - * @param bool $expectSuccess + * @param string $nplural Plural expected + * @param array $matrix Containing langcodes and their plural index values */ - protected function validateMatrix($nplural, $matrix, $expectSuccess = true) + protected function validateMatrix(string $nplural, array $matrix, bool $expectSuccess = true) { foreach ($matrix as $langCode => $data) { $indexes = array_flip($data); diff --git a/vendor/symfony/translation-contracts/TranslatorInterface.php b/vendor/symfony/translation-contracts/TranslatorInterface.php index dc9bf7f..018db07 100644 --- a/vendor/symfony/translation-contracts/TranslatorInterface.php +++ b/vendor/symfony/translation-contracts/TranslatorInterface.php @@ -13,8 +13,6 @@ namespace Symfony\Contracts\Translation; /** * @author Fabien Potencier - * - * @method string getLocale() Returns the default locale */ interface TranslatorInterface { @@ -59,9 +57,12 @@ interface TranslatorInterface * @param string|null $domain The domain for the message or null to use the default * @param string|null $locale The locale or null to use the default * - * @return string The translated string - * * @throws \InvalidArgumentException If the locale contains invalid characters */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null); + public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string; + + /** + * Returns the default locale. + */ + public function getLocale(): string; } diff --git a/vendor/symfony/translation-contracts/TranslatorTrait.php b/vendor/symfony/translation-contracts/TranslatorTrait.php index 789693d..9c264bd 100644 --- a/vendor/symfony/translation-contracts/TranslatorTrait.php +++ b/vendor/symfony/translation-contracts/TranslatorTrait.php @@ -20,7 +20,7 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException; */ trait TranslatorTrait { - private $locale; + private ?string $locale = null; /** * {@inheritdoc} @@ -32,10 +32,8 @@ trait TranslatorTrait /** * {@inheritdoc} - * - * @return string */ - public function getLocale() + public function getLocale(): string { return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); } @@ -142,7 +140,7 @@ EOF; { $number = abs($number); - switch ('pt_BR' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { + switch ('pt_BR' !== $locale && 'en_US_POSIX' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { case 'af': case 'bn': case 'bg': @@ -151,6 +149,7 @@ EOF; case 'de': case 'el': case 'en': + case 'en_US_POSIX': case 'eo': case 'es': case 'et': diff --git a/vendor/symfony/translation-contracts/composer.json b/vendor/symfony/translation-contracts/composer.json index 00e27f8..875242f 100644 --- a/vendor/symfony/translation-contracts/composer.json +++ b/vendor/symfony/translation-contracts/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" @@ -27,7 +27,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/vendor/symfony/translation/CHANGELOG.md b/vendor/symfony/translation/CHANGELOG.md index 3341328..160b5e6 100644 --- a/vendor/symfony/translation/CHANGELOG.md +++ b/vendor/symfony/translation/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +5.4 +--- + + * Add `github` format & autodetection to render errors as annotations when + running the XLIFF linter command in a Github Actions environment. + * Translation providers are not experimental anymore + 5.3 --- diff --git a/vendor/symfony/translation/Catalogue/AbstractOperation.php b/vendor/symfony/translation/Catalogue/AbstractOperation.php index 9869fbb..43a52fa 100644 --- a/vendor/symfony/translation/Catalogue/AbstractOperation.php +++ b/vendor/symfony/translation/Catalogue/AbstractOperation.php @@ -80,10 +80,21 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getDomains() + public function getDomains(): array { if (null === $this->domains) { - $this->domains = array_values(array_unique(array_merge($this->source->getDomains(), $this->target->getDomains()))); + $domains = []; + foreach ([$this->source, $this->target] as $catalogue) { + foreach ($catalogue->getDomains() as $domain) { + $domains[$domain] = $domain; + + if ($catalogue->all($domainIcu = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX)) { + $domains[$domainIcu] = $domainIcu; + } + } + } + + $this->domains = array_values($domains); } return $this->domains; @@ -92,7 +103,7 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getMessages(string $domain) + public function getMessages(string $domain): array { if (!\in_array($domain, $this->getDomains())) { throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain)); @@ -108,7 +119,7 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getNewMessages(string $domain) + public function getNewMessages(string $domain): array { if (!\in_array($domain, $this->getDomains())) { throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain)); @@ -124,7 +135,7 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getObsoleteMessages(string $domain) + public function getObsoleteMessages(string $domain): array { if (!\in_array($domain, $this->getDomains())) { throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain)); @@ -140,7 +151,7 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getResult() + public function getResult(): MessageCatalogueInterface { foreach ($this->getDomains() as $domain) { if (!isset($this->messages[$domain])) { diff --git a/vendor/symfony/translation/Catalogue/OperationInterface.php b/vendor/symfony/translation/Catalogue/OperationInterface.php index 9ffac88..1fe9534 100644 --- a/vendor/symfony/translation/Catalogue/OperationInterface.php +++ b/vendor/symfony/translation/Catalogue/OperationInterface.php @@ -36,36 +36,26 @@ interface OperationInterface { /** * Returns domains affected by operation. - * - * @return array */ - public function getDomains(); + public function getDomains(): array; /** * Returns all valid messages ('all') after operation. - * - * @return array */ - public function getMessages(string $domain); + public function getMessages(string $domain): array; /** * Returns new messages ('new') after operation. - * - * @return array */ - public function getNewMessages(string $domain); + public function getNewMessages(string $domain): array; /** * Returns obsolete messages ('obsolete') after operation. - * - * @return array */ - public function getObsoleteMessages(string $domain); + public function getObsoleteMessages(string $domain): array; /** * Returns resulting catalogue ('result'). - * - * @return MessageCatalogueInterface */ - public function getResult(); + public function getResult(): MessageCatalogueInterface; } diff --git a/vendor/symfony/translation/Catalogue/TargetOperation.php b/vendor/symfony/translation/Catalogue/TargetOperation.php index 399d917..682b575 100644 --- a/vendor/symfony/translation/Catalogue/TargetOperation.php +++ b/vendor/symfony/translation/Catalogue/TargetOperation.php @@ -49,7 +49,7 @@ class TargetOperation extends AbstractOperation foreach ($this->source->all($domain) as $id => $message) { if ($this->target->has($id, $domain)) { $this->messages[$domain]['all'][$id] = $message; - $d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain; + $d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain; $this->result->add([$id => $message], $d); if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) { $this->result->setMetadata($id, $keyMetadata, $d); diff --git a/vendor/symfony/translation/Command/TranslationPullCommand.php b/vendor/symfony/translation/Command/TranslationPullCommand.php index 0ec02ca..42513a8 100644 --- a/vendor/symfony/translation/Command/TranslationPullCommand.php +++ b/vendor/symfony/translation/Command/TranslationPullCommand.php @@ -11,7 +11,10 @@ namespace Symfony\Component\Translation\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -25,22 +28,18 @@ use Symfony\Component\Translation\Writer\TranslationWriterInterface; /** * @author Mathieu Santostefano - * - * @experimental in 5.3 */ +#[AsCommand(name: 'translation:pull', description: 'Pull translations from a given provider.')] final class TranslationPullCommand extends Command { use TranslationTrait; - protected static $defaultName = 'translation:pull'; - protected static $defaultDescription = 'Pull translations from a given provider.'; - private $providerCollection; private $writer; private $reader; - private $defaultLocale; - private $transPaths; - private $enabledLocales; + private string $defaultLocale; + private array $transPaths; + private array $enabledLocales; public function __construct(TranslationProviderCollection $providerCollection, TranslationWriterInterface $writer, TranslationReaderInterface $reader, string $defaultLocale, array $transPaths = [], array $enabledLocales = []) { @@ -54,6 +53,36 @@ final class TranslationPullCommand extends Command parent::__construct(); } + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('provider')) { + $suggestions->suggestValues($this->providerCollection->keys()); + + return; + } + + if ($input->mustSuggestOptionValuesFor('domains')) { + $provider = $this->providerCollection->get($input->getArgument('provider')); + + if ($provider && method_exists($provider, 'getDomains')) { + $domains = $provider->getDomains(); + $suggestions->suggestValues($domains); + } + + return; + } + + if ($input->mustSuggestOptionValuesFor('locales')) { + $suggestions->suggestValues($this->enabledLocales); + + return; + } + + if ($input->mustSuggestOptionValuesFor('format')) { + $suggestions->suggestValues(['php', 'xlf', 'xlf12', 'xlf20', 'po', 'mo', 'yml', 'yaml', 'ts', 'csv', 'json', 'ini', 'res']); + } + } + /** * {@inheritdoc} */ @@ -81,7 +110,7 @@ You can overwrite existing translations (and remove the missing ones on local si Full example: - php %command.full_name% provider --force --domains=messages,validators --locales=en + php %command.full_name% provider --force --domains=messages --domains=validators --locales=en This command pulls all translations associated with the messages and validators domains for the en locale. Local translations for the specified domains and locale are deleted if they're not present on the provider and overwritten if it's the case. @@ -119,6 +148,7 @@ EOF $writeOptions = [ 'path' => end($this->transPaths), 'xliff_version' => $xliffVersion, + 'default_locale' => $this->defaultLocale, ]; if (!$domains) { diff --git a/vendor/symfony/translation/Command/TranslationPushCommand.php b/vendor/symfony/translation/Command/TranslationPushCommand.php index b28d3e1..dba2164 100644 --- a/vendor/symfony/translation/Command/TranslationPushCommand.php +++ b/vendor/symfony/translation/Command/TranslationPushCommand.php @@ -11,7 +11,10 @@ namespace Symfony\Component\Translation\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -24,20 +27,16 @@ use Symfony\Component\Translation\TranslatorBag; /** * @author Mathieu Santostefano - * - * @experimental in 5.3 */ +#[AsCommand(name: 'translation:push', description: 'Push translations to a given provider.')] final class TranslationPushCommand extends Command { use TranslationTrait; - protected static $defaultName = 'translation:push'; - protected static $defaultDescription = 'Push translations to a given provider.'; - private $providers; private $reader; - private $transPaths; - private $enabledLocales; + private array $transPaths; + private array $enabledLocales; public function __construct(TranslationProviderCollection $providers, TranslationReaderInterface $reader, array $transPaths = [], array $enabledLocales = []) { @@ -49,6 +48,30 @@ final class TranslationPushCommand extends Command parent::__construct(); } + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('provider')) { + $suggestions->suggestValues($this->providers->keys()); + + return; + } + + if ($input->mustSuggestOptionValuesFor('domains')) { + $provider = $this->providers->get($input->getArgument('provider')); + + if ($provider && method_exists($provider, 'getDomains')) { + $domains = $provider->getDomains(); + $suggestions->suggestValues($domains); + } + + return; + } + + if ($input->mustSuggestOptionValuesFor('locales')) { + $suggestions->suggestValues($this->enabledLocales); + } + } + /** * {@inheritdoc} */ @@ -79,7 +102,7 @@ You can delete provider translations which are not present locally by using the Full example: - php %command.full_name% provider --force --delete-missing --domains=messages,validators --locales=en + php %command.full_name% provider --force --delete-missing --domains=messages --domains=validators --locales=en This command pushes all translations associated with the messages and validators domains for the en locale. Provider translations for the specified domains and locale are deleted if they're not present locally and overwritten if it's the case. diff --git a/vendor/symfony/translation/Command/TranslationTrait.php b/vendor/symfony/translation/Command/TranslationTrait.php index 6a2b1ba..eafaffd 100644 --- a/vendor/symfony/translation/Command/TranslationTrait.php +++ b/vendor/symfony/translation/Command/TranslationTrait.php @@ -32,8 +32,7 @@ trait TranslationTrait if ($domains) { foreach ($domains as $domain) { - $catalogue = $this->filterCatalogue($catalogue, $domain); - $bag->addCatalogue($catalogue); + $bag->addCatalogue($this->filterCatalogue($catalogue, $domain)); } } else { $bag->addCatalogue($catalogue); diff --git a/vendor/symfony/translation/Command/XliffLintCommand.php b/vendor/symfony/translation/Command/XliffLintCommand.php index 4117d87..f062fb7 100644 --- a/vendor/symfony/translation/Command/XliffLintCommand.php +++ b/vendor/symfony/translation/Command/XliffLintCommand.php @@ -11,7 +11,11 @@ namespace Symfony\Component\Translation\Command; +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\CI\GithubActionReporter; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -28,23 +32,21 @@ use Symfony\Component\Translation\Util\XliffUtils; * @author Robin Chalas * @author Javier Eguiluz */ +#[AsCommand(name: 'lint:xliff', description: 'Lint an XLIFF file and outputs encountered errors')] class XliffLintCommand extends Command { - protected static $defaultName = 'lint:xliff'; - protected static $defaultDescription = 'Lint an XLIFF file and outputs encountered errors'; - - private $format; - private $displayCorrectFiles; - private $directoryIteratorProvider; - private $isReadableProvider; - private $requireStrictFileNames; + private string $format; + private bool $displayCorrectFiles; + private ?\Closure $directoryIteratorProvider; + private ?\Closure $isReadableProvider; + private bool $requireStrictFileNames; public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null, bool $requireStrictFileNames = true) { parent::__construct($name); - $this->directoryIteratorProvider = $directoryIteratorProvider; - $this->isReadableProvider = $isReadableProvider; + $this->directoryIteratorProvider = null === $directoryIteratorProvider || $directoryIteratorProvider instanceof \Closure ? $directoryIteratorProvider : \Closure::fromCallable($directoryIteratorProvider); + $this->isReadableProvider = null === $isReadableProvider || $isReadableProvider instanceof \Closure ? $isReadableProvider : \Closure::fromCallable($isReadableProvider); $this->requireStrictFileNames = $requireStrictFileNames; } @@ -54,9 +56,8 @@ class XliffLintCommand extends Command protected function configure() { $this - ->setDescription(self::$defaultDescription) ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt') + ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format') ->setHelp(<<%command.name% command lints an XLIFF file and outputs to STDOUT the first encountered syntax error. @@ -79,11 +80,11 @@ EOF ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $filenames = (array) $input->getArgument('filename'); - $this->format = $input->getOption('format'); + $this->format = $input->getOption('format') ?? (GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt'); $this->displayCorrectFiles = $output->isVerbose(); if (['-'] === $filenames) { @@ -160,15 +161,18 @@ EOF return $this->displayTxt($io, $files); case 'json': return $this->displayJson($io, $files); + case 'github': + return $this->displayTxt($io, $files, true); default: throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)); } } - private function displayTxt(SymfonyStyle $io, array $filesInfo) + private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false) { $countFiles = \count($filesInfo); $erroredFiles = 0; + $githubReporter = $errorAsGithubAnnotations ? new GithubActionReporter($io) : null; foreach ($filesInfo as $info) { if ($info['valid'] && $this->displayCorrectFiles) { @@ -176,9 +180,15 @@ EOF } elseif (!$info['valid']) { ++$erroredFiles; $io->text(' ERROR '.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - $io->listing(array_map(function ($error) { + $io->listing(array_map(function ($error) use ($info, $githubReporter) { // general document errors have a '-1' line number - return -1 === $error['line'] ? $error['message'] : sprintf('Line %d, Column %d: %s', $error['line'], $error['column'], $error['message']); + $line = -1 === $error['line'] ? null : $error['line']; + + if ($githubReporter) { + $githubReporter->error($error['message'], $info['file'], $line, null !== $line ? $error['column'] : null); + } + + return null === $line ? $error['message'] : sprintf('Line %d, Column %d: %s', $line, $error['column'], $error['message']); }, $info['messages'])); } } @@ -264,4 +274,11 @@ EOF return null; } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestOptionValuesFor('format')) { + $suggestions->suggestValues(['txt', 'json', 'github']); + } + } } diff --git a/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/vendor/symfony/translation/DataCollector/TranslationDataCollector.php index f8480ad..0f7901d 100644 --- a/vendor/symfony/translation/DataCollector/TranslationDataCollector.php +++ b/vendor/symfony/translation/DataCollector/TranslationDataCollector.php @@ -62,34 +62,22 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto $this->data = []; } - /** - * @return array|Data - */ - public function getMessages() + public function getMessages(): array|Data { return $this->data['messages'] ?? []; } - /** - * @return int - */ - public function getCountMissings() + public function getCountMissings(): int { return $this->data[DataCollectorTranslator::MESSAGE_MISSING] ?? 0; } - /** - * @return int - */ - public function getCountFallbacks() + public function getCountFallbacks(): int { return $this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK] ?? 0; } - /** - * @return int - */ - public function getCountDefines() + public function getCountDefines(): int { return $this->data[DataCollectorTranslator::MESSAGE_DEFINED] ?? 0; } @@ -110,7 +98,7 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'translation'; } diff --git a/vendor/symfony/translation/DataCollectorTranslator.php b/vendor/symfony/translation/DataCollectorTranslator.php index c7d3597..2a08b09 100644 --- a/vendor/symfony/translation/DataCollectorTranslator.php +++ b/vendor/symfony/translation/DataCollectorTranslator.php @@ -25,15 +25,11 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter public const MESSAGE_MISSING = 1; public const MESSAGE_EQUALS_FALLBACK = 2; - /** - * @var TranslatorInterface|TranslatorBagInterface - */ private $translator; - - private $messages = []; + private array $messages = []; /** - * @param TranslatorInterface $translator The translator must implement TranslatorBagInterface + * @param TranslatorInterface&TranslatorBagInterface&LocaleAwareInterface $translator */ public function __construct(TranslatorInterface $translator) { @@ -47,7 +43,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter /** * {@inheritdoc} */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null) + public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string { $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); $this->collectMessage($locale, $domain, $id, $trans, $parameters); @@ -66,7 +62,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter /** * {@inheritdoc} */ - public function getLocale() + public function getLocale(): string { return $this->translator->getLocale(); } @@ -74,7 +70,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter /** * {@inheritdoc} */ - public function getCatalogue(string $locale = null) + public function getCatalogue(string $locale = null): MessageCatalogueInterface { return $this->translator->getCatalogue($locale); } @@ -92,7 +88,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter * * @return string[] */ - public function warmUp(string $cacheDir) + public function warmUp(string $cacheDir): array { if ($this->translator instanceof WarmableInterface) { return (array) $this->translator->warmUp($cacheDir); @@ -103,10 +99,8 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter /** * Gets the fallback locales. - * - * @return array The fallback locales */ - public function getFallbackLocales() + public function getFallbackLocales(): array { if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { return $this->translator->getFallbackLocales(); @@ -123,10 +117,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter return $this->translator->{$method}(...$args); } - /** - * @return array - */ - public function getCollectedMessages() + public function getCollectedMessages(): array { return $this->messages; } diff --git a/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php b/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php index 6d78342..4020a07 100644 --- a/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php +++ b/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php @@ -20,28 +20,15 @@ use Symfony\Component\DependencyInjection\Reference; */ class TranslationDumperPass implements CompilerPassInterface { - private $writerServiceId; - private $dumperTag; - - public function __construct(string $writerServiceId = 'translation.writer', string $dumperTag = 'translation.dumper') - { - if (1 < \func_num_args()) { - trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->writerServiceId = $writerServiceId; - $this->dumperTag = $dumperTag; - } - public function process(ContainerBuilder $container) { - if (!$container->hasDefinition($this->writerServiceId)) { + if (!$container->hasDefinition('translation.writer')) { return; } - $definition = $container->getDefinition($this->writerServiceId); + $definition = $container->getDefinition('translation.writer'); - foreach ($container->findTaggedServiceIds($this->dumperTag, true) as $id => $attributes) { + foreach ($container->findTaggedServiceIds('translation.dumper', true) as $id => $attributes) { $definition->addMethodCall('addDumper', [$attributes[0]['alias'], new Reference($id)]); } } diff --git a/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php b/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php index fab6b20..ee7c47a 100644 --- a/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php +++ b/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php @@ -21,28 +21,15 @@ use Symfony\Component\DependencyInjection\Reference; */ class TranslationExtractorPass implements CompilerPassInterface { - private $extractorServiceId; - private $extractorTag; - - public function __construct(string $extractorServiceId = 'translation.extractor', string $extractorTag = 'translation.extractor') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->extractorServiceId = $extractorServiceId; - $this->extractorTag = $extractorTag; - } - public function process(ContainerBuilder $container) { - if (!$container->hasDefinition($this->extractorServiceId)) { + if (!$container->hasDefinition('translation.extractor')) { return; } - $definition = $container->getDefinition($this->extractorServiceId); + $definition = $container->getDefinition('translation.extractor'); - foreach ($container->findTaggedServiceIds($this->extractorTag, true) as $id => $attributes) { + foreach ($container->findTaggedServiceIds('translation.extractor', true) as $id => $attributes) { if (!isset($attributes[0]['alias'])) { throw new RuntimeException(sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id)); } diff --git a/vendor/symfony/translation/DependencyInjection/TranslatorPass.php b/vendor/symfony/translation/DependencyInjection/TranslatorPass.php index c6a1306..be79cda 100644 --- a/vendor/symfony/translation/DependencyInjection/TranslatorPass.php +++ b/vendor/symfony/translation/DependencyInjection/TranslatorPass.php @@ -18,34 +18,15 @@ use Symfony\Component\DependencyInjection\Reference; class TranslatorPass implements CompilerPassInterface { - private $translatorServiceId; - private $readerServiceId; - private $loaderTag; - private $debugCommandServiceId; - private $updateCommandServiceId; - - public function __construct(string $translatorServiceId = 'translator.default', string $readerServiceId = 'translation.reader', string $loaderTag = 'translation.loader', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_update') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->translatorServiceId = $translatorServiceId; - $this->readerServiceId = $readerServiceId; - $this->loaderTag = $loaderTag; - $this->debugCommandServiceId = $debugCommandServiceId; - $this->updateCommandServiceId = $updateCommandServiceId; - } - public function process(ContainerBuilder $container) { - if (!$container->hasDefinition($this->translatorServiceId)) { + if (!$container->hasDefinition('translator.default')) { return; } $loaders = []; $loaderRefs = []; - foreach ($container->findTaggedServiceIds($this->loaderTag, true) as $id => $attributes) { + foreach ($container->findTaggedServiceIds('translation.loader', true) as $id => $attributes) { $loaderRefs[$id] = new Reference($id); $loaders[$id][] = $attributes[0]['alias']; if (isset($attributes[0]['legacy-alias'])) { @@ -53,8 +34,8 @@ class TranslatorPass implements CompilerPassInterface } } - if ($container->hasDefinition($this->readerServiceId)) { - $definition = $container->getDefinition($this->readerServiceId); + if ($container->hasDefinition('translation.reader')) { + $definition = $container->getDefinition('translation.reader'); foreach ($loaders as $id => $formats) { foreach ($formats as $format) { $definition->addMethodCall('addLoader', [$format, $loaderRefs[$id]]); @@ -63,7 +44,7 @@ class TranslatorPass implements CompilerPassInterface } $container - ->findDefinition($this->translatorServiceId) + ->findDefinition('translator.default') ->replaceArgument(0, ServiceLocatorTagPass::register($container, $loaderRefs)) ->replaceArgument(3, $loaders) ; @@ -73,16 +54,16 @@ class TranslatorPass implements CompilerPassInterface } $paths = array_keys($container->getDefinition('twig.template_iterator')->getArgument(1)); - if ($container->hasDefinition($this->debugCommandServiceId)) { - $definition = $container->getDefinition($this->debugCommandServiceId); + if ($container->hasDefinition('console.command.translation_debug')) { + $definition = $container->getDefinition('console.command.translation_debug'); $definition->replaceArgument(4, $container->getParameter('twig.default_path')); if (\count($definition->getArguments()) > 6) { $definition->replaceArgument(6, $paths); } } - if ($container->hasDefinition($this->updateCommandServiceId)) { - $definition = $container->getDefinition($this->updateCommandServiceId); + if ($container->hasDefinition('console.command.translation_extract')) { + $definition = $container->getDefinition('console.command.translation_extract'); $definition->replaceArgument(5, $container->getParameter('twig.default_path')); if (\count($definition->getArguments()) > 7) { diff --git a/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php b/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php index 85b0fa4..b85c066 100644 --- a/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php +++ b/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php @@ -22,30 +22,26 @@ use Symfony\Component\DependencyInjection\ServiceLocator; */ class TranslatorPathsPass extends AbstractRecursivePass { - private $translatorServiceId; - private $debugCommandServiceId; - private $updateCommandServiceId; - private $resolverServiceId; - private $level = 0; - private $paths = []; - private $definitions = []; - private $controllers = []; + private int $level = 0; - public function __construct(string $translatorServiceId = 'translator', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_update', string $resolverServiceId = 'argument_resolver.service') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } + /** + * @var array + */ + private array $paths = []; - $this->translatorServiceId = $translatorServiceId; - $this->debugCommandServiceId = $debugCommandServiceId; - $this->updateCommandServiceId = $updateCommandServiceId; - $this->resolverServiceId = $resolverServiceId; - } + /** + * @var array + */ + private array $definitions = []; + + /** + * @var array> + */ + private array $controllers = []; public function process(ContainerBuilder $container) { - if (!$container->hasDefinition($this->translatorServiceId)) { + if (!$container->hasDefinition('translator')) { return; } @@ -70,12 +66,12 @@ class TranslatorPathsPass extends AbstractRecursivePass } } if ($paths) { - if ($container->hasDefinition($this->debugCommandServiceId)) { - $definition = $container->getDefinition($this->debugCommandServiceId); + if ($container->hasDefinition('console.command.translation_debug')) { + $definition = $container->getDefinition('console.command.translation_debug'); $definition->replaceArgument(6, array_merge($definition->getArgument(6), $paths)); } - if ($container->hasDefinition($this->updateCommandServiceId)) { - $definition = $container->getDefinition($this->updateCommandServiceId); + if ($container->hasDefinition('console.command.translation_extract')) { + $definition = $container->getDefinition('console.command.translation_extract'); $definition->replaceArgument(7, array_merge($definition->getArgument(7), $paths)); } } @@ -86,10 +82,10 @@ class TranslatorPathsPass extends AbstractRecursivePass } } - protected function processValue($value, bool $isRoot = false) + protected function processValue(mixed $value, bool $isRoot = false): mixed { if ($value instanceof Reference) { - if ((string) $value === $this->translatorServiceId) { + if ('translator' === (string) $value) { for ($i = $this->level - 1; $i >= 0; --$i) { $class = $this->definitions[$i]->getClass(); @@ -124,8 +120,8 @@ class TranslatorPathsPass extends AbstractRecursivePass private function findControllerArguments(ContainerBuilder $container): array { - if ($container->hasDefinition($this->resolverServiceId)) { - $argument = $container->getDefinition($this->resolverServiceId)->getArgument(0); + if ($container->hasDefinition('argument_resolver.service')) { + $argument = $container->getDefinition('argument_resolver.service')->getArgument(0); if ($argument instanceof Reference) { $argument = $container->getDefinition($argument); } @@ -133,8 +129,8 @@ class TranslatorPathsPass extends AbstractRecursivePass return $argument->getArgument(0); } - if ($container->hasDefinition('debug.'.$this->resolverServiceId)) { - $argument = $container->getDefinition('debug.'.$this->resolverServiceId)->getArgument(0); + if ($container->hasDefinition('debug.'.'argument_resolver.service')) { + $argument = $container->getDefinition('debug.'.'argument_resolver.service')->getArgument(0); if ($argument instanceof Reference) { $argument = $container->getDefinition($argument); } diff --git a/vendor/symfony/translation/Dumper/CsvFileDumper.php b/vendor/symfony/translation/Dumper/CsvFileDumper.php index 0c8589a..0bd3f5e 100644 --- a/vendor/symfony/translation/Dumper/CsvFileDumper.php +++ b/vendor/symfony/translation/Dumper/CsvFileDumper.php @@ -20,13 +20,13 @@ use Symfony\Component\Translation\MessageCatalogue; */ class CsvFileDumper extends FileDumper { - private $delimiter = ';'; - private $enclosure = '"'; + private string $delimiter = ';'; + private string $enclosure = '"'; /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $handle = fopen('php://memory', 'r+'); @@ -53,7 +53,7 @@ class CsvFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'csv'; } diff --git a/vendor/symfony/translation/Dumper/FileDumper.php b/vendor/symfony/translation/Dumper/FileDumper.php index e257e72..6bad4ff 100644 --- a/vendor/symfony/translation/Dumper/FileDumper.php +++ b/vendor/symfony/translation/Dumper/FileDumper.php @@ -86,17 +86,13 @@ abstract class FileDumper implements DumperInterface /** * Transforms a domain of a message catalogue to its string representation. - * - * @return string representation */ - abstract public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []); + abstract public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string; /** * Gets the file extension of the dumper. - * - * @return string file extension */ - abstract protected function getExtension(); + abstract protected function getExtension(): string; /** * Gets the relative file path using the template. diff --git a/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/vendor/symfony/translation/Dumper/IcuResFileDumper.php index cdc5991..b62ea15 100644 --- a/vendor/symfony/translation/Dumper/IcuResFileDumper.php +++ b/vendor/symfony/translation/Dumper/IcuResFileDumper.php @@ -28,7 +28,7 @@ class IcuResFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $data = $indexes = $resources = ''; @@ -97,7 +97,7 @@ class IcuResFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'res'; } diff --git a/vendor/symfony/translation/Dumper/IniFileDumper.php b/vendor/symfony/translation/Dumper/IniFileDumper.php index 93c900a..75032be 100644 --- a/vendor/symfony/translation/Dumper/IniFileDumper.php +++ b/vendor/symfony/translation/Dumper/IniFileDumper.php @@ -23,7 +23,7 @@ class IniFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $output = ''; @@ -38,7 +38,7 @@ class IniFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'ini'; } diff --git a/vendor/symfony/translation/Dumper/JsonFileDumper.php b/vendor/symfony/translation/Dumper/JsonFileDumper.php index 34c0b56..1102730 100644 --- a/vendor/symfony/translation/Dumper/JsonFileDumper.php +++ b/vendor/symfony/translation/Dumper/JsonFileDumper.php @@ -23,7 +23,7 @@ class JsonFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $flags = $options['json_encoding'] ?? \JSON_PRETTY_PRINT; @@ -33,7 +33,7 @@ class JsonFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'json'; } diff --git a/vendor/symfony/translation/Dumper/MoFileDumper.php b/vendor/symfony/translation/Dumper/MoFileDumper.php index 54d0da8..08c8f89 100644 --- a/vendor/symfony/translation/Dumper/MoFileDumper.php +++ b/vendor/symfony/translation/Dumper/MoFileDumper.php @@ -24,7 +24,7 @@ class MoFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $sources = $targets = $sourceOffsets = $targetOffsets = ''; $offsets = []; @@ -70,12 +70,12 @@ class MoFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'mo'; } - private function writeLong($str): string + private function writeLong(mixed $str): string { return pack('V*', $str); } diff --git a/vendor/symfony/translation/Dumper/PhpFileDumper.php b/vendor/symfony/translation/Dumper/PhpFileDumper.php index 6163b52..565d893 100644 --- a/vendor/symfony/translation/Dumper/PhpFileDumper.php +++ b/vendor/symfony/translation/Dumper/PhpFileDumper.php @@ -23,7 +23,7 @@ class PhpFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { return "all($domain), true).";\n"; } @@ -31,7 +31,7 @@ class PhpFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'php'; } diff --git a/vendor/symfony/translation/Dumper/PoFileDumper.php b/vendor/symfony/translation/Dumper/PoFileDumper.php index 0d82281..313e504 100644 --- a/vendor/symfony/translation/Dumper/PoFileDumper.php +++ b/vendor/symfony/translation/Dumper/PoFileDumper.php @@ -23,7 +23,7 @@ class PoFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $output = 'msgid ""'."\n"; $output .= 'msgstr ""'."\n"; @@ -114,7 +114,7 @@ EOF; /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'po'; } @@ -124,7 +124,7 @@ EOF; return addcslashes($str, "\0..\37\42\134"); } - private function formatComments($comments, string $prefix = ''): ?string + private function formatComments(string|array $comments, string $prefix = ''): ?string { $output = null; diff --git a/vendor/symfony/translation/Dumper/QtFileDumper.php b/vendor/symfony/translation/Dumper/QtFileDumper.php index 406e9f0..819409f 100644 --- a/vendor/symfony/translation/Dumper/QtFileDumper.php +++ b/vendor/symfony/translation/Dumper/QtFileDumper.php @@ -23,7 +23,7 @@ class QtFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $dom = new \DOMDocument('1.0', 'utf-8'); $dom->formatOutput = true; @@ -54,7 +54,7 @@ class QtFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'ts'; } diff --git a/vendor/symfony/translation/Dumper/XliffFileDumper.php b/vendor/symfony/translation/Dumper/XliffFileDumper.php index f7dbdcd..b8a109a 100644 --- a/vendor/symfony/translation/Dumper/XliffFileDumper.php +++ b/vendor/symfony/translation/Dumper/XliffFileDumper.php @@ -24,7 +24,7 @@ class XliffFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $xliffVersion = '1.2'; if (\array_key_exists('xliff_version', $options)) { @@ -50,7 +50,7 @@ class XliffFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'xlf'; } diff --git a/vendor/symfony/translation/Dumper/YamlFileDumper.php b/vendor/symfony/translation/Dumper/YamlFileDumper.php index 0b21e8c..d0cfbef 100644 --- a/vendor/symfony/translation/Dumper/YamlFileDumper.php +++ b/vendor/symfony/translation/Dumper/YamlFileDumper.php @@ -23,7 +23,7 @@ use Symfony\Component\Yaml\Yaml; */ class YamlFileDumper extends FileDumper { - private $extension; + private string $extension; public function __construct(string $extension = 'yml') { @@ -33,7 +33,7 @@ class YamlFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { if (!class_exists(Yaml::class)) { throw new LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.'); @@ -55,7 +55,7 @@ class YamlFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return $this->extension; } diff --git a/vendor/symfony/translation/Exception/ProviderException.php b/vendor/symfony/translation/Exception/ProviderException.php index 659c6d7..331ff75 100644 --- a/vendor/symfony/translation/Exception/ProviderException.php +++ b/vendor/symfony/translation/Exception/ProviderException.php @@ -15,18 +15,16 @@ use Symfony\Contracts\HttpClient\ResponseInterface; /** * @author Fabien Potencier - * - * @experimental in 5.3 */ class ProviderException extends RuntimeException implements ProviderExceptionInterface { private $response; - private $debug; + private string $debug; public function __construct(string $message, ResponseInterface $response, int $code = 0, \Exception $previous = null) { $this->response = $response; - $this->debug .= $response->getInfo('debug') ?? ''; + $this->debug = $response->getInfo('debug') ?? ''; parent::__construct($message, $code, $previous); } diff --git a/vendor/symfony/translation/Exception/ProviderExceptionInterface.php b/vendor/symfony/translation/Exception/ProviderExceptionInterface.php index 8cf1c51..922e827 100644 --- a/vendor/symfony/translation/Exception/ProviderExceptionInterface.php +++ b/vendor/symfony/translation/Exception/ProviderExceptionInterface.php @@ -13,8 +13,6 @@ namespace Symfony\Component\Translation\Exception; /** * @author Fabien Potencier - * - * @experimental in 5.3 */ interface ProviderExceptionInterface extends ExceptionInterface { diff --git a/vendor/symfony/translation/Extractor/AbstractFileExtractor.php b/vendor/symfony/translation/Extractor/AbstractFileExtractor.php index 729dd17..4c088b9 100644 --- a/vendor/symfony/translation/Extractor/AbstractFileExtractor.php +++ b/vendor/symfony/translation/Extractor/AbstractFileExtractor.php @@ -20,12 +20,7 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException; */ abstract class AbstractFileExtractor { - /** - * @param string|iterable $resource Files, a file or a directory - * - * @return iterable - */ - protected function extractFiles($resource) + protected function extractFiles(string|iterable $resource): iterable { if (is_iterable($resource)) { $files = []; @@ -49,11 +44,9 @@ abstract class AbstractFileExtractor } /** - * @return bool - * * @throws InvalidArgumentException */ - protected function isFile(string $file) + protected function isFile(string $file): bool { if (!is_file($file)) { throw new InvalidArgumentException(sprintf('The "%s" file does not exist.', $file)); @@ -68,9 +61,7 @@ abstract class AbstractFileExtractor abstract protected function canBeExtracted(string $file); /** - * @param string|array $resource Files, a file or a directory - * - * @return iterable files to be extracted + * @return iterable */ - abstract protected function extractFromDirectory($resource); + abstract protected function extractFromDirectory(string|array $resource); } diff --git a/vendor/symfony/translation/Extractor/ChainExtractor.php b/vendor/symfony/translation/Extractor/ChainExtractor.php index 95dcf15..e58e82f 100644 --- a/vendor/symfony/translation/Extractor/ChainExtractor.php +++ b/vendor/symfony/translation/Extractor/ChainExtractor.php @@ -25,7 +25,7 @@ class ChainExtractor implements ExtractorInterface * * @var ExtractorInterface[] */ - private $extractors = []; + private array $extractors = []; /** * Adds a loader to the translation extractor. @@ -48,7 +48,7 @@ class ChainExtractor implements ExtractorInterface /** * {@inheritdoc} */ - public function extract($directory, MessageCatalogue $catalogue) + public function extract(string|iterable $directory, MessageCatalogue $catalogue) { foreach ($this->extractors as $extractor) { $extractor->extract($directory, $catalogue); diff --git a/vendor/symfony/translation/Extractor/ExtractorInterface.php b/vendor/symfony/translation/Extractor/ExtractorInterface.php index e1db8a9..b76a7f2 100644 --- a/vendor/symfony/translation/Extractor/ExtractorInterface.php +++ b/vendor/symfony/translation/Extractor/ExtractorInterface.php @@ -26,7 +26,7 @@ interface ExtractorInterface * * @param string|iterable $resource Files, a file or a directory */ - public function extract($resource, MessageCatalogue $catalogue); + public function extract(string|iterable $resource, MessageCatalogue $catalogue); /** * Sets the prefix that should be used for new found messages. diff --git a/vendor/symfony/translation/Extractor/PhpExtractor.php b/vendor/symfony/translation/Extractor/PhpExtractor.php index c5efb5f..1b86cc5 100644 --- a/vendor/symfony/translation/Extractor/PhpExtractor.php +++ b/vendor/symfony/translation/Extractor/PhpExtractor.php @@ -27,15 +27,11 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface /** * Prefix for new found message. - * - * @var string */ - private $prefix = ''; + private string $prefix = ''; /** * The sequence that captures translation messages. - * - * @var array */ protected $sequences = [ [ @@ -135,7 +131,7 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface /** * {@inheritdoc} */ - public function extract($resource, MessageCatalogue $catalog) + public function extract(string|iterable $resource, MessageCatalogue $catalog) { $files = $this->extractFiles($resource); foreach ($files as $file) { @@ -155,12 +151,8 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface /** * Normalizes a token. - * - * @param mixed $token - * - * @return string|null */ - protected function normalizeToken($token) + protected function normalizeToken(mixed $token): ?string { if (isset($token[1]) && 'b"' !== $token) { return $token[1]; @@ -315,11 +307,9 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface } /** - * @return bool - * * @throws \InvalidArgumentException */ - protected function canBeExtracted(string $file) + protected function canBeExtracted(string $file): bool { return $this->isFile($file) && 'php' === pathinfo($file, \PATHINFO_EXTENSION); } @@ -327,8 +317,12 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface /** * {@inheritdoc} */ - protected function extractFromDirectory($directory) + protected function extractFromDirectory(string|array $directory): iterable { + if (!class_exists(Finder::class)) { + throw new \LogicException(sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class)); + } + $finder = new Finder(); return $finder->files()->name('*.php')->in($directory); diff --git a/vendor/symfony/translation/Extractor/PhpStringTokenParser.php b/vendor/symfony/translation/Extractor/PhpStringTokenParser.php index 1d82caf..7fbd37c 100644 --- a/vendor/symfony/translation/Extractor/PhpStringTokenParser.php +++ b/vendor/symfony/translation/Extractor/PhpStringTokenParser.php @@ -64,10 +64,8 @@ class PhpStringTokenParser * Parses a string token. * * @param string $str String token content - * - * @return string The parsed string */ - public static function parse(string $str) + public static function parse(string $str): string { $bLength = 0; if ('b' === $str[0]) { @@ -90,10 +88,8 @@ class PhpStringTokenParser * * @param string $str String without quotes * @param string|null $quote Quote type - * - * @return string String with escape sequences parsed */ - public static function parseEscapeSequences(string $str, string $quote = null) + public static function parseEscapeSequences(string $str, string $quote = null): string { if (null !== $quote) { $str = str_replace('\\'.$quote, $quote, $str); @@ -124,10 +120,8 @@ class PhpStringTokenParser * * @param string $startToken Doc string start token content (<<translator instanceof TranslatorInterface) { return $this->translator->trans($message, $parameters, null, $locale); diff --git a/vendor/symfony/translation/Formatter/MessageFormatterInterface.php b/vendor/symfony/translation/Formatter/MessageFormatterInterface.php index b85dbfd..d5c41c1 100644 --- a/vendor/symfony/translation/Formatter/MessageFormatterInterface.php +++ b/vendor/symfony/translation/Formatter/MessageFormatterInterface.php @@ -23,8 +23,6 @@ interface MessageFormatterInterface * @param string $message The message (may also be an object that can be cast to string) * @param string $locale The message locale * @param array $parameters An array of parameters for the message - * - * @return string */ - public function format(string $message, string $locale, array $parameters = []); + public function format(string $message, string $locale, array $parameters = []): string; } diff --git a/vendor/symfony/translation/LICENSE b/vendor/symfony/translation/LICENSE index 9ff2d0d..88bf75b 100644 --- a/vendor/symfony/translation/LICENSE +++ b/vendor/symfony/translation/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2021 Fabien Potencier +Copyright (c) 2004-2022 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 diff --git a/vendor/symfony/translation/Loader/ArrayLoader.php b/vendor/symfony/translation/Loader/ArrayLoader.php index 0758da8..35de9ef 100644 --- a/vendor/symfony/translation/Loader/ArrayLoader.php +++ b/vendor/symfony/translation/Loader/ArrayLoader.php @@ -23,7 +23,7 @@ class ArrayLoader implements LoaderInterface /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { $resource = $this->flatten($resource); $catalogue = new MessageCatalogue($locale); diff --git a/vendor/symfony/translation/Loader/CsvFileLoader.php b/vendor/symfony/translation/Loader/CsvFileLoader.php index 8d5d4db..76b00b1 100644 --- a/vendor/symfony/translation/Loader/CsvFileLoader.php +++ b/vendor/symfony/translation/Loader/CsvFileLoader.php @@ -20,14 +20,14 @@ use Symfony\Component\Translation\Exception\NotFoundResourceException; */ class CsvFileLoader extends FileLoader { - private $delimiter = ';'; - private $enclosure = '"'; - private $escape = '\\'; + private string $delimiter = ';'; + private string $enclosure = '"'; + private string $escape = '\\'; /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { $messages = []; diff --git a/vendor/symfony/translation/Loader/FileLoader.php b/vendor/symfony/translation/Loader/FileLoader.php index 4725ea6..e170d76 100644 --- a/vendor/symfony/translation/Loader/FileLoader.php +++ b/vendor/symfony/translation/Loader/FileLoader.php @@ -14,6 +14,7 @@ namespace Symfony\Component\Translation\Loader; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\Translation\Exception\InvalidResourceException; use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Translation\MessageCatalogue; /** * @author Abdellatif Ait boudad @@ -23,7 +24,7 @@ abstract class FileLoader extends ArrayLoader /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!stream_is_local($resource)) { throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); @@ -55,9 +56,7 @@ abstract class FileLoader extends ArrayLoader } /** - * @return array - * * @throws InvalidResourceException if stream content has an invalid format */ - abstract protected function loadResource(string $resource); + abstract protected function loadResource(string $resource): array; } diff --git a/vendor/symfony/translation/Loader/IcuDatFileLoader.php b/vendor/symfony/translation/Loader/IcuDatFileLoader.php index 2a1aecc..c3ca5fd 100644 --- a/vendor/symfony/translation/Loader/IcuDatFileLoader.php +++ b/vendor/symfony/translation/Loader/IcuDatFileLoader.php @@ -26,7 +26,7 @@ class IcuDatFileLoader extends IcuResFileLoader /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!stream_is_local($resource.'.dat')) { throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); diff --git a/vendor/symfony/translation/Loader/IcuResFileLoader.php b/vendor/symfony/translation/Loader/IcuResFileLoader.php index 64bbd3e..54c48f8 100644 --- a/vendor/symfony/translation/Loader/IcuResFileLoader.php +++ b/vendor/symfony/translation/Loader/IcuResFileLoader.php @@ -26,7 +26,7 @@ class IcuResFileLoader implements LoaderInterface /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!stream_is_local($resource)) { throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); @@ -72,10 +72,8 @@ class IcuResFileLoader implements LoaderInterface * @param \ResourceBundle $rb The ResourceBundle that will be flattened * @param array $messages Used internally for recursive calls * @param string $path Current path being parsed, used internally for recursive calls - * - * @return array the flattened ResourceBundle */ - protected function flatten(\ResourceBundle $rb, array &$messages = [], string $path = null) + protected function flatten(\ResourceBundle $rb, array &$messages = [], string $path = null): array { foreach ($rb as $key => $value) { $nodePath = $path ? $path.'.'.$key : $key; diff --git a/vendor/symfony/translation/Loader/IniFileLoader.php b/vendor/symfony/translation/Loader/IniFileLoader.php index 7398f77..04e294d 100644 --- a/vendor/symfony/translation/Loader/IniFileLoader.php +++ b/vendor/symfony/translation/Loader/IniFileLoader.php @@ -21,7 +21,7 @@ class IniFileLoader extends FileLoader /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { return parse_ini_file($resource, true); } diff --git a/vendor/symfony/translation/Loader/JsonFileLoader.php b/vendor/symfony/translation/Loader/JsonFileLoader.php index 5aefba0..67a8d58 100644 --- a/vendor/symfony/translation/Loader/JsonFileLoader.php +++ b/vendor/symfony/translation/Loader/JsonFileLoader.php @@ -23,7 +23,7 @@ class JsonFileLoader extends FileLoader /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { $messages = []; if ($data = file_get_contents($resource)) { diff --git a/vendor/symfony/translation/Loader/LoaderInterface.php b/vendor/symfony/translation/Loader/LoaderInterface.php index 2073f2b..29d5560 100644 --- a/vendor/symfony/translation/Loader/LoaderInterface.php +++ b/vendor/symfony/translation/Loader/LoaderInterface.php @@ -25,14 +25,8 @@ interface LoaderInterface /** * Loads a locale. * - * @param mixed $resource A resource - * @param string $locale A locale - * @param string $domain The domain - * - * @return MessageCatalogue A MessageCatalogue instance - * * @throws NotFoundResourceException when the resource cannot be found * @throws InvalidResourceException when the resource cannot be loaded */ - public function load($resource, string $locale, string $domain = 'messages'); + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue; } diff --git a/vendor/symfony/translation/Loader/MoFileLoader.php b/vendor/symfony/translation/Loader/MoFileLoader.php index 0ff6549..b0c8913 100644 --- a/vendor/symfony/translation/Loader/MoFileLoader.php +++ b/vendor/symfony/translation/Loader/MoFileLoader.php @@ -22,13 +22,13 @@ class MoFileLoader extends FileLoader * Magic used for validating the format of an MO file as well as * detecting if the machine used to create that file was little endian. */ - public const MO_LITTLE_ENDIAN_MAGIC = 0x950412de; + public const MO_LITTLE_ENDIAN_MAGIC = 0x950412DE; /** * Magic used for validating the format of an MO file as well as * detecting if the machine used to create that file was big endian. */ - public const MO_BIG_ENDIAN_MAGIC = 0xde120495; + public const MO_BIG_ENDIAN_MAGIC = 0xDE120495; /** * The size of the header of an MO file in bytes. @@ -41,7 +41,7 @@ class MoFileLoader extends FileLoader * * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { $stream = fopen($resource, 'r'); diff --git a/vendor/symfony/translation/Loader/PhpFileLoader.php b/vendor/symfony/translation/Loader/PhpFileLoader.php index 85f1090..6bc2a05 100644 --- a/vendor/symfony/translation/Loader/PhpFileLoader.php +++ b/vendor/symfony/translation/Loader/PhpFileLoader.php @@ -18,12 +18,12 @@ namespace Symfony\Component\Translation\Loader; */ class PhpFileLoader extends FileLoader { - private static $cache = []; + private static ?array $cache = []; /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) { self::$cache = null; diff --git a/vendor/symfony/translation/Loader/PoFileLoader.php b/vendor/symfony/translation/Loader/PoFileLoader.php index ee143e2..6df1614 100644 --- a/vendor/symfony/translation/Loader/PoFileLoader.php +++ b/vendor/symfony/translation/Loader/PoFileLoader.php @@ -60,7 +60,7 @@ class PoFileLoader extends FileLoader * * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { $stream = fopen($resource, 'r'); diff --git a/vendor/symfony/translation/Loader/QtFileLoader.php b/vendor/symfony/translation/Loader/QtFileLoader.php index 9cf2fe9..6d5582d 100644 --- a/vendor/symfony/translation/Loader/QtFileLoader.php +++ b/vendor/symfony/translation/Loader/QtFileLoader.php @@ -28,7 +28,7 @@ class QtFileLoader implements LoaderInterface /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!class_exists(XmlUtils::class)) { throw new RuntimeException('Loading translations from the QT format requires the Symfony Config component.'); diff --git a/vendor/symfony/translation/Loader/XliffFileLoader.php b/vendor/symfony/translation/Loader/XliffFileLoader.php index 35ad33e..670e199 100644 --- a/vendor/symfony/translation/Loader/XliffFileLoader.php +++ b/vendor/symfony/translation/Loader/XliffFileLoader.php @@ -31,7 +31,7 @@ class XliffFileLoader implements LoaderInterface /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!class_exists(XmlUtils::class)) { throw new RuntimeException('Loading translations from the Xliff format requires the Symfony Config component.'); @@ -57,7 +57,7 @@ class XliffFileLoader implements LoaderInterface } else { $dom = XmlUtils::loadFile($resource); } - } catch (\InvalidArgumentException | XmlParsingException | InvalidXmlException $e) { + } catch (\InvalidArgumentException|XmlParsingException|InvalidXmlException $e) { throw new InvalidResourceException(sprintf('Unable to load "%s": ', $resource).$e->getMessage(), $e->getCode(), $e); } diff --git a/vendor/symfony/translation/Loader/YamlFileLoader.php b/vendor/symfony/translation/Loader/YamlFileLoader.php index 8588e18..5eccf99 100644 --- a/vendor/symfony/translation/Loader/YamlFileLoader.php +++ b/vendor/symfony/translation/Loader/YamlFileLoader.php @@ -29,7 +29,7 @@ class YamlFileLoader extends FileLoader /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { if (null === $this->yamlParser) { if (!class_exists(\Symfony\Component\Yaml\Parser::class)) { diff --git a/vendor/symfony/translation/LoggingTranslator.php b/vendor/symfony/translation/LoggingTranslator.php index bb93435..8c8441c 100644 --- a/vendor/symfony/translation/LoggingTranslator.php +++ b/vendor/symfony/translation/LoggingTranslator.php @@ -21,15 +21,11 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface { - /** - * @var TranslatorInterface|TranslatorBagInterface - */ private $translator; - private $logger; /** - * @param TranslatorInterface $translator The translator must implement TranslatorBagInterface + * @param TranslatorInterface&TranslatorBagInterface&LocaleAwareInterface $translator The translator must implement TranslatorBagInterface */ public function __construct(TranslatorInterface $translator, LoggerInterface $logger) { @@ -44,7 +40,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, /** * {@inheritdoc} */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null) + public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string { $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); $this->log($id, $domain, $locale); @@ -69,7 +65,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, /** * {@inheritdoc} */ - public function getLocale() + public function getLocale(): string { return $this->translator->getLocale(); } @@ -77,7 +73,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, /** * {@inheritdoc} */ - public function getCatalogue(string $locale = null) + public function getCatalogue(string $locale = null): MessageCatalogueInterface { return $this->translator->getCatalogue($locale); } @@ -92,10 +88,8 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, /** * Gets the fallback locales. - * - * @return array The fallback locales */ - public function getFallbackLocales() + public function getFallbackLocales(): array { if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { return $this->translator->getFallbackLocales(); diff --git a/vendor/symfony/translation/MessageCatalogue.php b/vendor/symfony/translation/MessageCatalogue.php index ff49b5a..7aa27ef 100644 --- a/vendor/symfony/translation/MessageCatalogue.php +++ b/vendor/symfony/translation/MessageCatalogue.php @@ -19,12 +19,12 @@ use Symfony\Component\Translation\Exception\LogicException; */ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface { - private $messages = []; - private $metadata = []; - private $resources = []; - private $locale; - private $fallbackCatalogue; - private $parent; + private array $messages = []; + private array $metadata = []; + private array $resources = []; + private string $locale; + private $fallbackCatalogue = null; + private ?self $parent = null; /** * @param array $messages An array of messages classified by domain @@ -38,7 +38,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getLocale() + public function getLocale(): string { return $this->locale; } @@ -46,7 +46,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getDomains() + public function getDomains(): array { $domains = []; @@ -63,7 +63,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function all(string $domain = null) + public function all(string $domain = null): array { if (null !== $domain) { // skip messages merge if intl-icu requested explicitly @@ -99,7 +99,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function has(string $id, string $domain = 'messages') + public function has(string $id, string $domain = 'messages'): bool { if (isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { return true; @@ -115,7 +115,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function defines(string $id, string $domain = 'messages') + public function defines(string $id, string $domain = 'messages'): bool { return isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]); } @@ -123,7 +123,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function get(string $id, string $domain = 'messages') + public function get(string $id, string $domain = 'messages'): string { if (isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { return $this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]; @@ -233,7 +233,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getFallbackCatalogue() + public function getFallbackCatalogue(): ?MessageCatalogueInterface { return $this->fallbackCatalogue; } @@ -241,7 +241,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getResources() + public function getResources(): array { return array_values($this->resources); } @@ -257,7 +257,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getMetadata(string $key = '', string $domain = 'messages') + public function getMetadata(string $key = '', string $domain = 'messages'): mixed { if ('' == $domain) { return $this->metadata; @@ -279,7 +279,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function setMetadata(string $key, $value, string $domain = 'messages') + public function setMetadata(string $key, mixed $value, string $domain = 'messages') { $this->metadata[$domain][$key] = $value; } diff --git a/vendor/symfony/translation/MessageCatalogueInterface.php b/vendor/symfony/translation/MessageCatalogueInterface.php index 5d83bd8..75e3a2f 100644 --- a/vendor/symfony/translation/MessageCatalogueInterface.php +++ b/vendor/symfony/translation/MessageCatalogueInterface.php @@ -24,17 +24,13 @@ interface MessageCatalogueInterface /** * Gets the catalogue locale. - * - * @return string The locale */ - public function getLocale(); + public function getLocale(): string; /** * Gets the domains. - * - * @return array An array of domains */ - public function getDomains(); + public function getDomains(): array; /** * Gets the messages within a given domain. @@ -42,10 +38,8 @@ interface MessageCatalogueInterface * If $domain is null, it returns all messages. * * @param string $domain The domain name - * - * @return array An array of messages */ - public function all(string $domain = null); + public function all(string $domain = null): array; /** * Sets a message translation. @@ -61,30 +55,24 @@ interface MessageCatalogueInterface * * @param string $id The message id * @param string $domain The domain name - * - * @return bool true if the message has a translation, false otherwise */ - public function has(string $id, string $domain = 'messages'); + public function has(string $id, string $domain = 'messages'): bool; /** * Checks if a message has a translation (it does not take into account the fallback mechanism). * * @param string $id The message id * @param string $domain The domain name - * - * @return bool true if the message has a translation, false otherwise */ - public function defines(string $id, string $domain = 'messages'); + public function defines(string $id, string $domain = 'messages'): bool; /** * Gets a message translation. * * @param string $id The message id * @param string $domain The domain name - * - * @return string The message translation */ - public function get(string $id, string $domain = 'messages'); + public function get(string $id, string $domain = 'messages'): string; /** * Sets translations for a given domain. @@ -119,17 +107,15 @@ interface MessageCatalogueInterface /** * Gets the fallback catalogue. - * - * @return self|null A MessageCatalogueInterface instance or null when no fallback has been set */ - public function getFallbackCatalogue(); + public function getFallbackCatalogue(): ?self; /** * Returns an array of resources loaded to build this collection. * - * @return ResourceInterface[] An array of resources + * @return ResourceInterface[] */ - public function getResources(); + public function getResources(): array; /** * Adds a resource for this collection. diff --git a/vendor/symfony/translation/MetadataAwareInterface.php b/vendor/symfony/translation/MetadataAwareInterface.php index 2216eed..2eaaceb 100644 --- a/vendor/symfony/translation/MetadataAwareInterface.php +++ b/vendor/symfony/translation/MetadataAwareInterface.php @@ -27,14 +27,12 @@ interface MetadataAwareInterface * * @return mixed The value that was set or an array with the domains/keys or null */ - public function getMetadata(string $key = '', string $domain = 'messages'); + public function getMetadata(string $key = '', string $domain = 'messages'): mixed; /** * Adds metadata to a message domain. - * - * @param mixed $value */ - public function setMetadata(string $key, $value, string $domain = 'messages'); + public function setMetadata(string $key, mixed $value, string $domain = 'messages'); /** * Deletes metadata for the given key and domain. diff --git a/vendor/symfony/translation/Provider/Dsn.php b/vendor/symfony/translation/Provider/Dsn.php index 820cabf..0f74d17 100644 --- a/vendor/symfony/translation/Provider/Dsn.php +++ b/vendor/symfony/translation/Provider/Dsn.php @@ -20,14 +20,14 @@ use Symfony\Component\Translation\Exception\MissingRequiredOptionException; */ final class Dsn { - private $scheme; - private $host; - private $user; - private $password; - private $port; - private $path; - private $options; - private $originalDsn; + private ?string $scheme; + private ?string $host; + private ?string $user; + private ?string $password; + private ?int $port; + private ?string $path; + private array $options = []; + private string $originalDsn; public function __construct(string $dsn) { @@ -79,7 +79,7 @@ final class Dsn return $this->port ?? $default; } - public function getOption(string $key, $default = null) + public function getOption(string $key, mixed $default = null) { return $this->options[$key] ?? $default; } diff --git a/vendor/symfony/translation/Provider/FilteringProvider.php b/vendor/symfony/translation/Provider/FilteringProvider.php index 0307cda..a43fedc 100644 --- a/vendor/symfony/translation/Provider/FilteringProvider.php +++ b/vendor/symfony/translation/Provider/FilteringProvider.php @@ -18,14 +18,12 @@ use Symfony\Component\Translation\TranslatorBagInterface; * Filters domains and locales between the Translator config values and those specific to each provider. * * @author Mathieu Santostefano - * - * @experimental in 5.3 */ class FilteringProvider implements ProviderInterface { private $provider; - private $locales; - private $domains; + private array $locales; + private array $domains; public function __construct(ProviderInterface $provider, array $locales, array $domains = []) { diff --git a/vendor/symfony/translation/Provider/NullProvider.php b/vendor/symfony/translation/Provider/NullProvider.php index 785fcaa..f00392e 100644 --- a/vendor/symfony/translation/Provider/NullProvider.php +++ b/vendor/symfony/translation/Provider/NullProvider.php @@ -16,8 +16,6 @@ use Symfony\Component\Translation\TranslatorBagInterface; /** * @author Mathieu Santostefano - * - * @experimental in 5.3 */ class NullProvider implements ProviderInterface { diff --git a/vendor/symfony/translation/Provider/NullProviderFactory.php b/vendor/symfony/translation/Provider/NullProviderFactory.php index 6ddbd85..f350f16 100644 --- a/vendor/symfony/translation/Provider/NullProviderFactory.php +++ b/vendor/symfony/translation/Provider/NullProviderFactory.php @@ -15,8 +15,6 @@ use Symfony\Component\Translation\Exception\UnsupportedSchemeException; /** * @author Mathieu Santostefano - * - * @experimental in 5.3 */ final class NullProviderFactory extends AbstractProviderFactory { diff --git a/vendor/symfony/translation/Provider/TranslationProviderCollection.php b/vendor/symfony/translation/Provider/TranslationProviderCollection.php index 9963cb9..61ac641 100644 --- a/vendor/symfony/translation/Provider/TranslationProviderCollection.php +++ b/vendor/symfony/translation/Provider/TranslationProviderCollection.php @@ -15,11 +15,12 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException; /** * @author Mathieu Santostefano - * - * @experimental in 5.3 */ final class TranslationProviderCollection { + /** + * @var array + */ private $providers; /** @@ -27,10 +28,7 @@ final class TranslationProviderCollection */ public function __construct(iterable $providers) { - $this->providers = []; - foreach ($providers as $name => $provider) { - $this->providers[$name] = $provider; - } + $this->providers = \is_array($providers) ? $providers : iterator_to_array($providers); } public function __toString(): string diff --git a/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php b/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php index 43f4a34..6300c87 100644 --- a/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php +++ b/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php @@ -15,16 +15,14 @@ use Symfony\Component\Translation\Exception\UnsupportedSchemeException; /** * @author Mathieu Santostefano - * - * @experimental in 5.3 */ class TranslationProviderCollectionFactory { - private $factories; - private $enabledLocales; + private iterable $factories; + private array $enabledLocales; /** - * @param ProviderFactoryInterface[] $factories + * @param iterable $factories */ public function __construct(iterable $factories, array $enabledLocales) { diff --git a/vendor/symfony/translation/PseudoLocalizationTranslator.php b/vendor/symfony/translation/PseudoLocalizationTranslator.php index 49f122e..848dc1d 100644 --- a/vendor/symfony/translation/PseudoLocalizationTranslator.php +++ b/vendor/symfony/translation/PseudoLocalizationTranslator.php @@ -21,11 +21,15 @@ final class PseudoLocalizationTranslator implements TranslatorInterface private const EXPANSION_CHARACTER = '~'; private $translator; - private $accents; - private $expansionFactor; - private $brackets; - private $parseHTML; - private $localizableHTMLAttributes; + private bool $accents; + private float $expansionFactor; + private bool $brackets; + private bool $parseHTML; + + /** + * @var string[] + */ + private array $localizableHTMLAttributes; /** * Available options: @@ -82,7 +86,7 @@ final class PseudoLocalizationTranslator implements TranslatorInterface /** * {@inheritdoc} */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null) + public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string { $trans = ''; $visibleText = ''; @@ -119,7 +123,7 @@ final class PseudoLocalizationTranslator implements TranslatorInterface return [[true, true, $originalTrans]]; } - $html = mb_convert_encoding($originalTrans, 'HTML-ENTITIES', mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8'); + $html = mb_encode_numericentity($originalTrans, [0x80, 0xFFFF, 0, 0xFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8'); $useInternalErrors = libxml_use_internal_errors(true); diff --git a/vendor/symfony/translation/README.md b/vendor/symfony/translation/README.md index 720bee3..adda9a5 100644 --- a/vendor/symfony/translation/README.md +++ b/vendor/symfony/translation/README.md @@ -23,6 +23,16 @@ $translator->addResource('array', [ echo $translator->trans('Hello World!'); // outputs « Bonjour ! » ``` +Sponsor +------- + +The Translation component for Symfony 5.4/6.0 is [backed][1] by: + + * [Crowdin][2], a cloud-based localization management software helping teams to go global and stay agile. + * [Lokalise][3], a continuous localization and translation management platform that integrates into your development workflow so you can ship localized products, faster. + +Help Symfony by [sponsoring][4] its development! + Resources --------- @@ -31,3 +41,8 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://crowdin.com +[3]: https://lokalise.com +[4]: https://symfony.com/sponsor diff --git a/vendor/symfony/translation/Reader/TranslationReader.php b/vendor/symfony/translation/Reader/TranslationReader.php index 9e51b15..bbc687e 100644 --- a/vendor/symfony/translation/Reader/TranslationReader.php +++ b/vendor/symfony/translation/Reader/TranslationReader.php @@ -25,9 +25,9 @@ class TranslationReader implements TranslationReaderInterface /** * Loaders used for import. * - * @var array + * @var array */ - private $loaders = []; + private array $loaders = []; /** * Adds a loader to the translation extractor. diff --git a/vendor/symfony/translation/Resources/bin/translation-status.php b/vendor/symfony/translation/Resources/bin/translation-status.php index 4e0723b..a769164 100644 --- a/vendor/symfony/translation/Resources/bin/translation-status.php +++ b/vendor/symfony/translation/Resources/bin/translation-status.php @@ -19,13 +19,16 @@ $usageInstructions = << false, // NULL = analyze all locales 'locale_to_analyze' => null, + // append --incomplete to only show incomplete languages + 'include_completed_languages' => true, // the reference files all the other translations are compared to 'original_files' => [ 'src/Symfony/Component/Form/Resources/translations/validators.en.xlf', @@ -46,12 +51,17 @@ $config = [ $argc = $_SERVER['argc']; $argv = $_SERVER['argv']; -if ($argc > 3) { +if ($argc > 4) { echo str_replace('translation-status.php', $argv[0], $usageInstructions); exit(1); } foreach (array_slice($argv, 1) as $argumentOrOption) { + if ('--incomplete' === $argumentOrOption) { + $config['include_completed_languages'] = false; + continue; + } + if (str_starts_with($argumentOrOption, '-')) { $config['verbose_output'] = true; } else { @@ -67,6 +77,7 @@ foreach ($config['original_files'] as $originalFilePath) { } $totalMissingTranslations = 0; +$totalTranslationMismatches = 0; foreach ($config['original_files'] as $originalFilePath) { $translationFilePaths = findTranslationFiles($originalFilePath, $config['locale_to_analyze']); @@ -75,11 +86,14 @@ foreach ($config['original_files'] as $originalFilePath) { $totalMissingTranslations += array_sum(array_map(function ($translation) { return count($translation['missingKeys']); }, array_values($translationStatus))); + $totalTranslationMismatches += array_sum(array_map(function ($translation) { + return count($translation['mismatches']); + }, array_values($translationStatus))); - printTranslationStatus($originalFilePath, $translationStatus, $config['verbose_output']); + printTranslationStatus($originalFilePath, $translationStatus, $config['verbose_output'], $config['include_completed_languages']); } -exit($totalMissingTranslations > 0 ? 1 : 0); +exit($totalTranslationMismatches > 0 ? 1 : 0); function findTranslationFiles($originalFilePath, $localeToAnalyze) { @@ -112,21 +126,29 @@ function calculateTranslationStatus($originalFilePath, $translationFilePaths) foreach ($translationFilePaths as $locale => $translationPath) { $translatedKeys = extractTranslationKeys($translationPath); $missingKeys = array_diff_key($allTranslationKeys, $translatedKeys); + $mismatches = findTransUnitMismatches($allTranslationKeys, $translatedKeys); $translationStatus[$locale] = [ 'total' => count($allTranslationKeys), 'translated' => count($translatedKeys), 'missingKeys' => $missingKeys, + 'mismatches' => $mismatches, ]; + $translationStatus[$locale]['is_completed'] = isTranslationCompleted($translationStatus[$locale]); } return $translationStatus; } -function printTranslationStatus($originalFilePath, $translationStatus, $verboseOutput) +function isTranslationCompleted(array $translationStatus): bool +{ + return $translationStatus['total'] === $translationStatus['translated'] && 0 === count($translationStatus['mismatches']); +} + +function printTranslationStatus($originalFilePath, $translationStatus, $verboseOutput, $includeCompletedLanguages) { printTitle($originalFilePath); - printTable($translationStatus, $verboseOutput); + printTable($translationStatus, $verboseOutput, $includeCompletedLanguages); echo \PHP_EOL.\PHP_EOL; } @@ -152,13 +174,35 @@ function extractTranslationKeys($filePath) return $translationKeys; } +/** + * Check whether the trans-unit id and source match with the base translation. + */ +function findTransUnitMismatches(array $baseTranslationKeys, array $translatedKeys): array +{ + $mismatches = []; + + foreach ($baseTranslationKeys as $translationId => $translationKey) { + if (!isset($translatedKeys[$translationId])) { + continue; + } + if ($translatedKeys[$translationId] !== $translationKey) { + $mismatches[$translationId] = [ + 'found' => $translatedKeys[$translationId], + 'expected' => $translationKey, + ]; + } + } + + return $mismatches; +} + function printTitle($title) { echo $title.\PHP_EOL; echo str_repeat('=', strlen($title)).\PHP_EOL.\PHP_EOL; } -function printTable($translations, $verboseOutput) +function printTable($translations, $verboseOutput, bool $includeCompletedLanguages) { if (0 === count($translations)) { echo 'No translations found'; @@ -168,24 +212,47 @@ function printTable($translations, $verboseOutput) $longestLocaleNameLength = max(array_map('strlen', array_keys($translations))); foreach ($translations as $locale => $translation) { + if (!$includeCompletedLanguages && $translation['is_completed']) { + continue; + } + if ($translation['translated'] > $translation['total']) { textColorRed(); - } elseif ($translation['translated'] === $translation['total']) { + } elseif (count($translation['mismatches']) > 0) { + textColorRed(); + } elseif ($translation['is_completed']) { textColorGreen(); } - echo sprintf('| Locale: %-'.$longestLocaleNameLength.'s | Translated: %d/%d', $locale, $translation['translated'], $translation['total']).\PHP_EOL; + echo sprintf( + '| Locale: %-'.$longestLocaleNameLength.'s | Translated: %2d/%2d | Mismatches: %d |', + $locale, + $translation['translated'], + $translation['total'], + count($translation['mismatches']) + ).\PHP_EOL; textColorNormal(); + $shouldBeClosed = false; if (true === $verboseOutput && count($translation['missingKeys']) > 0) { - echo str_repeat('-', 80).\PHP_EOL; - echo '| Missing Translations:'.\PHP_EOL; + echo '| Missing Translations:'.\PHP_EOL; foreach ($translation['missingKeys'] as $id => $content) { - echo sprintf('| (id=%s) %s', $id, $content).\PHP_EOL; + echo sprintf('| (id=%s) %s', $id, $content).\PHP_EOL; } + $shouldBeClosed = true; + } + if (true === $verboseOutput && count($translation['mismatches']) > 0) { + echo '| Mismatches between trans-unit id and source:'.\PHP_EOL; + foreach ($translation['mismatches'] as $id => $content) { + echo sprintf('| (id=%s) Expected: %s', $id, $content['expected']).\PHP_EOL; + echo sprintf('| Found: %s', $content['found']).\PHP_EOL; + } + $shouldBeClosed = true; + } + if ($shouldBeClosed) { echo str_repeat('-', 80).\PHP_EOL; } } diff --git a/vendor/symfony/translation/Resources/data/parents.json b/vendor/symfony/translation/Resources/data/parents.json index a67458a..288f163 100644 --- a/vendor/symfony/translation/Resources/data/parents.json +++ b/vendor/symfony/translation/Resources/data/parents.json @@ -12,7 +12,6 @@ "en_BS": "en_001", "en_BW": "en_001", "en_BZ": "en_001", - "en_CA": "en_001", "en_CC": "en_001", "en_CH": "en_150", "en_CK": "en_001", @@ -65,7 +64,6 @@ "en_NU": "en_001", "en_NZ": "en_001", "en_PG": "en_001", - "en_PH": "en_001", "en_PK": "en_001", "en_PN": "en_001", "en_PW": "en_001", diff --git a/vendor/symfony/translation/Test/ProviderFactoryTestCase.php b/vendor/symfony/translation/Test/ProviderFactoryTestCase.php index 6d5f4b7..d6510e0 100644 --- a/vendor/symfony/translation/Test/ProviderFactoryTestCase.php +++ b/vendor/symfony/translation/Test/ProviderFactoryTestCase.php @@ -33,7 +33,7 @@ abstract class ProviderFactoryTestCase extends TestCase { protected $client; protected $logger; - protected $defaultLocale; + protected string $defaultLocale; protected $loader; protected $xliffFileDumper; @@ -122,26 +122,26 @@ abstract class ProviderFactoryTestCase extends TestCase protected function getClient(): HttpClientInterface { - return $this->client ?? $this->client = new MockHttpClient(); + return $this->client ??= new MockHttpClient(); } protected function getLogger(): LoggerInterface { - return $this->logger ?? $this->logger = $this->createMock(LoggerInterface::class); + return $this->logger ??= $this->createMock(LoggerInterface::class); } protected function getDefaultLocale(): string { - return $this->defaultLocale ?? $this->defaultLocale = 'en'; + return $this->defaultLocale ??= 'en'; } protected function getLoader(): LoaderInterface { - return $this->loader ?? $this->loader = $this->createMock(LoaderInterface::class); + return $this->loader ??= $this->createMock(LoaderInterface::class); } protected function getXliffFileDumper(): XliffFileDumper { - return $this->xliffFileDumper ?? $this->xliffFileDumper = $this->createMock(XliffFileDumper::class); + return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); } } diff --git a/vendor/symfony/translation/Test/ProviderTestCase.php b/vendor/symfony/translation/Test/ProviderTestCase.php index 238fd96..5ae2682 100644 --- a/vendor/symfony/translation/Test/ProviderTestCase.php +++ b/vendor/symfony/translation/Test/ProviderTestCase.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Translation\Test; -use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Symfony\Component\HttpClient\MockHttpClient; @@ -31,7 +30,7 @@ abstract class ProviderTestCase extends TestCase { protected $client; protected $logger; - protected $defaultLocale; + protected string $defaultLocale; protected $loader; protected $xliffFileDumper; @@ -52,35 +51,26 @@ abstract class ProviderTestCase extends TestCase protected function getClient(): MockHttpClient { - return $this->client ?? $this->client = new MockHttpClient(); + return $this->client ??= new MockHttpClient(); } - /** - * @return LoaderInterface&MockObject - */ protected function getLoader(): LoaderInterface { - return $this->loader ?? $this->loader = $this->createMock(LoaderInterface::class); + return $this->loader ??= $this->createMock(LoaderInterface::class); } - /** - * @return LoaderInterface&MockObject - */ protected function getLogger(): LoggerInterface { - return $this->logger ?? $this->logger = $this->createMock(LoggerInterface::class); + return $this->logger ??= $this->createMock(LoggerInterface::class); } protected function getDefaultLocale(): string { - return $this->defaultLocale ?? $this->defaultLocale = 'en'; + return $this->defaultLocale ??= 'en'; } - /** - * @return LoaderInterface&MockObject - */ protected function getXliffFileDumper(): XliffFileDumper { - return $this->xliffFileDumper ?? $this->xliffFileDumper = $this->createMock(XliffFileDumper::class); + return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); } } diff --git a/vendor/symfony/translation/TranslatableMessage.php b/vendor/symfony/translation/TranslatableMessage.php index 82ae6d7..b1a3b6b 100644 --- a/vendor/symfony/translation/TranslatableMessage.php +++ b/vendor/symfony/translation/TranslatableMessage.php @@ -19,9 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class TranslatableMessage implements TranslatableInterface { - private $message; - private $parameters; - private $domain; + private string $message; + private array $parameters; + private ?string $domain; public function __construct(string $message, array $parameters = [], string $domain = null) { @@ -52,6 +52,11 @@ class TranslatableMessage implements TranslatableInterface public function trans(TranslatorInterface $translator, string $locale = null): string { - return $translator->trans($this->getMessage(), $this->getParameters(), $this->getDomain(), $locale); + return $translator->trans($this->getMessage(), array_map( + static function ($parameter) use ($translator, $locale) { + return $parameter instanceof TranslatableInterface ? $parameter->trans($translator, $locale) : $parameter; + }, + $this->getParameters() + ), $this->getDomain(), $locale); } } diff --git a/vendor/symfony/translation/Translator.php b/vendor/symfony/translation/Translator.php index 9a63956..05e84d0 100644 --- a/vendor/symfony/translation/Translator.php +++ b/vendor/symfony/translation/Translator.php @@ -37,54 +37,33 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA */ protected $catalogues = []; - /** - * @var string - */ - private $locale; + private string $locale; /** - * @var array + * @var string[] */ - private $fallbackLocales = []; + private array $fallbackLocales = []; /** * @var LoaderInterface[] */ - private $loaders = []; + private array $loaders = []; - /** - * @var array - */ - private $resources = []; + private array $resources = []; - /** - * @var MessageFormatterInterface - */ private $formatter; - /** - * @var string - */ - private $cacheDir; + private ?string $cacheDir; - /** - * @var bool - */ - private $debug; + private bool $debug; - private $cacheVary; + private array $cacheVary; - /** - * @var ConfigCacheFactoryInterface|null - */ private $configCacheFactory; - /** - * @var array|null - */ - private $parentLocales; + private array $parentLocales; - private $hasIntlFormatter; + private bool $hasIntlFormatter; /** * @throws InvalidArgumentException If a locale contains invalid characters @@ -127,7 +106,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA * * @throws InvalidArgumentException If the locale contains invalid characters */ - public function addResource(string $format, $resource, string $locale, string $domain = null) + public function addResource(string $format, mixed $resource, string $locale, string $domain = null) { if (null === $domain) { $domain = 'messages'; @@ -157,7 +136,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * {@inheritdoc} */ - public function getLocale() + public function getLocale(): string { return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); } @@ -165,6 +144,8 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * Sets the fallback locales. * + * @param string[] $locales + * * @throws InvalidArgumentException If a locale contains invalid characters */ public function setFallbackLocales(array $locales) @@ -192,7 +173,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * {@inheritdoc} */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null) + public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string { if (null === $id || '' === $id) { return ''; @@ -227,7 +208,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * {@inheritdoc} */ - public function getCatalogue(string $locale = null) + public function getCatalogue(string $locale = null): MessageCatalogueInterface { if (!$locale) { $locale = $this->getLocale(); @@ -253,9 +234,9 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * Gets the loaders. * - * @return array LoaderInterface[] + * @return LoaderInterface[] */ - protected function getLoaders() + protected function getLoaders(): array { return $this->loaders; } @@ -407,18 +388,10 @@ EOF protected function computeFallbackLocales(string $locale) { - if (null === $this->parentLocales) { - $this->parentLocales = json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); - } + $this->parentLocales ??= json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); + $originLocale = $locale; $locales = []; - foreach ($this->fallbackLocales as $fallback) { - if ($fallback === $locale) { - continue; - } - - $locales[] = $fallback; - } while ($locale) { $parent = $this->parentLocales[$locale] ?? null; @@ -439,10 +412,18 @@ EOF } if (null !== $locale) { - array_unshift($locales, $locale); + $locales[] = $locale; } } + foreach ($this->fallbackLocales as $fallback) { + if ($fallback === $originLocale) { + continue; + } + + $locales[] = $fallback; + } + return array_unique($locales); } @@ -453,7 +434,7 @@ EOF */ protected function assertValidLocale(string $locale) { - if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i', (string) $locale)) { + if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) { throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale)); } } @@ -464,9 +445,7 @@ EOF */ private function getConfigCacheFactory(): ConfigCacheFactoryInterface { - if (!$this->configCacheFactory) { - $this->configCacheFactory = new ConfigCacheFactory($this->debug); - } + $this->configCacheFactory ??= new ConfigCacheFactory($this->debug); return $this->configCacheFactory; } diff --git a/vendor/symfony/translation/TranslatorBag.php b/vendor/symfony/translation/TranslatorBag.php index c655578..ffd109f 100644 --- a/vendor/symfony/translation/TranslatorBag.php +++ b/vendor/symfony/translation/TranslatorBag.php @@ -17,7 +17,7 @@ use Symfony\Component\Translation\Catalogue\TargetOperation; final class TranslatorBag implements TranslatorBagInterface { /** @var MessageCatalogue[] */ - private $catalogues = []; + private array $catalogues = []; public function addCatalogue(MessageCatalogue $catalogue): void { @@ -38,7 +38,7 @@ final class TranslatorBag implements TranslatorBagInterface /** * {@inheritdoc} */ - public function getCatalogue(string $locale = null) + public function getCatalogue(string $locale = null): MessageCatalogueInterface { if (null === $locale || !isset($this->catalogues[$locale])) { $this->catalogues[$locale] = new MessageCatalogue($locale); diff --git a/vendor/symfony/translation/TranslatorBagInterface.php b/vendor/symfony/translation/TranslatorBagInterface.php index 4228977..a787acf 100644 --- a/vendor/symfony/translation/TranslatorBagInterface.php +++ b/vendor/symfony/translation/TranslatorBagInterface.php @@ -14,10 +14,6 @@ namespace Symfony\Component\Translation; use Symfony\Component\Translation\Exception\InvalidArgumentException; /** - * TranslatorBagInterface. - * - * @method MessageCatalogueInterface[] getCatalogues() Returns all catalogues of the instance - * * @author Abdellatif Ait boudad */ interface TranslatorBagInterface @@ -27,9 +23,14 @@ interface TranslatorBagInterface * * @param string|null $locale The locale or null to use the default * - * @return MessageCatalogueInterface - * * @throws InvalidArgumentException If the locale contains invalid characters */ - public function getCatalogue(string $locale = null); + public function getCatalogue(string $locale = null): MessageCatalogueInterface; + + /** + * Returns all catalogues of the instance. + * + * @return MessageCatalogueInterface[] + */ + public function getCatalogues(): array; } diff --git a/vendor/symfony/translation/Util/ArrayConverter.php b/vendor/symfony/translation/Util/ArrayConverter.php index acfbfc3..60b8be6 100644 --- a/vendor/symfony/translation/Util/ArrayConverter.php +++ b/vendor/symfony/translation/Util/ArrayConverter.php @@ -30,10 +30,8 @@ class ArrayConverter * For example this array('foo.bar' => 'value') will be converted to ['foo' => ['bar' => 'value']]. * * @param array $messages Linear messages array - * - * @return array Tree-like messages array */ - public static function expandToTree(array $messages) + public static function expandToTree(array $messages): array { $tree = []; diff --git a/vendor/symfony/translation/Util/XliffUtils.php b/vendor/symfony/translation/Util/XliffUtils.php index e4373a7..85ecc85 100644 --- a/vendor/symfony/translation/Util/XliffUtils.php +++ b/vendor/symfony/translation/Util/XliffUtils.php @@ -85,11 +85,6 @@ class XliffUtils private static function shouldEnableEntityLoader(): bool { - // Version prior to 8.0 can be enabled without deprecation - if (\PHP_VERSION_ID < 80000) { - return true; - } - static $dom, $schema; if (null === $dom) { $dom = new \DOMDocument(); diff --git a/vendor/symfony/translation/Writer/TranslationWriter.php b/vendor/symfony/translation/Writer/TranslationWriter.php index 0a349b8..5dd3a5c 100644 --- a/vendor/symfony/translation/Writer/TranslationWriter.php +++ b/vendor/symfony/translation/Writer/TranslationWriter.php @@ -23,7 +23,10 @@ use Symfony\Component\Translation\MessageCatalogue; */ class TranslationWriter implements TranslationWriterInterface { - private $dumpers = []; + /** + * @var array + */ + private array $dumpers = []; /** * Adds a dumper to the writer. @@ -35,10 +38,8 @@ class TranslationWriter implements TranslationWriterInterface /** * Obtains the list of supported formats. - * - * @return array */ - public function getFormats() + public function getFormats(): array { return array_keys($this->dumpers); } diff --git a/vendor/symfony/translation/composer.json b/vendor/symfony/translation/composer.json index de84e16..abe8b97 100644 --- a/vendor/symfony/translation/composer.json +++ b/vendor/symfony/translation/composer.json @@ -16,33 +16,33 @@ } ], "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" + "symfony/translation-contracts": "^2.3|^3.0" }, "require-dev": { - "symfony/config": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/http-kernel": "^5.0", - "symfony/intl": "^4.4|^5.0", + "symfony/config": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^4.4|^5.0", - "symfony/finder": "^4.4|^5.0", + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", "psr/log": "^1|^2|^3" }, "conflict": { - "symfony/config": "<4.4", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" + "symfony/config": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4", + "symfony/console": "<5.4" }, "provide": { - "symfony/translation-implementation": "2.3" + "symfony/translation-implementation": "2.3|3.0" }, "suggest": { "symfony/config": "", diff --git a/vendor/voku/portable-ascii/CHANGELOG.md b/vendor/voku/portable-ascii/CHANGELOG.md index 6e5357d..12fc393 100644 --- a/vendor/voku/portable-ascii/CHANGELOG.md +++ b/vendor/voku/portable-ascii/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +### 2.0.1 (2022-03-08) + +- "To people of Russia": There is a war in Ukraine right now. The forces of the Russian Federation are attacking civilians. +- optimize some phpdocs + +### 2.0.0 (2022-01-24) + +- prefer "Russian - Passport (2013), ICAO" instead of "Russian - GOST 7.79-2000(B)" +- fix "Ukrainian" char-mapping (thanks to @Andr1yk0) +- fix "Persian" char-mapping (thanks to @frost-cyber) + +### 1.6.1 (2022-01-24) + +- revert: prefer "Russian - Passport (2013), ICAO" instead of "Russian - GOST 7.79-2000(B)" +- revert: fix "Ukrainian" char-mapping (thanks to @Andr1yk0) +- revert: fix "Persian" char-mapping (thanks to @frost-cyber) + +### 1.6.0 (2022-01-24) + +- prefer "Russian - Passport (2013), ICAO" instead of "Russian - GOST 7.79-2000(B)" +- fix "Ukrainian" char-mapping (thanks to @Andr1yk0) +- fix "Persian" char-mapping (thanks to @frost-cyber) +- fix "ASCII::normalize_whitespace()" -> "CARRIAGE RETURN" is more like "
" and no "\n" +- add "ASCII::to_ascii_remap()" -> this method will return broken characters and is only for special cases + ### 1.5.6 (2020-11-12) - "ASCII::normalize_whitespace()" -> can now also remove "control characters" if needed v2 diff --git a/vendor/voku/portable-ascii/README.md b/vendor/voku/portable-ascii/README.md index 9dd7cec..3ce36d6 100644 --- a/vendor/voku/portable-ascii/README.md +++ b/vendor/voku/portable-ascii/README.md @@ -1,7 +1,9 @@ [//]: # (AUTO-GENERATED BY "PHP README Helper": base file -> docs/base.md) -[![Build Status](https://travis-ci.com/voku/portable-ascii.svg?branch=master)](https://travis-ci.com/voku/portable-ascii) +[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md) + +[![Build Status](https://github.com/voku/portable-ascii/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/voku/portable-ascii/actions) [![Build status](https://ci.appveyor.com/api/projects/status/gnejjnk7qplr7f5t/branch/master?svg=true)](https://ci.appveyor.com/project/voku/portable-ascii/branch/master) -[![Coverage Status](https://coveralls.io/repos/voku/portable-ascii/badge.svg?branch=master&service=github)](https://coveralls.io/github/voku/portable-ascii?branch=master) +[![codecov.io](https://codecov.io/github/voku/portable-ascii/coverage.svg?branch=master)](https://codecov.io/github/voku/portable-ascii?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/997c9bb10d1c4791967bdf2e42013e8e)](https://www.codacy.com/app/voku/portable-ascii) [![Latest Stable Version](https://poser.pugx.org/voku/portable-ascii/v/stable)](https://packagist.org/packages/voku/portable-ascii) [![Total Downloads](https://poser.pugx.org/voku/portable-ascii/downloads)](https://packagist.org/packages/voku/portable-ascii) @@ -96,11 +98,12 @@ The API from the "ASCII"-Class is written as small static methods. getAllLanguages is_ascii normalize_msword -normalize_whitespace -remove_invisible_characters +normalize_whitespace +remove_invisible_characters to_ascii -to_filename -to_slugify +to_ascii_remap +to_filename +to_slugify to_transliterate @@ -152,7 +155,7 @@ echo $array['orig'][$tmpKey]; // 'ё' **Parameters:** -- `string $language [optional]

Language of the source string e.g.: en, de_at, or de-ch. +- `ASCII::* $language [optional]

Language of the source string e.g.: en, de_at, or de-ch. (default is 'en') | ASCII::*_LANGUAGE_CODE

` - `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

` - `bool $asOrigReplaceArray [optional]

TRUE === return {orig: string[], replace: string[]} @@ -254,7 +257,7 @@ ASCII::normalize_msword('„Abcdef…”'); // '"Abcdef..."' -------- -#### normalize_whitespace(string $str, bool $keepNonBreakingSpace, bool $keepBidiUnicodeControls, bool $replaceSeparatorsWithNewline): string +#### normalize_whitespace(string $str, bool $keepNonBreakingSpace, bool $keepBidiUnicodeControls, bool $normalize_control_characters): string Normalize the whitespace. @@ -267,14 +270,14 @@ ASCII::normalize_whitespace("abc-\xc2\xa0-öäü-\xe2\x80\xaf-\xE2\x80\xAC", tru - `bool $keepNonBreakingSpace [optional]

Set to true, to keep non-breaking-spaces.

` - `bool $keepBidiUnicodeControls [optional]

Set to true, to keep non-printable (for the web) bidirectional text chars.

` -- `bool $replaceSeparatorsWithNewline [optional]

Set to true, to convert LINE and PARAGRAPH SEPARATOR with "\n".

` +- `bool $normalize_control_characters [optional]

Set to true, to convert e.g. LINE-, PARAGRAPH-SEPARATOR with "\n" and LINE TABULATION with "\t".

` **Return:** - `string

A string with normalized whitespace.

` -------- -#### remove_invisible_characters(string $str, bool $url_encoded, string $replacement, bool $keep_control_characters): string +#### remove_invisible_characters(string $str, bool $url_encoded, string $replacement, bool $keep_basic_control_characters): string Remove invisible characters from a string. @@ -286,7 +289,7 @@ copy&past from https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/C - `string $str` - `bool $url_encoded` - `string $replacement` -- `bool $keep_control_characters` +- `bool $keep_basic_control_characters` **Return:** - `string` @@ -308,7 +311,7 @@ ASCII::to_ascii('�Düsseldorf�', 'en'); // Dusseldorf **Parameters:** - `string $str

The input string.

` -- `string $language [optional]

Language of the source string. +- `ASCII::* $language [optional]

Language of the source string. (default is 'en') | ASCII::*_LANGUAGE_CODE

` - `bool $remove_unsupported_chars [optional]

Whether or not to remove the unsupported characters.

` @@ -325,6 +328,26 @@ language

` -------- +#### to_ascii_remap(string $str1, string $str2): string[] + +WARNING: This method will return broken characters and is only for special cases. + +Convert two UTF-8 encoded string to a single-byte strings suitable for +functions that need the same string length after the conversion. + +The function simply uses (and updates) a tailored dynamic encoding +(in/out map parameter) where non-ascii characters are remapped to +the range [128-255] in order of appearance. + +**Parameters:** +- `string $str1` +- `string $str2` + +**Return:** +- `string[]` + +-------- + #### to_filename(string $str, bool $use_transliterate, string $fallback_char): string Convert given string to safe filename (and keep string case). @@ -356,7 +379,7 @@ also be supplied for language-specific transliteration. **Parameters:** - `string $str` - `string $separator [optional]

The string used to replace whitespace.

` -- `string $language [optional]

Language of the source string. +- `ASCII::* $language [optional]

Language of the source string. (default is 'en') | ASCII::*_LANGUAGE_CODE

` - `array $replacements [optional]

A map of replaceable strings.

` - `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " diff --git a/vendor/voku/portable-ascii/build/composer.json b/vendor/voku/portable-ascii/build/composer.json deleted file mode 100644 index 30f30c3..0000000 --- a/vendor/voku/portable-ascii/build/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require-dev": { - "voku/php-readme-helper": "~0.6" - } -} diff --git a/vendor/voku/portable-ascii/build/docs/base.md b/vendor/voku/portable-ascii/build/docs/base.md deleted file mode 100644 index e21e731..0000000 --- a/vendor/voku/portable-ascii/build/docs/base.md +++ /dev/null @@ -1,127 +0,0 @@ -[![Build Status](https://travis-ci.com/voku/portable-ascii.svg?branch=master)](https://travis-ci.com/voku/portable-ascii) -[![Build status](https://ci.appveyor.com/api/projects/status/gnejjnk7qplr7f5t/branch/master?svg=true)](https://ci.appveyor.com/project/voku/portable-ascii/branch/master) -[![Coverage Status](https://coveralls.io/repos/voku/portable-ascii/badge.svg?branch=master&service=github)](https://coveralls.io/github/voku/portable-ascii?branch=master) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/997c9bb10d1c4791967bdf2e42013e8e)](https://www.codacy.com/app/voku/portable-ascii) -[![Latest Stable Version](https://poser.pugx.org/voku/portable-ascii/v/stable)](https://packagist.org/packages/voku/portable-ascii) -[![Total Downloads](https://poser.pugx.org/voku/portable-ascii/downloads)](https://packagist.org/packages/voku/portable-ascii) -[![License](https://poser.pugx.org/voku/portable-ascii/license)](https://packagist.org/packages/voku/portable-ascii) -[![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/moelleken) -[![Donate to this project using Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/voku) - -# 🔡 Portable ASCII - -## Description - -It is written in PHP (PHP 7+) and can work without "mbstring", "iconv" or any other extra encoding php-extension on your server. - -The benefit of Portable ASCII is that it is easy to use, easy to bundle. - -The project based on ... -+ Sean M. Burke's work (https://metacpan.org/pod/Text::Unidecode) -+ Tomaz Solc's work (https://pypi.org/project/Unidecode/) -+ Portable UTF-8 work (https://github.com/voku/portable-utf8) -+ Daniel St. Jules's work (https://github.com/danielstjules/Stringy) -+ Johnny Broadway's work (https://github.com/jbroadway/urlify) -+ and many cherry-picks from "github"-gists and "Stack Overflow"-snippets ... - -## Index - -* [Alternative](#alternative) -* [Install](#install-portable-ascii-via-composer-require) -* [Why Portable ASCII?](#why-portable-ascii) -* [Requirements and Recommendations](#requirements-and-recommendations) -* [Usage](#usage) -* [Class methods](#class-methods) -* [Unit Test](#unit-test) -* [License and Copyright](#license-and-copyright) - -## Alternative - -If you like a more Object Oriented Way to edit strings, then you can take a look at [voku/Stringy](https://github.com/voku/Stringy), it's a fork of "danielstjules/Stringy" but it used the "Portable ASCII"-Class and some extra methods. - -```php -// Portable ASCII -use voku\helper\ASCII; -ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii' - -// voku/Stringy -use Stringy\Stringy as S; -$stringy = S::create('déjà σσς iıii'); -$stringy->toTransliterate(); // 'deja sss iiii' -``` - -## Install "Portable ASCII" via "composer require" -```shell -composer require voku/portable-ascii -``` - -## Why Portable ASCII?[]() -I need ASCII char handling in different classes and before I added this functions into "Portable UTF-8", -but this repo is more modular and portable, because it has no dependencies. - -## Requirements and Recommendations - -* No extensions are required to run this library. Portable ASCII only needs PCRE library that is available by default since PHP 4.2.0 and cannot be disabled since PHP 5.3.0. "\u" modifier support in PCRE for ASCII handling is not a must. -* PHP 7.0 is the minimum requirement -* PHP 8.0 is also supported - -## Usage - -Example: ASCII::to_ascii() -```php - echo ASCII::to_ascii('�Düsseldorf�', 'de'); - - // will output - // Duesseldorf - - echo ASCII::to_ascii('�Düsseldorf�', 'en'); - - // will output - // Dusseldorf -``` - -# Portable ASCII | API - -The API from the "ASCII"-Class is written as small static methods. - - -## Class methods - -%__functions_index__voku\helper\ASCII__% - -%__functions_list__voku\helper\ASCII__% - - -## Unit Test - -1) [Composer](https://getcomposer.org) is a prerequisite for running the tests. - -``` -composer install -``` - -2) The tests can be executed by running this command from the root directory: - -```bash -./vendor/bin/phpunit -``` - -### Support - -For support and donations please visit [Github](https://github.com/voku/portable-ascii/) | [Issues](https://github.com/voku/portable-ascii/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku). - -For status updates and release announcements please visit [Releases](https://github.com/voku/portable-ascii/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts). - -For professional support please contact [me](https://about.me/voku). - -### Thanks - -- Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc. -- Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm! -- Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there! -- Thanks to [StyleCI](https://styleci.io/) for the simple but powerful code style check. -- Thanks to [PHPStan](https://github.com/phpstan/phpstan) && [Psalm](https://github.com/vimeo/psalm) for really great Static analysis tools and for discover bugs in the code! - -### License and Copyright - -Released under the MIT License - see `LICENSE.txt` for details. diff --git a/vendor/voku/portable-ascii/build/generate_docs.php b/vendor/voku/portable-ascii/build/generate_docs.php deleted file mode 100644 index c86f1f1..0000000 --- a/vendor/voku/portable-ascii/build/generate_docs.php +++ /dev/null @@ -1,26 +0,0 @@ -templateMethod = <<↑ -%description% - -**Parameters:** -%params% - -**Return:** -%return% - --------- - -RAW; -$readmeText = ($readmeGenerator)->generate( - __DIR__ . '/../src/voku/helper/ASCII.php', - __DIR__ . '/docs/base.md' -); - -file_put_contents(__DIR__ . '/../README.md', $readmeText); diff --git a/vendor/voku/portable-ascii/build/generate_max_key_length.php b/vendor/voku/portable-ascii/build/generate_max_key_length.php deleted file mode 100644 index 743d389..0000000 --- a/vendor/voku/portable-ascii/build/generate_max_key_length.php +++ /dev/null @@ -1,20 +0,0 @@ - + * @phpstan-return array */ public static function getAllLanguages(): array { @@ -238,7 +254,7 @@ final class ASCII * * @return array * - * @psalm-return array> + * @phpstan-return array> */ public static function charsArray(bool $replace_extra_symbols = false): array { @@ -268,13 +284,11 @@ final class ASCII * @return array *

An array of replacements.

* - * @psalm-return array> + * @phpstan-return array> */ public static function charsArrayWithMultiLanguageValues(bool $replace_extra_symbols = false): array { - /** - * @var array - */ + /** @var array>> */ static $CHARS_ARRAY = []; $cacheKey = '' . $replace_extra_symbols; @@ -300,10 +314,7 @@ final class ASCII $CHARS_ARRAY[$cacheKey] = $return; - /** @noinspection PhpSillyAssignmentInspection - hack for phpstan */ - /** @var array> $return */ - $return = $return; - + /** @var array> $return - hack for phpstan */ return $return; } @@ -332,7 +343,8 @@ final class ASCII * @return array *

An array of replacements.

* - * @psalm-return array{orig: string[], replace: string[]}|array + * @phpstan-param ASCII::*_LANGUAGE_CODE $language + * @phpstan-return array{orig: string[], replace: string[]}|array */ public static function charsArrayWithOneLanguage( string $language = self::ENGLISH_LANGUAGE_CODE, @@ -342,9 +354,7 @@ final class ASCII $language = self::get_language($language); // init - /** - * @var array - */ + /** @var array|array{orig: string[], replace: string[]}>> */ static $CHARS_ARRAY = []; $cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray; @@ -428,16 +438,14 @@ final class ASCII * @return array *

An array of replacements.

* - * @psalm-return array{orig: string[], replace: string[]}|array + * @phpstan-return array{orig: string[], replace: string[]}|array */ public static function charsArrayWithSingleLanguageValues( bool $replace_extra_symbols = false, bool $asOrigReplaceArray = true ): array { // init - /** - * @var array - */ + /** @var array|array{orig: string[], replace: string[]}> */ static $CHARS_ARRAY = []; $cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray; @@ -463,6 +471,7 @@ final class ASCII } } + /** @phpstan-ignore-next-line - ... error? */ $CHARS_ARRAY[$cacheKey] = \array_merge([], ...$CHARS_ARRAY[$cacheKey]); if ($asOrigReplaceArray) { @@ -581,19 +590,13 @@ final class ASCII return ''; } - /** - * @var array{orig: string[], replace: string[]} - */ + /** @var array{orig: string[], replace: string[]} */ static $MSWORD_CACHE = ['orig' => [], 'replace' => []]; if (empty($MSWORD_CACHE['orig'])) { self::prepareAsciiMaps(); - /** - * @psalm-suppress PossiblyNullArrayAccess - we use the prepare* methods here, so we don't get NULL here - * - * @var array - */ + /** @var array */ $map = self::$ASCII_MAPS[self::EXTRA_MSWORD_CHARS_LANGUAGE_CODE] ?? []; $MSWORD_CACHE = [ @@ -616,7 +619,7 @@ final class ASCII * @param bool $keepNonBreakingSpace [optional]

Set to true, to keep non-breaking-spaces.

* @param bool $keepBidiUnicodeControls [optional]

Set to true, to keep non-printable (for the web) * bidirectional text chars.

- * @param bool $normalize_control_characters [optional]

Set to true, to convert LINE-, PARAGRAPH-SEPARATOR with "\n" and LINE TABULATION with "\t".

+ * @param bool $normalize_control_characters [optional]

Set to true, to convert e.g. LINE-, PARAGRAPH-SEPARATOR with "\n" and LINE TABULATION with "\t".

* * @psalm-pure * @@ -633,9 +636,7 @@ final class ASCII return ''; } - /** - * @var array> - */ + /** @var array> */ static $WHITESPACE_CACHE = []; $cacheKey = (int) $keepNonBreakingSpace; @@ -645,16 +646,14 @@ final class ASCII "\x0d\x0c", // 'END OF LINE' "\xe2\x80\xa8", // 'LINE SEPARATOR' "\xe2\x80\xa9", // 'PARAGRAPH SEPARATOR' - "\x0c", // 'FORM FEED' - "\x0d", // 'CARRIAGE RETURN' - "\x0b", // 'VERTICAL TAB' + "\x0c", // 'FORM FEED' // "\f" + "\x0b", // 'VERTICAL TAB' // "\v" ], [ "\n", "\n", "\n", "\n", - "\n", "\t", ], $str @@ -670,13 +669,11 @@ final class ASCII unset($WHITESPACE_CACHE[$cacheKey]["\xc2\xa0"]); } - $WHITESPACE_CACHE[$cacheKey] = \array_keys($WHITESPACE_CACHE[$cacheKey]); + $WHITESPACE_CACHE[$cacheKey] = array_keys($WHITESPACE_CACHE[$cacheKey]); } if (!$keepBidiUnicodeControls) { - /** - * @var array|null - */ + /** @var array|null */ static $BIDI_UNICODE_CONTROLS_CACHE = null; if ($BIDI_UNICODE_CONTROLS_CACHE === null) { @@ -737,6 +734,32 @@ final class ASCII return $str; } + /** + * WARNING: This method will return broken characters and is only for special cases. + * + * Convert two UTF-8 encoded string to a single-byte strings suitable for + * functions that need the same string length after the conversion. + * + * The function simply uses (and updates) a tailored dynamic encoding + * (in/out map parameter) where non-ascii characters are remapped to + * the range [128-255] in order of appearance. + * + * @param string $str1 + * @param string $str2 + * + * @return string[] + * + * @phpstan-return array{0: string, 1: string} + */ + public static function to_ascii_remap(string $str1, string $str2): array + { + $charMap = []; + $str1 = self::to_ascii_remap_intern($str1, $charMap); + $str2 = self::to_ascii_remap_intern($str2, $charMap); + + return [$str1, $str2]; + } + /** * Returns an ASCII version of the string. A set of non-ASCII characters are * replaced with their closest ASCII counterparts, and the rest are removed @@ -766,6 +789,8 @@ final class ASCII * * @return string *

A string that contains only ASCII characters.

+ * + * @phpstan-param ASCII::*_LANGUAGE_CODE $language */ public static function to_ascii( string $str, @@ -779,13 +804,12 @@ final class ASCII return ''; } + /** @phpstan-var ASCII::*_LANGUAGE_CODE - hack for phpstan */ $language = self::get_language($language); static $EXTRA_SYMBOLS_CACHE = null; - /** - * @var array> - */ + /** @var array> */ static $REPLACE_HELPER_CACHE = []; $cacheKey = $language . '-' . $replace_extra_symbols; @@ -807,7 +831,7 @@ final class ASCII $EXTRA_SYMBOLS_CACHE === null ) { $EXTRA_SYMBOLS_CACHE = []; - foreach (self::$ASCII_EXTRAS ?? [] as $extrasLanguageTmp => $extrasDataTmp) { + foreach (self::$ASCII_EXTRAS ?? [] as $extrasDataTmp) { foreach ($extrasDataTmp as $extrasDataKeyTmp => $extrasDataValueTmp) { $EXTRA_SYMBOLS_CACHE[$extrasDataKeyTmp] = $extrasDataKeyTmp; } @@ -933,7 +957,7 @@ final class ASCII } } - foreach ($matches[0] as $keyTmp => $char) { + foreach ($matches[0] as $char) { if ( !isset($charDone[$char]) && @@ -959,7 +983,6 @@ final class ASCII } if ($use_transliterate) { - /** @noinspection ArgumentEqualsDefaultValueInspection */ $str = self::to_transliterate($str, null, false); } @@ -1001,9 +1024,9 @@ final class ASCII $str = (string) \preg_replace( [ - '/[^' . $fallback_char_escaped . '.\\-a-zA-Z0-9\\s]/', // 1) remove un-needed chars - '/[\\s]+/u', // 2) convert spaces to $fallback_char - '/[' . $fallback_char_escaped . ']+/u', // 3) remove double $fallback_char's + '/[^' . $fallback_char_escaped . '.\\-a-zA-Z\d\\s]/', // 1) remove un-needed chars + '/\s+/u', // 2) convert spaces to $fallback_char + '/[' . $fallback_char_escaped . ']+/u', // 3) remove double $fallback_char's ], [ '', @@ -1038,6 +1061,8 @@ final class ASCII * * @return string *

A string that has been converted to an URL slug.

+ * + * @phpstan-param ASCII::*_LANGUAGE_CODE $language */ public static function to_slugify( string $str, @@ -1118,19 +1143,13 @@ final class ASCII $unknown = '?', bool $strict = false ): string { - /** - * @var array|null - */ + /** @var array|null */ static $UTF8_TO_TRANSLIT = null; - /** - * null|\Transliterator - */ + /** null|\Transliterator */ static $TRANSLITERATOR = null; - /** - * @var bool|null - */ + /** @var bool|null */ static $SUPPORT_INTL = null; if ($str === '') { @@ -1165,9 +1184,7 @@ final class ASCII ) { if (!isset($TRANSLITERATOR)) { // INFO: see "*-Latin" rules via "transliterator_list_ids()" - /** - * @var \Transliterator - */ + /** @var \Transliterator */ $TRANSLITERATOR = \transliterator_create('NFKC; [:Nonspacing Mark:] Remove; NFKC; Any-Latin; Latin-ASCII;'); } @@ -1316,6 +1333,50 @@ final class ASCII return $str_tmp; } + /** + * WARNING: This method will return broken characters and is only for special cases. + * + * Convert a UTF-8 encoded string to a single-byte string suitable for + * functions that need the same string length after the conversion. + * + * The function simply uses (and updates) a tailored dynamic encoding + * (in/out map parameter) where non-ascii characters are remapped to + * the range [128-255] in order of appearance. + * + * Thus, it supports up to 128 different multibyte code points max over + * the whole set of strings sharing this encoding. + * + * Source: https://github.com/KEINOS/mb_levenshtein + * + * @param string $str

UTF-8 string to be converted to extended ASCII.

+ * @param array $map

Internal-Map of code points to ASCII characters.

+ * + * @return string + *

Mapped borken string.

+ * + * @phpstan-param array $map + */ + private static function to_ascii_remap_intern(string $str, array &$map): string + { + // find all utf-8 characters + $matches = []; + if (!\preg_match_all('/[\xC0-\xF7][\x80-\xBF]+/', $str, $matches)) { + return $str; // plain ascii string + } + + // update the encoding map with the characters not already met + $mapCount = \count($map); + foreach ($matches[0] as $mbc) { + if (!isset($map[$mbc])) { + $map[$mbc] = \chr(128 + $mapCount); + ++$mapCount; + } + } + + // finally, remap non-ascii characters + return \strtr($str, $map); + } + /** * Get the language from a string. * diff --git a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php index d51f557..68c3f9d 100644 --- a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php +++ b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php @@ -1060,108 +1060,6 @@ return [ 'Я' => 'Ya', 'я' => 'ya', ], - // Russian - Passport (2013), ICAO - // -> https://en.m.wikipedia.org/wiki/Romanization_of_Russian#content-collapsible-block-1 - 'ru__passport_2013' => [ - 'А' => 'A', - 'а' => 'a', - 'Б' => 'B', - 'б' => 'b', - 'В' => 'V', - 'в' => 'v', - 'Г' => 'G', - 'г' => 'g', - 'Д' => 'D', - 'д' => 'd', - 'Е' => 'E', - 'е' => 'e', - 'Ё' => 'E', - 'ё' => 'e', - 'Ж' => 'Zh', - 'ж' => 'zh', - 'З' => 'Z', - 'з' => 'z', - 'И' => 'i', - 'и' => 'i', - 'Й' => 'i', - 'й' => 'i', - 'К' => 'K', - 'к' => 'k', - 'Л' => 'L', - 'л' => 'l', - 'М' => 'M', - 'м' => 'm', - 'Н' => 'N', - 'н' => 'n', - 'О' => 'O', - 'о' => 'o', - 'П' => 'P', - 'п' => 'p', - 'Р' => 'R', - 'р' => 'r', - 'С' => 'S', - 'с' => 's', - 'Т' => 'T', - 'т' => 't', - 'У' => 'U', - 'у' => 'u', - 'Ф' => 'F', - 'ф' => 'f', - 'Х' => 'Kh', - 'х' => 'kh', - 'Ц' => 'Ts', - 'ц' => 'ts', - 'Ч' => 'Ch', - 'ч' => 'ch', - 'ш' => 'sh', - 'Ш' => 'Sh', - 'Щ' => 'Shch', - 'щ' => 'shch', - 'Ъ' => 'Ie', - 'ъ' => 'ie', - 'Ы' => 'Y', - 'ы' => 'y', - 'Ь' => '', - 'ь' => '', - 'Э' => 'E', - 'э' => 'e', - 'Ю' => 'Iu', - 'ю' => 'iu', - 'Я' => 'Ia', - 'я' => 'ia', - 'І' => '', - 'і' => '', - 'Ѳ' => '', - 'ѳ' => '', - 'Ѣ' => '', - 'ѣ' => '', - 'Ѵ' => '', - 'ѵ' => '', - 'Є' => '', - 'є' => '', - 'Ѥ' => '', - 'ѥ' => '', - 'Ѕ' => '', - 'ѕ' => '', - 'Ꙋ' => '', - 'ꙋ' => '', - 'Ѡ' => '', - 'ѡ' => '', - 'Ѿ' => '', - 'ѿ' => '', - 'Ѫ' => '', - 'ѫ' => '', - 'Ѧ' => '', - 'ѧ' => '', - 'Ѭ' => '', - 'ѭ' => '', - 'Ѩ' => '', - 'ѩ' => '', - 'Ѯ' => '', - 'ѯ' => '', - 'Ѱ' => '', - 'ѱ' => '', - ], // Russian - GOST 7.79-2000(B) // -> https://en.m.wikipedia.org/wiki/Romanization_of_Russian#content-collapsible-block-1 'ru__gost_2000_b' => [ @@ -1264,16 +1162,135 @@ return [ 'Ѱ' => '', 'ѱ' => '', ], + // Russian - Passport (2013), ICAO + // -> https://en.m.wikipedia.org/wiki/Romanization_of_Russian#content-collapsible-block-1 + 'ru__passport_2013' => [ + 'А' => 'A', + 'а' => 'a', + 'Б' => 'B', + 'б' => 'b', + 'В' => 'V', + 'в' => 'v', + 'Г' => 'G', + 'г' => 'g', + 'Д' => 'D', + 'д' => 'd', + 'Е' => 'E', + 'е' => 'e', + 'Ё' => 'E', + 'ё' => 'e', + 'Ж' => 'Zh', + 'ж' => 'zh', + 'З' => 'Z', + 'з' => 'z', + 'И' => 'i', + 'и' => 'i', + 'Й' => 'i', + 'й' => 'i', + 'К' => 'K', + 'к' => 'k', + 'Л' => 'L', + 'л' => 'l', + 'М' => 'M', + 'м' => 'm', + 'Н' => 'N', + 'н' => 'n', + 'О' => 'O', + 'о' => 'o', + 'П' => 'P', + 'п' => 'p', + 'Р' => 'R', + 'р' => 'r', + 'С' => 'S', + 'с' => 's', + 'Т' => 'T', + 'т' => 't', + 'У' => 'U', + 'у' => 'u', + 'Ф' => 'F', + 'ф' => 'f', + 'Х' => 'Kh', + 'х' => 'kh', + 'Ц' => 'Ts', + 'ц' => 'ts', + 'Ч' => 'Ch', + 'ч' => 'ch', + 'ш' => 'sh', + 'Ш' => 'Sh', + 'Щ' => 'Shch', + 'щ' => 'shch', + 'Ъ' => 'Ie', + 'ъ' => 'ie', + 'Ы' => 'Y', + 'ы' => 'y', + 'Ь' => '', + 'ь' => '', + 'Э' => 'E', + 'э' => 'e', + 'Ю' => 'Iu', + 'ю' => 'iu', + 'Я' => 'Ia', + 'я' => 'ia', + 'І' => '', + 'і' => '', + 'Ѳ' => '', + 'ѳ' => '', + 'Ѣ' => '', + 'ѣ' => '', + 'Ѵ' => '', + 'ѵ' => '', + 'Є' => '', + 'є' => '', + 'Ѥ' => '', + 'ѥ' => '', + 'Ѕ' => '', + 'ѕ' => '', + 'Ꙋ' => '', + 'ꙋ' => '', + 'Ѡ' => '', + 'ѡ' => '', + 'Ѿ' => '', + 'ѿ' => '', + 'Ѫ' => '', + 'ѫ' => '', + 'Ѧ' => '', + 'ѧ' => '', + 'Ѭ' => '', + 'ѭ' => '', + 'Ѩ' => '', + 'ѩ' => '', + 'Ѯ' => '', + 'ѯ' => '', + 'Ѱ' => '', + 'ѱ' => '', + ], // 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', - 'Ґ' => 'G', - 'ґ' => 'g', + 'Й' => 'Y', + 'й' => 'y', + 'Х' => 'Kh', + 'х' => 'kh', + 'Ц' => 'Ts', + 'ц' => 'ts', + 'Ч' => 'Ch', + 'ч' => 'ch', + 'Ш' => 'Sh', + 'ш' => 'sh', + 'Щ' => 'Shch', + 'щ' => 'shch', ], // Kazakh 'kk' => [ @@ -1602,10 +1619,10 @@ return [ 'fa' => [ 'ا' => 'a', 'ب' => 'b', - 'پ' => 'b', + 'پ' => 'p', 'ت' => 't', 'ث' => 's', - 'ج' => 'g', + 'ج' => 'j', 'چ' => 'ch', 'ح' => 'h', 'خ' => 'kh', @@ -2555,6 +2572,8 @@ return [ 'j̄' => 'j', 'J̃' => 'J', 'j̃' => 'j', + 'Й' => 'i', + 'й' => 'i', 'ĸ' => 'k', 'Ĺ' => 'L', 'Ľ' => 'L', @@ -2810,6 +2829,8 @@ return [ 'ȳ' => 'y', 'Ỹ' => 'Y', 'ỹ' => 'y', + 'Щ' => 'Shh', + 'щ' => 'shh', 'Ź' => 'Z', 'ź' => 'z', 'Z̀' => 'Z', diff --git a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php index 426d84a..afe31ae 100644 --- a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php +++ b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php @@ -199,8 +199,8 @@ return [ '&' => ' i ', '+' => ' plus ', ], - // Russian - Passport (2013), ICAO - 'ru__passport_2013' => [ + // Russian - GOST 7.79-2000(B) + 'ru__gost_2000_b' => [ '=' => ' ravnyj ', '%' => ' procent ', '∑' => ' summa ', @@ -210,8 +210,8 @@ return [ '&' => ' i ', '+' => ' plus ', ], - // Russian - GOST 7.79-2000(B) - 'ru__gost_2000_b' => [ + // Russian - Passport (2013), ICAO + 'ru__passport_2013' => [ '=' => ' ravnyj ', '%' => ' procent ', '∑' => ' summa ', diff --git a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php index a6345f2..da81ae2 100644 --- a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php +++ b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php @@ -31,8 +31,8 @@ return [ 'fi' => 1, 'ka' => 1, 'ru' => 1, - 'ru__passport_2013' => 1, 'ru__gost_2000_b' => 1, + 'ru__passport_2013' => 1, 'uk' => 1, 'kk' => 1, 'cs' => 1,