Skip to content

Commit e2e13b8

Browse files
bug #39603 [TwigBridge] allow null values in form helpers (xabbuh)
This PR was merged into the 5.2 branch. Discussion ---------- [TwigBridge] allow null values in form helpers | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #39591| License | MIT | Doc PR | Commits ------- f908047c6b allow null values in form helpers
2 parents 378a136 + 886ccfa commit e2e13b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Extension/FormExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function getFieldValue(FormView $view)
111111
return $view->vars['value'];
112112
}
113113

114-
public function getFieldLabel(FormView $view): string
114+
public function getFieldLabel(FormView $view): ?string
115115
{
116116
return $this->createFieldTranslation(
117117
$view->vars['label'],
@@ -120,7 +120,7 @@ public function getFieldLabel(FormView $view): string
120120
);
121121
}
122122

123-
public function getFieldHelp(FormView $view): string
123+
public function getFieldHelp(FormView $view): ?string
124124
{
125125
return $this->createFieldTranslation(
126126
$view->vars['help'],
@@ -164,7 +164,7 @@ private function createFieldChoicesList(iterable $choices, $translationDomain):
164164
}
165165
}
166166

167-
private function createFieldTranslation(?string $value, array $parameters, $domain): string
167+
private function createFieldTranslation(?string $value, array $parameters, $domain): ?string
168168
{
169169
if (!$this->translator || !$value || false === $domain) {
170170
return $value;

0 commit comments

Comments
 (0)