Version v0.15.1

This commit is contained in:
Johannes Meyer 2025-10-16 09:25:52 +00:00
parent a7944e40e1
commit feda07744e
17 changed files with 178 additions and 128 deletions

View File

@ -1 +1 @@
v0.14.2
v0.15.1

83
composer.lock generated
View File

@ -186,26 +186,29 @@
},
{
"name": "doctrine/deprecations",
"version": "1.1.4",
"version": "1.1.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"phpunit/phpunit": "<=7.5 || >=13"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "1.4.10 || 2.0.3",
"doctrine/coding-standard": "^9 || ^12 || ^13",
"phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
@ -225,9 +228,9 @@
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.4"
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
},
"time": "2024-12-07T21:18:45+00:00"
"time": "2025-04-07T20:06:18+00:00"
},
{
"name": "dragonmantank/cron-expression",
@ -388,16 +391,16 @@
},
{
"name": "guzzlehttp/psr7",
"version": "2.7.0",
"version": "2.8.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
"reference": "21dc724a0583619cd1652f673303492272778051"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051",
"reference": "21dc724a0583619cd1652f673303492272778051",
"shasum": ""
},
"require": {
@ -413,7 +416,7 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"http-interop/http-factory-tests": "0.9.0",
"phpunit/phpunit": "^8.5.39 || ^9.6.20"
"phpunit/phpunit": "^8.5.44 || ^9.6.25"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
@ -484,7 +487,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.7.0"
"source": "https://github.com/guzzle/psr7/tree/2.8.0"
},
"funding": [
{
@ -500,20 +503,20 @@
"type": "tidelift"
}
],
"time": "2024-07-18T11:15:46+00:00"
"time": "2025-08-23T21:21:41+00:00"
},
{
"name": "ipl/html",
"version": "v0.8.1",
"version": "v0.8.2",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-html.git",
"reference": "07f2fea6c1ddf032d17dd327fc3c573b73e45ef2"
"reference": "e18bdf11abca5e477100e2c7d190ef5f424d0d98"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-html/zipball/07f2fea6c1ddf032d17dd327fc3c573b73e45ef2",
"reference": "07f2fea6c1ddf032d17dd327fc3c573b73e45ef2",
"url": "https://api.github.com/repos/Icinga/ipl-html/zipball/e18bdf11abca5e477100e2c7d190ef5f424d0d98",
"reference": "e18bdf11abca5e477100e2c7d190ef5f424d0d98",
"shasum": ""
},
"require": {
@ -545,9 +548,9 @@
],
"support": {
"issues": "https://github.com/Icinga/ipl-html/issues",
"source": "https://github.com/Icinga/ipl-html/tree/v0.8.1"
"source": "https://github.com/Icinga/ipl-html/tree/v0.8.2"
},
"time": "2024-06-12T09:56:17+00:00"
"time": "2025-05-21T09:00:03+00:00"
},
{
"name": "ipl/i18n",
@ -602,16 +605,16 @@
},
{
"name": "ipl/orm",
"version": "v0.6.2",
"version": "v0.6.3",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-orm.git",
"reference": "be4125eb37287babd77a2687ae17201480c88200"
"reference": "a775a2745764a8dc7f28618cce69dcd7bbfd7915"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-orm/zipball/be4125eb37287babd77a2687ae17201480c88200",
"reference": "be4125eb37287babd77a2687ae17201480c88200",
"url": "https://api.github.com/repos/Icinga/ipl-orm/zipball/a775a2745764a8dc7f28618cce69dcd7bbfd7915",
"reference": "a775a2745764a8dc7f28618cce69dcd7bbfd7915",
"shasum": ""
},
"require": {
@ -644,9 +647,9 @@
],
"support": {
"issues": "https://github.com/Icinga/ipl-orm/issues",
"source": "https://github.com/Icinga/ipl-orm/tree/v0.6.2"
"source": "https://github.com/Icinga/ipl-orm/tree/v0.6.3"
},
"time": "2025-01-23T12:06:37+00:00"
"time": "2025-06-12T11:57:55+00:00"
},
{
"name": "ipl/scheduler",
@ -1469,7 +1472,7 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.31.0",
"version": "v1.33.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
@ -1528,7 +1531,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0"
},
"funding": [
{
@ -1539,6 +1542,10 @@
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
@ -1548,16 +1555,16 @@
},
{
"name": "symfony/polyfill-php80",
"version": "v1.31.0",
"version": "v1.33.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"shasum": ""
},
"require": {
@ -1608,7 +1615,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0"
},
"funding": [
{
@ -1619,12 +1626,16 @@
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-09-09T11:45:10+00:00"
"time": "2025-01-02T08:10:11+00:00"
},
{
"name": "webmozart/assert",

View File

@ -189,33 +189,36 @@
},
{
"name": "doctrine/deprecations",
"version": "1.1.4",
"version_normalized": "1.1.4.0",
"version": "1.1.5",
"version_normalized": "1.1.5.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"phpunit/phpunit": "<=7.5 || >=13"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "1.4.10 || 2.0.3",
"doctrine/coding-standard": "^9 || ^12 || ^13",
"phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"time": "2024-12-07T21:18:45+00:00",
"time": "2025-04-07T20:06:18+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -231,7 +234,7 @@
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.4"
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
},
"install-path": "../doctrine/deprecations"
},
@ -403,17 +406,17 @@
},
{
"name": "guzzlehttp/psr7",
"version": "2.7.0",
"version_normalized": "2.7.0.0",
"version": "2.8.0",
"version_normalized": "2.8.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
"reference": "21dc724a0583619cd1652f673303492272778051"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051",
"reference": "21dc724a0583619cd1652f673303492272778051",
"shasum": ""
},
"require": {
@ -429,12 +432,12 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"http-interop/http-factory-tests": "0.9.0",
"phpunit/phpunit": "^8.5.39 || ^9.6.20"
"phpunit/phpunit": "^8.5.44 || ^9.6.25"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"time": "2024-07-18T11:15:46+00:00",
"time": "2025-08-23T21:21:41+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
@ -502,7 +505,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.7.0"
"source": "https://github.com/guzzle/psr7/tree/2.8.0"
},
"funding": [
{
@ -522,17 +525,17 @@
},
{
"name": "ipl/html",
"version": "v0.8.1",
"version_normalized": "0.8.1.0",
"version": "v0.8.2",
"version_normalized": "0.8.2.0",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-html.git",
"reference": "07f2fea6c1ddf032d17dd327fc3c573b73e45ef2"
"reference": "e18bdf11abca5e477100e2c7d190ef5f424d0d98"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-html/zipball/07f2fea6c1ddf032d17dd327fc3c573b73e45ef2",
"reference": "07f2fea6c1ddf032d17dd327fc3c573b73e45ef2",
"url": "https://api.github.com/repos/Icinga/ipl-html/zipball/e18bdf11abca5e477100e2c7d190ef5f424d0d98",
"reference": "e18bdf11abca5e477100e2c7d190ef5f424d0d98",
"shasum": ""
},
"require": {
@ -547,7 +550,7 @@
"ipl/stdlib": "dev-main",
"ipl/validator": "dev-main"
},
"time": "2024-06-12T09:56:17+00:00",
"time": "2025-05-21T09:00:03+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -566,7 +569,7 @@
],
"support": {
"issues": "https://github.com/Icinga/ipl-html/issues",
"source": "https://github.com/Icinga/ipl-html/tree/v0.8.1"
"source": "https://github.com/Icinga/ipl-html/tree/v0.8.2"
},
"install-path": "../ipl/html"
},
@ -626,17 +629,17 @@
},
{
"name": "ipl/orm",
"version": "v0.6.2",
"version_normalized": "0.6.2.0",
"version": "v0.6.3",
"version_normalized": "0.6.3.0",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-orm.git",
"reference": "be4125eb37287babd77a2687ae17201480c88200"
"reference": "a775a2745764a8dc7f28618cce69dcd7bbfd7915"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-orm/zipball/be4125eb37287babd77a2687ae17201480c88200",
"reference": "be4125eb37287babd77a2687ae17201480c88200",
"url": "https://api.github.com/repos/Icinga/ipl-orm/zipball/a775a2745764a8dc7f28618cce69dcd7bbfd7915",
"reference": "a775a2745764a8dc7f28618cce69dcd7bbfd7915",
"shasum": ""
},
"require": {
@ -650,7 +653,7 @@
"ipl/sql": "dev-main",
"ipl/stdlib": "dev-main"
},
"time": "2025-01-23T12:06:37+00:00",
"time": "2025-06-12T11:57:55+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -671,7 +674,7 @@
],
"support": {
"issues": "https://github.com/Icinga/ipl-orm/issues",
"source": "https://github.com/Icinga/ipl-orm/tree/v0.6.2"
"source": "https://github.com/Icinga/ipl-orm/tree/v0.6.3"
},
"install-path": "../ipl/orm"
},
@ -1543,8 +1546,8 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.31.0",
"version_normalized": "1.31.0.0",
"version": "v1.33.0",
"version_normalized": "1.33.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
@ -1605,7 +1608,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0"
},
"funding": [
{
@ -1616,6 +1619,10 @@
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
@ -1625,23 +1632,23 @@
},
{
"name": "symfony/polyfill-php80",
"version": "v1.31.0",
"version_normalized": "1.31.0.0",
"version": "v1.33.0",
"version_normalized": "1.33.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"time": "2024-09-09T11:45:10+00:00",
"time": "2025-01-02T08:10:11+00:00",
"type": "library",
"extra": {
"thanks": {
@ -1688,7 +1695,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0"
},
"funding": [
{
@ -1699,6 +1706,10 @@
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"

View File

@ -3,7 +3,7 @@
'name' => 'icinga/icinga-php-library',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'ca92d8e26e6d284df2e48433938c72186136bed1',
'reference' => 'a7944e40e1b1c5f88dcb04c253e07001cb9ddb4b',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -38,9 +38,9 @@
'dev_requirement' => false,
),
'doctrine/deprecations' => array(
'pretty_version' => '1.1.4',
'version' => '1.1.4.0',
'reference' => '31610dbb31faa98e6b5447b62340826f54fbc4e9',
'pretty_version' => '1.1.5',
'version' => '1.1.5.0',
'reference' => '459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38',
'type' => 'library',
'install_path' => __DIR__ . '/../doctrine/deprecations',
'aliases' => array(),
@ -74,9 +74,9 @@
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
'pretty_version' => '2.7.0',
'version' => '2.7.0.0',
'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201',
'pretty_version' => '2.8.0',
'version' => '2.8.0.0',
'reference' => '21dc724a0583619cd1652f673303492272778051',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
@ -85,16 +85,16 @@
'icinga/icinga-php-library' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'ca92d8e26e6d284df2e48433938c72186136bed1',
'reference' => 'a7944e40e1b1c5f88dcb04c253e07001cb9ddb4b',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'ipl/html' => array(
'pretty_version' => 'v0.8.1',
'version' => '0.8.1.0',
'reference' => '07f2fea6c1ddf032d17dd327fc3c573b73e45ef2',
'pretty_version' => 'v0.8.2',
'version' => '0.8.2.0',
'reference' => 'e18bdf11abca5e477100e2c7d190ef5f424d0d98',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/html',
'aliases' => array(),
@ -110,9 +110,9 @@
'dev_requirement' => false,
),
'ipl/orm' => array(
'pretty_version' => 'v0.6.2',
'version' => '0.6.2.0',
'reference' => 'be4125eb37287babd77a2687ae17201480c88200',
'pretty_version' => 'v0.6.3',
'version' => '0.6.3.0',
'reference' => 'a775a2745764a8dc7f28618cce69dcd7bbfd7915',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/orm',
'aliases' => array(),
@ -269,8 +269,8 @@
'dev_requirement' => false,
),
'symfony/polyfill-ctype' => array(
'pretty_version' => 'v1.31.0',
'version' => '1.31.0.0',
'pretty_version' => 'v1.33.0',
'version' => '1.33.0.0',
'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
@ -278,9 +278,9 @@
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
'pretty_version' => 'v1.31.0',
'version' => '1.31.0.0',
'reference' => '60328e362d4c2c802a54fcbf04f9d3fb892b4cf8',
'pretty_version' => 'v1.33.0',
'version' => '1.33.0.0',
'reference' => '0cc9dd0f17f61d8131e7df6b84bd344899fe2608',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),

View File

@ -8,12 +8,15 @@
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "1.4.10 || 2.0.3",
"doctrine/coding-standard": "^9 || ^12 || ^13",
"phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
"psr/log": "^1 || ^2 || ^3"
},
"conflict": {
"phpunit/phpunit": "<=7.5 || >=13"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},

View File

@ -5,6 +5,8 @@ declare(strict_types=1);
namespace Doctrine\Deprecations\PHPUnit;
use Doctrine\Deprecations\Deprecation;
use PHPUnit\Framework\Attributes\After;
use PHPUnit\Framework\Attributes\Before;
use function sprintf;
@ -27,12 +29,14 @@ trait VerifyDeprecations
}
/** @before */
#[Before]
public function enableDeprecationTracking(): void
{
Deprecation::enableTrackingDeprecations();
}
/** @after */
#[After]
public function verifyDeprecationsAreTriggered(): void
{
foreach ($this->doctrineDeprecationsExpectations as $identifier => $expectation) {

View File

@ -62,7 +62,7 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"http-interop/http-factory-tests": "0.9.0",
"phpunit/phpunit": "^8.5.39 || ^9.6.20"
"phpunit/phpunit": "^8.5.44 || ^9.6.25"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"

View File

@ -174,10 +174,6 @@ trait MessageTrait
return $this->trimAndValidateHeaderValues([$value]);
}
if (count($value) === 0) {
throw new \InvalidArgumentException('Header value can not be an empty array.');
}
return $this->trimAndValidateHeaderValues($value);
}

View File

@ -11,15 +11,15 @@ use RuntimeException;
class UploadedFile implements UploadedFileInterface
{
private const ERRORS = [
UPLOAD_ERR_OK,
UPLOAD_ERR_INI_SIZE,
UPLOAD_ERR_FORM_SIZE,
UPLOAD_ERR_PARTIAL,
UPLOAD_ERR_NO_FILE,
UPLOAD_ERR_NO_TMP_DIR,
UPLOAD_ERR_CANT_WRITE,
UPLOAD_ERR_EXTENSION,
private const ERROR_MAP = [
UPLOAD_ERR_OK => 'UPLOAD_ERR_OK',
UPLOAD_ERR_INI_SIZE => 'UPLOAD_ERR_INI_SIZE',
UPLOAD_ERR_FORM_SIZE => 'UPLOAD_ERR_FORM_SIZE',
UPLOAD_ERR_PARTIAL => 'UPLOAD_ERR_PARTIAL',
UPLOAD_ERR_NO_FILE => 'UPLOAD_ERR_NO_FILE',
UPLOAD_ERR_NO_TMP_DIR => 'UPLOAD_ERR_NO_TMP_DIR',
UPLOAD_ERR_CANT_WRITE => 'UPLOAD_ERR_CANT_WRITE',
UPLOAD_ERR_EXTENSION => 'UPLOAD_ERR_EXTENSION',
];
/**
@ -104,7 +104,7 @@ class UploadedFile implements UploadedFileInterface
*/
private function setError(int $error): void
{
if (false === in_array($error, UploadedFile::ERRORS, true)) {
if (!isset(UploadedFile::ERROR_MAP[$error])) {
throw new InvalidArgumentException(
'Invalid error status for UploadedFile'
);
@ -137,7 +137,7 @@ class UploadedFile implements UploadedFileInterface
private function validateActive(): void
{
if (false === $this->isOk()) {
throw new RuntimeException('Cannot retrieve stream due to upload error');
throw new RuntimeException(\sprintf('Cannot retrieve stream due to upload error (%s)', self::ERROR_MAP[$this->error]));
}
if ($this->isMoved()) {

View File

@ -107,7 +107,7 @@ class Uri implements UriInterface, \JsonSerializable
{
// If IPv6
$prefix = '';
if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) {
if (preg_match('%^(.*://\[[0-9:a-fA-F]+\])(.*?)$%', $url, $matches)) {
/** @var array{0:string, 1:string, 2:string} $matches */
$prefix = $matches[1];
$url = $matches[2];

View File

@ -397,7 +397,7 @@ final class Utils
restore_error_handler();
if ($ex) {
/** @var $ex \RuntimeException */
/** @var \RuntimeException $ex */
throw $ex;
}
@ -444,7 +444,7 @@ final class Utils
restore_error_handler();
if ($ex) {
/** @var $ex \RuntimeException */
/** @var \RuntimeException $ex */
throw $ex;
}

View File

@ -55,7 +55,7 @@ class Form extends BaseHtmlElement
*/
public static function isEmptyValue($value): bool
{
return $value === null || $value === '' || $value === [];
return $value === null || $value === [] || (is_string($value) && trim($value) === '');
}
/**

View File

@ -121,4 +121,13 @@ class CheckboxElement extends InputElement
return (new HiddenElement($this->getValueOfNameAttribute(), ['value' => $this->getUncheckedValue()])) . $html;
}
/**
* Determine if the checkbox is considered "checked".
* Returns true if the current value matches the checked value, otherwise false.
*/
public function hasValue(): bool
{
return $this->getValue() === $this->getCheckedValue();
}
}

View File

@ -15,6 +15,9 @@ class PasswordElement extends InputElement
/** @var bool Status of the form */
protected $isFormValid = true;
/** @var bool Status indicating if the form got submitted */
protected $isFormSubmitted = false;
protected function registerAttributeCallbacks(Attributes $attributes)
{
parent::registerAttributeCallbacks($attributes);
@ -22,11 +25,16 @@ class PasswordElement extends InputElement
$attributes->registerAttributeCallback(
'value',
function () {
if ($this->hasValue() && count($this->getValueCandidates()) === 1 && $this->isFormValid) {
if (
$this->hasValue()
&& count($this->getValueCandidates()) === 1
&& $this->isFormValid
&& ! $this->isFormSubmitted
) {
return self::DUMMYPASSWORD;
}
if (parent::getValue() === self::DUMMYPASSWORD) {
if (parent::getValue() === self::DUMMYPASSWORD && count($this->getValueCandidates()) > 1) {
return self::DUMMYPASSWORD;
}
@ -40,6 +48,10 @@ class PasswordElement extends InputElement
$form->on(Form::ON_VALIDATE, function ($form) {
$this->isFormValid = $form->isValid();
});
$form->on(Form::ON_SENT, function ($form) {
$this->isFormSubmitted = $form->hasBeenSent();
});
}
public function getValue()

View File

@ -106,6 +106,8 @@ class BoolCast extends PropertyBehavior
return true;
case $this->falseValue === $value:
return false;
case is_bool($value):
return $value;
default:
if ($this->isStrict() && $value !== null) {
throw new InvalidArgumentException(sprintf(

View File

@ -22,9 +22,8 @@ class UnionQuery extends Query
/** @var UnionModel $model */
$model = $this->getModel();
foreach ($model->getUnions() as list($target, $relations, $columns)) {
$query = (new Query())
->setDb($this->getDb())
->setModel(new $target())
/** @var class-string<Model> $target */
$query = $target::on($this->getDb())
->columns($columns)
->disableDefaultSort()
->with($relations);

View File

@ -29,7 +29,7 @@ class PhpToken implements \Stringable
public $text;
/**
* @var int
* @var -1|positive-int
*/
public $line;
@ -38,6 +38,9 @@ class PhpToken implements \Stringable
*/
public $pos;
/**
* @param -1|positive-int $line
*/
public function __construct(int $id, string $text, int $line = -1, int $position = -1)
{
$this->id = $id;
@ -80,7 +83,7 @@ class PhpToken implements \Stringable
}
/**
* @return static[]
* @return list<static>
*/
public static function tokenize(string $code, int $flags = 0): array
{