Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/validator/Constraints/Ip.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
44 const V6_ONLY_PUBLIC = '6_public'; | 44 const V6_ONLY_PUBLIC = '6_public'; |
45 const ALL_ONLY_PUBLIC = 'all_public'; | 45 const ALL_ONLY_PUBLIC = 'all_public'; |
46 | 46 |
47 const INVALID_IP_ERROR = 'b1b427ae-9f6f-41b0-aa9b-84511fbb3c5b'; | 47 const INVALID_IP_ERROR = 'b1b427ae-9f6f-41b0-aa9b-84511fbb3c5b'; |
48 | 48 |
49 protected static $versions = array( | 49 protected static $versions = [ |
50 self::V4, | 50 self::V4, |
51 self::V6, | 51 self::V6, |
52 self::ALL, | 52 self::ALL, |
53 | 53 |
54 self::V4_NO_PRIV, | 54 self::V4_NO_PRIV, |
60 self::ALL_NO_RES, | 60 self::ALL_NO_RES, |
61 | 61 |
62 self::V4_ONLY_PUBLIC, | 62 self::V4_ONLY_PUBLIC, |
63 self::V6_ONLY_PUBLIC, | 63 self::V6_ONLY_PUBLIC, |
64 self::ALL_ONLY_PUBLIC, | 64 self::ALL_ONLY_PUBLIC, |
65 ); | 65 ]; |
66 | 66 |
67 protected static $errorNames = array( | 67 protected static $errorNames = [ |
68 self::INVALID_IP_ERROR => 'INVALID_IP_ERROR', | 68 self::INVALID_IP_ERROR => 'INVALID_IP_ERROR', |
69 ); | 69 ]; |
70 | 70 |
71 public $version = self::V4; | 71 public $version = self::V4; |
72 | 72 |
73 public $message = 'This is not a valid IP address.'; | 73 public $message = 'This is not a valid IP address.'; |
74 | 74 |
77 */ | 77 */ |
78 public function __construct($options = null) | 78 public function __construct($options = null) |
79 { | 79 { |
80 parent::__construct($options); | 80 parent::__construct($options); |
81 | 81 |
82 if (!in_array($this->version, self::$versions)) { | 82 if (!\in_array($this->version, self::$versions)) { |
83 throw new ConstraintDefinitionException(sprintf('The option "version" must be one of "%s"', implode('", "', self::$versions))); | 83 throw new ConstraintDefinitionException(sprintf('The option "version" must be one of "%s"', implode('", "', self::$versions))); |
84 } | 84 } |
85 } | 85 } |
86 } | 86 } |