当前位置: 首页>>代码示例>>PHP>>正文


PHP Assertion::greaterOrEqualThan方法代码示例

本文整理汇总了PHP中Assert\Assertion::greaterOrEqualThan方法的典型用法代码示例。如果您正苦于以下问题:PHP Assertion::greaterOrEqualThan方法的具体用法?PHP Assertion::greaterOrEqualThan怎么用?PHP Assertion::greaterOrEqualThan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assert\Assertion的用法示例。


在下文中一共展示了Assertion::greaterOrEqualThan方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getKey

 /**
  * @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];
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:12,代码来源:BaseJWKSet.php

示例2: __construct

 /**
  * @param float  $value
  * @param string $currency
  *
  * @throws \InvalidArgumentException
  */
 public function __construct($value, $currency)
 {
     Assertion::float($value);
     Assertion::greaterOrEqualThan($value, PriceInterface::VALUE_MIN);
     $this->value = $value;
     $this->currency = $currency;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:13,代码来源:Price.php

示例3: __construct

 public function __construct(string $eventStore = 'cqrs.event_store.cqrs_default', UuidInterface $previousEventId = null, int $delaySeconds = 0, int $throttleMicroseconds = 1000000)
 {
     Assertion::greaterOrEqualThan($delaySeconds, 0);
     Assertion::greaterThan($throttleMicroseconds, 0);
     $this->eventStore = $eventStore;
     $this->delaySeconds = $delaySeconds;
     $this->throttleMicroseconds = $throttleMicroseconds;
 }
开发者ID:pauci,项目名称:cqrs-job-manager,代码行数:8,代码来源:EventStreamConfig.php

示例4: __construct

 /**
  * ClientAssertionJwt constructor.
  *
  * @param \Jose\JWTLoaderInterface                    $jwt_loader
  * @param \OAuth2\Exception\ExceptionManagerInterface $exception_manager
  * @param int                                         $secret_lifetime
  */
 public function __construct(JWTLoaderInterface $jwt_loader, ExceptionManagerInterface $exception_manager, $secret_lifetime = 0)
 {
     $this->setJWTLoader($jwt_loader);
     $this->setExceptionManager($exception_manager);
     Assertion::integer($secret_lifetime);
     Assertion::greaterOrEqualThan($secret_lifetime, 0);
     $this->secret_lifetime = $secret_lifetime;
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:15,代码来源:ClientAssertionJwt.php

示例5: __construct

 /**
  * ClientSecretBasic constructor.
  *
  * @param string $realm
  * @param int    $secret_lifetime
  */
 public function __construct($realm, $secret_lifetime = 0)
 {
     Assertion::string($realm);
     Assertion::integer($secret_lifetime);
     Assertion::greaterOrEqualThan($secret_lifetime, 0);
     $this->realm = $realm;
     $this->secret_lifetime = $secret_lifetime;
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:14,代码来源:ClientSecretBasic.php

示例6: __construct

 private function __construct(Coords $startPoint, Coords $endPoint, $hits = 0)
 {
     Assertion::integer($hits);
     Assertion::greaterOrEqualThan($hits, 0);
     $size = $startPoint->distance($endPoint) + 1;
     Assertion::greaterOrEqualThan($size, static::MINIMUM_SIZE);
     Assertion::lessOrEqualThan($hits, $size);
     $this->startPoint = $startPoint;
     $this->endPoint = $endPoint;
     $this->hits = $hits;
 }
开发者ID:WeCamp,项目名称:flyingliquourice,代码行数:11,代码来源:Ship.php

示例7: __construct

 /**
  * A value object that contains a geographical coordinate.
  *
  * @param $latitude
  * @param $longitude
  */
 public function __construct($latitude, $longitude)
 {
     Assertion::true(is_int($latitude) || is_float($latitude));
     Assertion::true(is_int($longitude) || is_float($longitude));
     Assertion::greaterOrEqualThan($latitude, -90.0);
     Assertion::lessOrEqualThan($latitude, 90.0);
     Assertion::greaterOrEqualThan($longitude, -180.0);
     Assertion::lessOrEqualThan($longitude, 180.0);
     $this->latitude = $latitude;
     $this->longitude = $longitude;
 }
开发者ID:patrickkempff,项目名称:location,代码行数:17,代码来源:Coordinate2d.php

示例8: verify

 /**
  * If the counter is not provided, the OTP is verified at the actual counter.
  *
  * {@inheritdoc}
  */
 public function verify($otp, $counter = null, $window = null)
 {
     Assertion::string($otp, 'The OTP must be a string');
     Assertion::nullOrInteger($counter, 'The counter must be null or an integer');
     Assertion::greaterOrEqualThan($counter, 0, 'The counter must be at least 0.');
     Assertion::nullOrInteger($window, 'The window parameter must be null or an integer');
     if (null === $counter) {
         $counter = $this->getCounter();
     } elseif ($counter < $this->getCounter()) {
         return false;
     }
     return $this->verifyOtpWithWindow($otp, $counter, $window);
 }
开发者ID:spomky-labs,项目名称:otphp,代码行数:18,代码来源:HOTP.php

示例9: __construct

 public function __construct($time, $memory, $nbCalls, Document $traceDocument = null)
 {
     Assertion::integer($time, 'Time is not an integer, got "%s"');
     Assertion::greaterOrEqualThan($time, 0, 'Time must be greater than 0, got "%s"');
     Assertion::integer($memory, 'Memory was not an integer, got "%s"');
     Assertion::greaterOrEqualThan($memory, 0);
     Assertion::integer($nbCalls, 'Number of calls was not an integer, got "%s"');
     Assertion::greaterOrEqualThan($nbCalls, 0);
     $this->time = $time;
     $this->memory = $memory;
     $this->nbCalls = $nbCalls;
     // not serialized.
     $this->traceDocument = $traceDocument;
 }
开发者ID:dantleech,项目名称:phpbench,代码行数:14,代码来源:XDebugTraceResult.php

示例10: __construct

 /**
  * @param mixed $time Time taken to execute the iteration in microseconds.
  */
 public function __construct($time)
 {
     Assertion::greaterOrEqualThan($time, 0, 'Time cannot be less than 0, got %s');
     Assertion::integer($time);
     $this->netTime = $time;
 }
开发者ID:dantleech,项目名称:phpbench,代码行数:9,代码来源:TimeResult.php

示例11: createRSAKey

 /**
  * {@inheritdoc}
  */
 public static function createRSAKey(array $values)
 {
     Assertion::keyExists($values, 'size', 'The key size is not set.');
     $size = $values['size'];
     unset($values['size']);
     Assertion::true(0 === $size % 8, 'Invalid key size.');
     Assertion::greaterOrEqualThan($size, 384, 'Key length is too short. It needs to be at least 384 bits.');
     $key = openssl_pkey_new(['private_key_bits' => $size, 'private_key_type' => OPENSSL_KEYTYPE_RSA]);
     openssl_pkey_export($key, $out);
     $rsa = new RSAKey($out);
     $values = array_merge($values, $rsa->toArray());
     return new JWK($values);
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:16,代码来源:JWKFactory.php

示例12: testGreaterOrEqualThanThrowsException

 /**
  * @dataProvider invalidGreaterOrEqualProvider
  *
  * @param mixed $value
  * @param mixed $limit
  */
 public function testGreaterOrEqualThanThrowsException($value, $limit)
 {
     $this->setExpectedException('Assert\\AssertionFailedException', null, Assertion::INVALID_GREATER_OR_EQUAL);
     Assertion::greaterOrEqualThan($value, $limit);
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:11,代码来源:AssertTest.php

示例13: withViewCount

 /**
  * @param int $viewCount
  *
  * @throws \InvalidArgumentException
  *
  * @return static
  */
 public function withViewCount($viewCount)
 {
     Assertion::integer($viewCount);
     Assertion::greaterOrEqualThan($viewCount, VideoInterface::VIEW_COUNT_MIN);
     $instance = clone $this;
     $instance->viewCount = $viewCount;
     return $instance;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:15,代码来源:Video.php

示例14: __construct

 public function __construct($offset)
 {
     $offset = (int) $offset;
     Assertion::greaterOrEqualThan($offset, 0, 'Offset cannot be lower than 0');
     $this->offset = $offset;
 }
开发者ID:wookieb,项目名称:query-object,代码行数:6,代码来源:OffsetCondition.php

示例15: setExpiresAt

 /**
  * {@inheritdoc}
  */
 public function setExpiresAt($expires_at)
 {
     Assertion::integer($expires_at);
     Assertion::greaterOrEqualThan($expires_at, 0);
     $this->expires_at = $expires_at;
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:9,代码来源:Token.php


注:本文中的Assert\Assertion::greaterOrEqualThan方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。