File manager - Edit - /home/premiey/www/wp-content/plugins/ameliabooking/src/Domain/ValueObjects/Number/Integer/Capacity.php
Back
<?php namespace AmeliaBooking\Domain\ValueObjects\Number\Integer; use AmeliaBooking\Domain\Common\Exceptions\InvalidArgumentException; final class Capacity { const MIN = 1; const MAX = 10; /** * @var string */ private $capacity; /** * Capacity constructor. * * @param string $capacity * * @throws InvalidArgumentException */ public function __construct($capacity) { if (!filter_var($capacity, FILTER_VALIDATE_INT)) { throw new InvalidArgumentException("Capacity '$capacity' must be whole number between " . self::MIN . ' and ' . self::MAX); } $this->capacity = (int)$capacity; } /** * Return the capacity from the value object * * @return int */ public function getValue() { return $this->capacity; } }
| ver. 1.4 |
Github
|
.
| PHP 5.4.45 | Generation time: 0 |
proxy
|
phpinfo
|
Settings