| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | 1 | public function generate () |
|
| 45 | { |
||
| 46 | 1 | $password = ''; |
|
| 47 | 1 | $map = $this->options->createHitRateMap(); |
|
| 48 | 1 | $limit = count( $map ) - 1; |
|
| 49 | 1 | $length = $this->options->createLength(); |
|
| 50 | 1 | for ( $i = 0; $i < $length; $i++ ) { |
|
| 51 | 1 | $position = $this->getMethod()->getRandomInt( $limit ); |
|
| 52 | 1 | $symbols = $map[ $position ]; |
|
| 53 | 1 | $password .= $symbols->getRandomSymbol( $this->getMethod() ); |
|
| 54 | 1 | } |
|
| 55 | 1 | return $password; |
|
| 56 | } |
||
| 57 | } |
||
| 58 |