8000 Update datetime transformers return annotation to \DateTimeInterface · symfony/symfony@4062815 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4062815

Browse files
author
James Halsall
committed
Update datetime transformers return annotation to \DateTimeInterface
1 parent 5a3c0a3 commit 4062815

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/Symfony/Component/Form/Extension/Core/DataTransformer/BaseDateTimeTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class BaseDateTimeTransformer implements DataTransformerInterface
3636
*
3737
* @param string $inputTimezone The name of the input timezone
3838
* @param string $outputTimezone The name of the output timezone
39-
* @param bool $immutable If the datetime is immutable
39+
* @param bool $immutable Whether to use \DateTimeImmutable instead of \DateTime
4040
*
4141
* @throws UnexpectedTypeException if a timezone is not a string
4242
* @throws InvalidArgumentException if a timezone is not valid

src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
3333
* @param string $outputTimezone The output timezone
3434
* @param array $fields The date fields
3535
* @param bool $pad Whether to use padding
36-
* @param bool $immutable If the datetime is immutable
36+
* @param bool $immutable Whether to use \DateTimeImmutable instead of \DateTime
3737
*
3838
* @throws UnexpectedTypeException if a timezone is not a string
3939
*/
@@ -109,7 +109,7 @@ public function transform($dateTime)
109109
*
110110
* @param array $value Localized date
111111
*
112-
* @return \DateTime Normalized date
112+
* @return \DateTimeInterface Normalized date
113113
*
114114
* @throws TransformationFailedException If the given value is not an array,
115115
* if the value could not be transformed

src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer
3838
* @param int $timeFormat The time format
3939
* @param int $calendar One of the \IntlDateFormatter calendar constants
4040
* @param string $pattern A pattern to pass to \IntlDateFormatter
41-
* @param bool $immutable If the datetime is immutable
41+
* @param bool $immutable Whether to use \DateTimeImmutable instead of \DateTime
4242
*
4343
* @throws UnexpectedTypeException If a format is not supported or if a timezone is not a string
4444
*/
@@ -102,7 +102,7 @@ public function transform($dateTime)
102102
*
103103
* @param string|array $value Localized date string/array
104104
*
105-
* @return \DateTime Normalized date
105+
* @return \DateTimeInterface Normalized date
106106
*
107107
* @throws TransformationFailedException if the given value is not a string,
108108
* if the date could not be parsed

src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function transform($dateTime)
5353
*
5454
* @param string $rfc3339 Formatted string
5555
*
56-
* @return \DateTime Normalized date
56+
* @return \DateTimeInterface Normalized date
5757
*
5858
* @throws TransformationFailedException If the given value is not a string,
5959
* if the value could not be transformed

src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class DateTimeToStringTransformer extends BaseDateTimeTransformer
5858
* @param string $outputTimezone The name of the output timezone
5959
* @param string $format The date format
6060
* @param bool $parseUsingPipe Whether to parse by appending a pipe "|" to the parse format
61-
* @param bool $immutable If the datetime is immutable
61+
* @param bool $immutable Whether to use \DateTimeImmutable instead of \DateTime
6262
*
6363
* @throws UnexpectedTypeException if a timezone is not a string
6464
*/
@@ -116,7 +116,7 @@ public function transform($dateTime)
116116
*
117117
* @param string $value A value as produced by PHP's date() function
118118
*
119-
* @return \DateTime An instance of \DateTime
119+
* @return \DateTimeInterface An instance of \DateTime
120120
*
121121
* @throws TransformationFailedException If the given value is not a string,
122122
* or could not be transformed

0 commit comments

Comments
 (0)
0