| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class PasswordHashTestObject extends AbstractArrayBackedDaftObject |
||
| 10 | { |
||
| 11 | const PROPERTIES = [ |
||
| 12 | 'password', |
||
| 13 | 'passwordHash', |
||
| 14 | ]; |
||
| 15 | |||
| 16 | protected function GetPassword() : void |
||
| 17 | { |
||
| 18 | } |
||
| 19 | |||
| 20 | protected function SetPasswordHash(string $hash) : void |
||
| 21 | { |
||
| 22 | $this->NudgePropertyValue('passwordHash', $hash); |
||
| 23 | $this->NudgePropertyValue('password', ''); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function SetPassword(string $password) : void |
||
| 27 | { |
||
| 28 | $this->SetPasswordHash(password_hash($password, PASSWORD_DEFAULT)); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function GetPasswordHash() : string |
||
| 32 | { |
||
| 33 | return $this->RetrievePropertyValueFromData('passwordHash'); |
||
| 34 | } |
||
| 36 |