/**
  * @param int|float|string $step
  * @param int|float|string|null $base
  */
 public function __construct($step, $base = null)
 {
     Assertion::classExists(Decimal::class);
     Assertion::numeric($step);
     $decimalStep = Decimal::fromString((string) $step);
     Assertion::true($decimalStep->comp(DecimalConstants::zero()) > 0);
     thatNullOr($base)->numeric();
     $this->step = $decimalStep;
     $this->base = null === $base ? DecimalConstants::zero() : Decimal::fromString((string) $base);
 }
示例#2
0
 private function setFormatterFormat($formatterFormat)
 {
     thatNullOr($formatterFormat)->string()->notEmpty();
     $this->formatterFormat = $formatterFormat;
     return $this;
 }