Check exlusive minimum requirement

@param int|float $entity
@param object $schema
@param string $entityName

@return Validator
333931
protected function checkExclusiveMinimum($entity, $schema, $entityName)
    {
        if (isset($schema->minimum) && isset($schema->exclusiveMinimum) && $schema->exclusiveMinimum) {
            if ($entity == $schema->minimum) {
                throw new ValidationException(sprintf('Invalid value for [%s], must be greater than [%s]', $entityName, $schema->minimum));
            }
        }

        return $this;
    }
900108
public static function validator (EntityStructure $entityStructure, $data)
    {
        switch (gettype($data)) {
            case 'array':
                return new ArrayValidator($entityStructure, $data);
            default:
                return false;
        }
    }
218576
protected function checkDivisibleBy($entity, $schema, $entityName)
    {
        if (isset($schema->divisibleBy) && $schema->divisibleBy) {
            if (!is_numeric($schema->divisibleBy)) {
                throw new SchemaException(sprintf('Invalid divisibleBy value for [%s], must be numeric', $entityName));
            }

            if ($entity % $schema->divisibleBy != 0) {
                throw new ValidationException(sprintf('Invalid value for [%s], must be divisible by [%d]', $entityName, $schema->divisibleBy));
            }
        }

        return $this;
    }
110141
public function buildConstraint($fieldName, Schema $property, DocumentModel $model, array $options)
    {
        foreach ($options as $option) {
            if ($option->name == 'min' && $this->type == 'Range') {
                $property->setNumericMinimum(floatval($option->value));
            }
            if ($option->name == 'max' && $this->type == 'Range') {
                $property->setNumericMaximum(floatval($option->value));
            }
            if ($option->name == 'value' && $this->type == 'GreaterThanOrEqual') {
                $property->setNumericMinimum(floatval($option->value));
            }
            if ($option->name == 'value' && $this->type == 'LessThanOrEqual') {
                $property->setNumericMaximum(floatval($option->value));
            }
        }

        return $property;
    }
1365767
private function validateSchemata(EntityMetadata $metadata)
    {
        $persistence = $metadata->persistence;
        foreach ($persistence->schemata as $k => $schema) {
            if (!isset($schema['keys']) || empty($schema['keys'])) {
                throw MetadataException::invalidMetadata($metadata->type, 'At least one key must be specified to define an index.');
            }
            $persistence->schemata[$k]['options']['name'] = sprintf('modlr_%s', md5(json_encode($schema)));
        }
    }
26294
public function validate(EntityInterface $entity)
    {
        if (!$entity instanceof User) {
            throw new Exception(
                sprintf('The Entity to validate must be an instance of %s', User::class)
            );
        }

        $this->validateUserName($entity->getUserName());
        $this->validateFirstName($entity->getFirstName());
        $this->validateLastName($entity->getLastName());
        $this->validateEmail($entity->getEmail());
        $this->validateCreatedAt($entity->getCreatedAt());
        $this->validatePassword($entity->getPassword());
        $this->validateStatus($entity->getStatus());
        $this->validateRegisterToken($entity->getStatus());
        $this->validateAvatarUrl($entity->getAvatarUrl());
        $this->validateAvatarUrl($entity->getMiniAvatarUrl());
        $this->validateLanguage($entity->getLanguage());
        $errors = $this->getErrors();

        return empty($errors);
    }
843254
protected function checkMaxLength($entity, $schema, $entityName)
    {
        if (isset($schema->maxLength) && $schema->maxLength) {
            if (strlen($entity) > $schema->maxLength) {
                throw new ValidationException(sprintf('String too long for [%s], maximum length is [%s]', $entityName, $schema->maxLength));
            }
        }

        return $this;
    }
358298
public function validate(EntityInterface $entity)
    {
        if (!$entity instanceof UserGroup) {
            throw new Exception(
                sprintf('The Entity to validate must be an instance of %s', Role::class)
            );
        }

        $this->validateName($entity->getName());
        $this->validateDefaultRole($entity->getDefaultRole());
        $errors = $this->getErrors();

        return empty($errors);
    }
