File tree 1 file changed +20
-0
lines changed
src/Symfony/Component/Security/Http/Authenticator/Passport
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ class Passport implements UserPassportInterface
28
28
29
29
protected $ user ;
30
30
31
+ private $ attributes = [];
32
+
31
33
/**
32
34
* @param CredentialsInterface $credentials the credentials to check for this authentication, use
33
35
* SelfValidatingPassport if no credentials should be checked.
@@ -47,4 +49,22 @@ public function getUser(): UserInterface
47
49
{
48
50
return $ this ->user ;
49
51
}
52
+
53
+ /**
54
+ * @param mixed $value
55
+ */
56
+ public function setAttribute (string $ name , $ value ): void
57
+ {
58
+ $ this ->attributes [$ name ] = $ value ;
59
+ }
60
+
61
+ /**
62
+ * @param mixed $default
63
+ *
64
+ * @return mixed
65
+ */
66
+ public function getAttribute (string $ name , $ default = null )
67
+ {
68
+ return $ this ->attributes [$ name ] ?: $ default ;
69
+ }
50
70
}
You can’t perform that action at this time.
0 commit comments