Assert\Assertion::greaterOrEqualThan PHP Method

greaterOrEqualThan() public static method

Determines if the value is greater or equal than given limit.
public static greaterOrEqualThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$limit mixed
$message null
$propertyPath null
return boolean
    public static function greaterOrEqualThan($value, $limit, $message = null, $propertyPath = null)
    {
        if ($value < $limit) {
            $message = sprintf($message ?: 'Provided "%s" is not greater or equal than "%s".', static::stringify($value), static::stringify($limit));
            throw static::createException($value, $message, static::INVALID_GREATER_OR_EQUAL, $propertyPath);
        }
        return true;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @param int $index
  *
  * @return \Jose\Object\JWKInterface
  */
 public function getKey($index)
 {
     Assertion::integer($index, 'The index must be a positive integer.');
     Assertion::greaterOrEqualThan($index, 0, 'The index must be a positive integer.');
     Assertion::true($this->hasKey($index), 'Undefined index.');
     return $this->getKeys()[$index];
 }
All Usage Examples Of Assert\Assertion::greaterOrEqualThan