1 | <?php |
||
9 | class Credentials |
||
10 | { |
||
11 | const CONFIG_PREFIX = '___credentials_'; |
||
12 | |||
13 | /** |
||
14 | * The encrypter. |
||
15 | * |
||
16 | * @var \Illuminate\Contracts\Encryption\Encrypter |
||
17 | */ |
||
18 | private $encrypter; |
||
19 | |||
20 | /** |
||
21 | * The decrypted values array. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | private $decrypted; |
||
26 | |||
27 | /** |
||
28 | * Create a new Credentials Instance. |
||
29 | * |
||
30 | * @param \Illuminate\Contracts\Encryption\Encrypter $encrypter |
||
31 | * @return void |
||
|
|||
32 | */ |
||
33 | public function __construct(Encrypter $encrypter) |
||
37 | |||
38 | /** |
||
39 | * Load the file. |
||
40 | * |
||
41 | * @param string $filename |
||
42 | * @return array |
||
43 | */ |
||
44 | public function load(string $filename) |
||
58 | |||
59 | /** |
||
60 | * Store and encrypt the data in the file location. |
||
61 | * |
||
62 | * @param array $data |
||
63 | * @param string $filename |
||
64 | * @return void |
||
65 | */ |
||
66 | public function store(array $data, string $filename) |
||
74 | |||
75 | /** |
||
76 | * Get an encrypter value. |
||
77 | * |
||
78 | * @param string $key |
||
79 | * @param null $default |
||
80 | * @return mixed |
||
81 | */ |
||
82 | public function get(string $key, $default = null) |
||
86 | } |
||
87 |
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.