| 1 | <?php namespace Anomaly\UsersModule\User\Command; |
||
| 14 | class ActivateUserByCode |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The user instance. |
||
| 19 | * |
||
| 20 | * @var UserInterface |
||
| 21 | */ |
||
| 22 | protected $user; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The activation code. |
||
| 26 | * |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $code; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Create a new ActivateUserByCode instance. |
||
| 33 | * |
||
| 34 | * @param UserInterface $user |
||
| 35 | * @param $code |
||
| 36 | */ |
||
| 37 | function __construct(UserInterface $user, $code) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Handle the command. |
||
| 45 | * |
||
| 46 | * @param UserRepositoryInterface $users |
||
| 47 | * @return bool |
||
| 48 | */ |
||
| 49 | public function handle(UserRepositoryInterface $users) |
||
| 66 | } |
||
| 67 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.