X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fsymfony%2Fvalidator%2FConstraints%2FCallbackValidator.php;h=a66840eae1338b09810028e3361042e3d7720eec;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=733ee43ba75e333e8b7e96e84d71c9237261aef9;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/vendor/symfony/validator/Constraints/CallbackValidator.php b/vendor/symfony/validator/Constraints/CallbackValidator.php index 733ee43ba..a66840eae 100644 --- a/vendor/symfony/validator/Constraints/CallbackValidator.php +++ b/vendor/symfony/validator/Constraints/CallbackValidator.php @@ -35,18 +35,18 @@ class CallbackValidator extends ConstraintValidator $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);