Skip to content

Commit e250408

Browse files
Merge branch '7.4' into 8.0
* 7.4: (21 commits) [SecurityBundle] Fix tests with Symfony 7.4 [DependencyInjection] Ensure deprecation detection does not trigger a PHP error [DependencyInjection][FrameworkBundle] fix BC break when dumping container for build/lint commands [Form] Clean up wrong method docblocks in data transformers Fix merge [DependencyInjection] Throw when using `$this` or its internal scope from PHP config files; use the `$loader` variable instead [HttpClient] Fix sharing CurlClientState between clones of CurlHttpClient instances [FrameworkBundle] Don't exclude classes with constraint/serialization attributes from being registered as services Revert "[HttpClient] Lazily initialize CurlClientState" [Yaml] Fix regression handling blank lines in unquoted scalars [Cache] Fix NullAdapter must set taggable [FrameworkBundle] Order alphabetically known tags of `UnusedTagsPass` allow the installation of MercureBundle 0.4 [Console] don't discard existing aliases when constructing Command Import all node definition classes to DefinitionConfigurator Fix the creation of a redis connection with only ext-relay [FrameworkBundle] Dump bundles config reference first [DependencyInjection] Don't add the .container.known_envs parameter when empty [DependencyInjection] Reset resolved state when setting a parameter [HttpKernel] Don't reset services between fragments redering when using in HttpCache ...
2 parents 81dd027 + 7de5d09 commit e250408

20 files changed

+6
-306
lines changed

Extension/Core/DataTransformer/BooleanToStringTransformer.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ public function __construct(
3737
}
3838
}
3939

