throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Image');
}
- $violations = count($this->context->getViolations());
+ $violations = \count($this->context->getViolations());
parent::validate($value, $constraint);
- $failed = count($this->context->getViolations()) !== $violations;
+ $failed = \count($this->context->getViolations()) !== $violations;
if ($failed || null === $value || '' === $value) {
return;
}
if ($constraint->detectCorrupted) {
- if (!function_exists('imagecreatefromstring')) {
+ if (!\function_exists('imagecreatefromstring')) {
throw new RuntimeException('Corrupted images detection requires installed and enabled GD extension');
}