public static function check($name, $value, $validators)
    {
        foreach ($validators as $validator) {
            try {
                $validator->validate($value);
            } catch (\Exception $e) {
                throw new Exception(strip_tags($name) . ': ' . $e->getMessage(), $e->getCode());
            }
        }
    }
public static function check($name, $value, $validators)
    {
        foreach ($validators as $validator) {
            try {
                $validator->validate($value);
            } catch (\Exception $e) {
                throw new Exception(strip_tags($name) . ': ' . $e->getMessage(), $e->getCode());
            }
        }
    }
public static function check ( $ name , $ value , $ validators ) { foreach ( $ validators as $ validator ) { try { $ validator -> validate ( $ value ) ; } catch ( \ Exception $ e ) { throw new Exception ( strip_tags ( $ name ) . ': ' . $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } } }
Lets you easily check a value against multiple validators.

@param string $name The name/description of the field you want to validate the value for.
The name will be prefixed in case there is any error.
@param mixed $value The value which needs to be tested
@param BaseValidator[] $validators
Lets you easily check a value against multiple validators .