Class Validation
Validates data against a set of rules.
- ICanBoogie\Validate\Validation implements ICanBoogie\Validate\ValidatorOptions
Methods summary
public
validates_with( string $attribute
, string $class_or_alias
, array $params
)
: ICanBoogie\Validate\Validation
Defines validation for an attribute.
public
validate( ICanBoogie\Validate\Reader
$reader
)
: ICanBoogie\Validate\ValidationErrors
|array
Validates data.
protected
validate_attribute( string $attribute
, array $validators
, ICanBoogie\Validate\Context
$context
)
Validates an attribute.
protected
create_context( ICanBoogie\Validate\Reader
$reader
)
: ICanBoogie\Validate\Context
Creates a validation context.
protected
should_skip( ICanBoogie\Validate\Context
$context
)
: boolean
Whether the validator should be skipped.
protected
should_stop( ICanBoogie\Validate\Context
$context
)
: boolean
Whether validation for an attribute should stop.
protected
unserialize_validations( string $serialized_validations
)
: array
Resolves validations from a string.
protected
create_validator( string $class_or_alias
)
: ICanBoogie\Validate\Validator
Creates a validator.
protected
create_message( string $message
, array $args
)
: ICanBoogie\Validate\Message
Creates an error message.
Constants summary
Constants inherited from ICanBoogie\Validate\ValidatorOptions
OPTION_IF
,
OPTION_MESSAGE
,
OPTION_STOP_ON_ERROR
,
OPTION_UNLESS