Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'years' => range(date('Y') - 120, date('Y')),
'invalid_message' => 'Birthdate provided is invalid.',
));

$resolver->setAllowedTypes(array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)

$resolver->setDefaults(array(
'auto_initialize' => false,
'invalid_message' => 'Button is invalid.',
));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'value' => '1',
'empty_data' => $emptyData,
'compound' => false,
'invalid_message' => 'Checkbox checked has an invalid value.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
// is manually set to an object.
// See https://github.com/symfony/symfony/pull/5582
'data_class' => null,
'invalid_message' => 'Choice selected is invalid.',
));

$resolver->setNormalizers(array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'prototype_name' => '__name__',
'type' => 'text',
'options' => array(),
'invalid_message' => 'Collection provided is invalid.',
));

$resolver->setNormalizers(array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'choices' => Intl::getRegionBundle()->getCountryNames(),
'invalid_message' => 'Country provided is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'choices' => Intl::getCurrencyBundle()->getCurrencyNames(),
'invalid_message' => 'Currency provided is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
// this option.
'data_class' => null,
'compound' => $compound,
'invalid_message' => 'DateTime provided is invalid.',
));

// Don't add some defaults in order to preserve the defaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
// this option.
'data_class' => null,
'compound' => $compound,
'invalid_message' => 'Date provided is invalid.',
));

$resolver->setNormalizers(array(
Expand Down
11 changes: 11 additions & 0 deletions src/Symfony/Component/Form/Extension/Core/Type/EmailType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@
namespace Symfony\Component\Form\Extension\Core\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class EmailType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'invalid_message' => 'Email provided is invalid.',
));
}

/**
* {@inheritdoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'compound' => false,
'data_class' => 'Symfony\Component\HttpFoundation\File\File',
'empty_data' => null,
'invalid_message' => 'File provided is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
'compound' => $form->getConfig()->getCompound(),
'method' => $form->getConfig()->getMethod(),
'action' => $form->getConfig()->getAction(),
'invalid_message' => 'Form is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
// Pass errors to the parent
'error_bubbling' => true,
'compound' => false,
'invalid_message' => 'Hidden value provided is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
// Integer cast rounds towards 0, so do the same when displaying fractions
'rounding_mode' => \NumberFormatter::ROUND_DOWN,
'compound' => false,
'invalid_message' => 'Integer value provided is invalid.',
));

$resolver->setAllowedValues(array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'choices' => Intl::getLanguageBundle()->getLanguageNames(),
'invalid_message' => 'Language provided is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'choices' => Intl::getLocaleBundle()->getLocaleNames(),
'invalid_message' => 'Locale provided is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'divisor' => 1,
'currency' => 'EUR',
'compound' => false,
'invalid_message' => 'Money value provided is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'grouping' => false,
'rounding_mode' => \NumberFormatter::ROUND_HALFUP,
'compound' => false,
'invalid_message' => 'Number value provided is invalid.',
));

$resolver->setAllowedValues(array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
$resolver->setDefaults(array(
'always_empty' => true,
'trim' => false,
'invalid_message' => 'Password provided is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'precision' => 0,
'type' => 'fractional',
'compound' => false,
'invalid_message' => 'Percent value provided is invalid.',
));

$resolver->setAllowedValues(array(
Expand Down
11 changes: 11 additions & 0 deletions src/Symfony/Component/Form/Extension/Core/Type/RadioType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@
namespace Symfony\Component\Form\Extension\Core\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class RadioType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'invalid_message' => 'Selected value is invalid.',
));
}

/**
* {@inheritdoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'first_name' => 'first',
'second_name' => 'second',
'error_bubbling' => false,
'invalid_message' => 'Repeated value is invalid.',
));

$resolver->setAllowedTypes(array(
Expand Down
11 changes: 11 additions & 0 deletions src/Symfony/Component/Form/Extension/Core/Type/ResetType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\ButtonTypeInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
* A reset button.
Expand All @@ -21,6 +22,16 @@
*/
class ResetType extends AbstractType implements ButtonTypeInterface
{
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'invalid_message' => 'Reset button is invalid.',
));
}

/**
* {@inheritdoc}
*/
Expand Down
11 changes: 11 additions & 0 deletions src/Symfony/Component/Form/Extension/Core/Type/SearchType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@
namespace Symfony\Component\Form\Extension\Core\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class SearchType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'invalid_message' => 'Search button is invalid.',
));
}

/**
* {@inheritdoc}
*/
Expand Down
11 changes: 11 additions & 0 deletions src/Symfony/Component/Form/Extension/Core/Type/SubmitType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\SubmitButtonTypeInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
* A submit button.
Expand All @@ -28,6 +29,16 @@ public function buildView(FormView $view, FormInterface $form, array $options)
$view->vars['clicked'] = $form->isClicked();
}

/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'invalid_message' => 'Submit button is invalid.',
));
}

/**
* {@inheritdoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'compound' => false,
'invalid_message' => 'Text provided is invalid.',
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
// this option.
'data_class' => null,
'compound' => $compound,
'invalid_message' => 'Time provided is invalid.',
));

$resolver->setNormalizers(array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'choices' => self::getTimezones(),
'invalid_message' => 'Timezone provided is invalid.',
));
}

Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Form/Extension/Core/Type/UrlType.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'default_protocol' => 'http',
'invalid_message' => 'Url provided is invalid.',
));

$resolver->setAllowedTypes(array(
Expand Down