| 1 | <?php |
||
| 21 | final class RobotPlacer |
||
| 22 | { |
||
| 23 | private $spaceInterface; |
||
| 24 | |||
| 25 | private $repository; |
||
| 26 | |||
| 27 | private $logger; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param SpaceInterface $space |
||
| 31 | * @param RobotRepositoryInterface $repository |
||
| 32 | * @param LoggerInterface $logger |
||
| 33 | */ |
||
| 34 | 9 | public function __construct( |
|
| 43 | |||
| 44 | /** |
||
| 45 | * @Subscribe |
||
| 46 | * |
||
| 47 | * @param PlaceRobot $command |
||
| 48 | */ |
||
| 49 | 6 | public function handlePlaceRobot(PlaceRobot $command): void |
|
| 60 | } |
||
| 61 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: