8000 Remove \DateTimeInterface reference from constraint validators · symfony/symfony-docs@47b5917 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47b5917

Browse files
ro0NLjaviereguiluz
authored andcommitted
Remove \DateTimeInterface reference from constraint validators
1 parent 984c3ef commit 47b5917

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

reference/constraints/Date.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
Date
22
====
33

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.
76

87
+----------------+--------------------------------------------------------------------+
98
| Applies to | :ref:`property or method <validation-property-target>` |
@@ -32,6 +31,7 @@ Basic Usage
3231
{
3332
/**
3433
* @Assert\Date()
34+
* @var string A "Y-m-d" formatted value
3535
*/
3636
protected $birthday;
3737
}
@@ -69,6 +69,11 @@ Basic Usage
6969
7070
class Author
7171
{
72+
/**
73+
* @var string A "Y-m-d" formatted value
74+
*/
75+
protected $birthday;
76+
7277
public static function loadValidatorMetadata(ClassMetadata $metadata)
7378
{
7479
$metadata->addPropertyConstraint('birthday', new Assert\Date());

reference/constraints/DateTime.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
DateTime
22
========
33

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.
76

87
+----------------+------------------------------------------------------------------------+
98
| Applies to | :ref:`property or method <validation-property-target>` |
@@ -33,6 +32,7 @@ Basic Usage
3332
{
3433
/**
3534
* @Assert\DateTime()
35+
* @var string A "Y-m-d H:i:s" formatted value
3636
*/
3737
protected $createdAt;
3838
}
@@ -70,6 +70,11 @@ Basic Usage
7070
7171
class Author
7272
{
73+
/**
74+
* @var string A "Y-m-d H:i:s" formatted value
75+
*/
76+
protected $createdAt;
77+
7378
public static function loadValidatorMetadata(ClassMetadata $metadata)
7479
{
7580
$metadata->addPropertyConstraint('createdAt', new Assert\DateTime());

reference/constraints/Time.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Time
22
====
33

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)
65
that follows a valid ``HH:MM:SS`` format.
76

87
+----------------+------------------------------------------------------------------------+
@@ -35,6 +34,7 @@ of the day when the event starts:
3534
{
3635
/**
3736
* @Assert\Time()
37+
* @var string A "H:i:s" formatted value
3838
*/
3939
protected $startsAt;
4040
}
@@ -72,6 +72,11 @@ of the day when the event starts:
7272
7373
class Event
7474
{
75+
/**
76+
* @var string A "H:i:s" formatted value
77+
*/
78+
protected $startsAt;
79+
7580
public static function loadValidatorMetadata(ClassMetadata $metadata)
7681
{
7782
$metadata->addPropertyConstraint('startsAt', new Assert\Time());

0 commit comments

Comments
 (0)
0