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


PHP Assert::greaterThanEq方法代码示例

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


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

 /**
  * Creates a new version list.
  *
  * @param string         $path     The Puli path.
  * @param PuliResource[] $versions The versions of the resource, starting
  *                                 with the first.
  */
 public function __construct($path, array $versions)
 {
     Assert::stringNotEmpty($path, 'The Puli path must be a non-empty string. Got: %s');
     Assert::allIsInstanceOf($versions, 'Puli\\Repository\\Api\\Resource\\PuliResource');
     Assert::greaterThanEq(count($versions), 1, 'Expected at least one version.');
     $this->path = $path;
     $this->versions = array_values($versions);
 }
开发者ID:puli,项目名称:repository,代码行数:15,代码来源:VersionList.php

示例3: decrease

 /**
  * {@inheritdoc}
  */
 public function decrease(OrderInterface $order)
 {
     /** @var OrderItemInterface $orderItem */
     foreach ($order->getItems() as $orderItem) {
         $variant = $orderItem->getVariant();
         if ($variant->isTracked()) {
             Assert::greaterThanEq($variant->getOnHold() - $orderItem->getQuantity(), 0, sprintf('Not enough units to decrease the inventory of a variant "%s".', $variant->getName()));
             $variant->setOnHold($variant->getOnHold() - $orderItem->getQuantity());
         }
     }
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:14,代码来源:OnHoldQuantityUpdater.php

示例4: reorder

 /**
  * {@inheritdoc}
  */
 public function reorder($sourcePath, $position)
 {
     Assert::greaterThanEq($position, 0, 'Reorder position cannot be negative, got: %s');
     $this->reorderNode($sourcePath, $position);
 }
开发者ID:symfony-cmf,项目名称:resource,代码行数:8,代码来源:AbstractPhpcrRepository.php


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