Download the PHP package sunnyflail/constraints without Composer
On this page you can find all versions of the php package sunnyflail/constraints. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package constraints
Constraints
This library provides basic constraints
1 Primitive value Constraints
1.1 EmailConstraint
A simple constraint for validating email adresses
This constraint constructor doesn't take any parameters
1.2 EqualsConstraint
A simple constraint for validating number equality
This constraint constructor takes in one parameter:
int|float $equals
- The number to which provided number must be equal to
1.3 GreaterThanConstraint
A simple constraint for validating number
This constraint constructor takes in two parameters:
int|float $min
- The number which value must be greater than
bool $orEqual
- Should this also count in equality
1.4 LesserThanConstraint
A simple constraint for validating number
This constraint constructor takes in two parameters:
int|float $max
- The number which value must be lesser than
bool $orEqual
- Should this also count in equality
1.5 LengthConstraint
A simple constraint for string length
This constraint constructor takes in two parameters:
int $minLength
- Minimum length
?int $maxLength
- Maximum length
1.6 PatternConstraint
A simple constraint for matching string with regex
This constraint constructor takes in one parameter:
string ...$regexes
- Regular expressions to match against
1.7 OneOfConstraint
Constraint for matching against of one of constraints
This constraint constructor takes in one parameter:
IConstraint ...$constraints
- Constraints to match against
2 File Constraints
2.1 BasicMediaTypeConstraint
Constraint for matching mime types. Unsafe
This constraint constructor takes in one parameter:
array $allowedTypes
- MIME types to match against
2.2 FileSizeConstraint
Constraint for matching file sizes
This constraint constructor takes in two parameters:
int|null $max
- Maximum allowed file size in bytes
int|null $min
- Minimum allowed file size in bytes
2.3 NoErrorConstraint
Constraint for checking upload error
This constraint constructor doesn't take any parameters