Skip to content

Commit 721ffc8

Browse files
committed
limit scope of help option
1 parent ac7bb46 commit 721ffc8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Symfony/Component/Form/Extension/Core/Type/FormType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Symfony\Component\OptionsResolver\OptionsResolver;
2626
use Symfony\Component\PropertyAccess\PropertyAccess;
2727
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
28+
use Symfony\Component\Translation\TranslatableMessage;
2829

2930
class FormType extends BaseType
3031
{
@@ -226,6 +227,7 @@ public function configureOptions(OptionsResolver $resolver)
226227
$resolver->setAllowedTypes('label_attr', 'array');
227228
$resolver->setAllowedTypes('action', 'string');
228229
$resolver->setAllowedTypes('upload_max_size_message', ['callable']);
230+
$resolver->setAllowedTypes('help', ['string', 'null', TranslatableMessage::class]);
229231
$resolver->setAllowedTypes('help_attr', 'array');
230232
$resolver->setAllowedTypes('help_html', 'bool');
231233
$resolver->setAllowedTypes('is_empty_callback', ['null', 'callable']);

src/Symfony/Component/Form/Tests/AbstractLayoutTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,9 +2669,6 @@ public function testHelpWithTranslationParameters()
26692669
);
26702670
}
26712671

2672-
/**
2673-
* @requires function Symfony\Component\Translation\TranslatableMessage::__construct
2674-
*/
26752672
public function testLabelWithTranslatableMessage()
26762673
{
26772674
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [
@@ -2687,9 +2684,6 @@ public function testLabelWithTranslatableMessage()
26872684
);
26882685
}
26892686

2690-
/**
2691-
* @requires function Symfony\Component\Translation\TranslatableMessage::__construct
2692-
*/
26932687
public function testHelpWithTranslatableMessage()
26942688
{
26952689
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [

0 commit comments

Comments
 (0)