40-
/**
41-
* Transforms a Boolean into a string.
42-
*
43-
* @param bool $value Boolean value
44-
*
45-
* @throws TransformationFailedException if the given value is not a Boolean
46-
*/
4740
public function transform(mixed $value): ?string
4841
{
4942
if (null === $value) {
@@ -57,13 +50,6 @@ public function transform(mixed $value): ?string
5750
return $value ? $this->trueValue : null;
5851
}
5952

60-
/**
61-
* Transforms a string into a Boolean.
62-
*
63-
* @param string $value String value
64-
*
65-
* @throws TransformationFailedException if the given value is not a string
66-
*/
6753
public function reverseTransform(mixed $value): bool
6854
{
6955
if (\in_array($value, $this->falseValues, true)) {

Extension/Core/DataTransformer/ChoicesToValuesTransformer.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ public function __construct(
2727
) {
2828
}
2929

30-
/**
31-
* @throws TransformationFailedException if the given value is not an array
32-
*/
3330
public function transform(mixed $array): array
3431
{
3532
if (null === $array) {
@@ -43,11 +40,6 @@ public function transform(mixed $array): array
4340
return $this->choiceList->getValuesForChoices($array);
4441
}
4542

46-
/**
47-
* @throws TransformationFailedException if the given value is not an array
48-
* or if no matching choice could be
49-
* found for some given value
50-
*/
5143
public function reverseTransform(mixed $array): array
5244
{
5345
if (null === $array) {

Extension/Core/DataTransformer/DataTransformerChain.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Form\Extension\Core\DataTransformer;
1313

1414
use Symfony\Component\Form\DataTransformerInterface;
15-
use Symfony\Component\Form\Exception\TransformationFailedException;
1615

1716
/**
1817
* Passes a value through multiple value transformers.
@@ -31,18 +30,6 @@ public function __construct(
3130
) {
3231
}
3332

34-
/**
35-
* Passes the value through the transform() method of all nested transformers.
36-
*
37-
* The transformers receive the value in the same order as they were passed
38-
* to the constructor. Each transformer receives the result of the previous
39-
* transformer as input. The output of the last transformer is returned
40-
* by this method.
41-
*
42-
* @param mixed $value The original value
43-
*
44-
* @throws TransformationFailedException
45-
*/
4633
public function transform(mixed $value): mixed
4734
{
4835
foreach ($this->transformers as $transformer) {
@@ -52,19 +39,6 @@ public function transform(mixed $value): mixed
5239
return $value;
5340
}
5441

55-
/**
56-
* Passes the value through the reverseTransform() method of all nested
57-
* transformers.
58-
*
59-
* The transformers receive the value in the reverse order as they were passed
60-
* to the constructor. Each transformer receives the result of the previous
61-
* transformer as input. The output of the last transformer is returned
62-
* by this method.
63-
*
64-
* @param mixed $value The transformed value
65-
*
66-
* @throws TransformationFailedException
67-
*/
6842
public function reverseTransform(mixed $value): mixed
6943
{
7044
for ($i = \count($this->transformers) - 1; $i >= 0; --$i) {

Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ public function __construct(
5454
$this->fields = $fields ?? ['years', 'months', 'days', 'hours', 'minutes', 'seconds', 'invert'];
5555
}
5656

57-
/**
58-
* Transforms a normalized date interval into an interval array.
59-
*
60-
* @param \DateInterval $dateInterval Normalized date interval
61-
*
62-
* @throws UnexpectedTypeException if the given value is not a \DateInterval instance
63-
*/
6457
public function transform(mixed $dateInterval): array
6558
{
6659
if (null === $dateInterval) {
@@ -97,14 +90,6 @@ public function transform(mixed $dateInterval): array
9790
return array_intersect_key($result, array_flip($this->fields));
9891
}
9992

100-
/**
101-
* Transforms an interval array into a normalized date interval.
102-
*
103-
* @param array $value Interval array
104-
*
105-
* @throws UnexpectedTypeException if the given value is not an array
106-
* @throws TransformationFailedException if the value could not be transformed
107-
*/
10893
public function reverseTransform(mixed $value): ?\DateInterval
10994
{
11095
if (null === $value) {

Extension/Core/DataTransformer/DateIntervalToStringTransformer.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ public function __construct(
3636
) {
3737
}
3838

39-
/**
40-
* Transforms a DateInterval object into a date string with the configured format.
41-
*
42-
* @param \DateInterval|null $value A DateInterval object
43-
*
44-
* @throws UnexpectedTypeException if the given value is not a \DateInterval instance
45-
*/
4639
public function transform(mixed $value): string
4740
{
4841
if (null === $value) {
@@ -55,14 +48,6 @@ public function transform(mixed $value): string
5548
return $value->format($this->format);
5649
}
5750

58-
/**
59-
* Transforms a date string in the configured format into a DateInterval object.
60-
*
61-
* @param string $value An ISO 8601 or date string like date interval presentation
62-
*
63-
* @throws UnexpectedTypeException if the given value is not a string
64-
* @throws TransformationFailedException if the date interval could not be parsed
65-
*/
6651
public function reverseTransform(mixed $value): ?\DateInterval
6752
{
6853
if (null === $value) {

Extension/Core/DataTransformer/DatePointToDateTimeTransformer.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222
*/
2323
final class DatePointToDateTimeTransformer implements DataTransformerInterface
2424
{
25-
/**
26-
* Transforms a DatePoint into a DateTime object.
27-
*
28-
* @param DatePoint|null $value A DatePoint object
29-
*
30-
* @throws TransformationFailedException If the given value is not a DatePoint
31-
*/
3225
public function transform(mixed $value): ?\DateTime
3326
{
3427
if (null === $value) {
@@ -42,13 +35,6 @@ public function transform(mixed $value): ?\DateTime
4235
return \DateTime::createFromImmutable($value);
4336
}
4437

45-
/**
46-
* Transforms a DateTime object into a DatePoint object.
47-
*
48-
* @param \DateTime|null $value A DateTime object
49-
*
50-
* @throws TransformationFailedException If the given value is not a \DateTime
51-
*/
5238
public function reverseTransform(mixed $value): ?DatePoint
5339
{
5440
if (null === $value) {

Extension/Core/DataTransformer/DateTimeImmutableToDateTimeTransformer.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
2323
*/
2424
final class DateTimeImmutableToDateTimeTransformer implements DataTransformerInterface
2525
{
26-
/**
27-
* Transforms a DateTimeImmutable into a DateTime object.
28-
*
29-
* @param \DateTimeImmutable|null $value A DateTimeImmutable object
30-
*
31-
* @throws TransformationFailedException If the given value is not a \DateTimeImmutable
32-
*/
3326
public function transform(mixed $value): ?\DateTime
3427
{
3528
if (null === $value) {
@@ -43,13 +36,6 @@ public function transform(mixed $value): ?\DateTime
4336
return \DateTime::createFromImmutable($value);
4437
}
4538

46-
/**
47-
* Transforms a DateTime object into a DateTimeImmutable object.
48-
*
49-
* @param \DateTime|null $value A DateTime object
50-
*
51-
* @throws TransformationFailedException If the given value is not a \DateTime
52-
*/
5339
public function reverseTransform(mixed $value): ?\DateTimeImmutable
5440
{
5541
if (null === $value) {

Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ public function __construct(
4545
$this->referenceDate = $referenceDate ?? new \DateTimeImmutable('1970-01-01 00:00:00');
4646
}
4747

48-
/**
49-
* Transforms a normalized date into a localized date.
50-
*
51-
* @param \DateTimeInterface $dateTime A DateTimeInterface object
52-
*
53-
* @throws TransformationFailedException If the given value is not a \DateTimeInterface
54-
*/
5548
public function transform(mixed $dateTime): array
5649
{
5750
if (null === $dateTime) {
@@ -95,14 +88,6 @@ public function transform(mixed $dateTime): array
9588
return $result;
9689
}
9790

98-
/**
99-
* Transforms a localized date into a normalized date.
100-
*
101-
* @param array $value Localized date
102-
*
103-
* @throws TransformationFailedException If the given value is not an array,
104-
* if the value could not be transformed
105-
*/
10691
public function reverseTransform(mixed $value): ?\DateTime
10792
{
10893
if (null === $value) {

Extension/Core/DataTransformer/DateTimeToHtml5LocalDateTimeTransformer.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,11 @@ public function __construct(?string $inputTimezone = null, ?string $outputTimezo
3131
}
3232

3333
/**
34-
* Transforms a \DateTime into a local date and time string.
35-
*
3634
* According to the HTML standard, the input string of a datetime-local
3735
* input is an RFC3339 date followed by 'T', followed by an RFC3339 time.
38-
* https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-local-date-and-time-string
39-
*
40-
* @param \DateTimeInterface $dateTime
36+
* https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-local-date-and-time-string.
4137
*
42-
* @throws TransformationFailedException If the given value is not an
43-
* instance of \DateTime or \DateTimeInterface
38+
* @throws \DateInvalidTimeZoneException
4439
*/
4540
public function transform(mixed $dateTime): string
4641
{
@@ -61,16 +56,11 @@ public function transform(mixed $dateTime): string
6156
}
6257

6358
/**
64-
* Transforms a local date and time string into a \DateTime.
65-
*
6659
* When transforming back to DateTime the regex is slightly laxer, taking into
6760
* account rules for parsing a local date and time string
68-
* https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#parse-a-local-date-and-time-string
69-
*
70-
* @param string $dateTimeLocal Formatted string
61+
* https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#parse-a-local-date-and-time-string.
7162
*
72-
* @throws TransformationFailedException If the given value is not a string,
73-
* if the value could not be transformed
63+
* @throws \DateInvalidTimeZoneException
7464
*/
7565
public function reverseTransform(mixed $dateTimeLocal): ?\DateTime
7666
{

Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ public function __construct(
6969
$this->timeFormat = $timeFormat;
7070
}
7171

72-
/**
73-
* Transforms a normalized date into a localized date string/array.
74-
*
75-
* @param \DateTimeInterface $dateTime A DateTimeInterface object
76-
*
77-
* @throws TransformationFailedException if the given value is not a \DateTimeInterface
78-
* or if the date could not be transformed
79-
*/
8072
public function transform(mixed $dateTime): string
8173
{
8274
if (null === $dateTime) {
@@ -96,14 +88,6 @@ public function transform(mixed $dateTime): string
9688
return $value;
9789
}
9890

99-
/**
100-
* Transforms a localized date string/array into a normalized date.
101-
*
102-
* @param string $value Localized date string
103-
*
104-
* @throws TransformationFailedException if the given value is not a string,
105-
* if the date could not be parsed
106-
*/
10791
public function reverseTransform(mixed $value): ?\DateTime
10892
{
10993
if (!\is_string($value)) {

0 commit comments

Comments
 (0)