chebur/validator-constraints

1.3.0 2022-04-11 17:37 UTC

This package is not auto-updated.

Last update: 2024-09-24 05:48:10 UTC


README

PHP requirements Latest version Total downloads License

安装

composer require chebur/validator-constraints

约束列表

OrComposite

如果至少有一个子约束验证通过,则验证将通过
(自Symfony 5.1起存在 AtLeastOneOf 约束)

KeyExists

检查传入的键是否存在于值中。

AbstractConstraintList

抽象组合约束。有助于创建任何约束组合。
(自Symfony 5.1起存在 Compound 约束)

BreakOnFailure

组合约束。验证将通过子约束进行,一旦出现第一个错误将停止。
(自Symfony 5.1起存在 Sequentially 约束)

AllKey

组合约束。类似于 All 约束,但此约束验证数组键而不是值。

AllUnique

检查传入的数组是否只包含唯一的值

IntInString

检查传入的字符串是否只包含不超过 PHP_INT_MAX 的有效正整数