Assert\Assertion::lessThan PHP Method

lessThan() public static method

Determines if the value is less than given limit.
public static lessThan ( mixed $value, mixed $limit, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$limit mixed
$message null
$propertyPath null
return boolean
    public static function lessThan($value, $limit, $message = null, $propertyPath = null)
    {
        if ($value >= $limit) {
            $message = sprintf($message ?: 'Provided "%s" is not less than "%s".', static::stringify($value), static::stringify($limit));
            throw static::createException($value, $message, static::INVALID_LESS, $propertyPath);
        }
        return true;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function checkJWS(Object\JWSInterface $jws, $signature)
 {
     Assertion::integer($signature);
     Assertion::lessThan($signature, $jws->countSignatures());
     $checked_claims = $this->checkJWT($jws);
     $protected_headers = $jws->getSignature($signature)->getProtectedHeaders();
     $headers = $jws->getSignature($signature)->getHeaders();
     $this->checkHeaders($protected_headers, $headers, $checked_claims);
 }
All Usage Examples Of Assert\Assertion::lessThan