for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Location\Utility;
class Cartesian
{
/**
* @var float
*/
private $x;
private $y;
private $z;
* Cartesian constructor.
*
* @param $x
* @param $y
* @param $z
public function __construct(float $x, float $y, float $z)
$this->x = $x;
$this->y = $y;
$this->z = $z;
}
* @return float
public function getX(): float
return $this->x;
public function getY(): float
return $this->y;
public function getZ(): float
return $this->z;
* @param Cartesian $other
* @return Cartesian
public function add(Cartesian $other): Cartesian
return new self(
$this->x + $other->x,
$this->y + $other->y,
$this->z + $other->z
);