protected function isValid($image)
{
$this->validateOptions();
if (!$image instanceof ImageInterface) {
$this->addError('The given value was not an Image instance.', 1328028604);
return;
}
if (!in_array($image->getOrientation(), $this->options['allowedOrientations'])) {
if (count($this->options['allowedOrientations']) === 1) {
reset($this->options['allowedOrientations']);
$allowedOrientation = current($this->options['allowedOrientations']);
$this->addError('The image orientation must be "%s".', 1328029406, array($allowedOrientation));
} else {
$this->addError('The image orientation "%s" is not allowed.', 1328029362, array($image->getOrientation()));
}
}
}