@@ -33,30 +33,30 @@ Basic Usage
3333
3434 ..code-block ::php-annotations
3535
36- // src/Acme/BlogBundle/Entity/Author.php
37- namespace Acme\BlogBundle\Entity;
38-
39- use Symfony\Component\Validator\Constraints as Assert;
40-
41- class Author
42- {
43- /**
44- * @Assert\Type(type="integer", message="The value {{ value }} is not a valid {{ type }}.")
45- */
36+ // src/Acme/BlogBundle/Entity/Author.php
37+ namespace Acme\BlogBundle\Entity;
38+
39+ use Symfony\Component\Validator\Constraints as Assert;
40+
41+ class Author
42+ {
43+ /**
44+ * @Assert\Type(type="integer", message="The value {{ value }} is not a valid {{ type }}.")
45+ */
4646 protected $age;
47- }
47+ }
4848
4949 ..code-block ::xml
5050
51- <!-- src/Acme/BlogBundle/Resources/config/validation.xml-->
52- <class name =" Acme\BlogBundle\Entity\Author" >
53- <property name =" age" >
54- <constraint name =" Type" >
55- <option name =" type" >integer</option >
56- <option name =" message" >The value {{ value }} is not a valid {{ type }}.</option >
57- </constraint >
58- </property >
59- </class >
51+ <!-- src/Acme/BlogBundle/Resources/config/validation.xml-->
52+ <class name =" Acme\BlogBundle\Entity\Author" >
53+ <property name =" age" >
54+ <constraint name =" Type" >
55+ <option name =" type" >integer</option >
56+ <option name =" message" >The value {{ value }} is not a valid {{ type }}.</option >
57+ </constraint >
58+ </property >
59+ </class >
6060
6161 Options
6262-------
7171This required option is the fully qualified class name or one of the PHP datatypes
7272as determined by PHP's ``is_ `` functions.
7373
74- * `array <http://php.net/is_array >`_
75- * `bool <http://php.net/is_bool >`_
76- * `callable <http://php.net/is_callable >`_
77- * `float <http://php.net/is_float >`_
78- * `double <http://php.net/is_double >`_
79- * `int <http://php.net/is_int >`_
80- * `integer <http://php.net/is_integer >`_
81- * `long <http://php.net/is_long >`_
82- * `null <http://php.net/is_null >`_
83- * `numeric <http://php.net/is_numeric >`_
84- * `object <http://php.net/is_object >`_
85- * `real <http://php.net/is_real >`_
86- * `resource <http://php.net/is_resource >`_
87- * `scalar <http://php.net/is_scalar >`_
88- * `string <http://php.net/is_string >`_
89-
74+ * `array <http://php.net/is_array >`_
75+ * `bool <http://php.net/is_bool >`_
76+ * `callable <http://php.net/is_callable >`_
77+ * `float <http://php.net/is_float >`_
78+ * `double <http://php.net/is_double >`_
79+ * `int <http://php.net/is_int >`_
80+ * `integer <http://php.net/is_integer >`_
81+ * `long <http://php.net/is_long >`_
82+ * `null <http://php.net/is_null >`_
83+ * `numeric <http://php.net/is_numeric >`_
84+ * `object <http://php.net/is_object >`_
85+ * `real <http://php.net/is_real >`_
86+ * `resource <http://php.net/is_resource >`_
87+ * `scalar <http://php.net/is_scalar >`_
88+ * `string <http://php.net/is_string >`_
89+
9090message
9191~~~~~~~
9292
9393**type **: ``string `` **default **: ``This value should be of type {{ type }} ``
9494
95- The message if the underlying data is not of the given type.
95+ The message if the underlying data is not of the given type.