1 | <?php |
||
15 | class GetUserAction extends Action |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * @var \App\Containers\User\Tasks\GetAuthenticatedUserTask |
||
20 | */ |
||
21 | private $getAuthenticatedUserTask; |
||
22 | |||
23 | /** |
||
24 | * FindUserByAnythingAction constructor. |
||
25 | * |
||
26 | * @param \App\Containers\User\Tasks\FindUserByIdTask $findUserByIdTask |
||
27 | * @param \App\Containers\User\Tasks\GetAuthenticatedUserTask $getAuthenticatedUserTask |
||
28 | */ |
||
29 | public function __construct( |
||
36 | |||
37 | /** |
||
38 | * @param $userId |
||
39 | * @param null $token |
||
40 | * |
||
41 | * @return mixed |
||
42 | */ |
||
43 | public function run($userId, $token = null) |
||
59 | |||
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: