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;
    }
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;
    }
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 ; }
Check divisibleby restriction

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

@return Validator
Check divisibleby restriction