Valdi\Validator\AbstractParametrizedValidator

class AbstractParametrizedValidator

Validator for parametrized validators.

validateParameterCount($name, $parameterAmount, $parameters)

Throws an exception if the parameters don’t fulfill the expected parameter count.

Parameters:
  • $name (string) – the name of the validator
  • $parameterAmount (integer) – the amount of expected parameters
  • $parameters (string[]) – the parameters
isValid($value, $parameters)

Validates the given value.

Parameters:
  • $value (mixed) – the value to validate
  • $parameters (array) – the other parameters the validator might need
Returns:

boolean true if the value is valid, false else

getInvalidDetails()

Gets the details if the validation failed.

Returns:mixed the details