| 1 | <?php |
||
| 13 | class CountAllUsersTask extends Action |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * CountUsersAction constructor. |
||
| 18 | * |
||
| 19 | * @param \App\Containers\User\Data\Repositories\UserRepository $userRepository |
||
| 20 | */ |
||
| 21 | public function __construct(UserRepository $userRepository) |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | public function run() |
||
| 33 | |||
| 34 | } |
||
| 35 |
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: