File tree 3 files changed +12
-28
lines changed
3 files changed +12
-28
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,21 +19,16 @@ 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
- public function __construct (array $ passwords , array $ roles = [], array $ data = [])
33
- {
34
- $ this -> passwords = $ passwords ;
35
- $ this -> roles = $ roles ;
36
- $ this -> data = $ data ;
27
+ public function __construct (
28
+ private array $ passwords ,
29
+ private array $ roles = [],
30
+ private array $ data = [],
31
+ ) {
37
32
}
38
33
39
34
Original file line number Diff line number Diff line change @@ -54,23 +54,16 @@ class User
54
54
/** @var callable[] function (User $sender): void; Occurs when the user is logged out */
55
55
public iterable $ onLoggedOut = [];
56
56
57
- /** Session storage for current user */
58
- private UserStorage $ storage ;
59
- private ?Authenticator $ authenticator ;
60
- private ?Authorizator $ authorizator ;
61
57
private ?IIdentity $ identity = null ;
62
58
private ?bool $ authenticated = null ;
63
59
private ?int $ logoutReason = null ;
64
60
65
61
66
62
public function __construct (
67
- UserStorage $ storage ,
68
- ?Authenticator $ authenticator = null ,
69
- ?Authorizator $ authorizator = null ,
63
+ private UserStorage $ storage ,
64
+ private ?Authenticator $ authenticator = null ,
65
+ private ?Authorizator $ authorizator = null ,
70
66
) {
71
- $ this ->storage = $ storage ;
72
- $ this ->authenticator = $ authenticator ;
73
- $ this ->authorizator = $ authorizator ;
74
67
}
75
68
76
69
You can’t perform that action at this time.
0 commit comments