File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -11,22 +11,24 @@ class IntrospectGuard implements Guard
1111{
1212 protected $ user = false ;
1313
14+ private Introspect $ introspect ;
15+
1416 public function __construct (Introspect $ introspect )
1517 {
1618 $ this ->introspect = $ introspect ;
1719 }
1820
19- public function authenticate ()
21+ public function authenticate (): bool
2022 {
2123 return $ this ->check ();
2224 }
2325
24- public function check ()
26+ public function check (): bool
2527 {
2628 return !is_null ($ this ->user ());
2729 }
2830
29- public function guest ()
31+ public function guest (): bool
3032 {
3133 return !$ this ->check ();
3234 }
@@ -36,7 +38,7 @@ public function id()
3638 return $ this ->check () ? $ this ->user ()->getKey () : null ;
3739 }
3840
39- public function user ()
41+ public function user (): ? Authenticatable
4042 {
4143 if ($ this ->user === false ) {
4244 try {
@@ -60,4 +62,9 @@ public function validate(array $credentials = []): bool
6062 {
6163 return true ;
6264 }
65+
66+ public function hasUser (): bool
67+ {
68+ return $ this ->user !== false ;
69+ }
6370}
You can’t perform that action at this time.
0 commit comments