Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d1b22ce

Browse filesBrowse files
committed
bug #44854 [Validator] throw when Constraint::_construct() has not been called (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [Validator] throw when Constraint::_construct() has not been called | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44846 | License | MIT | Doc PR | - Instead of #44847 Commits ------- 20aacce [Validator] throw when Constraint::_construct() has not been called
2 parents 94007a5 + 20aacce commit d1b22ce
Copy full SHA for d1b22ce

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

‎src/Symfony/Component/Validator/Constraint.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraint.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ public function __isset($option)
226226
*/
227227
public function addImplicitGroupName($group)
228228
{
229+
if (null === $this->groups && \array_key_exists('groups', (array) $this)) {
230+
throw new \LogicException(sprintf('"%s::$groups" is set to null. Did you forget to call "%s::__construct()"?', static::class, self::class));
231+
}
232+
229233
if (\in_array(self::DEFAULT_GROUP, $this->groups) && !\in_array($group, $this->groups)) {
230234
$this->groups[] = $group;
231235
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.