Skip to content

Commit 201d31b

Browse files
stehledsmnandre
authored andcommitted
Remove symfony/translation-contracts dependency
Co-authored-by: Simon André <[email protected]>
1 parent 0984bef commit 201d31b

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/LiveComponent/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 2.25.0
44

55
- Add support for [Symfony UID](https://symfony.com/doc/current/components/uid.html) hydration/dehydration
6+
- `ComponentWithFormTrait` now correctly checks for a `TranslatableInterface` placeholder for `<select>` elements
67

78
## 2.23.0
89

src/LiveComponent/composer.json

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"symfony/property-access": "^5.4.5|^6.0|^7.0",
3232
"symfony/property-info": "^5.4|^6.0|^7.0",
3333
"symfony/stimulus-bundle": "^2.9",
34-
"symfony/translation-contracts": "^2.5|^3.0",
3534
"symfony/ux-twig-component": "^2.8",
3635
"twig/twig": "^3.8.0"
3736
},

src/LiveComponent/src/ComponentWithFormTrait.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,8 @@ private function extractFormValues(FormView $formView): array
287287
)
288288
&& !$child->vars['expanded'] // is a <select> (not a radio/checkbox)
289289
&& !$child->vars['multiple'] // is not multiple
290-
&& (
291-
!\is_string($child->vars['placeholder'])
292-
&& !$child->vars['placeholder'] instanceof TranslatableInterface
293-
) // has no placeholder (empty string is valid, translatable interface is valid)
290+
&& !\is_string($child->vars['placeholder']) // has no placeholder (empty string is valid)
291+
&& !$child->vars['placeholder'] instanceof TranslatableInterface // has no placeholder (translatable interface is valid)
294292
) {
295293
$choices = $child->vars['preferred_choices'] ?: $child->vars['choices']; // preferred_choices has precedence, as they rendered before regular choices
296294
do {

0 commit comments

Comments
 (0)