Neos\Flow\Validation\Validator\CountValidator::isValid PHP Method

isValid() protected method

The given value is valid if it is an array or \Countable that contains the specified amount of elements.
protected isValid ( mixed $value ) : void
$value mixed The value that should be validated
return void
    protected function isValid($value)
    {
        if (!is_array($value) && !$value instanceof \Countable) {
            $this->addError('The given subject was not countable.', 1253718666);
            return;
        }
        $minimum = intval($this->options['minimum']);
        $maximum = intval($this->options['maximum']);
        if (count($value) < $minimum || count($value) > $maximum) {
            $this->addError('The count must be between %1$d and %2$d.', 1253718831, [$minimum, $maximum]);
        }
    }
CountValidator