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


PHP Assertion::integerish方法代码示例

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


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

示例1: __construct

 /**
  * @param string $direction
  * @param int $days
  */
 public function __construct($direction, $days)
 {
     Assertion::integerish($days);
     Assertion::choice($direction, [self::DIRECTION_PAST, self::DIRECTION_FUTURE]);
     $this->direction = $direction;
     $this->days = (int) $days;
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:11,代码来源:ReleaseDateCondition.php

示例2: __construct

 public function __construct($value)
 {
     try {
         Assertion::integerish($value);
         $this->value = (int) $value;
     } catch (AssertionInvalidArgumentException $exception) {
         throw new InvalidArgumentException($value, array('integer'));
     }
 }
开发者ID:lorenzomar,项目名称:valueobject,代码行数:9,代码来源:Integer.php

示例3: __construct

 public function __construct($filters, $offset, $limit, $sortField, $sortOrder, $isPaginated)
 {
     Assertion::isArray($filters, "Invalid filters");
     Assertion::integerish($limit, "Invalid limit");
     Assertion::integerish($offset, "Invalid offset");
     Assertion::nullOrString($sortField, "Invalid sort field");
     Assertion::choice($sortOrder, [null, self::ORDER_ASC, self::ORDER_DESC], "Invalid sort order");
     Assertion::boolean($isPaginated, "Invalid value for isPaginated");
     if ($limit < 0) {
         throw new \InvalidArgumentException("Invalid limit");
     }
     if ($offset < 0) {
         throw new \InvalidArgumentException("Invalid offset");
     }
     $this->filters = $filters;
     $this->offset = (int) $offset;
     $this->limit = (int) $limit;
     $this->sortField = $sortField;
     $this->sortOrder = $sortOrder;
     $this->isPaginated = (bool) $isPaginated;
 }
开发者ID:domynation,项目名称:domynation-framework,代码行数:21,代码来源:SearchRequest.php

示例4: __construct

 /**
  * @param int $days
  */
 public function __construct($days)
 {
     Assertion::integerish($days);
     $this->days = (int) $days;
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:8,代码来源:CreateDateCondition.php

示例5: testInvalidIntegerish

 /**
  * @dataProvider dataInvalidIntegerish
  */
 public function testInvalidIntegerish($nonInteger)
 {
     $this->setExpectedException('Assert\\AssertionFailedException', null, Assertion::INVALID_INTEGERISH);
     Assertion::integerish($nonInteger);
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:8,代码来源:AssertTest.php

示例6:

 function _validateAmountIsNumeric()
 {
     Assertion::integerish($this->amount);
 }
开发者ID:PhillipMwaniki,项目名称:pesapal-1,代码行数:4,代码来源:Order.php

示例7: __construct

 /**
  * @param int $minSales
  */
 public function __construct($minSales)
 {
     Assertion::integerish($minSales);
     $this->minSales = (int) $minSales;
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:8,代码来源:SalesCondition.php

示例8: read

 /**
  * @param int $chunkSize
  * @return string
  */
 public function read($chunkSize = self::DEFAULT_CHUNK_SIZE)
 {
     Assertion::integerish($chunkSize);
     return fread($this->resource, $chunkSize);
 }
开发者ID:metasyntactical,项目名称:xml-tools,代码行数:9,代码来源:AbstractXmlStream.php


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