10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b53fe24 commit 5e4f4d4Copy full SHA for 5e4f4d4
src/Symfony/Component/Form/FormTypeGuesserChain.php
@@ -25,8 +25,12 @@ class FormTypeGuesserChain implements FormTypeGuesserInterface
25
*
26
* @throws UnexpectedTypeException if any guesser does not implement FormTypeGuesserInterface
27
*/
28
- public function __construct(array $guessers)
+ public function __construct($guessers)
29
{
30
+ if (!is_array($guessers) && !$guessers instanceof \Traversable) {
31
+ throw new UnexpectedTypeException($guessers, 'array or Traversable');
32
+ }
33
+
34
foreach ($guessers as $guesser) {
35
if (!$guesser instanceof FormTypeGuesserInterface) {
36
throw new UnexpectedTypeException($guesser, 'Symfony\Component\Form\FormTypeGuesserInterface');
0 commit comments