8000 Fix failing tests after merge by nicolas-grekas · Pull Request #12967 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix failing tests after merge #12967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 13, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix failing tests after merge
  • Loading branch information
nicolas-grekas committed Dec 13, 2014
commit 9b96373d10334c7b4a74c54e6a42f91e9c5c5e1f
26 changes: 10 additions & 16 deletions src/Symfony/Component/Validator/Constraints/CallbackValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,18 @@ public function validate($object, Constraint $constraint)
}

call_user_func($method, $object, $this->context);
} elseif (null !== $object) {
if (!method_exists($object, $method)) {
throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist', $method));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't fix this in #12963.


continue;
}

if (null === $object) {
continue;
}

if (!method_exists($object, $method)) {
throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist', $method));
}

$reflMethod = new \ReflectionMethod($object, $method);
$reflMethod = new \ReflectionMethod($object, $method);

if ($reflMethod->isStatic()) {
$reflMethod->invoke(null, $object, $this->context);
} else {
$reflMethod->invoke($object, $this->context);
if ($reflMethod->isStatic()) {
$reflMethod->invoke(null, $object, $this->context);
} else {
$reflMethod->invoke($object, $this->context);
}
}
}
}
Expand Down
0