class Illuminate / Validation / ValidationRuleParser
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

ValidationRuleParser

Properties

public

$data array

The data being validated.

Default: null
public

$implicitAttributes array

The implicit attributes.

Default: []

Methods

public

__construct ( array $data ) : void

Create a new validation rule parser.

Parameters

  • $data array
public

explode ( $rules ) : stdClass

Parse the human-friendly rules into a full rules array for the validator.

Parameters

  • $rules array
protected

explodeRules ( $rules ) : array

Explode the rules into an array of explicit rules.

Parameters

  • $rules array
protected

explodeExplicitRule ( $rule , $attribute ) : array

Explode the explicit rule into an array if necessary.

Parameters

  • $rule mixed
  • $attribute string
protected

prepareRule ( $rule , $attribute ) : mixed

Prepare the given rule for the Validator.

Parameters

  • $rule mixed
  • $attribute string
protected

explodeWildcardRules ( $results , $attribute , $rules ) : array

Define a set of rules that apply to each element in an array attribute.

Parameters

  • $results array
  • $attribute string
  • $rules string|array
public

mergeRules ( $results , $attribute , $rules ) : array

Merge additional rules into a given attribute(s).

Parameters

  • $results array
  • $attribute string|array
  • $rules string|array
protected

mergeRulesForAttribute ( $results , $attribute , $rules ) : array

Merge additional rules into a given attribute.

Parameters

  • $results array
  • $attribute string
  • $rules string|array
public static

parse ( $rule ) : array

Extract the rule name and parameters from a rule.

Parameters

  • $rule array|string
protected static

parseArrayRule ( array $rule ) : array

Parse an array based rule.

Parameters

  • $rule array
protected static

parseStringRule ( $rule ) : array

Parse a string based rule.

Parameters

  • $rule string
protected static

parseParameters ( $rule , $parameter ) : array

Parse a parameter list.

Parameters

  • $rule string
  • $parameter string
protected static

ruleIsRegex ( $rule ) : bool

Determine if the rule is a regular expression.

Parameters

  • $rule string
protected static

normalizeRule ( $rule ) : string

Normalizes a rule so that we can accept short types.

Parameters

  • $rule string
public static

filterConditionalRules ( $rules , array $data ) : array

Expand the conditional rules in the given array of rules.

Parameters

  • $rules array
  • $data array