protected function checkMaxItems($entity, $schema, $entityName)
    {
        if (isset($schema->maxItems) && $schema->maxItems) {
            if (count($entity) > $schema->maxItems) {
                throw new ValidationException(sprintf('Too many array items for [%s], maximum is [%s]', $entityName, $schema->maxItems));
            }
        }

        return $this;
    }
protected function checkMaxItems($entity, $schema, $entityName)
    {
        if (isset($schema->maxItems) && $schema->maxItems) {
            if (count($entity) > $schema->maxItems) {
                throw new ValidationException(sprintf('Too many array items for [%s], maximum is [%s]', $entityName, $schema->maxItems));
            }
        }

        return $this;
    }
protected function checkMaxItems ( $ entity , $ schema , $ entityName ) { if ( isset ( $ schema -> maxItems ) && $ schema -> maxItems ) { if ( count ( $ entity ) > $ schema -> maxItems ) { throw new ValidationException ( sprintf ( 'Too many array items for [%s], maximum is [%s]' , $ entityName , $ schema -> maxItems ) ) ; } } return $ this ; }
Check array maximum items

@param array $entity
@param object $schema
@param string $entityName

@return Validator
Check array maximum items