From 02c3382b5866bdfbff5eccdb6794ad2ff6fb45eb Mon Sep 17 00:00:00 2001 From: Fabian Kreuzkam Date: Wed, 12 Jul 2023 17:59:04 +0200 Subject: [PATCH 1/2] Add \Laminas\Validator\IsCountable validator metadata The IsCountable validator has 3 options, that should be configurable via admin-tools as well. The validator has five specific behaviors: - You can determine if a value is countable only - You can test if the value is an exact count - You can test if the value is greater than a minimum count value - You can test if the value is greater than a maximum count value - You can test if the value is between the minimum and maximum count values source: https://github.com/laminas/laminas-validator/blob/2.36.x/src/IsCountable.php Signed-off-by: Fabian Kreuzkam --- config/module.config.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/module.config.php b/config/module.config.php index 7aa8f9f5..30186f52 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -146,6 +146,7 @@ use Laminas\Validator\InArray; use Laminas\Validator\Ip; use Laminas\Validator\Isbn; +use Laminas\Validator\IsCountable; use Laminas\Validator\IsInstanceOf; use Laminas\Validator\LessThan; use Laminas\Validator\NotEmpty; @@ -1603,6 +1604,11 @@ Isbn::class => [ 'type' => 'string', 'separator' => 'string', + ], + IsCountable::class => [ + 'min' => 'int', + 'max' => 'int', + 'count' => 'int', ], IsInstanceOf::class => [ 'classname' => 'string', From 1a9c14074c2eb9c15b5fb65bf44090cf9898177d Mon Sep 17 00:00:00 2001 From: Fabian Kreuzkam Date: Wed, 12 Jul 2023 18:22:50 +0200 Subject: [PATCH 2/2] Fixed indentation Signed-off-by: Fabian Kreuzkam --- config/module.config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/module.config.php b/config/module.config.php index 30186f52..061c6326 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -1605,7 +1605,7 @@ 'type' => 'string', 'separator' => 'string', ], - IsCountable::class => [ + IsCountable::class => [ 'min' => 'int', 'max' => 'int', 'count' => 'int',