Skip to content

Commit f033ea4

Browse files
committed
minor symfony#31278 [Form] Fix author tag + exception messages (ro0NL)
This PR was squashed before being merged into the 3.4 branch (closes symfony#31278). Discussion ---------- [Form] Fix author tag + exception messages | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> spotted in symfony#31195 😅 Commits ------- 796f2ff [Form] Fix author tag + exception messages
2 parents 2774705 + 796f2ff commit f033ea4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* Transforms between a timezone identifier string and a DateTimeZone object.
1919
*
20-
* @author Roland Franssen <franssen.roland@gmai.com>
20+
* @author Roland Franssen <franssen.roland@gmail.com>
2121
*/
2222
class DateTimeZoneToStringTransformer implements DataTransformerInterface
2323
{
@@ -39,14 +39,14 @@ public function transform($dateTimeZone)
3939

4040
if ($this->multiple) {
4141
if (!\is_array($dateTimeZone)) {
42-
throw new TransformationFailedException('Expected an array.');
42+
throw new TransformationFailedException('Expected an array of \DateTimeZone objects.');
4343
}
4444

4545
return array_map([new self(), 'transform'], $dateTimeZone);
4646
}
4747

4848
if (!$dateTimeZone instanceof \DateTimeZone) {
49-
throw new TransformationFailedException('Expected a \DateTimeZone.');
49+
throw new TransformationFailedException('Expected a \DateTimeZone object.');
5050
}
5151

5252
return $dateTimeZone->getName();
@@ -63,14 +63,14 @@ public function reverseTransform($value)
6363

6464
if ($this->multiple) {
6565
if (!\is_array($value)) {
66-
throw new TransformationFailedException('Expected an array.');
66+
throw new TransformationFailedException('Expected an array of timezone identifier strings.');
6767
}
6868

6969
return array_map([new self(), 'reverseTransform'], $value);
7070
}
7171

7272
if (!\is_string($value)) {
73-
throw new TransformationFailedException('Expected a string.');
73+
throw new TransformationFailedException('Expected a timezone identifier string.');
7474
}
7575

7676
try {

0 commit comments

Comments
 (0)