Webmozart\Assert\Assert::greaterThan PHP Method

greaterThan() public static method

public static greaterThan ( $value, $limit, $message = '' )
    public static function greaterThan($value, $limit, $message = '')
    {
        if ($value <= $limit) {
            static::reportInvalidArgument(sprintf($message ?: 'Expected a value greater than %2$s. Got: %s', static::valueToString($value), static::valueToString($limit)));
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function release(StockableInterface $stockable, $quantity)
 {
     Assert::greaterThan($quantity, 0, 'Quantity of units must be greater than 0.');
     $this->dispatchEvent(SyliusStockableEvents::PRE_RELEASE, $stockable);
     $stockable->setOnHold($stockable->getOnHold() - $quantity);
     $this->dispatchEvent(SyliusStockableEvents::POST_RELEASE, $stockable);
 }
All Usage Examples Of Webmozart\Assert\Assert::greaterThan