| 1 | <?php |
||
| 14 | class CountVisitorUsersTask extends Action |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * CountUsersAction constructor. |
||
| 19 | * |
||
| 20 | * @param \App\Containers\User\Data\Repositories\UserRepository $userRepository |
||
| 21 | */ |
||
| 22 | public function __construct(UserRepository $userRepository) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @return mixed |
||
| 29 | * @throws \Prettus\Repository\Exceptions\RepositoryException |
||
| 30 | */ |
||
| 31 | public function run() |
||
| 37 | |||
| 38 | } |
||
| 39 |
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: