Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
72 | public function authenticate() |
||
73 | { |
||
74 | if (!isset($this->accounts[$this->identity])) { |
||
75 | return new Result(Result::FAILURE_IDENTITY_NOT_FOUND, null, ['Login does not exists']); |
||
76 | } |
||
77 | |||
78 | if ($this->accounts[$this->identity] !== $this->credential) { |
||
79 | return new Result(Result::FAILURE_CREDENTIAL_INVALID, null, ['Invalid credentials']); |
||
80 | } |
||
81 | |||
82 | return new Result(Result::SUCCESS, $this->identity); |
||
83 | } |
||
84 | } |
||
85 |