File tree 3 files changed +23
-8
lines changed
3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 1
1
Date
2
2
====
3
3
4
- Validates that a value is a valid date, meaning either a ``DateTime `` object
5
- or a string (or an object that can be cast into a string) that follows a
6
- valid YYYY-MM-DD format.
4
+ Validates that a value is a valid date, meaning a string (or an object that can be cast into a string)
5
+ that follows a valid YYYY-MM-DD format.
7
6
8
7
+----------------+--------------------------------------------------------------------+
9
8
| Applies to | :ref: `property or method <validation-property-target >` |
@@ -32,6 +31,7 @@ Basic Usage
32
31
{
33
32
/**
34
33
* @Assert\Date()
34
+ * @var string A "Y-m-d" formatted value
35
35
*/
36
36
protected $birthday;
37
37
}
@@ -69,6 +69,11 @@ Basic Usage
69
69
70
70
class Author
71
71
{
72
+ /**
73
+ * @var string A "Y-m-d" formatted value
74
+ */
75
+ protected $birthday;
76
+
72
77
public static function loadValidatorMetadata(ClassMetadata $metadata)
73
78
{
74
79
$metadata->addPropertyConstraint('birthday', new Assert\Date());
Original file line number Diff line number Diff line change 1
1
DateTime
2
2
========
3
3
4
- Validates that a value is a valid "datetime", meaning either a ``DateTime ``
5
- object or a string (or an object that can be cast into a string) that follows
6
- a specific format.
4
+ Validates that a value is a valid "datetime", meaning a string (or an object that can be cast into a string)
5
+ that follows a specific format.
7
6
8
7
+----------------+------------------------------------------------------------------------+
9
8
| Applies to | :ref: `property or method <validation-property-target >` |
@@ -33,6 +32,7 @@ Basic Usage
33
32
{
34
33
/**
35
34
* @Assert\DateTime()
35
+ * @var string A "Y-m-d H:i:s" formatted value
36
36
*/
37
37
protected $createdAt;
38
38
}
@@ -70,6 +70,11 @@ Basic Usage
70
70
71
71
class Author
72
72
{
73
+ /**
74
+ * @var string A "Y-m-d H:i:s" formatted value
75
+ */
76
+ protected $createdAt;
77
+
73
78
public static function loadValidatorMetadata(ClassMetadata $metadata)
74
79
{
75
80
$metadata->addPropertyConstraint('createdAt', new Assert\DateTime());
Original file line number Diff line number Diff line change 1
1
Time
2
2
====
3
3
4
- Validates that a value is a valid time, meaning an object implementing
5
- ``DateTimeInterface `` or a string (or an object that can be cast into a string)
4
+ Validates that a value is a valid time, meaning a string (or an object that can be cast into a string)
6
5
that follows a valid ``HH:MM:SS `` format.
7
6
8
7
+----------------+------------------------------------------------------------------------+
@@ -35,6 +34,7 @@ of the day when the event starts:
35
34
{
36
35
/**
37
36
* @Assert\Time()
37
+ * @var string A "H:i:s" formatted value
38
38
*/
39
39
protected $startsAt;
40
40
}
@@ -72,6 +72,11 @@ of the day when the event starts:
72
72
73
73
class Event
74
74
{
75
+ /**
76
+ * @var string A "H:i:s" formatted value
77
+ */
78
+ protected $startsAt;
79
+
75
80
public static function loadValidatorMetadata(ClassMetadata $metadata)
76
81
{
77
82
$metadata->addPropertyConstraint('startsAt', new Assert\Time());
You can’t perform that action at this time.
0 commit comments