🔧 Update npm + login page

This commit is contained in:
TiclemFR
2024-01-25 14:00:48 +01:00
parent 468c2cd0e6
commit 336f2bae93
128 changed files with 3078 additions and 2368 deletions

View File

@@ -9,6 +9,7 @@ return array(
'App\\Console\\Kernel' => $baseDir . '/app/Console/Kernel.php',
'App\\Exceptions\\Handler' => $baseDir . '/app/Exceptions/Handler.php',
'App\\Http\\Controllers\\Controller' => $baseDir . '/app/Http/Controllers/Controller.php',
'App\\Http\\Controllers\\UserController' => $baseDir . '/app/Http/Controllers/UserController.php',
'App\\Http\\Kernel' => $baseDir . '/app/Http/Kernel.php',
'App\\Http\\Middleware\\Authenticate' => $baseDir . '/app/Http/Middleware/Authenticate.php',
'App\\Http\\Middleware\\EncryptCookies' => $baseDir . '/app/Http/Middleware/EncryptCookies.php',
@@ -1896,6 +1897,7 @@ return array(
'Illuminate\\Queue\\Events\\JobProcessed' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php',
'Illuminate\\Queue\\Events\\JobProcessing' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php',
'Illuminate\\Queue\\Events\\JobQueued' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobQueued.php',
'Illuminate\\Queue\\Events\\JobQueueing' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobQueueing.php',
'Illuminate\\Queue\\Events\\JobReleasedAfterException' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobReleasedAfterException.php',
'Illuminate\\Queue\\Events\\JobRetryRequested' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobRetryRequested.php',
'Illuminate\\Queue\\Events\\JobTimedOut' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobTimedOut.php',

View File

@@ -538,6 +538,7 @@ class ComposerStaticInitc055060de071b17f9341a87ba18bf477
'App\\Console\\Kernel' => __DIR__ . '/../..' . '/app/Console/Kernel.php',
'App\\Exceptions\\Handler' => __DIR__ . '/../..' . '/app/Exceptions/Handler.php',
'App\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/app/Http/Controllers/Controller.php',
'App\\Http\\Controllers\\UserController' => __DIR__ . '/../..' . '/app/Http/Controllers/UserController.php',
'App\\Http\\Kernel' => __DIR__ . '/../..' . '/app/Http/Kernel.php',
'App\\Http\\Middleware\\Authenticate' => __DIR__ . '/../..' . '/app/Http/Middleware/Authenticate.php',
'App\\Http\\Middleware\\EncryptCookies' => __DIR__ . '/../..' . '/app/Http/Middleware/EncryptCookies.php',
@@ -2425,6 +2426,7 @@ class ComposerStaticInitc055060de071b17f9341a87ba18bf477
'Illuminate\\Queue\\Events\\JobProcessed' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php',
'Illuminate\\Queue\\Events\\JobProcessing' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php',
'Illuminate\\Queue\\Events\\JobQueued' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobQueued.php',
'Illuminate\\Queue\\Events\\JobQueueing' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobQueueing.php',
'Illuminate\\Queue\\Events\\JobReleasedAfterException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobReleasedAfterException.php',
'Illuminate\\Queue\\Events\\JobRetryRequested' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobRetryRequested.php',
'Illuminate\\Queue\\Events\\JobTimedOut' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobTimedOut.php',

View File

@@ -1349,17 +1349,17 @@
},
{
"name": "laravel/framework",
"version": "v10.41.0",
"version_normalized": "10.41.0.0",
"version": "v10.42.0",
"version_normalized": "10.42.0.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "da31969bd35e6ee0bbcd9e876f88952dc754b012"
"reference": "fef1aff874a6749c44f8e142e5764eab8cb96890"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/da31969bd35e6ee0bbcd9e876f88952dc754b012",
"reference": "da31969bd35e6ee0bbcd9e876f88952dc754b012",
"url": "https://api.github.com/repos/laravel/framework/zipball/fef1aff874a6749c44f8e142e5764eab8cb96890",
"reference": "fef1aff874a6749c44f8e142e5764eab8cb96890",
"shasum": ""
},
"require": {
@@ -1508,7 +1508,7 @@
"symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.2).",
"symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)."
},
"time": "2024-01-16T15:23:58+00:00",
"time": "2024-01-23T15:07:56+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -1557,17 +1557,17 @@
},
{
"name": "laravel/pint",
"version": "v1.13.9",
"version_normalized": "1.13.9.0",
"version": "v1.13.10",
"version_normalized": "1.13.10.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
"reference": "e3e269cc5d874c8efd2dc7962b1c7ff2585fe525"
"reference": "e2b5060885694ca30ac008c05dc9d47f10ed1abf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/e3e269cc5d874c8efd2dc7962b1c7ff2585fe525",
"reference": "e3e269cc5d874c8efd2dc7962b1c7ff2585fe525",
"url": "https://api.github.com/repos/laravel/pint/zipball/e2b5060885694ca30ac008c05dc9d47f10ed1abf",
"reference": "e2b5060885694ca30ac008c05dc9d47f10ed1abf",
"shasum": ""
},
"require": {
@@ -1578,15 +1578,15 @@
"php": "^8.1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.47.0",
"illuminate/view": "^10.40.0",
"friendsofphp/php-cs-fixer": "^3.47.1",
"illuminate/view": "^10.41.0",
"larastan/larastan": "^2.8.1",
"laravel-zero/framework": "^10.3.0",
"mockery/mockery": "^1.6.7",
"nunomaduro/termwind": "^1.15.1",
"pestphp/pest": "^2.31.0"
},
"time": "2024-01-16T17:39:29+00:00",
"time": "2024-01-22T09:04:15+00:00",
"bin": [
"builds/pint"
],
@@ -2616,17 +2616,17 @@
},
{
"name": "nesbot/carbon",
"version": "2.72.1",
"version_normalized": "2.72.1.0",
"version": "2.72.2",
"version_normalized": "2.72.2.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78"
"reference": "3e7edc41b58d65509baeb0d4a14c8fa41d627130"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2b3b3db0a2d0556a177392ff1a3bf5608fa09f78",
"reference": "2b3b3db0a2d0556a177392ff1a3bf5608fa09f78",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/3e7edc41b58d65509baeb0d4a14c8fa41d627130",
"reference": "3e7edc41b58d65509baeb0d4a14c8fa41d627130",
"shasum": ""
},
"require": {
@@ -2654,7 +2654,7 @@
"phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20",
"squizlabs/php_codesniffer": "^3.4"
},
"time": "2023-12-08T23:47:49+00:00",
"time": "2024-01-19T00:21:53+00:00",
"bin": [
"bin/carbon"
],
@@ -2726,33 +2726,33 @@
},
{
"name": "nette/schema",
"version": "v1.2.5",
"version_normalized": "1.2.5.0",
"version": "v1.3.0",
"version_normalized": "1.3.0.0",
"source": {
"type": "git",
"url": "https://github.com/nette/schema.git",
"reference": "0462f0166e823aad657c9224d0f849ecac1ba10a"
"reference": "a6d3a6d1f545f01ef38e60f375d1cf1f4de98188"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/schema/zipball/0462f0166e823aad657c9224d0f849ecac1ba10a",
"reference": "0462f0166e823aad657c9224d0f849ecac1ba10a",
"url": "https://api.github.com/repos/nette/schema/zipball/a6d3a6d1f545f01ef38e60f375d1cf1f4de98188",
"reference": "a6d3a6d1f545f01ef38e60f375d1cf1f4de98188",
"shasum": ""
},
"require": {
"nette/utils": "^2.5.7 || ^3.1.5 || ^4.0",
"php": "7.1 - 8.3"
"nette/utils": "^4.0",
"php": "8.1 - 8.3"
},
"require-dev": {
"nette/tester": "^2.3 || ^2.4",
"nette/tester": "^2.4",
"phpstan/phpstan-nette": "^1.0",
"tracy/tracy": "^2.7"
"tracy/tracy": "^2.8"
},
"time": "2023-10-05T20:37:59+00:00",
"time": "2023-12-11T11:54:22+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
"dev-master": "1.3-dev"
}
},
"installation-source": "dist",
@@ -2785,7 +2785,7 @@
],
"support": {
"issues": "https://github.com/nette/schema/issues",
"source": "https://github.com/nette/schema/tree/v1.2.5"
"source": "https://github.com/nette/schema/tree/v1.3.0"
},
"install-path": "../nette/schema"
},
@@ -3660,17 +3660,17 @@
},
{
"name": "phpunit/phpunit",
"version": "10.5.8",
"version_normalized": "10.5.8.0",
"version": "10.5.9",
"version_normalized": "10.5.9.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "08f4fa74d5fbfff1ef22abffee47aaedcaea227e"
"reference": "0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/08f4fa74d5fbfff1ef22abffee47aaedcaea227e",
"reference": "08f4fa74d5fbfff1ef22abffee47aaedcaea227e",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe",
"reference": "0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe",
"shasum": ""
},
"require": {
@@ -3704,7 +3704,7 @@
"suggest": {
"ext-soap": "To be able to generate mocks based on WSDL files"
},
"time": "2024-01-19T07:07:27+00:00",
"time": "2024-01-22T14:35:40+00:00",
"bin": [
"phpunit"
],
@@ -3744,7 +3744,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.8"
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.9"
},
"funding": [
{

View File

@@ -3,7 +3,7 @@
'name' => 'laravel/laravel',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '031f7071e6d723126171aaae79112d82773417fe',
'reference' => '468c2cd0e65223b904a5a1c2c15921b684d8b85b',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -169,199 +169,199 @@
'illuminate/auth' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/broadcasting' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/bus' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/cache' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/collections' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/conditionable' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/config' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/console' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/container' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/contracts' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/cookie' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/database' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/encryption' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/events' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/filesystem' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/hashing' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/http' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/log' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/macroable' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/mail' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/notifications' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/pagination' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/pipeline' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/process' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/queue' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/redis' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/routing' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/session' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/support' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/testing' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/translation' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/validation' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'illuminate/view' => array(
'dev_requirement' => false,
'replaced' => array(
0 => 'v10.41.0',
0 => 'v10.42.0',
),
),
'inertiajs/inertia-laravel' => array(
@@ -380,9 +380,9 @@
),
),
'laravel/framework' => array(
'pretty_version' => 'v10.41.0',
'version' => '10.41.0.0',
'reference' => 'da31969bd35e6ee0bbcd9e876f88952dc754b012',
'pretty_version' => 'v10.42.0',
'version' => '10.42.0.0',
'reference' => 'fef1aff874a6749c44f8e142e5764eab8cb96890',
'type' => 'library',
'install_path' => __DIR__ . '/../laravel/framework',
'aliases' => array(),
@@ -391,16 +391,16 @@
'laravel/laravel' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '031f7071e6d723126171aaae79112d82773417fe',
'reference' => '468c2cd0e65223b904a5a1c2c15921b684d8b85b',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'laravel/pint' => array(
'pretty_version' => 'v1.13.9',
'version' => '1.13.9.0',
'reference' => 'e3e269cc5d874c8efd2dc7962b1c7ff2585fe525',
'pretty_version' => 'v1.13.10',
'version' => '1.13.10.0',
'reference' => 'e2b5060885694ca30ac008c05dc9d47f10ed1abf',
'type' => 'project',
'install_path' => __DIR__ . '/../laravel/pint',
'aliases' => array(),
@@ -530,18 +530,18 @@
'dev_requirement' => true,
),
'nesbot/carbon' => array(
'pretty_version' => '2.72.1',
'version' => '2.72.1.0',
'reference' => '2b3b3db0a2d0556a177392ff1a3bf5608fa09f78',
'pretty_version' => '2.72.2',
'version' => '2.72.2.0',
'reference' => '3e7edc41b58d65509baeb0d4a14c8fa41d627130',
'type' => 'library',
'install_path' => __DIR__ . '/../nesbot/carbon',
'aliases' => array(),
'dev_requirement' => false,
),
'nette/schema' => array(
'pretty_version' => 'v1.2.5',
'version' => '1.2.5.0',
'reference' => '0462f0166e823aad657c9224d0f849ecac1ba10a',
'pretty_version' => 'v1.3.0',
'version' => '1.3.0.0',
'reference' => 'a6d3a6d1f545f01ef38e60f375d1cf1f4de98188',
'type' => 'library',
'install_path' => __DIR__ . '/../nette/schema',
'aliases' => array(),
@@ -656,9 +656,9 @@
'dev_requirement' => true,
),
'phpunit/phpunit' => array(
'pretty_version' => '10.5.8',
'version' => '10.5.8.0',
'reference' => '08f4fa74d5fbfff1ef22abffee47aaedcaea227e',
'pretty_version' => '10.5.9',
'version' => '10.5.9.0',
'reference' => '0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe',
'type' => 'library',
'install_path' => __DIR__ . '/../phpunit/phpunit',
'aliases' => array(),

View File

@@ -1,6 +1,31 @@
# Release Notes for 10.x
## [Unreleased](https://github.com/laravel/framework/compare/v10.40.0...10.x)
## [Unreleased](https://github.com/laravel/framework/compare/v10.41.0...10.x)
## [v10.41.0](https://github.com/laravel/framework/compare/v10.40.0...v10.41.0) - 2024-01-16
* [10.x] Add a `threshold` parameter to the `Number::spell` helper by [@caendesilva](https://github.com/caendesilva) in https://github.com/laravel/framework/pull/49610
* Revert "[10.x] Make ComponentAttributeBag Arrayable" by [@luanfreitasdev](https://github.com/luanfreitasdev) in https://github.com/laravel/framework/pull/49623
* [10.x] Fix return value and docblock by [@dwightwatson](https://github.com/dwightwatson) in https://github.com/laravel/framework/pull/49627
* [10.x] Add an option to specify the default path to the models directory for `php artisan model:prune` by [@dbhynds](https://github.com/dbhynds) in https://github.com/laravel/framework/pull/49617
* [10.x] Allow job chains to be conditionally dispatched by [@fjarrett](https://github.com/fjarrett) in https://github.com/laravel/framework/pull/49624
* [10.x] Add test for existing empty test by [@lioneaglesolutions](https://github.com/lioneaglesolutions) in https://github.com/laravel/framework/pull/49632
* [10.x] Add additional context to Mailable assertion messages by [@lioneaglesolutions](https://github.com/lioneaglesolutions) in https://github.com/laravel/framework/pull/49631
* [10.x] Allow job batches to be conditionally dispatched by [@fjarrett](https://github.com/fjarrett) in https://github.com/laravel/framework/pull/49639
* [10.x] Revert parameter name change by [@timacdonald](https://github.com/timacdonald) in https://github.com/laravel/framework/pull/49659
* [10.x] Printing Name of The Method that Calls `ensureIntlExtensionIsInstalled` in `Number` class. by [@devajmeireles](https://github.com/devajmeireles) in https://github.com/laravel/framework/pull/49660
* [10.x] Update pagination tailwind.blade.php by [@anasmorahhib](https://github.com/anasmorahhib) in https://github.com/laravel/framework/pull/49665
* [10.x] feat: add base argument to Stringable->toInteger() by [@adamczykpiotr](https://github.com/adamczykpiotr) in https://github.com/laravel/framework/pull/49670
* [10.x]: Remove unused class ShouldBeUnique when make a job by [@Kenini1805](https://github.com/Kenini1805) in https://github.com/laravel/framework/pull/49669
* [10.x] Add tests for Eloquent methods by [@milwad-dev](https://github.com/milwad-dev) in https://github.com/laravel/framework/pull/49673
* Implement draft workflow by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/49683
* [10.x] Fixing Types, Word and Returns of `Number`class. by [@devajmeireles](https://github.com/devajmeireles) in https://github.com/laravel/framework/pull/49681
* [10.x] Test Improvements by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/49679
* [10.x] Officially support floats in trans_choice and Translator::choice by [@philbates35](https://github.com/philbates35) in https://github.com/laravel/framework/pull/49693
* [10.x] Use static function by [@michaelnabil230](https://github.com/michaelnabil230) in https://github.com/laravel/framework/pull/49696
* [10.x] Revert "[10.x] Improve numeric comparison for custom casts" by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/49702
* [10.x] Add exit code to queue:clear, and queue:forget commands by [@bytestream](https://github.com/bytestream) in https://github.com/laravel/framework/pull/49707
* [10.x] Allow StreamInterface as raw HTTP Client body by [@janolivermr](https://github.com/janolivermr) in https://github.com/laravel/framework/pull/49705
## [v10.40.0](https://github.com/laravel/framework/compare/v10.39.0...v10.40.0) - 2024-01-09

View File

@@ -1740,6 +1740,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
*/
protected function now()
{
return Carbon::now()->timestamp;
return class_exists(Carbon::class)
? Carbon::now()->timestamp
: time();
}
}

View File

@@ -546,7 +546,7 @@ class Filesystem
{
$hash = @md5_file($firstFile);
return $hash && $hash === @md5_file($secondFile);
return $hash && hash_equals($hash, (string) @md5_file($secondFile));
}
/**

View File

@@ -40,7 +40,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
*
* @var string
*/
const VERSION = '10.41.0';
const VERSION = '10.42.0';
/**
* The base path for the Laravel installation.

View File

@@ -36,6 +36,13 @@ class Factory
*/
protected $globalMiddleware = [];
/**
* The options to apply to every request.
*
* @var array
*/
protected $globalOptions = [];
/**
* The stub callables that will handle requests.
*
@@ -123,6 +130,19 @@ class Factory
return $this;
}
/**
* Set the options to apply to every request.
*
* @param array $options
* @return $this
*/
public function globalOptions($options)
{
$this->globalOptions = $options;
return $this;
}
/**
* Create a new response instance for use during stubbing.
*
@@ -400,7 +420,7 @@ class Factory
*/
protected function newPendingRequest()
{
return new PendingRequest($this, $this->globalMiddleware);
return (new PendingRequest($this, $this->globalMiddleware))->withOptions($this->globalOptions);
}
/**

View File

@@ -2,6 +2,7 @@
namespace Illuminate\Mail\Transport;
use Illuminate\Support\Str;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\SentMessage;
@@ -33,17 +34,48 @@ class LogTransport implements TransportInterface
*/
public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage
{
$string = $message->toString();
$string = Str::of($message->toString());
if (str_contains($string, 'Content-Transfer-Encoding: quoted-printable')) {
$string = quoted_printable_decode($string);
if ($string->contains('Content-Type: multipart/')) {
$boundary = $string
->after('boundary=')
->before("\r\n")
->prepend('--')
->append("\r\n");
$string = $string
->explode($boundary)
->map($this->decodeQuotedPrintableContent(...))
->implode($boundary);
} elseif ($string->contains('Content-Transfer-Encoding: quoted-printable')) {
$string = $this->decodeQuotedPrintableContent($string);
}
$this->logger->debug($string);
$this->logger->debug((string) $string);
return new SentMessage($message, $envelope ?? Envelope::create($message));
}
/**
* Decode the given quoted printable content.
*
* @param string $part
* @return string
*/
protected function decodeQuotedPrintableContent(string $part)
{
if (! str_contains($part, 'Content-Transfer-Encoding: quoted-printable')) {
return $part;
}
[$headers, $content] = explode("\r\n\r\n", $part, 2);
return implode("\r\n\r\n", [
$headers,
quoted_printable_decode($content),
]);
}
/**
* Get the logger for the LogTransport instance.
*

View File

@@ -0,0 +1,58 @@
<?php
namespace Illuminate\Queue\Events;
use RuntimeException;
class JobQueueing
{
/**
* The connection name.
*
* @var string
*/
public $connectionName;
/**
* The job instance.
*
* @var \Closure|string|object
*/
public $job;
/**
* The job payload.
*
* @var string|null
*/
public $payload;
/**
* Create a new event instance.
*
* @param string $connectionName
* @param \Closure|string|object $job
* @param string|null $payload
* @return void
*/
public function __construct($connectionName, $job, $payload = null)
{
$this->connectionName = $connectionName;
$this->job = $job;
$this->payload = $payload;
}
/**
* Get the decoded job payload.
*
* @return array
*/
public function payload()
{
if ($this->payload === null) {
throw new RuntimeException('The job payload was not provided when the event was dispatched.');
}
return json_decode($this->payload, true, flags: JSON_THROW_ON_ERROR);
}
}

View File

@@ -9,6 +9,7 @@ use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
use Illuminate\Contracts\Queue\ShouldQueueAfterCommit;
use Illuminate\Queue\Events\JobQueued;
use Illuminate\Queue\Events\JobQueueing;
use Illuminate\Support\Arr;
use Illuminate\Support\InteractsWithTime;
use Illuminate\Support\Str;
@@ -327,6 +328,8 @@ abstract class Queue
$this->container->bound('db.transactions')) {
return $this->container->make('db.transactions')->addCallback(
function () use ($payload, $queue, $delay, $callback, $job) {
$this->raiseJobQueueingEvent($job, $payload);
return tap($callback($payload, $queue, $delay), function ($jobId) use ($job, $payload) {
$this->raiseJobQueuedEvent($jobId, $job, $payload);
});
@@ -334,6 +337,8 @@ abstract class Queue
);
}
$this->raiseJobQueueingEvent($job, $payload);
return tap($callback($payload, $queue, $delay), function ($jobId) use ($job, $payload) {
$this->raiseJobQueuedEvent($jobId, $job, $payload);
});
@@ -362,6 +367,20 @@ abstract class Queue
return false;
}
/**
* Raise the job queueing event.
*
* @param \Closure|string|object $job
* @param string $payload
* @return void
*/
protected function raiseJobQueueingEvent($job, $payload)
{
if ($this->container->bound('events')) {
$this->container['events']->dispatch(new JobQueueing($this->connectionName, $job, $payload));
}
}
/**
* Raise the job queued event.
*

View File

@@ -29,9 +29,11 @@ class Carbon extends BaseCarbon
*/
public static function createFromId($id)
{
return Ulid::isValid($id)
? static::createFromInterface(Ulid::fromString($id)->getDateTime())
: static::createFromInterface(Uuid::fromString($id)->getDateTime());
if (is_string($id)) {
$id = Ulid::isValid($id) ? Ulid::fromString($id) : Uuid::fromString($id);
}
return static::createFromInterface($id->getDateTime());
}
/**

View File

@@ -33,10 +33,10 @@ class DefaultProviders
\Illuminate\Mail\MailServiceProvider::class,
\Illuminate\Notifications\NotificationServiceProvider::class,
\Illuminate\Pagination\PaginationServiceProvider::class,
\Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
\Illuminate\Pipeline\PipelineServiceProvider::class,
\Illuminate\Queue\QueueServiceProvider::class,
\Illuminate\Redis\RedisServiceProvider::class,
\Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
\Illuminate\Session\SessionServiceProvider::class,
\Illuminate\Translation\TranslationServiceProvider::class,
\Illuminate\Validation\ValidationServiceProvider::class,

View File

@@ -8,6 +8,7 @@ use Illuminate\Http\Client\Factory;
* @method static \Illuminate\Http\Client\Factory globalMiddleware(callable $middleware)
* @method static \Illuminate\Http\Client\Factory globalRequestMiddleware(callable $middleware)
* @method static \Illuminate\Http\Client\Factory globalResponseMiddleware(callable $middleware)
* @method static \Illuminate\Http\Client\Factory globalOptions(array $options)
* @method static \GuzzleHttp\Promise\PromiseInterface response(array|string|null $body = null, int $status = 200, array $headers = [])
* @method static \Illuminate\Http\Client\ResponseSequence sequence(array $responses = [])
* @method static \Illuminate\Http\Client\Factory allowStrayRequests()

View File

@@ -54,6 +54,23 @@ class Notification extends Facade
});
}
/**
* Begin sending a notification to an anonymous notifiable on the given channels.
*
* @param array $channels
* @return \Illuminate\Notifications\AnonymousNotifiable
*/
public static function routes(array $channels)
{
$notifiable = new AnonymousNotifiable;
foreach ($channels as $channel => $route) {
$notifiable->route($channel, $route);
}
return $notifiable;
}
/**
* Begin sending a notification to an anonymous notifiable.
*

View File

@@ -390,6 +390,27 @@ class Str
return $before.$value.($after ??= $before);
}
/**
* Unwrap the string with the given strings.
*
* @param string $value
* @param string $before
* @param string|null $after
* @return string
*/
public static function unwrap($value, $before, $after = null)
{
if (static::startsWith($value, $before)) {
$value = static::substr($value, static::length($before));
}
if (static::endsWith($value, $after ??= $before)) {
$value = static::substr($value, 0, -static::length($after));
}
return $value;
}
/**
* Determine if a given string matches a given pattern.
*

View File

@@ -1224,6 +1224,18 @@ class Stringable implements JsonSerializable, ArrayAccess
return new static(Str::wrap($this->value, $before, $after));
}
/**
* Unwrap the string with the given strings.
*
* @param string $before
* @param string|null $after
* @return static
*/
public function unwrap($before, $after = null)
{
return new static(Str::unwrap($this->value, $before, $after));
}
/**
* Convert the string into a `HtmlString` instance.
*

View File

@@ -56,7 +56,7 @@ class Rule
*/
public static function unless($condition, $rules, $defaultRules = [])
{
return new ConditionalRules(! $condition, $rules, $defaultRules);
return new ConditionalRules($condition, $defaultRules, $rules);
}
/**

View File

@@ -37,6 +37,13 @@ class Password implements Rule, DataAwareRule, ValidatorAwareRule
*/
protected $min = 8;
/**
* The maximum size of the password.
*
* @var int
*/
protected $max;
/**
* If the password requires at least one uppercase and one lowercase letter.
*
@@ -193,7 +200,7 @@ class Password implements Rule, DataAwareRule, ValidatorAwareRule
}
/**
* Sets the minimum size of the password.
* Set the minimum size of the password.
*
* @param int $size
* @return $this
@@ -203,6 +210,19 @@ class Password implements Rule, DataAwareRule, ValidatorAwareRule
return new static($size);
}
/**
* Set the maximum size of the password.
*
* @param int $size
* @return $this
*/
public function max($size)
{
$this->max = $size;
return $this;
}
/**
* Ensures the password has not been compromised in data leaks.
*
@@ -300,6 +320,10 @@ class Password implements Rule, DataAwareRule, ValidatorAwareRule
return;
}
if ($this->max && mb_strlen($value) > $this->max) {
$validator->addFailure($attribute, 'max.string');
}
if ($this->mixedCase && ! preg_match('/(\p{Ll}+.*\p{Lu})|(\p{Lu}+.*\p{Ll})/u', $value)) {
$validator->addFailure($attribute, 'password.mixed');
}

Binary file not shown.

View File

@@ -23,8 +23,8 @@
"ext-xml": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.47.0",
"illuminate/view": "^10.40.0",
"friendsofphp/php-cs-fixer": "^3.47.1",
"illuminate/view": "^10.41.0",
"larastan/larastan": "^2.8.1",
"laravel-zero/framework": "^10.3.0",
"mockery/mockery": "^1.6.7",

View File

@@ -120,33 +120,41 @@ This project exists thanks to all the people who contribute.
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
<a href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme" target="_blank"><img src="https://carbon.nesbot.com/tidelift-brand.png" width="256" height="64"></a><!-- <open-collective-sponsors> -->
<a title="Онлайн казино 777 Україна" href="https://777.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7e572d50-1ce8-4d69-ae12-86cc80371373/ok-ua-777.png" width="64" height="64"></a>
<a title="#1 Guide To Online Gambling In Canada" href="https://casinohex.org/canada/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="CasinoHex Canada" src="https://opencollective-production.s3.us-west-1.amazonaws.com/79fdbcc0-a997-11eb-abbc-25e48b63c6dc.jpg" width="85" height="64"></a>
<a title="Casino-portugal.pt" href="https://casino-portugal.pt/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Casino-portugal.pt" src="https://logo.clearbit.com/casino-portugal.pt" width="64" height="64"></a>
<a title="Slots City® ➢ Лучшее лицензионно казино онлайн и оффлайн на гривны в Украине. 【 Более1500 игровых автоматов и слотов】✅ Официально и Безопасно" href="https://slotscity.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Slots City" src="https://opencollective-production.s3.us-west-1.amazonaws.com/d7e298c0-7abe-11ed-8553-230872f5e54d.png" width="90" height="64"></a>
<a title="Znajdź najlepsze zakłady bukmacherskie w Polsce w 2023 roku. Probukmacher.pl to Twoje kompendium wiedzy na temat bukmacherów!" href="https://www.probukmacher.pl?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Probukmacher" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/caf50271-4560-4ffe-a434-ea15239168db/Screenshot_1.png" width="89" height="64"></a>
<a title="Gives a fun for our users" href="https://slotoking.ua/games/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Игровые автоматы" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/94601d07-3205-4c60-9c2d-9b8194dbefb7/skg-blue.png" width="64" height="64"></a>
<a title="Онлайн казино 777 Україна" href="https://777.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7e572d50-1ce8-4d69-ae12-86cc80371373/ok-ua-777.png" width="64" height="64"></a>
<a title="Casino-portugal.pt" href="https://casino-portugal.pt/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Casino-portugal.pt" src="https://logo.clearbit.com/casino-portugal.pt" width="64" height="64"></a>
<a title="Slots City® ➢ Лучшее лицензионно казино онлайн и оффлайн на гривны в Украине. 【 Более1500 игровых автоматов и слотов】✅ Официально и Безопасно" href="https://slotscity.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Slots City" src="https://opencollective-production.s3.us-west-1.amazonaws.com/d7e298c0-7abe-11ed-8553-230872f5e54d.png" width="90" height="64"></a>
<a title="inkedin" href="https://inkedin.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="inkedin" src="https://logo.clearbit.com/inkedin.com" width="64" height="64"></a>
<a title="Актуальний та повносправний рейтинг онлайн казино України, ґрунтований на відгуках реальних гравців." href="https://uk.onlinecasino.in.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино України" src="https://opencollective-production.s3.us-west-1.amazonaws.com/c0b4b090-eef8-11ec-9cb7-0527a205b226.png" width="64" height="64"></a>
<a title="OnlineCasinosSpelen" href="https://onlinecasinosspelen.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="OnlineCasinosSpelen" src="https://logo.clearbit.com/onlinecasinosspelen.com" width="64" height="64"></a>
<a title="Best non Gamstop sites in the UK" href="https://nongamstopcasinos.net/gb/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Best non Gamstop sites in the UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/34e340b8-e1de-4932-8a76-1b3ce2ec7ee8/logo_white%20bg%20(8).png" width="64" height="64"></a>
<a title="Real Money Pokies" href="https://www.nzfirst.org.nz/real-money-pokies/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Real Money Pokies" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/30d38232-a9d6-4e95-a48c-641fdc4d96fd/NZ_logo%20(6)%20(1)%20(1).jpg" width="64" height="64"></a>
<a title="Non GamStop Bookies UK" href="https://nongamstopbookies.com/uk/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Non GamStop Bookies UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/43c5561c-8907-4ef7-a4ee-c6da054788b8/logo-site%20(3).jpg" width="64" height="64"></a>
<a title="Актуальний топ-рейтинг українських онлайн казино на гривні! Щоденне оновлення топу та унікальна система ранжування, основана на відгуках гравців!" href="https://onlinecasino.in.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн Казино Украины" src="https://opencollective-production.s3.us-west-1.amazonaws.com/8fdd8aa0-e273-11ec-a95e-d38fd331cabf.png" width="64" height="64"></a>
<a title="Entertainment" href="https://www.nongamstopbets.com/casinos-not-on-gamstop/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Non-GamStop Bets UK" src="https://logo.clearbit.com/nongamstopbets.com" width="64" height="64"></a>
<a title="Chudovo - international software development company with representative offices in Kyiv, Cologne, New York, Tallinn and London. It has been working on the market since 2006. Company has domain expertise in video security, logistics, medicine, finance and" href="https://chudovo.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Chudovo" src="https://opencollective-production.s3.us-west-1.amazonaws.com/326c19a0-2e87-11eb-a13a-c99a2a201d11.png" width="128" height="48"></a>
<a title="Entertainment" href="https://casinogap.org/uk/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="UK Casino Gap" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/143f9301-beec-4118-89d5-9a07a01345f3/casinogap-uk.png" width="48" height="48"></a>
<a title="NZ Gaming Portal" href="https://casinodeps.co.nz?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="NZ Casino Deps" src="https://logo.clearbit.com/casinodeps.co.nz" width="48" height="48"></a>
<a title="NonStop Sites" href="https://uk.nonstopcasino.org/non-gamstop-casinos/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="NonStopCasino.org" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/fd7ad905-8752-468f-ad20-582a24cca9d9/non-stop-casino.png" width="48" height="48"></a>
<a title="Siti Non AAMS" href="https://www.outlookindia.com/outlook-spotlight/migliori-siti-non-aams-siti-scommesse-senza-licenza-sicuri-news-294715?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Migliori Siti Non AAMS" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/392810da-6cb6-4938-a3cb-38bd0e1eb7de/migliori-siti-non-aams.png" width="48" height="48"></a>
<a title="List of trusted non GamStop casino reviews" href="https://nongamstopcasinos.org?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="UK NonGamStopCasinos" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/cbda0ee1-26ea-4252-9580-f1f9b317b1f7/nongamstopcasinos-uk.png" width="48" height="48"></a>
<a title="A self-hosted web radio management suite, including turnkey installer tools and an easy-to-use web app to manage your stations. " href="https://azuracast.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="AzuraCast" src="https://opencollective-production.s3.us-west-1.amazonaws.com/3c12ea10-cdfb-11eb-9cf4-3760b386b76d.png" width="48" height="48"></a>
<a title="Triplebyte is the first software engineering job platform that is on the developer&#039;s side. Take our coding quiz!" href="https://triplebyte.com/os/opencollective?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Triplebyte" src="https://opencollective-production.s3.us-west-1.amazonaws.com/43e4f9d0-30cd-11ea-9c6b-e1142996e8b2.png" width="48" height="48"></a>
<a title="Connect your Collective to GitHub Sponsors: https://docs.opencollective.com/help/collectives/github-sponsors" href="https://github.com/sponsors/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="GitHub Sponsors" src="https://opencollective-production.s3.us-west-1.amazonaws.com/87b1d240-f617-11ea-9960-fd7e8ab20fe4.png" width="55" height="48"></a>
<a title="Salesforce" href="https://engineering.salesforce.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Salesforce" src="https://opencollective-production.s3.us-west-1.amazonaws.com/24d34880-df8d-11e9-949c-6bc2037b6bd5.png" width="48" height="48"></a>
<a title="Chudovo - international software development company with representative offices in Kyiv, Cologne, New York, Tallinn and London. It has been working on the market since 2006. Company has domain expertise in video security, logistics, medicine, finance and" href="https://chudovo.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Chudovo" src="https://opencollective-production.s3.us-west-1.amazonaws.com/326c19a0-2e87-11eb-a13a-c99a2a201d11.png" width="84" height="42"></a>
<a title="Entertainment" href="https://casinogap.org/uk/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="UK Casino Gap" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/143f9301-beec-4118-89d5-9a07a01345f3/casinogap-uk.png" width="42" height="42"></a>
<a title="NZ Gaming Portal" href="https://casinodeps.co.nz?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="NZ Casino Deps" src="https://logo.clearbit.com/casinodeps.co.nz" width="42" height="42"></a>
<a title="NonStop Sites" href="https://uk.nonstopcasino.org/non-gamstop-casinos/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="NonStopCasino.org" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/fd7ad905-8752-468f-ad20-582a24cca9d9/non-stop-casino.png" width="42" height="42"></a>
<a title="Siti Non AAMS" href="https://www.outlookindia.com/outlook-spotlight/migliori-siti-non-aams-siti-scommesse-senza-licenza-sicuri-news-294715?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Migliori Siti Non AAMS" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/392810da-6cb6-4938-a3cb-38bd0e1eb7de/migliori-siti-non-aams.png" width="42" height="42"></a>
<a title="List of trusted non GamStop casino reviews" href="https://nongamstopcasinos.org?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="UK NonGamStopCasinos" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/cbda0ee1-26ea-4252-9580-f1f9b317b1f7/nongamstopcasinos-uk.png" width="42" height="42"></a>
<a title="Online TikTok Video Download Tool" href="https://snaptik.pro?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="SnapTik" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/546bcd53-6615-457d-ab21-1db1c52b3af5/logo.jpg" width="42" height="42"></a>
<a title="IG Downloader is an Instagram Downloader service that offers a variety of tools to download Instagram content for free. Listed below are all the tools" href="https://indownloader.app/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="IG Downloader" src="https://logo.clearbit.com/indownloader.app" width="42" height="42"></a>
<a title="Proxidize is a mobile proxy creation and management platform that provides all needed components from hardware to cloud software and SIM cards." href="https://proxidize.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Proxidize" src="https://logo.clearbit.com/proxidize.com" width="42" height="42"></a>
<a title="A self-hosted web radio management suite, including turnkey installer tools and an easy-to-use web app to manage your stations. " href="https://azuracast.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="AzuraCast" src="https://opencollective-production.s3.us-west-1.amazonaws.com/3c12ea10-cdfb-11eb-9cf4-3760b386b76d.png" width="42" height="42"></a>
<a title="Triplebyte is the first software engineering job platform that is on the developer&#039;s side. Take our coding quiz!" href="https://triplebyte.com/os/opencollective?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Triplebyte" src="https://opencollective-production.s3.us-west-1.amazonaws.com/43e4f9d0-30cd-11ea-9c6b-e1142996e8b2.png" width="42" height="42"></a>
<a title="Connect your Collective to GitHub Sponsors: https://docs.opencollective.com/help/collectives/github-sponsors" href="https://github.com/sponsors/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="GitHub Sponsors" src="https://opencollective-production.s3.us-west-1.amazonaws.com/87b1d240-f617-11ea-9960-fd7e8ab20fe4.png" width="48" height="42"></a>
<a title="Salesforce" href="https://engineering.salesforce.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Salesforce" src="https://opencollective-production.s3.us-west-1.amazonaws.com/24d34880-df8d-11e9-949c-6bc2037b6bd5.png" width="42" height="42"></a>
<!-- </open-collective-sponsors> -->
[[Become a sponsor via OpenCollective](https://opencollective.com/Carbon#sponsor)]
<a href="https://github.com/johnrsimeone" target="_blank"><img src="https://avatars.githubusercontent.com/u/22871068?s=70&v=4" width="64" height="64"></a>
<a href="https://github.com/taylorotwell" target="_blank"><img src="https://avatars.githubusercontent.com/u/463230?s=128&v=4" width="64" height="64"></a>
<a href="https://github.com/codecov" target="_blank"><img src="https://avatars.githubusercontent.com/u/8226205?s=128&v=4" width="64" height="64"></a>
<a href="https://github.com/getsentry" target="_blank"><img src="https://avatars.githubusercontent.com/u/1396951?s=128&v=4" width="64" height="64"></a>
<a href="https://github.com/codecov" target="_blank"><img src="https://avatars.githubusercontent.com/u/8226205?s=128&v=4" width="64" height="64"></a>
[[Become a sponsor via GitHub](https://github.com/sponsors/kylekatarnls)]

View File

@@ -99,8 +99,8 @@ function getOpenCollectiveSponsors(): string
[$x, $y] = @getimagesize($src) ?: [0, 0];
$validImage = ($x && $y);
$src = $validImage ? htmlspecialchars($src) : 'https://opencollective.com/static/images/default-guest-logo.svg';
$height = $member['status'] === 'sponsor' ? 64 : 48;
$width = min(128, $validImage ? round($x * $height / $y) : $height);
$height = $member['status'] === 'sponsor' ? 64 : 42;
$width = min($height * 2, $validImage ? round($x * $height / $y) : $height);
$href .= (strpos($href, '?') === false ? '?' : '&amp;').'utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon';
$title = htmlspecialchars(($member['description'] ?? null) ?: $member['name']);
$alt = htmlspecialchars($member['name']);

View File

@@ -82,7 +82,7 @@ return [
'second_before' => ':count másodperccel',
's_before' => ':count másodperccel',
'months' => ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'],
'months_short' => ['jan.', 'feb.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.'],
'months_short' => ['jan.', 'febr.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.'],
'weekdays' => ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'],
'weekdays_short' => ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'],
'weekdays_min' => ['v', 'h', 'k', 'sze', 'cs', 'p', 'sz'],

View File

@@ -147,7 +147,7 @@ return [
'sameElse' => 'L',
],
'weekdays' => ['nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota'],
'weekdays_short' => ['ned', 'pod', 'uto', 'str', 'štv', 'pia', 'sob'],
'weekdays_short' => ['ned', 'pon', 'uto', 'str', 'štv', 'pia', 'sob'],
'weekdays_min' => ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'],
'months' => ['január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december'],
'months_short' => ['jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec'],

View File

@@ -15,12 +15,12 @@
}
],
"require": {
"php": "7.1 - 8.3",
"nette/utils": "^2.5.7 || ^3.1.5 || ^4.0"
"php": "8.1 - 8.3",
"nette/utils": "^4.0"
},
"require-dev": {
"nette/tester": "^2.3 || ^2.4",
"tracy/tracy": "^2.7",
"nette/tester": "^2.4",
"tracy/tracy": "^2.8",
"phpstan/phpstan-nette": "^1.0"
},
"autoload": {
@@ -33,7 +33,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
"dev-master": "1.3-dev"
}
}
}

View File

@@ -21,7 +21,7 @@ Installation:
composer require nette/schema
```
It requires PHP version 7.1 and supports PHP up to 8.3.
It requires PHP version 8.1 and supports PHP up to 8.3.
[Support Me](https://github.com/sponsors/dg)
@@ -439,7 +439,7 @@ Expect::structure([
// creates '$obj = new Info' and writes to $obj->processRefund and $obj->refundAmount
```
If the class has a constructor, the elements of the structure are passed as named parameters to the constructor (requires PHP 8):
If the class has a constructor, the elements of the structure are passed as named parameters to the constructor:
```php
class Info

View File

@@ -9,30 +9,24 @@ declare(strict_types=1);
namespace Nette\Schema;
use Nette;
final class Context
{
use Nette\SmartObject;
/** @var bool */
public $skipDefaults = false;
public bool $skipDefaults = false;
/** @var string[] */
public $path = [];
public array $path = [];
/** @var bool */
public $isKey = false;
public bool $isKey = false;
/** @var Message[] */
public $errors = [];
public array $errors = [];
/** @var Message[] */
public $warnings = [];
public array $warnings = [];
/** @var array[] */
public $dynamics = [];
public array $dynamics = [];
public function addError(string $message, string $code, array $variables = []): Message
@@ -52,8 +46,6 @@ final class Context
public function createChecker(): \Closure
{
$count = count($this->errors);
return function () use ($count): bool {
return $count === count($this->errors);
};
return fn(): bool => $count === count($this->errors);
}
}

View File

@@ -18,16 +18,11 @@ use Nette\Schema\Schema;
final class AnyOf implements Schema
{
use Base;
use Nette\SmartObject;
/** @var array */
private $set;
private array $set;
/**
* @param mixed|Schema ...$set
*/
public function __construct(...$set)
public function __construct(mixed ...$set)
{
if (!$set) {
throw new Nette\InvalidStateException('The enumeration must not be empty.');
@@ -61,13 +56,13 @@ final class AnyOf implements Schema
/********************* processing ****************d*g**/
public function normalize($value, Context $context)
public function normalize(mixed $value, Context $context): mixed
{
return $this->doNormalize($value, $context);
}
public function merge($value, $base)
public function merge(mixed $value, mixed $base): mixed
{
if (is_array($value) && isset($value[Helpers::PreventMerging])) {
unset($value[Helpers::PreventMerging]);
@@ -78,7 +73,7 @@ final class AnyOf implements Schema
}
public function complete($value, Context $context)
public function complete(mixed $value, Context $context): mixed
{
$isOk = $context->createChecker();
$value = $this->findAlternative($value, $context);
@@ -87,7 +82,7 @@ final class AnyOf implements Schema
}
private function findAlternative($value, Context $context)
private function findAlternative(mixed $value, Context $context): mixed
{
$expecteds = $innerErrors = [];
foreach ($this->set as $item) {
@@ -125,18 +120,20 @@ final class AnyOf implements Schema
[
'value' => $value,
'expected' => implode('|', array_unique($expecteds)),
]
],
);
}
return null;
}
public function completeDefault(Context $context)
public function completeDefault(Context $context): mixed
{
if ($this->required) {
$context->addError(
'The mandatory item %path% is missing.',
Nette\Schema\Message::MissingItem
Nette\Schema\Message::MissingItem,
);
return null;
}

View File

@@ -19,23 +19,18 @@ use Nette\Schema\Helpers;
*/
trait Base
{
/** @var bool */
private $required = false;
private bool $required = false;
private mixed $default = null;
/** @var mixed */
private $default;
/** @var callable|null */
/** @var ?callable */
private $before;
/** @var callable[] */
private $transforms = [];
/** @var string|null */
private $deprecated;
private array $transforms = [];
private ?string $deprecated = null;
public function default($value): self
public function default(mixed $value): self
{
$this->default = $value;
return $this;
@@ -79,7 +74,7 @@ trait Base
$context->addError(
'Failed assertion ' . ($description ? "'%assertion%'" : '%assertion%') . ' for %label% %path% with value %value%.',
Nette\Schema\Message::FailedAssertion,
['value' => $value, 'assertion' => $expected]
['value' => $value, 'assertion' => $expected],
);
});
}
@@ -93,12 +88,12 @@ trait Base
}
public function completeDefault(Context $context)
public function completeDefault(Context $context): mixed
{
if ($this->required) {
$context->addError(
'The mandatory item %path% is missing.',
Nette\Schema\Message::MissingItem
Nette\Schema\Message::MissingItem,
);
return null;
}
@@ -107,7 +102,7 @@ trait Base
}
public function doNormalize($value, Context $context)
public function doNormalize(mixed $value, Context $context): mixed
{
if ($this->before) {
$value = ($this->before)($value);
@@ -122,13 +117,13 @@ trait Base
if ($this->deprecated !== null) {
$context->addWarning(
$this->deprecated,
Nette\Schema\Message::Deprecated
Nette\Schema\Message::Deprecated,
);
}
}
private function doTransform($value, Context $context)
private function doTransform(mixed $value, Context $context): mixed
{
$isOk = $context->createChecker();
foreach ($this->transforms as $handler) {
@@ -142,7 +137,7 @@ trait Base
/** @deprecated use Nette\Schema\Validators::validateType() */
private function doValidate($value, string $expected, Context $context): bool
private function doValidate(mixed $value, string $expected, Context $context): bool
{
$isOk = $context->createChecker();
Helpers::validateType($value, $expected, $context);
@@ -151,7 +146,7 @@ trait Base
/** @deprecated use Nette\Schema\Validators::validateRange() */
private static function doValidateRange($value, array $range, Context $context, string $types = ''): bool
private static function doValidateRange(mixed $value, array $range, Context $context, string $types = ''): bool
{
$isOk = $context->createChecker();
Helpers::validateRange($value, $range, $context, $types);
@@ -160,7 +155,7 @@ trait Base
/** @deprecated use doTransform() */
private function doFinalize($value, Context $context)
private function doFinalize(mixed $value, Context $context): mixed
{
return $this->doTransform($value, $context);
}

View File

@@ -18,19 +18,16 @@ use Nette\Schema\Schema;
final class Structure implements Schema
{
use Base;
use Nette\SmartObject;
/** @var Schema[] */
private $items;
private array $items;
/** @var Schema|null for array|list */
private $otherItems;
/** for array|list */
private ?Schema $otherItems = null;
/** @var array{?int, ?int} */
private $range = [null, null];
/** @var bool */
private $skipDefaults = false;
private array $range = [null, null];
private bool $skipDefaults = false;
/**
@@ -45,7 +42,7 @@ final class Structure implements Schema
}
public function default($value): self
public function default(mixed $value): self
{
throw new Nette\InvalidStateException('Structure cannot have default value.');
}
@@ -65,10 +62,7 @@ final class Structure implements Schema
}
/**
* @param string|Schema $type
*/
public function otherItems($type = 'mixed'): self
public function otherItems(string|Schema $type = 'mixed'): self
{
$this->otherItems = $type instanceof Schema ? $type : new Type($type);
return $this;
@@ -85,7 +79,7 @@ final class Structure implements Schema
/********************* processing ****************d*g**/
public function normalize($value, Context $context)
public function normalize(mixed $value, Context $context): mixed
{
if ($prevent = (is_array($value) && isset($value[Helpers::PreventMerging]))) {
unset($value[Helpers::PreventMerging]);
@@ -115,7 +109,7 @@ final class Structure implements Schema
}
public function merge($value, $base)
public function merge(mixed $value, mixed $base): mixed
{
if (is_array($value) && isset($value[Helpers::PreventMerging])) {
unset($value[Helpers::PreventMerging]);
@@ -145,7 +139,7 @@ final class Structure implements Schema
}
public function complete($value, Context $context)
public function complete(mixed $value, Context $context): mixed
{
if ($value === null) {
$value = []; // is unable to distinguish null from array in NEON
@@ -171,11 +165,11 @@ final class Structure implements Schema
} else {
$keys = array_map('strval', array_keys($items));
foreach ($extraKeys as $key) {
$hint = Nette\Utils\ObjectHelpers::getSuggestion($keys, (string) $key);
$hint = Nette\Utils\Helpers::getSuggestion($keys, (string) $key);
$context->addError(
'Unexpected item %path%' . ($hint ? ", did you mean '%hint%'?" : '.'),
Nette\Schema\Message::UnexpectedItem,
['hint' => $hint]
['hint' => $hint],
)->path[] = $key;
}
}
@@ -197,7 +191,7 @@ final class Structure implements Schema
}
public function completeDefault(Context $context)
public function completeDefault(Context $context): mixed
{
return $this->required
? $this->complete([], $context)

View File

@@ -9,7 +9,6 @@ declare(strict_types=1);
namespace Nette\Schema\Elements;
use Nette;
use Nette\Schema\Context;
use Nette\Schema\DynamicParameter;
use Nette\Schema\Helpers;
@@ -19,25 +18,15 @@ use Nette\Schema\Schema;
final class Type implements Schema
{
use Base;
use Nette\SmartObject;
/** @var string */
private $type;
/** @var Schema|null for arrays */
private $itemsValue;
/** @var Schema|null for arrays */
private $itemsKey;
private string $type;
private ?Schema $itemsValue = null;
private ?Schema $itemsKey = null;
/** @var array{?float, ?float} */
private $range = [null, null];
/** @var string|null */
private $pattern;
/** @var bool */
private $merge = true;
private array $range = [null, null];
private ?string $pattern = null;
private bool $merge = true;
public function __construct(string $type)
@@ -84,11 +73,9 @@ final class Type implements Schema
/**
* @param string|Schema $valueType
* @param string|Schema|null $keyType
* @internal use arrayOf() or listOf()
*/
public function items($valueType = 'mixed', $keyType = null): self
public function items(string|Schema $valueType = 'mixed', string|Schema $keyType = null): self
{
$this->itemsValue = $valueType instanceof Schema
? $valueType
@@ -110,7 +97,7 @@ final class Type implements Schema
/********************* processing ****************d*g**/
public function normalize($value, Context $context)
public function normalize(mixed $value, Context $context): mixed
{
if ($prevent = (is_array($value) && isset($value[Helpers::PreventMerging]))) {
unset($value[Helpers::PreventMerging]);
@@ -141,7 +128,7 @@ final class Type implements Schema
}
public function merge($value, $base)
public function merge(mixed $value, mixed $base): mixed
{
if (is_array($value) && isset($value[Helpers::PreventMerging])) {
unset($value[Helpers::PreventMerging]);
@@ -168,7 +155,7 @@ final class Type implements Schema
}
public function complete($value, Context $context)
public function complete(mixed $value, Context $context): mixed
{
$merge = $this->merge;
if (is_array($value) && isset($value[Helpers::PreventMerging])) {

View File

@@ -32,8 +32,6 @@ use Nette\Schema\Elements\Type;
*/
final class Expect
{
use Nette\SmartObject;
public static function __callStatic(string $name, array $args): Type
{
$type = new Type($name);
@@ -51,10 +49,7 @@ final class Expect
}
/**
* @param mixed|Schema ...$set
*/
public static function anyOf(...$set): AnyOf
public static function anyOf(mixed ...$set): AnyOf
{
return new AnyOf(...$set);
}
@@ -69,21 +64,20 @@ final class Expect
}
/**
* @param object $object
*/
public static function from($object, array $items = []): Structure
public static function from(object $object, array $items = []): Structure
{
$ro = new \ReflectionObject($object);
foreach ($ro->getProperties() as $prop) {
$type = Helpers::getPropertyType($prop) ?? 'mixed';
$props = $ro->hasMethod('__construct')
? $ro->getMethod('__construct')->getParameters()
: $ro->getProperties();
foreach ($props as $prop) {
$item = &$items[$prop->getName()];
if (!$item) {
$type = Helpers::getPropertyType($prop) ?? 'mixed';
$item = new Type($type);
if (PHP_VERSION_ID >= 70400 && !$prop->isInitialized($object)) {
$item->required();
} else {
$def = $prop->getValue($object);
if ($prop instanceof \ReflectionProperty ? $prop->isInitialized($object) : $prop->isOptional()) {
$def = ($prop instanceof \ReflectionProperty ? $prop->getValue($object) : $prop->getDefaultValue());
if (is_object($def)) {
$item = static::from($def);
} elseif ($def === null && !Nette\Utils\Validators::is(null, $type)) {
@@ -91,6 +85,8 @@ final class Expect
} else {
$item->default($def);
}
} else {
$item->required();
}
}
}
@@ -99,20 +95,13 @@ final class Expect
}
/**
* @param string|Schema $valueType
* @param string|Schema|null $keyType
*/
public static function arrayOf($valueType, $keyType = null): Type
public static function arrayOf(string|Schema $valueType, string|Schema $keyType = null): Type
{
return (new Type('array'))->items($valueType, $keyType);
}
/**
* @param string|Schema $type
*/
public static function listOf($type): Type
public static function listOf(string|Schema $type): Type
{
return (new Type('list'))->items($type);
}

View File

@@ -21,14 +21,12 @@ final class Helpers
use Nette\StaticClass;
public const PreventMerging = '_prevent_merging';
public const PREVENT_MERGING = self::PreventMerging;
/**
* Merges dataset. Left has higher priority than right one.
* @return array|string
*/
public static function merge($value, $base)
public static function merge(mixed $value, mixed $base): mixed
{
if (is_array($value) && isset($value[self::PreventMerging])) {
unset($value[self::PreventMerging]);
@@ -57,17 +55,16 @@ final class Helpers
}
public static function getPropertyType(\ReflectionProperty $prop): ?string
public static function getPropertyType(\ReflectionProperty|\ReflectionParameter $prop): ?string
{
if (!class_exists(Nette\Utils\Type::class)) {
throw new Nette\NotSupportedException('Expect::from() requires nette/utils 3.x');
} elseif ($type = Nette\Utils\Type::fromReflection($prop)) {
if ($type = Nette\Utils\Type::fromReflection($prop)) {
return (string) $type;
} elseif ($type = preg_replace('#\s.*#', '', (string) self::parseAnnotation($prop, 'var'))) {
} elseif (
($prop instanceof \ReflectionProperty)
&& ($type = preg_replace('#\s.*#', '', (string) self::parseAnnotation($prop, 'var')))
) {
$class = Reflection::getPropertyDeclaringClass($prop);
return preg_replace_callback('#[\w\\\\]+#', function ($m) use ($class) {
return Reflection::expandClassName($m[0], $class);
}, $type);
return preg_replace_callback('#[\w\\\\]+#', fn($m) => Reflection::expandClassName($m[0], $class), $type);
}
return null;
@@ -93,24 +90,23 @@ final class Helpers
}
/**
* @param mixed $value
*/
public static function formatValue($value): string
public static function formatValue(mixed $value): string
{
if (is_object($value)) {
return 'object ' . get_class($value);
if ($value instanceof DynamicParameter) {
return 'dynamic';
} elseif (is_object($value)) {
return 'object ' . $value::class;
} elseif (is_string($value)) {
return "'" . Nette\Utils\Strings::truncate($value, 15, '...') . "'";
} elseif (is_scalar($value)) {
return var_export($value, true);
return var_export($value, return: true);
} else {
return strtolower(gettype($value));
return get_debug_type($value);
}
}
public static function validateType($value, string $expected, Context $context): void
public static function validateType(mixed $value, string $expected, Context $context): void
{
if (!Nette\Utils\Validators::is($value, $expected)) {
$expected = str_replace(DynamicParameter::class . '|', '', $expected);
@@ -118,13 +114,13 @@ final class Helpers
$context->addError(
'The %label% %path% expects to be %expected%, %value% given.',
Message::TypeMismatch,
['value' => $value, 'expected' => $expected]
['value' => $value, 'expected' => $expected],
);
}
}
public static function validateRange($value, array $range, Context $context, string $types = ''): void
public static function validateRange(mixed $value, array $range, Context $context, string $types = ''): void
{
if (is_array($value) || is_string($value)) {
[$length, $label] = is_array($value)
@@ -137,20 +133,20 @@ final class Helpers
$context->addError(
"The length of %label% %path% expects to be in range %expected%, %length% $label given.",
Message::LengthOutOfRange,
['value' => $value, 'length' => $length, 'expected' => implode('..', $range)]
['value' => $value, 'length' => $length, 'expected' => implode('..', $range)],
);
}
} elseif ((is_int($value) || is_float($value)) && !self::isInRange($value, $range)) {
$context->addError(
'The %label% %path% expects to be in range %expected%, %value% given.',
Message::ValueOutOfRange,
['value' => $value, 'expected' => implode('..', $range)]
['value' => $value, 'expected' => implode('..', $range)],
);
}
}
public static function isInRange($value, array $range): bool
public static function isInRange(mixed $value, array $range): bool
{
return ($range[0] === null || $value >= $range[0])
&& ($range[1] === null || $value <= $range[1]);
@@ -163,7 +159,7 @@ final class Helpers
$context->addError(
"The %label% %path% expects to match pattern '%pattern%', %value% given.",
Message::PatternMismatch,
['value' => $value, 'pattern' => $pattern]
['value' => $value, 'pattern' => $pattern],
);
}
}
@@ -177,22 +173,11 @@ final class Helpers
return $value;
};
} elseif (method_exists($type, '__construct')) {
return static function ($value) use ($type) {
if (PHP_VERSION_ID < 80000 && is_array($value)) {
throw new Nette\NotSupportedException("Creating $type objects is supported since PHP 8.0");
}
return is_array($value)
? new $type(...$value)
: new $type($value);
};
return static fn($value) => is_array($value) || $value instanceof \stdClass
? new $type(...(array) $value)
: new $type($value);
} else {
return static function ($value) use ($type) {
$object = new $type;
foreach ($value as $k => $v) {
$object->$k = $v;
}
return $object;
};
return static fn($value) => Nette\Utils\Arrays::toObject((array) $value, new $type);
}
}
}

View File

@@ -14,8 +14,6 @@ use Nette;
final class Message
{
use Nette\SmartObject;
/** variables: {value: mixed, expected: string} */
public const TypeMismatch = 'schema.typeMismatch';
@@ -40,27 +38,38 @@ final class Message
/** no variables */
public const Deprecated = 'schema.deprecated';
/** Deprecated */
/** @deprecated use Message::TypeMismatch */
public const TYPE_MISMATCH = self::TypeMismatch;
/** @deprecated use Message::ValueOutOfRange */
public const VALUE_OUT_OF_RANGE = self::ValueOutOfRange;
/** @deprecated use Message::LengthOutOfRange */
public const LENGTH_OUT_OF_RANGE = self::LengthOutOfRange;
/** @deprecated use Message::PatternMismatch */
public const PATTERN_MISMATCH = self::PatternMismatch;
/** @deprecated use Message::FailedAssertion */
public const FAILED_ASSERTION = self::FailedAssertion;
/** @deprecated use Message::MissingItem */
public const MISSING_ITEM = self::MissingItem;
/** @deprecated use Message::UnexpectedItem */
public const UNEXPECTED_ITEM = self::UnexpectedItem;
/** @deprecated use Message::Deprecated */
public const DEPRECATED = self::Deprecated;
/** @var string */
public $message;
/** @var string */
public $code;
public string $message;
public string $code;
/** @var string[] */
public $path;
public array $path;
/** @var string[] */
public $variables;
public array $variables;
public function __construct(string $message, string $code, array $path, array $variables = [])
@@ -84,6 +93,6 @@ final class Message
return preg_replace_callback('~( ?)%(\w+)%~', function ($m) use ($vars) {
[, $space, $key] = $m;
return $vars[$key] === null ? '' : $space . $vars[$key];
}, $this->message);
}, $this->message) ?? throw new Nette\InvalidStateException(preg_last_error_msg());
}
}

View File

@@ -17,19 +17,12 @@ use Nette;
*/
final class Processor
{
use Nette\SmartObject;
/** @var array */
public $onNewContext = [];
/** @var Context|null */
private $context;
/** @var bool */
private $skipDefaults;
public array $onNewContext = [];
private Context $context;
private bool $skipDefaults = false;
public function skipDefaults(bool $value = true)
public function skipDefaults(bool $value = true): void
{
$this->skipDefaults = $value;
}
@@ -37,10 +30,9 @@ final class Processor
/**
* Normalizes and validates data. Result is a clean completed data.
* @return mixed
* @throws ValidationException
*/
public function process(Schema $schema, $data)
public function process(Schema $schema, mixed $data): mixed
{
$this->createContext();
$data = $schema->normalize($data, $this->context);
@@ -53,10 +45,9 @@ final class Processor
/**
* Normalizes and validates and merges multiple data. Result is a clean completed data.
* @return mixed
* @throws ValidationException
*/
public function processMultiple(Schema $schema, array $dataset)
public function processMultiple(Schema $schema, array $dataset): mixed
{
$this->createContext();
$flatten = null;
@@ -96,10 +87,10 @@ final class Processor
}
private function createContext()
private function createContext(): void
{
$this->context = new Context;
$this->context->skipDefaults = $this->skipDefaults;
$this->onNewContext($this->context);
Nette\Utils\Arrays::invoke($this->onNewContext, $this->context);
}
}

View File

@@ -16,19 +16,19 @@ interface Schema
* Normalization.
* @return mixed
*/
function normalize($value, Context $context);
function normalize(mixed $value, Context $context);
/**
* Merging.
* @return mixed
*/
function merge($value, $base);
function merge(mixed $value, mixed $base);
/**
* Validation and finalization.
* @return mixed
*/
function complete($value, Context $context);
function complete(mixed $value, Context $context);
/**
* @return mixed

View File

@@ -18,7 +18,7 @@ use Nette;
class ValidationException extends Nette\InvalidStateException
{
/** @var Message[] */
private $messages;
private array $messages;
/**

View File

@@ -2,6 +2,12 @@
All notable changes of the PHPUnit 10.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [10.5.9] - 2024-01-22
### Fixed
* [#5676](https://github.com/sebastianbergmann/phpunit/issues/5676): PHPUnit's test runner overwrites custom error handler registered using `set_error_handler()` in bootstrap script
## [10.5.8] - 2024-01-19
### Fixed
@@ -91,6 +97,7 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi
* [#5563](https://github.com/sebastianbergmann/phpunit/issues/5563): `createMockForIntersectionOfInterfaces()` does not automatically register mock object for expectation verification
[10.5.9]: https://github.com/sebastianbergmann/phpunit/compare/10.5.8...10.5.9
[10.5.8]: https://github.com/sebastianbergmann/phpunit/compare/10.5.7...10.5.8
[10.5.7]: https://github.com/sebastianbergmann/phpunit/compare/10.5.6...10.5.7
[10.5.6]: https://github.com/sebastianbergmann/phpunit/compare/10.5.5...10.5.6

View File

@@ -166,7 +166,13 @@ final class ErrorHandler
return;
}
set_error_handler($this);
$oldErrorHandler = set_error_handler($this);
if ($oldErrorHandler !== null) {
restore_error_handler();
return;
}
$this->enabled = true;
$this->originalErrorReportingLevel = error_reporting();

View File

@@ -34,7 +34,7 @@ final class Version
}
if (self::$version === '') {
self::$version = (new VersionId('10.5.8', dirname(__DIR__, 2)))->asString();
self::$version = (new VersionId('10.5.9', dirname(__DIR__, 2)))->asString();
}
return self::$version;

View File

@@ -11,6 +11,7 @@ namespace PHPUnit\TextUI;
use const PHP_EOL;
use function count;
use function defined;
use function explode;
use function max;
use function preg_replace_callback;
@@ -26,144 +27,7 @@ use SebastianBergmann\Environment\Console;
*/
final class Help
{
private const LEFT_MARGIN = ' ';
private const HELP_TEXT = [
'Usage' => [
['text' => 'phpunit [options] <directory|file> ...'],
],
'Configuration' => [
['arg' => '--bootstrap <file>', 'desc' => 'A PHP script that is included before the tests run'],
['arg' => '-c|--configuration <file>', 'desc' => 'Read configuration from XML file'],
['arg' => '--no-configuration', 'desc' => 'Ignore default configuration file (phpunit.xml)'],
['arg' => '--no-extensions', 'desc' => 'Do not load PHPUnit extensions'],
['arg' => '--include-path <path(s)>', 'desc' => 'Prepend PHP\'s include_path with given path(s)'],
['arg' => '-d <key[=value]>', 'desc' => 'Sets a php.ini value'],
['arg' => '--cache-directory <dir>', 'desc' => 'Specify cache directory'],
['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'],
['arg' => '--migrate-configuration', 'desc' => 'Migrate configuration file to current format'],
['arg' => '--generate-baseline <file>', 'desc' => 'Generate baseline for issues'],
['arg' => '--use-baseline <file>', 'desc' => 'Use baseline to ignore issues'],
['arg' => '--ignore-baseline', 'desc' => 'Do not use baseline to ignore issues'],
],
'Selection' => [
['arg' => '--list-suites', 'desc' => 'List available test suites'],
['arg' => '--testsuite <name>', 'desc' => 'Only run tests from the specified test suite(s)'],
['arg' => '--exclude-testsuite <name>', 'desc' => 'Exclude tests from the specified test suite(s)'],
['arg' => '--list-groups', 'desc' => 'List available test groups'],
['arg' => '--group <name>', 'desc' => 'Only run tests from the specified group(s)'],
['arg' => '--exclude-group <name>', 'desc' => 'Exclude tests from the specified group(s)'],
['arg' => '--covers <name>', 'desc' => 'Only run tests that intend to cover <name>'],
['arg' => '--uses <name>', 'desc' => 'Only run tests that intend to use <name>'],
['arg' => '--list-tests', 'desc' => 'List available tests'],
['arg' => '--list-tests-xml <file>', 'desc' => 'List available tests in XML format'],
['arg' => '--filter <pattern>', 'desc' => 'Filter which tests to run'],
['arg' => '--test-suffix <suffixes>', 'desc' => 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt'],
],
'Execution' => [
['arg' => '--process-isolation', 'desc' => 'Run each test in a separate PHP process'],
['arg' => '--globals-backup', 'desc' => 'Backup and restore $GLOBALS for each test'],
['arg' => '--static-backup', 'desc' => 'Backup and restore static properties for each test'],
['spacer' => ''],
['arg' => '--strict-coverage', 'desc' => 'Be strict about code coverage metadata'],
['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'],
['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'],
['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'],
['arg' => '--default-time-limit <sec>', 'desc' => 'Timeout in seconds for tests that have no declared size'],
['arg' => '--dont-report-useless-tests', 'desc' => 'Do not report tests that do not test anything'],
['spacer' => ''],
['arg' => '--stop-on-defect', 'desc' => 'Stop after first error, failure, warning, or risky test'],
['arg' => '--stop-on-error', 'desc' => 'Stop after first error'],
['arg' => '--stop-on-failure', 'desc' => 'Stop after first failure'],
['arg' => '--stop-on-warning', 'desc' => 'Stop after first warning'],
['arg' => '--stop-on-risky', 'desc' => 'Stop after first risky test'],
['arg' => '--stop-on-deprecation', 'desc' => 'Stop after first test that triggered a deprecation'],
['arg' => '--stop-on-notice', 'desc' => 'Stop after first test that triggered a notice'],
['arg' => '--stop-on-skipped', 'desc' => 'Stop after first skipped test'],
['arg' => '--stop-on-incomplete', 'desc' => 'Stop after first incomplete test'],
['spacer' => ''],
['arg' => '--fail-on-warning', 'desc' => 'Signal failure using shell exit code when a warning was triggered'],
['arg' => '--fail-on-risky', 'desc' => 'Signal failure using shell exit code when a test was considered risky'],
['arg' => '--fail-on-deprecation', 'desc' => 'Signal failure using shell exit code when a deprecation was triggered'],
['arg' => '--fail-on-notice', 'desc' => 'Signal failure using shell exit code when a notice was triggered'],
['arg' => '--fail-on-skipped', 'desc' => 'Signal failure using shell exit code when a test was skipped'],
['arg' => '--fail-on-incomplete', 'desc' => 'Signal failure using shell exit code when a test was marked incomplete'],
['spacer' => ''],
['arg' => '--cache-result', 'desc' => 'Write test results to cache file'],
['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'],
['spacer' => ''],
['arg' => '--order-by <order>', 'desc' => 'Run tests in order: default|defects|depends|duration|no-depends|random|reverse|size'],
['arg' => '--random-order-seed <N>', 'desc' => 'Use the specified random seed when running tests in random order'],
],
'Reporting' => [
['arg' => '--colors <flag>', 'desc' => 'Use colors in output ("never", "auto" or "always")'],
['arg' => '--columns <n>', 'desc' => 'Number of columns to use for progress output'],
['arg' => '--columns max', 'desc' => 'Use maximum number of columns for progress output'],
['arg' => '--stderr', 'desc' => 'Write to STDERR instead of STDOUT'],
['spacer' => ''],
['arg' => '--no-progress', 'desc' => 'Disable output of test execution progress'],
['arg' => '--no-results', 'desc' => 'Disable output of test results'],
['arg' => '--no-output', 'desc' => 'Disable all output'],
['spacer' => ''],
['arg' => '--display-incomplete', 'desc' => 'Display details for incomplete tests'],
['arg' => '--display-skipped', 'desc' => 'Display details for skipped tests'],
['arg' => '--display-deprecations', 'desc' => 'Display details for deprecations triggered by tests'],
['arg' => '--display-errors', 'desc' => 'Display details for errors triggered by tests'],
['arg' => '--display-notices', 'desc' => 'Display details for notices triggered by tests'],
['arg' => '--display-warnings', 'desc' => 'Display details for warnings triggered by tests'],
['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'],
['spacer' => ''],
['arg' => '--teamcity', 'desc' => 'Replace default progress and result output with TeamCity format'],
['arg' => '--testdox', 'desc' => 'Replace default result output with TestDox format'],
['spacer' => ''],
['arg' => '--debug', 'desc' => 'Replace default progress and result output with debugging information'],
],
'Logging' => [
['arg' => '--log-junit <file>', 'desc' => 'Write test results in JUnit XML format to file'],
['arg' => '--log-teamcity <file>', 'desc' => 'Write test results in TeamCity format to file'],
['arg' => '--testdox-html <file>', 'desc' => 'Write test results in TestDox format (HTML) to file'],
['arg' => '--testdox-text <file>', 'desc' => 'Write test results in TestDox format (plain text) to file'],
['arg' => '--log-events-text <file>', 'desc' => 'Stream events as plain text to file'],
['arg' => '--log-events-verbose-text <file>', 'desc' => 'Stream events as plain text with extended information to file'],
['arg' => '--no-logging', 'desc' => 'Ignore logging configured in the XML configuration file'],
],
'Code Coverage' => [
['arg' => '--coverage-clover <file>', 'desc' => 'Write code coverage report in Clover XML format to file'],
['arg' => '--coverage-cobertura <file>', 'desc' => 'Write code coverage report in Cobertura XML format to file'],
['arg' => '--coverage-crap4j <file>', 'desc' => 'Write code coverage report in Crap4J XML format to file'],
['arg' => '--coverage-html <dir>', 'desc' => 'Write code coverage report in HTML format to directory'],
['arg' => '--coverage-php <file>', 'desc' => 'Write serialized code coverage data to file'],
['arg' => '--coverage-text=<file>', 'desc' => 'Write code coverage report in text format to file [default: standard output]'],
['arg' => '--coverage-xml <dir>', 'desc' => 'Write code coverage report in XML format to directory'],
['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'],
['arg' => '--coverage-filter <dir>', 'desc' => 'Include <dir> in code coverage reporting'],
['arg' => '--path-coverage', 'desc' => 'Report path coverage in addition to line coverage'],
['arg' => '--disable-coverage-ignore', 'desc' => 'Disable metadata for ignoring code coverage'],
['arg' => '--no-coverage', 'desc' => 'Ignore code coverage reporting configured in the XML configuration file'],
],
'Miscellaneous' => [
['arg' => '-h|--help', 'desc' => 'Prints this usage information'],
['arg' => '--version', 'desc' => 'Prints the version and exits'],
['arg' => '--atleast-version <min>', 'desc' => 'Checks that version is greater than <min> and exits'],
['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version and exits'],
],
];
private const LEFT_MARGIN = ' ';
private int $lengthOfLongestOptionName = 0;
private readonly int $columnsAvailableForDescription;
private ?bool $hasColor;
@@ -180,7 +44,7 @@ final class Help
$this->hasColor = $withColor;
}
foreach (self::HELP_TEXT as $options) {
foreach ($this->elements() as $options) {
foreach ($options as $option) {
if (isset($option['arg'])) {
$this->lengthOfLongestOptionName = max($this->lengthOfLongestOptionName, isset($option['arg']) ? strlen($option['arg']) : 0);
@@ -204,7 +68,7 @@ final class Help
{
$buffer = '';
foreach (self::HELP_TEXT as $section => $options) {
foreach ($this->elements() as $section => $options) {
$buffer .= "{$section}:" . PHP_EOL;
if ($section !== 'Usage') {
@@ -237,7 +101,7 @@ final class Help
{
$buffer = '';
foreach (self::HELP_TEXT as $section => $options) {
foreach ($this->elements() as $section => $options) {
$buffer .= Color::colorize('fg-yellow', "{$section}:") . PHP_EOL;
if ($section !== 'Usage') {
@@ -276,4 +140,157 @@ final class Help
return $buffer;
}
/**
* @psalm-return array<non-empty-string, non-empty-list<array{text: non-empty-string}|array{arg: non-empty-string, desc: non-empty-string}|array{spacer: ''}>>
*/
private function elements(): array
{
$elements = [
'Usage' => [
['text' => 'phpunit [options] <directory|file> ...'],
],
'Configuration' => [
['arg' => '--bootstrap <file>', 'desc' => 'A PHP script that is included before the tests run'],
['arg' => '-c|--configuration <file>', 'desc' => 'Read configuration from XML file'],
['arg' => '--no-configuration', 'desc' => 'Ignore default configuration file (phpunit.xml)'],
['arg' => '--no-extensions', 'desc' => 'Do not load PHPUnit extensions'],
['arg' => '--include-path <path(s)>', 'desc' => 'Prepend PHP\'s include_path with given path(s)'],
['arg' => '-d <key[=value]>', 'desc' => 'Sets a php.ini value'],
['arg' => '--cache-directory <dir>', 'desc' => 'Specify cache directory'],
['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'],
['arg' => '--migrate-configuration', 'desc' => 'Migrate configuration file to current format'],
['arg' => '--generate-baseline <file>', 'desc' => 'Generate baseline for issues'],
['arg' => '--use-baseline <file>', 'desc' => 'Use baseline to ignore issues'],
['arg' => '--ignore-baseline', 'desc' => 'Do not use baseline to ignore issues'],
],
'Selection' => [
['arg' => '--list-suites', 'desc' => 'List available test suites'],
['arg' => '--testsuite <name>', 'desc' => 'Only run tests from the specified test suite(s)'],
['arg' => '--exclude-testsuite <name>', 'desc' => 'Exclude tests from the specified test suite(s)'],
['arg' => '--list-groups', 'desc' => 'List available test groups'],
['arg' => '--group <name>', 'desc' => 'Only run tests from the specified group(s)'],
['arg' => '--exclude-group <name>', 'desc' => 'Exclude tests from the specified group(s)'],
['arg' => '--covers <name>', 'desc' => 'Only run tests that intend to cover <name>'],
['arg' => '--uses <name>', 'desc' => 'Only run tests that intend to use <name>'],
['arg' => '--list-tests', 'desc' => 'List available tests'],
['arg' => '--list-tests-xml <file>', 'desc' => 'List available tests in XML format'],
['arg' => '--filter <pattern>', 'desc' => 'Filter which tests to run'],
['arg' => '--test-suffix <suffixes>', 'desc' => 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt'],
],
'Execution' => [
['arg' => '--process-isolation', 'desc' => 'Run each test in a separate PHP process'],
['arg' => '--globals-backup', 'desc' => 'Backup and restore $GLOBALS for each test'],
['arg' => '--static-backup', 'desc' => 'Backup and restore static properties for each test'],
['spacer' => ''],
['arg' => '--strict-coverage', 'desc' => 'Be strict about code coverage metadata'],
['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'],
['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'],
['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'],
['arg' => '--default-time-limit <sec>', 'desc' => 'Timeout in seconds for tests that have no declared size'],
['arg' => '--dont-report-useless-tests', 'desc' => 'Do not report tests that do not test anything'],
['spacer' => ''],
['arg' => '--stop-on-defect', 'desc' => 'Stop after first error, failure, warning, or risky test'],
['arg' => '--stop-on-error', 'desc' => 'Stop after first error'],
['arg' => '--stop-on-failure', 'desc' => 'Stop after first failure'],
['arg' => '--stop-on-warning', 'desc' => 'Stop after first warning'],
['arg' => '--stop-on-risky', 'desc' => 'Stop after first risky test'],
['arg' => '--stop-on-deprecation', 'desc' => 'Stop after first test that triggered a deprecation'],
['arg' => '--stop-on-notice', 'desc' => 'Stop after first test that triggered a notice'],
['arg' => '--stop-on-skipped', 'desc' => 'Stop after first skipped test'],
['arg' => '--stop-on-incomplete', 'desc' => 'Stop after first incomplete test'],
['spacer' => ''],
['arg' => '--fail-on-warning', 'desc' => 'Signal failure using shell exit code when a warning was triggered'],
['arg' => '--fail-on-risky', 'desc' => 'Signal failure using shell exit code when a test was considered risky'],
['arg' => '--fail-on-deprecation', 'desc' => 'Signal failure using shell exit code when a deprecation was triggered'],
['arg' => '--fail-on-notice', 'desc' => 'Signal failure using shell exit code when a notice was triggered'],
['arg' => '--fail-on-skipped', 'desc' => 'Signal failure using shell exit code when a test was skipped'],
['arg' => '--fail-on-incomplete', 'desc' => 'Signal failure using shell exit code when a test was marked incomplete'],
['spacer' => ''],
['arg' => '--cache-result', 'desc' => 'Write test results to cache file'],
['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'],
['spacer' => ''],
['arg' => '--order-by <order>', 'desc' => 'Run tests in order: default|defects|depends|duration|no-depends|random|reverse|size'],
['arg' => '--random-order-seed <N>', 'desc' => 'Use the specified random seed when running tests in random order'],
],
'Reporting' => [
['arg' => '--colors <flag>', 'desc' => 'Use colors in output ("never", "auto" or "always")'],
['arg' => '--columns <n>', 'desc' => 'Number of columns to use for progress output'],
['arg' => '--columns max', 'desc' => 'Use maximum number of columns for progress output'],
['arg' => '--stderr', 'desc' => 'Write to STDERR instead of STDOUT'],
['spacer' => ''],
['arg' => '--no-progress', 'desc' => 'Disable output of test execution progress'],
['arg' => '--no-results', 'desc' => 'Disable output of test results'],
['arg' => '--no-output', 'desc' => 'Disable all output'],
['spacer' => ''],
['arg' => '--display-incomplete', 'desc' => 'Display details for incomplete tests'],
['arg' => '--display-skipped', 'desc' => 'Display details for skipped tests'],
['arg' => '--display-deprecations', 'desc' => 'Display details for deprecations triggered by tests'],
['arg' => '--display-errors', 'desc' => 'Display details for errors triggered by tests'],
['arg' => '--display-notices', 'desc' => 'Display details for notices triggered by tests'],
['arg' => '--display-warnings', 'desc' => 'Display details for warnings triggered by tests'],
['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'],
['spacer' => ''],
['arg' => '--teamcity', 'desc' => 'Replace default progress and result output with TeamCity format'],
['arg' => '--testdox', 'desc' => 'Replace default result output with TestDox format'],
['spacer' => ''],
['arg' => '--debug', 'desc' => 'Replace default progress and result output with debugging information'],
],
'Logging' => [
['arg' => '--log-junit <file>', 'desc' => 'Write test results in JUnit XML format to file'],
['arg' => '--log-teamcity <file>', 'desc' => 'Write test results in TeamCity format to file'],
['arg' => '--testdox-html <file>', 'desc' => 'Write test results in TestDox format (HTML) to file'],
['arg' => '--testdox-text <file>', 'desc' => 'Write test results in TestDox format (plain text) to file'],
['arg' => '--log-events-text <file>', 'desc' => 'Stream events as plain text to file'],
['arg' => '--log-events-verbose-text <file>', 'desc' => 'Stream events as plain text with extended information to file'],
['arg' => '--no-logging', 'desc' => 'Ignore logging configured in the XML configuration file'],
],
'Code Coverage' => [
['arg' => '--coverage-clover <file>', 'desc' => 'Write code coverage report in Clover XML format to file'],
['arg' => '--coverage-cobertura <file>', 'desc' => 'Write code coverage report in Cobertura XML format to file'],
['arg' => '--coverage-crap4j <file>', 'desc' => 'Write code coverage report in Crap4J XML format to file'],
['arg' => '--coverage-html <dir>', 'desc' => 'Write code coverage report in HTML format to directory'],
['arg' => '--coverage-php <file>', 'desc' => 'Write serialized code coverage data to file'],
['arg' => '--coverage-text=<file>', 'desc' => 'Write code coverage report in text format to file [default: standard output]'],
['arg' => '--coverage-xml <dir>', 'desc' => 'Write code coverage report in XML format to directory'],
['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'],
['arg' => '--coverage-filter <dir>', 'desc' => 'Include <dir> in code coverage reporting'],
['arg' => '--path-coverage', 'desc' => 'Report path coverage in addition to line coverage'],
['arg' => '--disable-coverage-ignore', 'desc' => 'Disable metadata for ignoring code coverage'],
['arg' => '--no-coverage', 'desc' => 'Ignore code coverage reporting configured in the XML configuration file'],
],
];
if (defined('__PHPUNIT_PHAR__')) {
$elements['PHAR'] = [
['arg' => '--manifest', 'desc' => 'Print Software Bill of Materials (SBOM) in plain-text format'],
['arg' => '--sbom', 'desc' => 'Print Software Bill of Materials (SBOM) in CycloneDX XML format'],
['arg' => '--composer-lock', 'desc' => 'Print composer.lock file used to build the PHAR'],
];
}
$elements['Miscellaneous'] = [
['arg' => '-h|--help', 'desc' => 'Prints this usage information'],
['arg' => '--version', 'desc' => 'Prints the version and exits'],
['arg' => '--atleast-version <min>', 'desc' => 'Checks that version is greater than <min> and exits'],
['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version and exits'],
];
return $elements;
}
}