Neos\Media\Validator\ImageOrientationValidator::validateOptions PHP Метод

validateOptions() защищенный Метод

protected validateOptions ( ) : void
Результат void
    protected function validateOptions()
    {
        if (!isset($this->options['allowedOrientations'])) {
            throw new InvalidValidationOptionsException('The option "allowedOrientations" was not specified.', 1328028795);
        } elseif (!is_array($this->options['allowedOrientations']) || $this->options['allowedOrientations'] === array()) {
            throw new InvalidValidationOptionsException('The option "allowedOrientations" must be an array with at least one element of "square", "portrait" or "landscape".', 1328028798);
        }
        foreach ($this->options['allowedOrientations'] as $orientation) {
            if ($orientation !== ImageInterface::ORIENTATION_LANDSCAPE && $orientation !== ImageInterface::ORIENTATION_PORTRAIT && $orientation !== ImageInterface::ORIENTATION_SQUARE) {
                throw new InvalidValidationOptionsException(sprintf('The option "allowedOrientations" contains an invalid orientation "%s".', $orientation), 1328029114);
            }
        }
        if (count($this->options['allowedOrientations']) === 3) {
            throw new InvalidValidationOptionsException('The option "allowedOrientations" must contain at most two elements of "square", "portrait" or "landscape".', 1328029781);
        }
    }
ImageOrientationValidator