@@ -233,7 +233,8 @@ checkDNS
233233
234234By default, this constraint just validates the syntax of the given URL. If you
235235also need to check whether the associated host exists, set the ``checkDNS ``
236- option to ``true ``:
236+ option to the value of any of the ``CHECK_DNS_TYPE_* `` constants in the
237+ :class: `Symfony\\ Component\\ Validator\\ Constraints\\ Url ` class:
237238
238239.. configuration-block ::
239240
@@ -248,7 +249,7 @@ option to ``true``:
248249 {
249250 /**
250251 * @Assert\Url(
251- * checkDNS = true
252+ * checkDNS = "ANY"
252253 * )
253254 */
254255 protected $bioUrl;
@@ -260,7 +261,7 @@ option to ``true``:
260261 AppBundle\Entity\Author :
261262 properties :
262263 bioUrl :
263- - Url : { checkDNS: true }
264+ - Url : { checkDNS: 'ANY' }
264265
265266 .. code-block :: xml
266267
@@ -273,7 +274,7 @@ option to ``true``:
273274 <class name =" AppBundle\Entity\Author" >
274275 <property name =" bioUrl" >
275276 <constraint name =" Url" >
276- <option name =" checkDNS" >true </option >
277+ <option name =" checkDNS" >ANY </option >
277278 </constraint >
278279 </property >
279280 </class >
@@ -292,13 +293,13 @@ option to ``true``:
292293 public static function loadValidatorMetadata(ClassMetadata $metadata)
293294 {
294295 $metadata->addPropertyConstraint('bioUrl', new Assert\Url(array(
295- 'checkDNS' => true ,
296+ 'checkDNS' => Assert\Url::CHECK_DNS_TYPE_ANY ,
296297 )));
297298 }
298299 }
299300
300301 This option uses the :phpfunction: `checkdnsrr ` PHP function to check the validity
301- of the `` ANY `` DNS record corresponding to the host associated with the given URL.
302+ of the DNS record corresponding to the host associated with the given URL.
302303
303304dnsMessage
304305~~~~~~~~~~
0 commit comments