PHP Class Flarum\Core\Validator\AbstractValidator

Show file Open project: flarum/core

Protected Properties

Property Type Description
$events Illuminate\Contracts\Events\Dispatcher
$rules array
$translator Symfony\Component\Translation\TranslatorInterface
$validator Illuminate\Validation\Factory

Public Methods

Method Description
__construct ( Illuminate\Validation\Factory $validator, Illuminate\Contracts\Events\Dispatcher $events, Symfony\Component\Translation\TranslatorInterface $translator )
assertValid ( array $attributes ) Throw an exception if a model is not valid.

Protected Methods

Method Description
getMessages ( ) : array
getRules ( ) : array
makeValidator ( array $attributes ) : Illuminate\Validation\Validator Make a new validator instance for this model.

Method Details

__construct() public method

public __construct ( Illuminate\Validation\Factory $validator, Illuminate\Contracts\Events\Dispatcher $events, Symfony\Component\Translation\TranslatorInterface $translator )
$validator Illuminate\Validation\Factory
$events Illuminate\Contracts\Events\Dispatcher
$translator Symfony\Component\Translation\TranslatorInterface

assertValid() public method

Throw an exception if a model is not valid.
public assertValid ( array $attributes )
$attributes array

getMessages() protected method

protected getMessages ( ) : array
return array

getRules() protected method

protected getRules ( ) : array
return array

makeValidator() protected method

Make a new validator instance for this model.
protected makeValidator ( array $attributes ) : Illuminate\Validation\Validator
$attributes array
return Illuminate\Validation\Validator

Property Details

$events protected property

protected Dispatcher,Illuminate\Contracts\Events $events
return Illuminate\Contracts\Events\Dispatcher

$rules protected property

protected array $rules
return array

$translator protected property

protected TranslatorInterface,Symfony\Component\Translation $translator
return Symfony\Component\Translation\TranslatorInterface

$validator protected property

protected Factory,Illuminate\Validation $validator
return Illuminate\Validation\Factory