Version v0.15.0-dev

This commit is contained in:
github-actions[bot] 2024-11-12 18:05:51 +00:00
parent 10695d8ca3
commit f9916214e5
30 changed files with 501 additions and 256 deletions

View File

@ -1 +1 @@
v0.14.1
v0.15.0-dev

176
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "20d4022bc196691807f55d4a47c06474",
"content-hash": "f580b55d7310ea22a4bf2f6619442d6e",
"packages": [
{
"name": "brick/math",
@ -233,16 +233,16 @@
},
{
"name": "dragonmantank/cron-expression",
"version": "v3.3.3",
"version": "v3.4.0",
"source": {
"type": "git",
"url": "https://github.com/dragonmantank/cron-expression.git",
"reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a"
"reference": "8c784d071debd117328803d86b2097615b457500"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/adfb1f505deb6384dc8b39804c5065dd3c8c8c0a",
"reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a",
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8c784d071debd117328803d86b2097615b457500",
"reference": "8c784d071debd117328803d86b2097615b457500",
"shasum": ""
},
"require": {
@ -255,10 +255,14 @@
"require-dev": {
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Cron\\": "src/Cron/"
@ -282,7 +286,7 @@
],
"support": {
"issues": "https://github.com/dragonmantank/cron-expression/issues",
"source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.3"
"source": "https://github.com/dragonmantank/cron-expression/tree/v3.4.0"
},
"funding": [
{
@ -290,7 +294,7 @@
"type": "github"
}
],
"time": "2023-08-10T19:36:49+00:00"
"time": "2024-10-09T13:47:03+00:00"
},
{
"name": "evenement/evenement",
@ -502,7 +506,7 @@
},
{
"name": "ipl/html",
"version": "v0.8.1",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-html.git",
@ -526,6 +530,7 @@
"ipl/stdlib": "dev-main",
"ipl/validator": "dev-main"
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@ -549,7 +554,7 @@
},
{
"name": "ipl/i18n",
"version": "v0.2.2",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-i18n.git",
@ -570,6 +575,7 @@
"require-dev": {
"ipl/stdlib": "dev-main"
},
"default-branch": true,
"type": "library",
"autoload": {
"files": [
@ -600,16 +606,16 @@
},
{
"name": "ipl/orm",
"version": "v0.6.1",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-orm.git",
"reference": "d210c4793f6b3d78d0da3eaf0e0d1eb14167701c"
"reference": "832d9ff5346ddce2f2ef19919815067a40bc1ec2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-orm/zipball/d210c4793f6b3d78d0da3eaf0e0d1eb14167701c",
"reference": "d210c4793f6b3d78d0da3eaf0e0d1eb14167701c",
"url": "https://api.github.com/repos/Icinga/ipl-orm/zipball/832d9ff5346ddce2f2ef19919815067a40bc1ec2",
"reference": "832d9ff5346ddce2f2ef19919815067a40bc1ec2",
"shasum": ""
},
"require": {
@ -623,6 +629,7 @@
"ipl/sql": "dev-main",
"ipl/stdlib": "dev-main"
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@ -642,13 +649,13 @@
],
"support": {
"issues": "https://github.com/Icinga/ipl-orm/issues",
"source": "https://github.com/Icinga/ipl-orm/tree/v0.6.1"
"source": "https://github.com/Icinga/ipl-orm/tree/main"
},
"time": "2024-04-08T13:03:36+00:00"
"time": "2024-09-24T08:55:43+00:00"
},
{
"name": "ipl/scheduler",
"version": "v0.1.2",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-scheduler.git",
@ -677,6 +684,7 @@
"suggest": {
"ext-ev": "Improves performance, efficiency and avoids system limitations. Highly recommended! (See https://www.php.net/manual/en/intro.ev.php for details)"
},
"default-branch": true,
"type": "library",
"autoload": {
"files": [
@ -706,7 +714,7 @@
},
{
"name": "ipl/sql",
"version": "v0.7.1",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-sql.git",
@ -726,6 +734,7 @@
"require-dev": {
"ipl/stdlib": "dev-main"
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@ -750,7 +759,7 @@
},
{
"name": "ipl/stdlib",
"version": "v0.14.0",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-stdlib.git",
@ -767,6 +776,7 @@
"ext-openssl": "*",
"php": ">=7.2"
},
"default-branch": true,
"type": "library",
"autoload": {
"files": [
@ -789,16 +799,16 @@
},
{
"name": "ipl/validator",
"version": "v0.5.0",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-validator.git",
"reference": "a601fae0ed330e63cea50e4a2a6659ca1ad97bde"
"reference": "bacdda8027d0b4c2937185882d06b1876818b247"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-validator/zipball/a601fae0ed330e63cea50e4a2a6659ca1ad97bde",
"reference": "a601fae0ed330e63cea50e4a2a6659ca1ad97bde",
"url": "https://api.github.com/repos/Icinga/ipl-validator/zipball/bacdda8027d0b4c2937185882d06b1876818b247",
"reference": "bacdda8027d0b4c2937185882d06b1876818b247",
"shasum": ""
},
"require": {
@ -807,11 +817,14 @@
"ipl/i18n": ">=0.2.0",
"ipl/stdlib": ">=0.12.0",
"php": ">=7.2",
"psr/http-message": "~1.0"
"psr/http-message": "^1.1"
},
"require-dev": {
"guzzlehttp/psr7": "^1"
"guzzlehttp/psr7": "^1",
"ipl/i18n": "dev-main",
"ipl/stdlib": "dev-main"
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@ -826,22 +839,22 @@
"homepage": "https://github.com/Icinga/ipl-validator",
"support": {
"issues": "https://github.com/Icinga/ipl-validator/issues",
"source": "https://github.com/Icinga/ipl-validator/tree/v0.5.0"
"source": "https://github.com/Icinga/ipl-validator/tree/main"
},
"time": "2023-03-21T15:59:00+00:00"
"time": "2024-04-15T14:38:01+00:00"
},
{
"name": "ipl/web",
"version": "v0.10.1",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-web.git",
"reference": "f4a7411791527935c426266f0aca0dba38f02780"
"reference": "f449fa78a03c0269180630dfcccce18d888bec00"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-web/zipball/f4a7411791527935c426266f0aca0dba38f02780",
"reference": "f4a7411791527935c426266f0aca0dba38f02780",
"url": "https://api.github.com/repos/Icinga/ipl-web/zipball/f449fa78a03c0269180630dfcccce18d888bec00",
"reference": "f449fa78a03c0269180630dfcccce18d888bec00",
"shasum": ""
},
"require": {
@ -864,6 +877,7 @@
"ipl/stdlib": "dev-main",
"shardj/zf1-future": "^1.22"
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@ -881,9 +895,9 @@
],
"support": {
"issues": "https://github.com/Icinga/ipl-web/issues",
"source": "https://github.com/Icinga/ipl-web/tree/v0.10.1"
"source": "https://github.com/Icinga/ipl-web/tree/main"
},
"time": "2024-08-05T12:02:43+00:00"
"time": "2024-10-24T11:58:33+00:00"
},
{
"name": "psr/http-factory",
@ -1467,20 +1481,20 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.30.0",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540"
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"provide": {
"ext-ctype": "*"
@ -1526,7 +1540,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
},
"funding": [
{
@ -1542,24 +1556,24 @@
"type": "tidelift"
}
],
"time": "2024-05-31T15:07:36+00:00"
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.30.0",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433"
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"type": "library",
"extra": {
@ -1606,7 +1620,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
},
"funding": [
{
@ -1622,7 +1636,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T15:07:36+00:00"
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "webmozart/assert",
@ -1759,15 +1773,73 @@
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"aliases": [
{
"package": "ipl/html",
"version": "dev-main",
"alias": "99.x-dev",
"alias_normalized": "99.9999999.9999999.9999999-dev"
},
{
"package": "ipl/i18n",
"version": "dev-main",
"alias": "99.x-dev",
"alias_normalized": "99.9999999.9999999.9999999-dev"
},
{
"package": "ipl/orm",
"version": "dev-main",
"alias": "99.x-dev",
"alias_normalized": "99.9999999.9999999.9999999-dev"
},
{
"package": "ipl/scheduler",
"version": "dev-main",
"alias": "99.x-dev",
"alias_normalized": "99.9999999.9999999.9999999-dev"
},
{
"package": "ipl/sql",
"version": "dev-main",
"alias": "99.x-dev",
"alias_normalized": "99.9999999.9999999.9999999-dev"
},
{
"package": "ipl/stdlib",
"version": "dev-main",
"alias": "99.x-dev",
"alias_normalized": "99.9999999.9999999.9999999-dev"
},
{
"package": "ipl/validator",
"version": "dev-main",
"alias": "99.x-dev",
"alias_normalized": "99.9999999.9999999.9999999-dev"
},
{
"package": "ipl/web",
"version": "dev-main",
"alias": "99.x-dev",
"alias_normalized": "99.9999999.9999999.9999999-dev"
}
],
"minimum-stability": "dev",
"stability-flags": {
"ipl/html": 20,
"ipl/i18n": 20,
"ipl/orm": 20,
"ipl/scheduler": 20,
"ipl/sql": 20,
"ipl/stdlib": 20,
"ipl/validator": 20,
"ipl/web": 20
},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": ">=7.2"
},
"platform-dev": [],
"platform-dev": {},
"platform-overrides": {
"php": "7.2.9"
},

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit20d4022bc196691807f55d4a47c06474::getLoader();
return ComposerAutoloaderInitf580b55d7310ea22a4bf2f6619442d6e::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit20d4022bc196691807f55d4a47c06474
class ComposerAutoloaderInitf580b55d7310ea22a4bf2f6619442d6e
{
private static $loader;
@ -24,16 +24,16 @@ class ComposerAutoloaderInit20d4022bc196691807f55d4a47c06474
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit20d4022bc196691807f55d4a47c06474', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitf580b55d7310ea22a4bf2f6619442d6e', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit20d4022bc196691807f55d4a47c06474', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitf580b55d7310ea22a4bf2f6619442d6e', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit20d4022bc196691807f55d4a47c06474::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitf580b55d7310ea22a4bf2f6619442d6e::getInitializer($loader));
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit20d4022bc196691807f55d4a47c06474::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitf580b55d7310ea22a4bf2f6619442d6e::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit20d4022bc196691807f55d4a47c06474
class ComposerStaticInitf580b55d7310ea22a4bf2f6619442d6e
{
public static $files = array (
'a2c78434f64e5f5ed402f42eee19c025' => __DIR__ . '/..' . '/ipl/stdlib/src/functions_include.php',
@ -212,10 +212,10 @@ class ComposerStaticInit20d4022bc196691807f55d4a47c06474
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit20d4022bc196691807f55d4a47c06474::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit20d4022bc196691807f55d4a47c06474::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit20d4022bc196691807f55d4a47c06474::$prefixesPsr0;
$loader->classMap = ComposerStaticInit20d4022bc196691807f55d4a47c06474::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitf580b55d7310ea22a4bf2f6619442d6e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitf580b55d7310ea22a4bf2f6619442d6e::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInitf580b55d7310ea22a4bf2f6619442d6e::$prefixesPsr0;
$loader->classMap = ComposerStaticInitf580b55d7310ea22a4bf2f6619442d6e::$classMap;
}, null, ClassLoader::class);
}

View File

@ -239,17 +239,17 @@
},
{
"name": "dragonmantank/cron-expression",
"version": "v3.3.3",
"version_normalized": "3.3.3.0",
"version": "v3.4.0",
"version_normalized": "3.4.0.0",
"source": {
"type": "git",
"url": "https://github.com/dragonmantank/cron-expression.git",
"reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a"
"reference": "8c784d071debd117328803d86b2097615b457500"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/adfb1f505deb6384dc8b39804c5065dd3c8c8c0a",
"reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a",
"url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8c784d071debd117328803d86b2097615b457500",
"reference": "8c784d071debd117328803d86b2097615b457500",
"shasum": ""
},
"require": {
@ -262,11 +262,15 @@
"require-dev": {
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0"
},
"time": "2023-08-10T19:36:49+00:00",
"time": "2024-10-09T13:47:03+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
@ -291,7 +295,7 @@
],
"support": {
"issues": "https://github.com/dragonmantank/cron-expression/issues",
"source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.3"
"source": "https://github.com/dragonmantank/cron-expression/tree/v3.4.0"
},
"funding": [
{
@ -520,8 +524,8 @@
},
{
"name": "ipl/html",
"version": "v0.8.1",
"version_normalized": "0.8.1.0",
"version": "dev-main",
"version_normalized": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-html.git",
@ -546,6 +550,7 @@
"ipl/validator": "dev-main"
},
"time": "2024-06-12T09:56:17+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
@ -570,8 +575,8 @@
},
{
"name": "ipl/i18n",
"version": "v0.2.2",
"version_normalized": "0.2.2.0",
"version": "dev-main",
"version_normalized": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-i18n.git",
@ -593,6 +598,7 @@
"ipl/stdlib": "dev-main"
},
"time": "2024-04-08T12:28:47+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
@ -624,17 +630,17 @@
},
{
"name": "ipl/orm",
"version": "v0.6.1",
"version_normalized": "0.6.1.0",
"version": "dev-main",
"version_normalized": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-orm.git",
"reference": "d210c4793f6b3d78d0da3eaf0e0d1eb14167701c"
"reference": "832d9ff5346ddce2f2ef19919815067a40bc1ec2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-orm/zipball/d210c4793f6b3d78d0da3eaf0e0d1eb14167701c",
"reference": "d210c4793f6b3d78d0da3eaf0e0d1eb14167701c",
"url": "https://api.github.com/repos/Icinga/ipl-orm/zipball/832d9ff5346ddce2f2ef19919815067a40bc1ec2",
"reference": "832d9ff5346ddce2f2ef19919815067a40bc1ec2",
"shasum": ""
},
"require": {
@ -648,7 +654,8 @@
"ipl/sql": "dev-main",
"ipl/stdlib": "dev-main"
},
"time": "2024-04-08T13:03:36+00:00",
"time": "2024-09-24T08:55:43+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
@ -669,14 +676,14 @@
],
"support": {
"issues": "https://github.com/Icinga/ipl-orm/issues",
"source": "https://github.com/Icinga/ipl-orm/tree/v0.6.1"
"source": "https://github.com/Icinga/ipl-orm/tree/main"
},
"install-path": "../ipl/orm"
},
{
"name": "ipl/scheduler",
"version": "v0.1.2",
"version_normalized": "0.1.2.0",
"version": "dev-main",
"version_normalized": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-scheduler.git",
@ -706,6 +713,7 @@
"ext-ev": "Improves performance, efficiency and avoids system limitations. Highly recommended! (See https://www.php.net/manual/en/intro.ev.php for details)"
},
"time": "2023-08-30T14:14:23+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
@ -736,8 +744,8 @@
},
{
"name": "ipl/sql",
"version": "v0.7.1",
"version_normalized": "0.7.1.0",
"version": "dev-main",
"version_normalized": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-sql.git",
@ -758,6 +766,7 @@
"ipl/stdlib": "dev-main"
},
"time": "2024-06-25T09:55:43+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
@ -783,8 +792,8 @@
},
{
"name": "ipl/stdlib",
"version": "v0.14.0",
"version_normalized": "0.14.0.0",
"version": "dev-main",
"version_normalized": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-stdlib.git",
@ -802,6 +811,7 @@
"php": ">=7.2"
},
"time": "2024-04-22T08:47:08+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
@ -825,17 +835,17 @@
},
{
"name": "ipl/validator",
"version": "v0.5.0",
"version_normalized": "0.5.0.0",
"version": "dev-main",
"version_normalized": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-validator.git",
"reference": "a601fae0ed330e63cea50e4a2a6659ca1ad97bde"
"reference": "bacdda8027d0b4c2937185882d06b1876818b247"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-validator/zipball/a601fae0ed330e63cea50e4a2a6659ca1ad97bde",
"reference": "a601fae0ed330e63cea50e4a2a6659ca1ad97bde",
"url": "https://api.github.com/repos/Icinga/ipl-validator/zipball/bacdda8027d0b4c2937185882d06b1876818b247",
"reference": "bacdda8027d0b4c2937185882d06b1876818b247",
"shasum": ""
},
"require": {
@ -844,12 +854,15 @@
"ipl/i18n": ">=0.2.0",
"ipl/stdlib": ">=0.12.0",
"php": ">=7.2",
"psr/http-message": "~1.0"
"psr/http-message": "^1.1"
},
"require-dev": {
"guzzlehttp/psr7": "^1"
"guzzlehttp/psr7": "^1",
"ipl/i18n": "dev-main",
"ipl/stdlib": "dev-main"
},
"time": "2023-03-21T15:59:00+00:00",
"time": "2024-04-15T14:38:01+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
@ -865,23 +878,23 @@
"homepage": "https://github.com/Icinga/ipl-validator",
"support": {
"issues": "https://github.com/Icinga/ipl-validator/issues",
"source": "https://github.com/Icinga/ipl-validator/tree/v0.5.0"
"source": "https://github.com/Icinga/ipl-validator/tree/main"
},
"install-path": "../ipl/validator"
},
{
"name": "ipl/web",
"version": "v0.10.1",
"version_normalized": "0.10.1.0",
"version": "dev-main",
"version_normalized": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/Icinga/ipl-web.git",
"reference": "f4a7411791527935c426266f0aca0dba38f02780"
"reference": "f449fa78a03c0269180630dfcccce18d888bec00"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Icinga/ipl-web/zipball/f4a7411791527935c426266f0aca0dba38f02780",
"reference": "f4a7411791527935c426266f0aca0dba38f02780",
"url": "https://api.github.com/repos/Icinga/ipl-web/zipball/f449fa78a03c0269180630dfcccce18d888bec00",
"reference": "f449fa78a03c0269180630dfcccce18d888bec00",
"shasum": ""
},
"require": {
@ -904,7 +917,8 @@
"ipl/stdlib": "dev-main",
"shardj/zf1-future": "^1.22"
},
"time": "2024-08-05T12:02:43+00:00",
"time": "2024-10-24T11:58:33+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
@ -923,7 +937,7 @@
],
"support": {
"issues": "https://github.com/Icinga/ipl-web/issues",
"source": "https://github.com/Icinga/ipl-web/tree/v0.10.1"
"source": "https://github.com/Icinga/ipl-web/tree/main"
},
"install-path": "../ipl/web"
},
@ -1541,21 +1555,21 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.30.0",
"version_normalized": "1.30.0.0",
"version": "v1.31.0",
"version_normalized": "1.31.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540"
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"provide": {
"ext-ctype": "*"
@ -1563,7 +1577,7 @@
"suggest": {
"ext-ctype": "For best performance"
},
"time": "2024-05-31T15:07:36+00:00",
"time": "2024-09-09T11:45:10+00:00",
"type": "library",
"extra": {
"thanks": {
@ -1603,7 +1617,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
},
"funding": [
{
@ -1623,23 +1637,23 @@
},
{
"name": "symfony/polyfill-php80",
"version": "v1.30.0",
"version_normalized": "1.30.0.0",
"version": "v1.31.0",
"version_normalized": "1.31.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433"
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"time": "2024-05-31T15:07:36+00:00",
"time": "2024-09-09T11:45:10+00:00",
"type": "library",
"extra": {
"thanks": {
@ -1686,7 +1700,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
},
"funding": [
{

View File

@ -3,7 +3,7 @@
'name' => 'icinga/icinga-php-library',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'ca92d8e26e6d284df2e48433938c72186136bed1',
'reference' => '10695d8ca35b2ee0651d08e14670ba854c7b845e',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -47,9 +47,9 @@
'dev_requirement' => false,
),
'dragonmantank/cron-expression' => array(
'pretty_version' => 'v3.3.3',
'version' => '3.3.3.0',
'reference' => 'adfb1f505deb6384dc8b39804c5065dd3c8c8c0a',
'pretty_version' => 'v3.4.0',
'version' => '3.4.0.0',
'reference' => '8c784d071debd117328803d86b2097615b457500',
'type' => 'library',
'install_path' => __DIR__ . '/../dragonmantank/cron-expression',
'aliases' => array(),
@ -85,82 +85,106 @@
'icinga/icinga-php-library' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'ca92d8e26e6d284df2e48433938c72186136bed1',
'reference' => '10695d8ca35b2ee0651d08e14670ba854c7b845e',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'ipl/html' => array(
'pretty_version' => 'v0.8.1',
'version' => '0.8.1.0',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '07f2fea6c1ddf032d17dd327fc3c573b73e45ef2',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/html',
'aliases' => array(),
'aliases' => array(
0 => '99.x-dev',
1 => '9999999-dev',
),
'dev_requirement' => false,
),
'ipl/i18n' => array(
'pretty_version' => 'v0.2.2',
'version' => '0.2.2.0',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'a2b6109c5a93f86ce46d5dc351dbe75e8502cf8c',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/i18n',
'aliases' => array(),
'aliases' => array(
0 => '99.x-dev',
1 => '9999999-dev',
),
'dev_requirement' => false,
),
'ipl/orm' => array(
'pretty_version' => 'v0.6.1',
'version' => '0.6.1.0',
'reference' => 'd210c4793f6b3d78d0da3eaf0e0d1eb14167701c',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '832d9ff5346ddce2f2ef19919815067a40bc1ec2',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/orm',
'aliases' => array(),
'aliases' => array(
0 => '99.x-dev',
1 => '9999999-dev',
),
'dev_requirement' => false,
),
'ipl/scheduler' => array(
'pretty_version' => 'v0.1.2',
'version' => '0.1.2.0',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '6119afdea07b1390bd728e350e0d80b26ec8d6ba',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/scheduler',
'aliases' => array(),
'aliases' => array(
0 => '99.x-dev',
1 => '9999999-dev',
),
'dev_requirement' => false,
),
'ipl/sql' => array(
'pretty_version' => 'v0.7.1',
'version' => '0.7.1.0',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'e80f1b712c4b96099b0bf9096e6efe317a165e3b',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/sql',
'aliases' => array(),
'aliases' => array(
0 => '99.x-dev',
1 => '9999999-dev',
),
'dev_requirement' => false,
),
'ipl/stdlib' => array(
'pretty_version' => 'v0.14.0',
'version' => '0.14.0.0',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'bf5fc8f40b86bd90337db6f3be389be2a93fa64a',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/stdlib',
'aliases' => array(),
'aliases' => array(
0 => '99.x-dev',
1 => '9999999-dev',
),
'dev_requirement' => false,
),
'ipl/validator' => array(
'pretty_version' => 'v0.5.0',
'version' => '0.5.0.0',
'reference' => 'a601fae0ed330e63cea50e4a2a6659ca1ad97bde',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'bacdda8027d0b4c2937185882d06b1876818b247',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/validator',
'aliases' => array(),
'aliases' => array(
0 => '99.x-dev',
1 => '9999999-dev',
),
'dev_requirement' => false,
),
'ipl/web' => array(
'pretty_version' => 'v0.10.1',
'version' => '0.10.1.0',
'reference' => 'f4a7411791527935c426266f0aca0dba38f02780',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'f449fa78a03c0269180630dfcccce18d888bec00',
'type' => 'library',
'install_path' => __DIR__ . '/../ipl/web',
'aliases' => array(),
'aliases' => array(
0 => '99.x-dev',
1 => '9999999-dev',
),
'dev_requirement' => false,
),
'mtdowling/cron-expression' => array(
@ -269,18 +293,18 @@
'dev_requirement' => false,
),
'symfony/polyfill-ctype' => array(
'pretty_version' => 'v1.30.0',
'version' => '1.30.0.0',
'reference' => '0424dff1c58f028c451efff2045f5d92410bd540',
'pretty_version' => 'v1.31.0',
'version' => '1.31.0.0',
'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
'pretty_version' => 'v1.30.0',
'version' => '1.30.0.0',
'reference' => '77fa7995ac1b21ab60769b7323d600a991a90433',
'pretty_version' => 'v1.31.0',
'version' => '1.31.0.0',
'reference' => '60328e362d4c2c802a54fcbf04f9d3fb892b4cf8',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),

View File

@ -18,7 +18,6 @@
"require-dev": {
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpstan/extension-installer": "^1.0"
},
"autoload": {
@ -38,6 +37,11 @@
"phpstan": "./vendor/bin/phpstan analyze",
"test": "phpunit"
},
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"config": {
"allow-plugins": {
"ocramius/package-versions": true,

View File

@ -12,7 +12,6 @@ use Exception;
use InvalidArgumentException;
use LogicException;
use RuntimeException;
use Webmozart\Assert\Assert;
/**
* CRON expression parser that can determine whether or not a CRON expression is
@ -148,7 +147,7 @@ class CronExpression
/**
* @deprecated since version 3.0.2, use __construct instead.
*/
public static function factory(string $expression, FieldFactoryInterface $fieldFactory = null): CronExpression
public static function factory(string $expression, ?FieldFactoryInterface $fieldFactory = null): CronExpression
{
/** @phpstan-ignore-next-line */
return new static($expression, $fieldFactory);
@ -179,7 +178,7 @@ class CronExpression
* @param null|FieldFactoryInterface $fieldFactory Factory to create cron fields
* @throws InvalidArgumentException
*/
public function __construct(string $expression, FieldFactoryInterface $fieldFactory = null)
public function __construct(string $expression, ?FieldFactoryInterface $fieldFactory = null)
{
$shortcut = strtolower($expression);
$expression = self::$registeredAliases[$shortcut] ?? $expression;
@ -200,7 +199,12 @@ class CronExpression
public function setExpression(string $value): CronExpression
{
$split = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
Assert::isArray($split);
if (!\is_array($split)) {
throw new InvalidArgumentException(
$value . ' is not a valid CRON expression'
);
}
$notEnoughParts = \count($split) < 5;
@ -334,7 +338,10 @@ class CronExpression
$currentTime = new DateTime($currentTime);
}
Assert::isInstanceOf($currentTime, DateTime::class);
if (!$currentTime instanceof DateTime) {
throw new InvalidArgumentException('invalid current time');
}
$currentTime->setTimezone(new DateTimeZone($timeZone));
$matches = [];
@ -420,7 +427,10 @@ class CronExpression
$currentTime = new DateTime($currentTime);
}
Assert::isInstanceOf($currentTime, DateTime::class);
if (!$currentTime instanceof DateTime) {
throw new InvalidArgumentException('invalid current time');
}
$currentTime->setTimezone(new DateTimeZone($timeZone));
// drop the seconds to 0
@ -462,7 +472,10 @@ class CronExpression
$currentDate = new DateTime('now');
}
Assert::isInstanceOf($currentDate, DateTime::class);
if (!$currentDate instanceof DateTime) {
throw new InvalidArgumentException('invalid current date');
}
$currentDate->setTimezone(new DateTimeZone($timeZone));
// Workaround for setTime causing an offset change: https://bugs.php.net/bug.php?id=81074
$currentDate = DateTime::createFromFormat("!Y-m-d H:iO", $currentDate->format("Y-m-d H:iP"), $currentDate->getTimezone());

View File

@ -454,7 +454,18 @@ class Query implements Filterable, LimitOffsetInterface, OrderByInterface, Pagin
foreach ($resolved as $target) {
$targetColumns = $resolved[$target]->getArrayCopy();
if (isset($omitted[$target])) {
$targetColumns = array_diff($targetColumns, $omitted[$target]->getArrayCopy());
$toExclude = $omitted[$target]->getArrayCopy();
$targetColumns = array_filter($targetColumns, function ($column, $alias) use ($toExclude) {
if (is_string($alias) && isset($toExclude[$alias])) {
return false;
}
if (is_string($alias)) {
return ! in_array($alias, $toExclude, true);
}
return ! in_array($column, $toExclude, true);
}, ARRAY_FILTER_USE_BOTH);
}
if (! empty($customAliases)) {

View File

@ -10,7 +10,7 @@
"ext-openssl": "*",
"ipl/stdlib": ">=0.12.0",
"ipl/i18n": ">=0.2.0",
"psr/http-message": "~1.0"
"psr/http-message": "^1.1"
},
"autoload": {
"psr-4": {
@ -23,6 +23,8 @@
}
},
"require-dev": {
"guzzlehttp/psr7": "^1"
"guzzlehttp/psr7": "^1",
"ipl/stdlib": "dev-main",
"ipl/i18n": "dev-main"
}
}

View File

@ -12,10 +12,10 @@ class BetweenValidator extends BaseValidator
{
use Translation;
/** @var mixed Min value */
/** @var int|float Min value */
protected $min;
/** @var mixed Max value */
/** @var int|float Max value */
protected $max;
/**
@ -33,14 +33,14 @@ class BetweenValidator extends BaseValidator
*
* Required options:
*
* - min: (scalar) Minimum border
* - max: (scalar) Maximum border
* - min: (int|float) Minimum border
* - max: (int|float) Maximum border
*
* Optional options:
*
* - inclusive: (bool) Whether inclusive border values, default true
*
* @param array $options
* @param array{min: int|float, max: int|float, inclusive?: bool} $options
*
* @throws Exception When required option is missing
*/
@ -58,7 +58,7 @@ class BetweenValidator extends BaseValidator
/**
* Return the min option
*
* @return mixed
* @return int|float
*/
public function getMin()
{
@ -68,7 +68,7 @@ class BetweenValidator extends BaseValidator
/**
* Set the min option
*
* @param mixed $min
* @param int|float $min
*
* @return $this
*/
@ -82,7 +82,7 @@ class BetweenValidator extends BaseValidator
/**
* Return the max option
*
* @return mixed
* @return int|float
*/
public function getMax()
{
@ -92,7 +92,7 @@ class BetweenValidator extends BaseValidator
/**
* Set the max option
*
* @param mixed $max
* @param int|float $max
*
* @return $this
*/
@ -120,14 +120,19 @@ class BetweenValidator extends BaseValidator
*
* @return $this
*/
public function setInclusive($inclusive = true): self
public function setInclusive(bool $inclusive = true): self
{
$this->inclusive = (bool) $inclusive;
$this->inclusive = $inclusive;
return $this;
}
public function isValid($value)
/**
* @param int|float $value
*
* @return bool
*/
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();

View File

@ -35,7 +35,7 @@ class CallbackValidator extends BaseValidator
$this->callback = $callback;
}
public function isValid($value)
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();

View File

@ -12,6 +12,10 @@ class CidrValidator extends BaseValidator
{
use Translation;
/**
* @param string $value
* @return bool
*/
public function isValid($value): bool
{
$this->clearMessages();

View File

@ -23,9 +23,9 @@ class DateTimeValidator extends BaseValidator
*
* @param bool $local
*/
public function __construct($local = true)
public function __construct(bool $local = true)
{
$this->local = (bool) $local;
$this->local = $local;
}
/**
@ -35,7 +35,7 @@ class DateTimeValidator extends BaseValidator
*
* @return bool
*/
public function isValid($value)
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();

View File

@ -15,7 +15,7 @@ class DeferredInArrayValidator extends InArrayValidator
*
* **Required parameter:**
*
* - `callback`: (`callable`) The callback to create haystack
* - `callback`: (`callable`) The callback to create the haystack
*
* **Optional parameter:**
*
@ -23,8 +23,8 @@ class DeferredInArrayValidator extends InArrayValidator
*
* * `strict`: (`bool`) Whether the types of the needle in the haystack should also match, default `false`
*
* @param callable $callback Validation callback
* @param array $options
* @param callable $callback The callback to create the haystack
* @param array{haystack?: mixed[], strict?: bool} $options
*/
public function __construct(callable $callback, array $options = [])
{

View File

@ -40,7 +40,7 @@ class EmailAddressValidator extends BaseValidator
* 'mx' => If an MX check should be enabled, boolean
* 'deep' => If a deep MX check should be enabled, boolean
*
* @param array $options
* @param array{max?: bool, deep?: bool} $options
*
* @throws Exception
*/
@ -266,7 +266,8 @@ class EmailAddressValidator extends BaseValidator
//decode IDN domain name
$decodedHostname = idn_to_ascii($hostname, 0, INTL_IDNA_VARIANT_UTS46);
$result = getmxrr($decodedHostname, $mxHosts);
$result = $decodedHostname && getmxrr($decodedHostname, $mxHosts);
if (! $result) {
$this->addMessage(sprintf(
$this->translate("'%s' does not appear to have a valid MX record for the email address '%s'"),

View File

@ -34,6 +34,8 @@ class FileValidator extends BaseValidator
* - maxSize: (int) Maximum allowed file size, by default no limit
* - maxFileNameLength: (int) Maximum allowed file name length, by default no limit
* - mimeType: (array) Allowed mime types, by default no restriction
*
* @param array{minSize?: int, maxSize?: int, maxFileNameLength?: int, mimeType?: string[]} $options
*/
public function __construct(array $options = [])
{
@ -160,7 +162,11 @@ class FileValidator extends BaseValidator
return $this;
}
public function isValid($value)
/**
* @param UploadedFileInterface|UploadedFileInterface[] $value
* @return bool
*/
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();
@ -185,7 +191,7 @@ class FileValidator extends BaseValidator
if ($this->getMaxSize() && $file->getSize() > $this->getMaxSize()) {
$this->addMessage(sprintf(
$this->translate('File %s is bigger than the allowed maximum size of %d'),
$file->getClientFileName(),
$file->getClientFilename(),
$this->getMaxSize()
));
@ -195,7 +201,7 @@ class FileValidator extends BaseValidator
if ($this->getMinSize() && $file->getSize() < $this->getMinSize()) {
$this->addMessage(sprintf(
$this->translate('File %s is smaller than the minimum required size of %d'),
$file->getClientFileName(),
$file->getClientFilename(),
$this->getMinSize()
));
@ -205,7 +211,7 @@ class FileValidator extends BaseValidator
if ($this->getMaxFileNameLength()) {
$strValidator = new StringLengthValidator(['max' => $this->getMaxFileNameLength()]);
if (! $strValidator->isValid($file->getClientFilename())) {
if (! $strValidator->isValid($file->getClientFilename() ?? '')) {
$this->addMessage(sprintf(
$this->translate('File name is longer than the allowed length of %d characters.'),
$this->maxFileNameLength
@ -217,26 +223,29 @@ class FileValidator extends BaseValidator
if (! empty($this->getAllowedMimeTypes())) {
$hasAllowedMimeType = false;
foreach ($this->getAllowedMimeTypes() as $type) {
$fileMimetype = $file->getClientMediaType();
if (($pos = strpos($type, '/*')) !== false) { // image/*
$typePrefix = substr($type, 0, $pos);
if (Str::startsWith($fileMimetype, $typePrefix)) {
$fileMimetype = $file->getClientMediaType();
if ($fileMimetype) {
foreach ($this->getAllowedMimeTypes() as $type) {
if (($pos = strpos($type, '/*')) !== false) { // image/*
$typePrefix = substr($type, 0, $pos);
if (Str::startsWith($fileMimetype, $typePrefix)) {
$hasAllowedMimeType = true;
break;
}
} elseif ($fileMimetype === $type) { // image/png
$hasAllowedMimeType = true;
break;
}
} elseif ($fileMimetype === $type) { // image/png
$hasAllowedMimeType = true;
break;
}
}
if (! $hasAllowedMimeType) {
$this->addMessage(sprintf(
$this->translate('File %s is of type %s. Only %s allowed.'),
$file->getClientFileName(),
$file->getClientFilename(),
$file->getClientMediaType(),
implode(', ', $this->allowedMimeTypes)
implode(', ', $this->allowedMimeTypes ?? [])
));
$isValid = false;

View File

@ -11,14 +11,16 @@ class GreaterThanValidator extends BaseValidator
{
use Translation;
/** @var mixed Comparison value for greater than */
/** @var int|float Comparison value for greater than */
protected $min;
/**
* Create a new GreaterThanValidator
*
* Optional options:
* - min: (scalar) Comparison value for greater than, default 0
* - min: (int|float) Comparison value for greater than, default 0
*
* @param array{min?: int|float} $options
*/
public function __construct(array $options = [])
{
@ -28,7 +30,7 @@ class GreaterThanValidator extends BaseValidator
/**
* Get the min option
*
* @return mixed
* @return int|float
*/
public function getMin()
{
@ -38,7 +40,7 @@ class GreaterThanValidator extends BaseValidator
/**
* Set the min option
*
* @param mixed $min
* @param int|float $min
*
* @return $this
*/
@ -49,7 +51,12 @@ class GreaterThanValidator extends BaseValidator
return $this;
}
public function isValid($value)
/**
* @param int|float $value
*
* @return bool
*/
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();

View File

@ -18,7 +18,7 @@ class HostnameValidator extends BaseValidator
*
* @return boolean
*/
public function isValid($value)
public function isValid($value): bool
{
$this->clearMessages();
@ -26,7 +26,7 @@ class HostnameValidator extends BaseValidator
if (filter_var($asciiHostname, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {
$this->addMessage(sprintf(
$this->translate("%s is not a valid host name."),
$value ?? ''
$value
));
return false;

View File

@ -11,7 +11,7 @@ class InArrayValidator extends BaseValidator
{
use Translation;
/** @var array The array */
/** @var ?mixed[] The array */
protected $haystack;
/** @var bool Whether the types of the needle in the haystack should also match */
@ -25,7 +25,7 @@ class InArrayValidator extends BaseValidator
* * `haystack`: (`array`) The array
* * `strict`: (`bool`) Whether the types of the needle in the haystack should also match, default `false`
*
* @param array $options
* @param array{haystack?: mixed[], strict?: bool} $options
*/
public function __construct(array $options = [])
{
@ -39,7 +39,7 @@ class InArrayValidator extends BaseValidator
/**
* Get the haystack
*
* @return array
* @return mixed[]
*/
public function getHaystack(): array
{
@ -49,7 +49,7 @@ class InArrayValidator extends BaseValidator
/**
* Set the haystack
*
* @param array $haystack
* @param mixed[] $haystack
*
* @return $this
*/
@ -84,7 +84,7 @@ class InArrayValidator extends BaseValidator
return $this;
}
public function isValid($value)
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();
@ -110,9 +110,9 @@ class InArrayValidator extends BaseValidator
/**
* Get the values from the specified array that are not present in the haystack
*
* @param array $values
* @param mixed[] $values
*
* @return array Values not found in the haystack
* @return mixed[] Values not found in the haystack
*/
protected function findInvalid(array $values = []): array
{

View File

@ -11,14 +11,16 @@ class LessThanValidator extends BaseValidator
{
use Translation;
/** @var mixed Comparison value for less than */
/** @var int|float Comparison value for less than */
protected $max;
/**
* Create a new LessThanValidator
*
* Optional options:
* - max: (int) Comparison value for less than, default 0
* - max: (int|float) Comparison value for less than, default 0
*
* @param array{max?: int|float} $options
*/
public function __construct(array $options = [])
{
@ -28,7 +30,7 @@ class LessThanValidator extends BaseValidator
/**
* Get the max option
*
* @return mixed
* @return int|float
*/
public function getMax()
{
@ -38,7 +40,7 @@ class LessThanValidator extends BaseValidator
/**
* Set the max option
*
* @param mixed $max
* @param int|float $max
*
* @return $this
*/
@ -49,7 +51,12 @@ class LessThanValidator extends BaseValidator
return $this;
}
public function isValid($value)
/**
* @param int|float $value
*
* @return bool
*/
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();

View File

@ -11,7 +11,12 @@ class PrivateKeyValidator extends BaseValidator
{
use Translation;
public function isValid($value)
/**
* @param string $value
*
* @return bool
*/
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();

View File

@ -13,10 +13,10 @@ class StringLengthValidator extends BaseValidator
{
use Translation;
/** @var mixed Minimum required length */
/** @var int Minimum required length */
protected $min;
/** @var mixed Maximum required length */
/** @var ?int Maximum required length */
protected $max;
/** @var ?string Encoding to use */
@ -26,9 +26,11 @@ class StringLengthValidator extends BaseValidator
* Create a new StringLengthValidator
*
* Optional options:
* - min: (scalar) Minimum required string length, default 0
* - max: (scalar) Maximum required string length, default null
* - encoding: (string) Encoding type, default null
* - min: (int) Minimum required string length, default 0
* - max: (int) Maximum required string length, default none
* - encoding: (string) Encoding type, default none
*
* @param array{min?: int, max?: int, encoding?: string} $options
*/
public function __construct(array $options = [])
{
@ -41,9 +43,9 @@ class StringLengthValidator extends BaseValidator
/**
* Get the minimum required string length
*
* @return mixed
* @return int
*/
public function getMin()
public function getMin(): int
{
return $this->min;
}
@ -51,13 +53,13 @@ class StringLengthValidator extends BaseValidator
/**
* Set the minimum required string length
*
* @param mixed $min
* @param int $min
*
* @return $this
*
* @throws LogicException When the $min is greater than the $max value
*/
public function setMin($min): self
public function setMin(int $min): self
{
if ($this->getMax() !== null && $min > $this->getMax()) {
throw new LogicException(
@ -77,9 +79,9 @@ class StringLengthValidator extends BaseValidator
/**
* Get the maximum required string length
*
* @return mixed
* @return ?int
*/
public function getMax()
public function getMax(): ?int
{
return $this->max;
}
@ -87,13 +89,13 @@ class StringLengthValidator extends BaseValidator
/**
* Set the minimum required string length
*
* @param mixed $max
* @param ?int $max
*
* @return $this
*
* @throws LogicException When the $min is greater than the $max value
*/
public function setMax($max): self
public function setMax(?int $max): self
{
if ($max !== null && $this->getMin() > $max) {
throw new LogicException(
@ -143,7 +145,12 @@ class StringLengthValidator extends BaseValidator
return $this;
}
public function isValid($value)
/**
* @param string $value
*
* @return bool
*/
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();

View File

@ -15,6 +15,7 @@ use UnexpectedValueException;
use function ipl\Stdlib\get_php_type;
/** @implements IteratorAggregate<int, Validator> */
class ValidatorChain implements Countable, IteratorAggregate, Validator
{
use Messages;
@ -23,10 +24,10 @@ class ValidatorChain implements Countable, IteratorAggregate, Validator
/** Default priority at which validators are added */
const DEFAULT_PRIORITY = 1;
/** @var PriorityQueue Validator chain */
/** @var PriorityQueue<int, Validator> Validator chain */
protected $validators;
/** @var SplObjectStorage Validators that break the chain on failure */
/** @var SplObjectStorage<Validator, null> Validators that break the chain on failure */
protected $validatorsThatBreakTheChain;
/**
@ -43,7 +44,7 @@ class ValidatorChain implements Countable, IteratorAggregate, Validator
/**
* Get the validators that break the chain
*
* @return SplObjectStorage
* @return SplObjectStorage<Validator, null>
*/
public function getValidatorsThatBreakTheChain()
{
@ -76,7 +77,7 @@ class ValidatorChain implements Countable, IteratorAggregate, Validator
/**
* Add the validators from the given validator specification to the chain
*
* @param iterable $validators
* @param static|Traversable<int|string, mixed> $validators
*
* @return $this
*
@ -149,7 +150,7 @@ class ValidatorChain implements Countable, IteratorAggregate, Validator
*
* @return $this
*/
public function addValidatorLoader($namespace, $postfix = null)
public function addValidatorLoader($namespace, $postfix = '')
{
$this->addPluginLoader('validator', $namespace, $postfix);
@ -221,6 +222,10 @@ class ValidatorChain implements Countable, IteratorAggregate, Validator
{
$validatorsThatBreakTheChain = $validatorChain->getValidatorsThatBreakTheChain();
/**
* @var int $priority
* @var Validator $validator
*/
foreach ($validatorChain->validators->yieldAll() as $priority => $validator) {
$this->add($validator, $validatorsThatBreakTheChain->contains($validator), $priority);
}
@ -236,11 +241,14 @@ class ValidatorChain implements Countable, IteratorAggregate, Validator
/**
* Export the chain as array
*
* @return array
* @return Validator[]
*/
public function toArray()
{
return array_values(iterator_to_array($this));
/** @var Validator[] $validators */
$validators = iterator_to_array($this);
return array_values($validators);
}
public function count(): int
@ -251,7 +259,7 @@ class ValidatorChain implements Countable, IteratorAggregate, Validator
/**
* Get an iterator for traversing the validators
*
* @return Validator[]|PriorityQueue
* @return PriorityQueue<int, Validator>
*/
public function getIterator(): Traversable
{
@ -259,7 +267,7 @@ class ValidatorChain implements Countable, IteratorAggregate, Validator
return clone $this->validators;
}
public function isValid($value)
public function isValid($value): bool
{
$this->clearMessages();

View File

@ -11,7 +11,11 @@ class X509CertValidator extends BaseValidator
{
use Translation;
public function isValid($value)
/**
* @param String $value
* @return bool
*/
public function isValid($value): bool
{
// Multiple isValid() calls must not stack validation messages
$this->clearMessages();

View File

@ -33,6 +33,9 @@ abstract class BaseItemList extends BaseHtmlElement
protected $tag = 'ul';
/** @var ?string Message to show if the list is empty */
protected $emptyStateMessage;
/**
* Create a new item list
*
@ -62,12 +65,52 @@ abstract class BaseItemList extends BaseHtmlElement
{
}
/**
* Create a list item for the given data
*
* @param object $data
*
* @return BaseListItem|BaseTableRowItem
*/
protected function createListItem(object $data)
{
$className = $this->getItemClass();
return new $className($data, $this);
}
/**
* Get message to show if the list is empty
*
* @return string
*/
public function getEmptyStateMessage(): string
{
if ($this->emptyStateMessage === null) {
return t('No items found.');
}
return $this->emptyStateMessage;
}
/**
* Set message to show if the list is empty
*
* @param string $message
*
* @return $this
*/
public function setEmptyStateMessage(string $message): self
{
$this->emptyStateMessage = $message;
return $this;
}
protected function assemble(): void
{
$itemClass = $this->getItemClass();
foreach ($this->data as $data) {
/** @var BaseListItem|BaseTableRowItem $item */
$item = new $itemClass($data, $this);
$item = $this->createListItem($data);
$this->emit(self::BEFORE_ITEM_ADD, [$item, $data]);
$this->addHtml($item);
$this->emit(self::ON_ITEM_ADD, [$item, $data]);
@ -75,7 +118,7 @@ abstract class BaseItemList extends BaseHtmlElement
if ($this->isEmpty()) {
$this->setTag('div');
$this->addHtml(new EmptyStateBar(t('No items found.')));
$this->addHtml(new EmptyStateBar($this->getEmptyStateMessage()));
}
}
}

View File

@ -4,6 +4,7 @@ namespace ipl\Web\Widget;
use ipl\Html\Attributes;
use ipl\Html\BaseHtmlElement;
use ipl\Stdlib\Str;
/**
* Icon element
@ -30,9 +31,13 @@ class Icon extends BaseHtmlElement
*/
public function __construct(string $name, $attributes = null)
{
if (! Str::startsWith($name, 'fa-')) {
$name = "fa-$name";
}
$this
->getAttributes()
->add('class', ['icon', "fa-$name"])
->add('class', ['icon', $name])
->add($attributes);
}

View File

@ -16,7 +16,7 @@
}
],
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"provide": {
"ext-ctype": "*"

View File

@ -20,7 +20,7 @@
}
],
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"autoload": {
"psr-4": { "Symfony\\Polyfill\\Php80\\": "" },