18 Ip::V4 => FILTER_FLAG_IPV4,
19 Ip::V6 => FILTER_FLAG_IPV6,
26 Ip::V4_ONLY_PUBLIC => FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE,
27 Ip::V6_ONLY_PUBLIC => FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE,
31 $this->message =
"{value} is not a valid ip of type {ref}";
35 parent::validate (
$value );
38 if ($this->notNull !==
false) {
39 if (isset ( self::FLAGS [$this->ref] )) {
42 return \filter_var (
$value, \FILTER_VALIDATE_IP, $flag );
53 return [
'value',
'ref' ];
Validates an address ip Usage @validator("ip","4") Inspired from Bernhard Schussek Symfony IpValidato...
getParameters()
{{}\Ubiquity\contents\validation\validators\ValidatorInterfacegetParameters()}