File tree 3 files changed +10
-29
lines changed
3 files changed +10
-29
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,14 @@ class Passwords
19
19
{
20
20
use Nette \SmartObject;
21
21
22
- private string $ algo ;
23
- private array $ options ;
24
-
25
-
26
22
/**
27
23
* Chooses which secure algorithm is used for hashing and how to configure it.
28
24
* @see https://php.net/manual/en/password.constants.php
29
25
*/
30
- public function __construct (string $ algo = PASSWORD_DEFAULT , array $ options = [])
31
- {
32
- $ this -> algo = $ algo ;
33
- $ this -> options = $ options ;
26
+ public function __construct (
27
+ private string $ algo = PASSWORD_DEFAULT ,
28
+ private array $ options = [],
29
+ ) {
34
30
}
35
31
36
32
Original file line number Diff line number Diff line change @@ -19,25 +19,17 @@ class SimpleAuthenticator implements Authenticator
19
19
{
20
20
use Nette \SmartObject;
21
21
22
- private array $ passwords ;
23
- private array $ roles ;
24
- private array $ data ;
25
-
26
-
27
22
/**
28
23
* @param array $passwords list of pairs username => password
29
24
* @param array $roles list of pairs username => role[]
30
25
* @param array $data list of pairs username => mixed[]
31
26
*/
32
27
public function __construct (
33
28
#[\SensitiveParameter]
34
- array $ passwords ,
35
- array $ roles = [],
36
- array $ data = []
29
+ private array $ passwords ,
30
+ private array $ roles = [],
31
+ private array $ data = [],
37
32
) {
38
- $ this ->passwords = $ passwords ;
39
- $ this ->roles = $ roles ;
40
- $ this ->data = $ data ;
41
33
}
42
34
43
35
Original file line number Diff line number Diff line change @@ -53,23 +53,16 @@ class User
53
53
/** @var callable[] function (User $sender): void; Occurs when the user is logged out */
54
54
public array $ onLoggedOut = [];
55
55
56
- /** Session storage for current user */
57
- private UserStorage $ storage ;
58
- private ?Authenticator $ authenticator ;
59
- private ?Authorizator $ authorizator ;
60
56
private ?IIdentity $ identity = null ;
61
57
private ?bool $ authenticated = null ;
62
58
private ?int $ logoutReason = null ;
63
59
64
60
65
61
public function __construct (
66
- UserStorage $ storage ,
67
- ?Authenticator $ authenticator = null ,
68
- ?Authorizator $ authorizator = null ,
62
+ private UserStorage $ storage ,
63
+ private ?Authenticator $ authenticator = null ,
64
+ private ?Authorizator $ authorizator = null ,
69
65
) {
70
- $ this ->storage = $ storage ;
71
- $ this ->authenticator = $ authenticator ;
72
- $ this ->authorizator = $ authorizator ;
73
66
}
74
67
75
68
You can’t perform that action at this time.
0 commit comments