/** * @param Point $lowerLeft * @param Point $upperRight * @param ValueProvider|callable $valueProvider */ public function __construct(Point $lowerLeft, Point $upperRight, $valueProvider = null) { parent::__construct($valueProvider); if ($lowerLeft->isRight($upperRight) || $lowerLeft->isAbove($upperRight)) { throw new \InvalidArgumentException('First point must not be right or above of the second point'); } $this->lowerLeft = $lowerLeft; $this->upperRight = $upperRight; }
/** * @param Point $lowerLeft * @param int $width * @param int $height * @param ValueProvider|callable $valueProvider */ public function __construct(Point $lowerLeft, $width, $height, $valueProvider = null) { parent::__construct($valueProvider); if (false === is_int($width) || false === is_int($height) || $width < 0 || $height < 0) { throw new \InvalidArgumentException('Width and height must be integers'); } $this->lowerLeft = $lowerLeft; $this->width = $width; $this->height = $height; }
/** * @param Point $center * @param int $radius * @param ValueProvider|callable $valueProvider */ public function __construct(Point $center, $radius, $fill, $valueProvider = null) { parent::__construct($valueProvider); if (false === is_int($radius) || $radius < 0) { throw new \InvalidArgumentException('Radius must be non-negative integer'); } $this->center = $center; $this->radius = $radius; $this->fill = (bool) $fill; }