1 | <?php |
||
21 | class StringScrambler |
||
22 | { |
||
23 | /** |
||
24 | * Salt |
||
25 | * |
||
26 | * @return void |
||
27 | **/ |
||
28 | private $salt; |
||
29 | |||
30 | /** |
||
31 | * Constructor |
||
32 | * |
||
33 | * @param string $salt optional salt, when left empty (null) semi-random value will be generated |
||
34 | * @return void |
||
|
|||
35 | **/ |
||
36 | public function __construct($salt = null) |
||
46 | |||
47 | /** |
||
48 | * Scramble a string |
||
49 | * |
||
50 | * @param string $string |
||
51 | * @return string |
||
52 | **/ |
||
53 | public function scramble($string) |
||
57 | |||
58 | /** |
||
59 | * Get the salt |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | public function getSalt() |
||
67 | |||
68 | /** |
||
69 | * Set the salt |
||
70 | * |
||
71 | * @param string $salt |
||
72 | * @return StringScrambler |
||
73 | */ |
||
74 | public function setSalt($salt) |
||
80 | } |
||
81 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.