ValidationRuleParser
class ValidationRuleParser
Properties
| array | $data | The data being validated. |
|
| array | $implicitAttributes | The implicit attributes. |
Methods
Create a new validation rule parser.
Parse the human-friendly rules into a full rules array for the validator.
Explode the rules into an array of explicit rules.
Explode the explicit rule into an array if necessary.
Prepare the given rule for the Validator.
Define a set of rules that apply to each element in an array attribute.
Merge additional rules into a given attribute(s).
Merge additional rules into a given attribute.
Extract the rule name and parameters from a rule.
Parse an array based rule.
Parse a string based rule.
Parse a parameter list.
Normalizes a rule so that we can accept short types.
Details
at line 32
void
__construct(array $data)
Create a new validation rule parser.
at line 43
stdClass
explode(array $rules)
Parse the human-friendly rules into a full rules array for the validator.
at line 61
protected array
explodeRules(array $rules)
Explode the rules into an array of explicit rules.
at line 82
protected array
explodeExplicitRule(mixed $rule)
Explode the explicit rule into an array if necessary.
at line 99
protected mixed
prepareRule(mixed $rule)
Prepare the given rule for the Validator.
at line 118
protected array
explodeWildcardRules(array $results, string $attribute, string|array $rules)
Define a set of rules that apply to each element in an array attribute.
at line 145
array
mergeRules(array $results, string|array $attribute, string|array $rules = [])
Merge additional rules into a given attribute(s).
at line 168
protected array
mergeRulesForAttribute(array $results, string $attribute, string|array $rules)
Merge additional rules into a given attribute.
at line 185
static array
parse(array|string $rules)
Extract the rule name and parameters from a rule.
at line 204
static protected array
parseArrayRule(array $rules)
Parse an array based rule.
at line 215
static protected array
parseStringRule(string $rules)
Parse a string based rule.
at line 238
static protected array
parseParameters(string $rule, string $parameter)
Parse a parameter list.
at line 253
static protected string
normalizeRule(string $rule)
Normalizes a rule so that we can accept short types.