| 1 | <?php |
||
| 7 | class Password |
||
| 8 | { |
||
| 9 | |||
| 10 | protected $criterias = []; |
||
| 11 | |||
| 12 | protected $manager; |
||
| 13 | |||
| 14 | 27 | public function __construct() |
|
| 18 | |||
| 19 | 26 | public function addCriteria(Contracts\Dictionary $dictionary, Contracts\Occurrence $occurrence) |
|
| 23 | |||
| 24 | 26 | public function addNamedCriteria($name, Contracts\Dictionary $dictionary, Contracts\Occurrence $occurrence) |
|
| 30 | |||
| 31 | 5 | public function addFormat(Contracts\Format $format) |
|
| 39 | |||
| 40 | /** |
||
| 41 | * Génère un nouveau mot de passe depuis les critères |
||
| 42 | * |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | 13 | public function generate() |
|
| 46 | { |
||
| 47 | 13 | return $this->manager->generate($this->criterias); |
|
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Evalue le mot de passe |
||
| 52 | * |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | 10 | public function score($value) |
|
| 59 | |||
| 60 | 4 | public function passed($value) |
|
| 64 | } |
||
| 65 |