class Point (View source)

A value object which has X and Y coordinates.

Properties

protected int $x
protected int $y

Methods

__construct(int $x, int $y)

Point constructor.

int
getX()

Returns the x-coordinate of the point.

setX(int $x)

Sets the x-coordinate for this point.

int
getY()

Returns the y-coordinate of the point.

setY(int $y)

Sets the x-coordinate for this point.

__toString()

No description

verify(int|mixed $coordinate)

Verifies that the coordinate is valid.

Details

__construct(int $x, int $y)

Point constructor.

Parameters

int $x The x-coordinate
int $y The y-coordinate

int getX()

Returns the x-coordinate of the point.

Return Value

int

Point setX(int $x)

Sets the x-coordinate for this point.

Parameters

int $x

Return Value

Point

int getY()

Returns the y-coordinate of the point.

Return Value

int

Point setY(int $y)

Sets the x-coordinate for this point.

Parameters

int $y

Return Value

Point

__toString()

protected verify(int|mixed $coordinate)

Verifies that the coordinate is valid.

Parameters

int|mixed $coordinate