|
2 | 2 |
|
3 | 3 | namespace Hackzilla\PasswordGenerator\Generator;
|
4 | 4 |
|
| 5 | +use Hackzilla\PasswordGenerator\Exception\InvalidOptionException; |
| 6 | +use Hackzilla\PasswordGenerator\Exception\InvalidOptionTypeException; |
| 7 | +use Hackzilla\PasswordGenerator\Model\Option\Option; |
| 8 | +use Hackzilla\PasswordGenerator\RandomGenerator\RandomGeneratorInterface; |
| 9 | + |
5 | 10 | interface PasswordGeneratorInterface
|
6 | 11 | {
|
| 12 | + /** |
| 13 | + * Possible options. |
| 14 | + * |
| 15 | + * @return array |
| 16 | + */ |
7 | 17 | public function getOptions();
|
8 | 18 |
|
| 19 | + /** |
| 20 | + * Set password generator option. |
| 21 | + * |
| 22 | + * @param string $option |
| 23 | + * @param array $optionSettings |
| 24 | + * |
| 25 | + * @return $this |
| 26 | + * @throws InvalidOptionTypeException |
| 27 | + */ |
9 | 28 | public function setOption($option, $optionSettings);
|
10 | 29 |
|
| 30 | + /** |
| 31 | + * Get option. |
| 32 | + * |
| 33 | + * @param $option |
| 34 | + * |
| 35 | + * @return mixed |
| 36 | + */ |
11 | 37 | public function getOption($option);
|
12 | 38 |
|
| 39 | +// /** |
| 40 | +// * Remove Option. |
| 41 | +// * |
| 42 | +// * @param string $option |
| 43 | +// * |
| 44 | +// * @return $this |
| 45 | +// */ |
| 46 | +// public function removeOption($option); |
| 47 | + |
| 48 | + /** |
| 49 | + * Set password generator option value. |
| 50 | + * |
| 51 | + * @param string $option |
| 52 | + * @param $value |
| 53 | + * |
| 54 | + * @return $this |
| 55 | + */ |
13 | 56 | public function setOptionValue($option, $value);
|
14 | 57 |
|
| 58 | + /** |
| 59 | + * Get option value. |
| 60 | + * |
| 61 | + * @param $option |
| 62 | + * |
| 63 | + * @return mixed |
| 64 | + */ |
15 | 65 | public function getOptionValue($option);
|
16 | 66 |
|
| 67 | + /** |
| 68 | + * @param string $parameter |
| 69 | + * @param mixed $value |
| 70 | + * |
| 71 | + * @return $this |
| 72 | + */ |
17 | 73 | public function setParameter($parameter, $value);
|
18 | 74 |
|
| 75 | + /** |
| 76 | + * @param string $parameter |
| 77 | + * @param mixed $default |
| 78 | + * |
| 79 | + * @return null|mixed |
| 80 | + */ |
19 | 81 | public function getParameter($parameter);
|
20 | 82 |
|
| 83 | + /** |
| 84 | + * Generate $count number of passwords. |
| 85 | + * |
| 86 | + * @param int $count Number of passwords to return |
| 87 | + * |
| 88 | + * @return string[] |
| 89 | + * |
| 90 | + * @throws \InvalidArgumentException |
| 91 | + */ |
21 | 92 | public function generatePasswords($count = 1);
|
22 | 93 |
|
| 94 | + /** |
| 95 | + * Generate one password based on options. |
| 96 | + * |
| 97 | + * @return string password |
| 98 | + */ |
23 | 99 | public function generatePassword();
|
| 100 | + |
| 101 | + |
| 102 | +// /** |
| 103 | +// * Set source of randomness. |
| 104 | +// * |
| 105 | +// * @param RandomGeneratorInterface $randomGenerator |
| 106 | +// * |
| 107 | +// * @return $this |
| 108 | +// */ |
| 109 | +// public function setRandomGenerator(RandomGeneratorInterface $randomGenerator); |
| 110 | + |
| 111 | +// /** |
| 112 | +// * Generate a random value |
| 113 | +// * |
| 114 | +// * @param int $min |
| 115 | +// * @param int $max |
| 116 | +// * |
| 117 | +// * @return int |
| 118 | +// */ |
| 119 | +// public function randomInteger($min, $max); |
24 | 120 | }
|
0 commit comments