/** * Set the shape. * * @param int $shape A value from the Shape enumeration. * @throws \InvalidArgumentException If $shape is not a value from the Shape enumeration. */ public function setShape($shape) { if (in_array($shape, Shape::asArray())) { $this->shape = $shape; } else { $msg = "The shape argument must be a value from the Shape enumeration, '" . $shape . "' given."; throw new InvalidArgumentException($msg); } }