Assert\Assertion::greaterThan PHP Метод

greaterThan() публичный статический Метод

Determines if the value is greater than given limit.
public static greaterThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$limit mixed
$message null
$propertyPath null
Результат boolean
    public static function greaterThan($value, $limit, $message = null, $propertyPath = null)
    {
        if ($value <= $limit) {
            $message = sprintf($message ?: 'Provided "%s" is not greater than "%s".', static::stringify($value), static::stringify($limit));
            throw static::createException($value, $message, static::INVALID_GREATER, $propertyPath);
        }
        return true;
    }

Usage Example

Пример #1
0
 /**
  * @param int $period
  *
  * @return self
  */
 private function setPeriod($period)
 {
     Assertion::integer($period, 'Period must be at least 1.');
     Assertion::greaterThan($period, 0, 'Period must be at least 1.');
     $this->setParameter('period', $period);
     return $this;
 }
All Usage Examples Of Assert\Assertion::greaterThan