Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0bc7129

Browse files
committed
[Form] Fixed invalid use of FormException
1 parent 600007b commit 0bc7129

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/Symfony/Component/Form/ButtonBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1515
use Symfony\Component\Form\Exception\FormException;
16+
use Symfony\Component\Form\Exception\InvalidArgumentException;
1617

1718
/**
1819
* A builder for {@link Button} instances.
@@ -62,7 +63,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
6263
public function __construct($name, array $options)
6364
{
6465
if (empty($name) && 0 != $name) {
65-
throw new FormException('Buttons cannot have empty names.');
66+
throw new InvalidArgumentException('Buttons cannot have empty names.');
6667
}
6768

6869
$this->name = (string) $name;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Form\Exception;
13+
14+
/**
15+
* Base InvalidArgumentException for the Form component.
16+
*
17+
* @author Bernhard Schussek <[email protected]>
18+
*/
19+
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
20+
{
21+
}

0 commit comments

Comments
 (0)