| Conditions | 5 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | protected function askPassword() |
||
| 28 | { |
||
| 29 | $password = $passwordConfirm = null; |
||
| 30 | $tries = 0; |
||
| 31 | |||
| 32 | while (! $password || strlen($password) < 4 || $password != $passwordConfirm) { |
||
|
|
|||
| 33 | if ($tries > 2) { |
||
| 34 | throw new \Exception('Aborting. Too many failed attempts to set password'); |
||
| 35 | } |
||
| 36 | |||
| 37 | $password = $this->secret('Password (min. 5 chars)'); |
||
| 38 | $passwordConfirm = $this->secret('Password (confirm)'); |
||
| 39 | |||
| 40 | $tries++; |
||
| 41 | } |
||
| 42 | |||
| 43 | return $password; |
||
| 44 | } |
||
| 46 |