Mercurial > hg > isophonics-drupal-site
diff vendor/symfony/validator/Constraints/CallbackValidator.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line diff
--- a/vendor/symfony/validator/Constraints/CallbackValidator.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/symfony/validator/Constraints/CallbackValidator.php Thu Feb 28 13:21:36 2019 +0000 @@ -35,18 +35,18 @@ $method = $constraint->callback; if ($method instanceof \Closure) { $method($object, $this->context, $constraint->payload); - } elseif (is_array($method)) { - if (!is_callable($method)) { - if (isset($method[0]) && is_object($method[0])) { - $method[0] = get_class($method[0]); + } elseif (\is_array($method)) { + if (!\is_callable($method)) { + if (isset($method[0]) && \is_object($method[0])) { + $method[0] = \get_class($method[0]); } throw new ConstraintDefinitionException(sprintf('%s targeted by Callback constraint is not a valid callable', json_encode($method))); } - call_user_func($method, $object, $this->context, $constraint->payload); + \call_user_func($method, $object, $this->context, $constraint->payload); } elseif (null !== $object) { if (!method_exists($object, $method)) { - throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist in class %s', $method, get_class($object))); + throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist in class %s', $method, \get_class($object))); } $reflMethod = new \ReflectionMethod($object, $method);