| 1 | <?php |
||
| 20 | class Node extends BuildableAbstract implements JsonSerializable |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var string[] $allowedGet |
||
| 24 | */ |
||
| 25 | protected $allowedGet = array('id', 'x', 'y', 'z'); |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var integer $increment |
||
| 29 | */ |
||
| 30 | private static $increment = 0; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var integer $id |
||
| 34 | */ |
||
| 35 | protected $id; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @var float|null $x |
||
| 39 | */ |
||
| 40 | protected $x; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @var float|null $y |
||
| 44 | */ |
||
| 45 | protected $y; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @var float|null $z |
||
| 49 | */ |
||
| 50 | protected $z; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Point constructor. |
||
| 54 | * @param float|null $x |
||
| 55 | * @param float|null $y |
||
| 56 | * @param float|null $z |
||
| 57 | */ |
||
| 58 | public function __construct(?float $x = null, ?float $y = null, ?float $z = null) |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @return array |
||
| 69 | */ |
||
| 70 | public function jsonSerialize() : array |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @param float|null $x |
||
| 89 | * @param float|null $y |
||
| 90 | * @param float|null $z |
||
| 91 | * @return Node |
||
| 92 | */ |
||
| 93 | public function move(float $x = null, float $y = null, float $z = null) : Node |
||
| 101 | } |