17
17
/**
18
18
* Transforms between a timezone identifier string and a DateTimeZone object.
19
19
*
20
- * @author Roland Franssen <franssen.roland@gmai .com>
20
+ * @author Roland Franssen <franssen.roland@gmail .com>
21
21
*/
22
22
class DateTimeZoneToStringTransformer implements DataTransformerInterface
23
23
{
@@ -39,14 +39,14 @@ public function transform($dateTimeZone)
39
39
40
40
if ($ this ->multiple ) {
41
41
if (!\is_array ($ dateTimeZone )) {
42
- throw new TransformationFailedException ('Expected an array. ' );
42
+ throw new TransformationFailedException ('Expected an array of \DateTimeZone objects . ' );
43
43
}
44
44
45
45
return array_map ([new self (), 'transform ' ], $ dateTimeZone );
46
46
}
47
47
48
48
if (!$ dateTimeZone instanceof \DateTimeZone) {
49
- throw new TransformationFailedException ('Expected a \DateTimeZone. ' );
49
+ throw new TransformationFailedException ('Expected a \DateTimeZone object . ' );
50
50
}
51
51
52
52
return $ dateTimeZone ->getName ();
@@ -63,14 +63,14 @@ public function reverseTransform($value)
63
63
64
64
if ($ this ->multiple ) {
65
65
if (!\is_array ($ value )) {
66
- throw new TransformationFailedException ('Expected an array. ' );
66
+ throw new TransformationFailedException ('Expected an array of timezone identifier strings . ' );
67
67
}
68
68
69
69
return array_map ([new self (), 'reverseTransform ' ], $ value );
70
70
}
71
71
72
72
if (!\is_string ($ value )) {
73
- throw new TransformationFailedException ('Expected a string. ' );
73
+ throw new TransformationFailedException ('Expected a timezone identifier string. ' );
74
74
}
75
75
76
76
try {
0 commit comments