| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Anomaly\UsersModule\User\Command; |
||
| 49 | public function handle(UserRepositoryInterface $users) |
||
| 50 | { |
||
| 51 | if (!$user = $users->findByActivationCode($this->code)) { |
||
| 52 | return false; |
||
| 53 | } |
||
| 54 | |||
| 55 | if ($this->user->getId() !== $user->getId()) { |
||
| 56 | return false; |
||
| 57 | } |
||
| 58 | |||
| 59 | $this->user->activated = true; |
||
| 60 | $this->user->activation_code = null; |
||
| 61 | |||
| 62 | $users->save($this->user); |
||
| 63 | |||
| 64 | return true; |
||
| 65 | } |
||
| 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.