Skip to content

Commit 73c00ef

Browse files
Remove always true/false occurrences
1 parent 04cf304 commit 73c00ef

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed

Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function reverseTransform(mixed $value): ?\DateInterval
139139
'P%sY%sM%sWT%sH%sM%sS',
140140
empty($value['years']) ? '0' : $value['years'],
141141
empty($value['months']) ? '0' : $value['months'],
142-
empty($value['weeks']) ? '0' : $value['weeks'],
142+
$value['weeks'],
143143
empty($value['hours']) ? '0' : $value['hours'],
144144
empty($value['minutes']) ? '0' : $value['minutes'],
145145
empty($value['seconds']) ? '0' : $value['seconds']

Extension/Core/Type/DateType.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,8 @@ public function configureOptions(OptionsResolver $resolver): void
249249

250250
$choiceTranslationDomainNormalizer = static function (Options $options, $choiceTranslationDomain) {
251251
if (\is_array($choiceTranslationDomain)) {
252-
$default = false;
253-
254252
return array_replace(
255-
['year' => $default, 'month' => $default, 'day' => $default],
253+
['year' => false, 'month' => false, 'day' => false],
256254
$choiceTranslationDomain
257255
);
258256
}

Extension/Core/Type/TimeType.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,8 @@ public function configureOptions(OptionsResolver $resolver): void
274274

275275
$choiceTranslationDomainNormalizer = static function (Options $options, $choiceTranslationDomain) {
276276
if (\is_array($choiceTranslationDomain)) {
277-
$default = false;
278-
279277
return array_replace(
280-
['hour' => $default, 'minute' => $default, 'second' => $default],
278+
['hour' => false, 'minute' => false, 'second' => false],
281279
$choiceTranslationDomain
282280
);
283281
}

Extension/Core/Type/WeekType.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,8 @@ public function configureOptions(OptionsResolver $resolver): void
113113

114114
$choiceTranslationDomainNormalizer = static function (Options $options, $choiceTranslationDomain) {
115115
if (\is_array($choiceTranslationDomain)) {
116-
$default = false;
117-
118116
return array_replace(
119-
['year' => $default, 'week' => $default],
117+
['year' => false, 'week' => false],
120118
$choiceTranslationDomain
121119
);
122120
}

Extension/Validator/Constraints/FormValidator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function validate(mixed $form, Constraint $formConstraint): void
5656
// Validate the data against its own constraints
5757
$validateDataGraph = $form->isRoot()
5858
&& (\is_object($data) || \is_array($data))
59-
&& (($groups && \is_array($groups)) || ($groups instanceof GroupSequence && $groups->groups))
59+
&& (\is_array($groups) || ($groups instanceof GroupSequence && $groups->groups))
6060
;
6161

6262
// Validate the data against the constraints defined in the form

0 commit comments

Comments
 (0)