8000
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 1156bde commit 321d5bbCopy full SHA for 321d5bb
src/Symfony/Component/Validator/NodeVisitor/ObjectInitializer.php
@@ -30,10 +30,15 @@ public function __construct(array $initializers)
30
{
31
foreach ($initializers as $initializer) {
32
if (!$initializer instanceof ObjectInitializerInterface) {
33
- throw new \LogicException('Validator initializers must implement ObjectInitializerInterface.');
+ throw new \InvalidArgumentException('Validator initializers must implement ObjectInitializerInterface.');
34
}
35
36
37
+ // If no initializer is present, this visitor should not even be created
38
+ if (0 === count($initializers)) {
39
+ throw new \InvalidArgumentException('Please pass at least one initializer.');
40
+ }
41
+
42
$this->initializers = $initializers;
43
44
0 commit comments