/** * {@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); }
/** * @dataProvider invalidLessProvider */ public function testLessThanThrowsException($value, $limit) { $this->setExpectedException('Assert\\AssertionFailedException', null, Assertion::INVALID_LESS); Assertion::lessThan($value, $limit); }
/** * @param int $refresh_token_min_length */ public function setRefreshTokenMinLength($refresh_token_min_length) { Assertion::integer($refresh_token_min_length); Assertion::greaterThan($refresh_token_min_length, 0); Assertion::lessThan($refresh_token_min_length, $this->getRefreshTokenMaxLength()); $this->refresh_token_min_length = $refresh_token_min_length; }
/** * @param int $access_token_min_length */ public function setAccessTokenMinLength($access_token_min_length) { Assertion::integer($access_token_min_length); Assertion::greaterThan($access_token_min_length, 0); Assertion::lessThan($access_token_min_length, $this->getAccessTokenMaxLength()); $this->access_token_min_length = $access_token_min_length; }
/** * Validate price: * 0 < $price < 10000 * @param $price */ public static function price($price) { Assert::digit($price); Assert::greaterThan($price, 0); Assert::lessThan($price, 10000); }
/** * @param int $duration * * @throws \InvalidArgumentException * * @return static */ public function withDuration($duration) { Assertion::integer($duration); Assertion::greaterThan($duration, VideoInterface::DURATION_LOWER_LIMIT); Assertion::lessThan($duration, VideoInterface::DURATION_UPPER_LIMIT); $instance = clone $this; $instance->duration = $duration; return $instance; }
/** * @param int $authorization_code_min_length */ public function setAuthorizationCodeMinLength($authorization_code_min_length) { Assertion::integer($authorization_code_min_length); Assertion::greaterThan($authorization_code_min_length, 0); Assertion::lessThan($authorization_code_min_length, $this->getAuthorizationCodeMaxLength()); $this->authorization_code_min_length = $authorization_code_min_length; }