1 | <?php |
||
18 | class Robot |
||
19 | { |
||
20 | /** |
||
21 | * Purchased by Rupert, then tanked :). |
||
22 | * |
||
23 | * @var SpaceInterface |
||
24 | */ |
||
25 | private $mySpace; |
||
26 | |||
27 | private $placement; |
||
28 | |||
29 | private $facingDirection; |
||
30 | |||
31 | 8 | private function __construct( |
|
40 | |||
41 | /** |
||
42 | * @param SpaceInterface $space |
||
43 | * @param Place $placement |
||
44 | * @param string|null $facingDirection |
||
45 | * |
||
46 | * @return Robot |
||
47 | * |
||
48 | * @throws Assert\AssertionFailedException |
||
49 | */ |
||
50 | 9 | public static function create( |
|
61 | |||
62 | public function move(): Robot |
||
73 | |||
74 | public function left(): Robot |
||
80 | |||
81 | public function right(): Robot |
||
87 | |||
88 | 2 | public function moveNorthward(): Robot |
|
99 | |||
100 | 1 | public function moveEastward(): Robot |
|
111 | |||
112 | 2 | public function moveSouthward(): Robot |
|
123 | |||
124 | 2 | public function moveWestward(): Robot |
|
135 | |||
136 | 1 | public function getPlacement(): Place |
|
140 | |||
141 | /** |
||
142 | * validateCanMove. |
||
143 | * |
||
144 | * The robot requires a space during construction, however, |
||
145 | * this is extra precautionary in case the space is removed |
||
146 | * |
||
147 | * @throws NotPlacedInSpaceException |
||
148 | */ |
||
149 | 4 | private function validateCanMove(): void |
|
157 | } |
||
158 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.