x($x)->y($y); } /** * Sets the x dimension of the point. * * @param int $x The value of the x dimension. * * @return PointValue */ public function x($x) { $this->x = $x; return $this; } /** * Sets the y dimension of the point. * * @param int $y The value of the y dimension. * * @return PointValue */ public function y($y) { $this->y = $y; return $this; } /** * Serializes to string. * * @return string */ public function __toString() { return "{$this->x}:{$this->y}"; } /** * Serializes to json. * * @return mixed */ public function jsonSerialize() { return [ 'x' => $this->x, 'y' => $this->y ]; } }