| 1 | <?php |
||
| 7 | class Password {
|
||
| 8 | |||
| 9 | protected $criterias = []; |
||
| 10 | |||
| 11 | protected $manager; |
||
| 12 | |||
| 13 | 13 | public function __construct() |
|
| 14 | {
|
||
| 15 | 13 | $this->manager = new Manager; |
|
| 16 | 13 | } |
|
| 17 | |||
| 18 | 12 | public function addCriteria(Contracts\Dictionary $dictionary, Contracts\Occurrence $occurrence) |
|
| 24 | |||
| 25 | 5 | public function addFormat(Contracts\Format $format) |
|
| 26 | {
|
||
| 27 | 5 | $criteriasBundle = $format->handle(); |
|
| 28 | |||
| 29 | 5 | foreach ($criteriasBundle as $bundle) {
|
|
| 30 | 5 | $this->addCriteria($bundle[0], $bundle[1]); |
|
| 31 | } |
||
| 32 | 5 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Génère un nouveau mot de passe depuis les critères |
||
| 36 | * |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | 12 | public function generate() |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Evalue le mot de passe |
||
| 46 | * |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | 1 | public function score($value) |
|
| 53 | } |
||
| 54 |