MinLength
Less than 1 minute
MinLength
class MinLength extends \Hazaar\Model\Attribute\BaseExtends: Hazaar\Model\Attribute\Base
Properties
length
The minimum allowed length for the string property.
private int $lengthType: int
Methods
__construct
Constructor for the MinLength attribute.
public __construct(int $length): voidParameters
| Parameter | Type | Description |
|---|---|---|
$length | int | the minimum length allowed for the string property |
evaluate
Evaluates whether the string property value is at least the minimum allowed length.
public evaluate(mixed $propertyValue, \ReflectionProperty $property): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$propertyValue | mixed | the value of the property to evaluate (passed by reference) |
$property | ReflectionProperty | the reflection property instance for metadata (passed by reference) |
getLength
Gets the minimum allowed length for the string property.
public getLength(): intReturns: int
getReason
Returns a human-readable reason for attribute rule failure.
public getReason(): stringReturns: string
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:17 +0000