[Form] Fixed invalid use of FormException
This commit is contained in:
parent
600007b71f
commit
0bc7129eb1
@ -13,6 +13,7 @@ namespace Symfony\Component\Form;
|
|||||||
|
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Symfony\Component\Form\Exception\FormException;
|
use Symfony\Component\Form\Exception\FormException;
|
||||||
|
use Symfony\Component\Form\Exception\InvalidArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A builder for {@link Button} instances.
|
* A builder for {@link Button} instances.
|
||||||
@ -62,7 +63,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
|
|||||||
public function __construct($name, array $options)
|
public function __construct($name, array $options)
|
||||||
{
|
{
|
||||||
if (empty($name) && 0 != $name) {
|
if (empty($name) && 0 != $name) {
|
||||||
throw new FormException('Buttons cannot have empty names.');
|
throw new InvalidArgumentException('Buttons cannot have empty names.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->name = (string) $name;
|
$this->name = (string) $name;
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Form\Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base InvalidArgumentException for the Form component.
|
||||||
|
*
|
||||||
|
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||||
|
*/
|
||||||
|
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
|
||||||
|
{
|
||||||
|
}
|
Reference in New Issue
Block a user