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


PHP Assert::integerish方法代码示例

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


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

示例1: create

 /**
  * Create the tag
  *
  * @param string             $body               Tag body
  * @param DescriptionFactory $descriptionFactory The description factory
  * @param Context|null       $context            The Context is used to resolve Types and FQSENs, although optional
  *                                               it is highly recommended to pass it. If you omit it then it is assumed that
  *                                               the DocBlock is in the global namespace and has no `use` statements.
  *
  * @return SleepTime
  */
 public static function create($body, DescriptionFactory $descriptionFactory = null, Context $context = null)
 {
     Assert::integerish($body, self::MSG);
     Assert::greaterThanEq($body, 0, self::MSG);
     Assert::notNull($descriptionFactory);
     return new static($descriptionFactory->create($body, $context));
 }
开发者ID:alorel,项目名称:phpunit-auto-rerun,代码行数:18,代码来源:SleepTime.php

示例2: __construct

 public function __construct($startingLine, $lineCount = null, Description $description = null)
 {
     Assert::integerish($startingLine);
     Assert::nullOrIntegerish($lineCount);
     $this->startingLine = (int) $startingLine;
     $this->lineCount = $lineCount !== null ? (int) $lineCount : null;
     $this->description = $description;
 }
开发者ID:timpressive,项目名称:art-auction,代码行数:8,代码来源:Source.php

示例3: create

 public static function create($body)
 {
     Assert::string($body);
     $parts = explode('.', $body);
     if (!empty($parts[0])) {
         Assert::integerish($parts[0]);
         $major = (int) array_shift($parts);
     } else {
         $major = 0;
     }
     if (!empty($parts[0])) {
         Assert::integerish($parts[0]);
         $minor = (int) array_shift($parts);
     } else {
         $minor = 0;
     }
     if (!empty($parts[0])) {
         Assert::integerish($parts[0]);
         $patch = (int) array_shift($parts);
     } else {
         $patch = 0;
     }
     return new static($major, $minor, $patch);
 }
开发者ID:stratedge,项目名称:inspection,代码行数:24,代码来源:ApiVersion.php


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