218310
public function validate(EntityInterface $entity)
    {
        if (!$entity instanceof EmailConfiguration) {
            throw new Exception(
                sprintf('The Entity to validate must be an instance of %s', EmailConfiguration::class)
            );
        }

        $this->validateEmailSender($entity->getEmailSender());
        $this->validateEmailSenderName($entity->getEmailSenderName());
        $this->validateEmailSubjectPrefix($entity->getEmailSubjectPrefix());
        $this->validateEmailBodySignature($entity->getEmailBodySignature());

        $errors = $this->getErrors();

        return empty($errors);
    }
452522
public function visitSchema(Schema $schema)
    {
        return new Schema(
            $this->transformConstraintArray($schema->constraints()),
            $schema->defaultValue(),
            $schema->title(),
            $schema->description()
        );
    }
28904
private function validateAbstractSchemaName($schemaName) : void
    {
        if (class_exists($schemaName, true) || interface_exists($schemaName, true)) {
            return;
        }

        try {
            $this->getEntityManager()->getClassMetadata($schemaName);

            return;
        } catch (MappingException $mappingException) {
            $this->semanticalError(
                sprintf('Class %s could not be mapped', $schemaName),
                $this->lexer->token
            );
        }

        $this->semanticalError(sprintf("Class '%s' is not defined.", $schemaName), $this->lexer->token);
    }
844841
protected function checkMinItems($entity, $schema, $entityName)
    {
        if (isset($schema->minItems) && $schema->minItems) {
            if (count($entity) < $schema->minItems) {
                throw new ValidationException(sprintf('Not enough array items for [%s], minimum is [%s]', $entityName, $schema->minItems));
            }
        }

        return $this;
    }
286809
public function validate(EntityInterface $entity)
    {
        if (!$entity instanceof Attribution) {
            throw new Exception(
                sprintf('The Entity to validate must be an instance of %s', Attribution::class)
            );
        }

        $this->validateSource($entity->getSource());
        $this->validateTarget($entity->getTarget());
        $this->validateRole($entity->getRole());
        $errors = $this->getErrors();

        return empty($errors);
    }
38927
protected function checkTypeString($entity, $schema, $entityName)
    {
        $this->checkPattern($entity, $schema, $entityName);
        $this->checkMinLength($entity, $schema, $entityName);
        $this->checkMaxLength($entity, $schema, $entityName);
        $this->checkFormat($entity, $schema, $entityName);
        $this->checkEnum($entity, $schema, $entityName);
        $this->checkDisallow($entity, $schema, $entityName);

        return $this;
    }
132461
public static function buildValidation(array $schema, $name = null)
    {
        $validation = new NestedValidation($name);

        foreach ($schema as $key => $value) {

            if (!is_array($value)) {
                trigger_error('parsing error', E_USER_ERROR);
            }

            if (self::isNestedValidation($value)) {
                $validation->addValidation(self::buildValidation($value, $key));
            } else {
                $validation->addValidation(self::buildKeyValidation($value, $key));
            }

        }
        return $validation;
    }
1240362
private static function getRequiredAttribute(
            $entity,
            string $name,
            string $method
    ) {
        if (!method_exists($entity, $method)) {
            throw new XmlException(
                    'RSSFeedItem ' . get_class($entity)
                    . ' does not offer a method named "' . $method
                    . '" to return the ' . $name . ', but ' . $name
                    . ' is required.'
            );
        }

        return $entity->$method();
    }
644778
public function validate(EntityInterface $entity)
    {
        if (!$entity instanceof Role) {
            throw new Exception(
                sprintf('The Entity to validate must be an instance of %s', Role::class)
            );
        }

        $this->validateRole($entity->getRole());
        $this->validateLabel($entity->getLabel());
        $this->validateUserCreated($entity->getUserCreated());
        $errors = $this->getErrors();

        return empty($errors);
    }