55namespace Bow \Auth \Guards ;
66
77use Bow \Security \Hash ;
8+ use Bow \Session \Exception \SessionException ;
89use Bow \Session \Session ;
910use Bow \Auth \Authentication ;
1011use Bow \Auth \Exception \AuthenticationException ;
11- use Bow \Auth \Guards \GuardContract ;
1212use Bow \Auth \Traits \LoginUserTrait ;
1313
1414class SessionGuard extends GuardContract
@@ -25,7 +25,7 @@ class SessionGuard extends GuardContract
2525 /**
2626 * Defines the session_key
2727 *
28- * @var array
28+ * @var string
2929 */
3030 private string $ session_key ;
3131
@@ -44,10 +44,11 @@ public function __construct(array $provider, string $guard)
4444 }
4545
4646 /**
47- * Check if user is authenticate
47+ * Check if user is authenticated
4848 *
4949 * @param array $credentials
5050 * @return bool
51+ * @throws AuthenticationException|SessionException
5152 */
5253 public function attempts (array $ credentials ): bool
5354 {
@@ -72,6 +73,7 @@ public function attempts(array $credentials): bool
7273 * Get the session instance
7374 *
7475 * @return Session
76+ * @throws AuthenticationException
7577 */
7678 private function getSession (): Session
7779 {
@@ -87,9 +89,10 @@ private function getSession(): Session
8789 }
8890
8991 /**
90- * Check if user is authenticate
92+ * Check if user is authenticated
9193 *
9294 * @return bool
95+ * @throws AuthenticationException|SessionException
9396 */
9497 public function check (): bool
9598 {
@@ -100,16 +103,18 @@ public function check(): bool
100103 * Check if user is guest
101104 *
102105 * @return bool
106+ * @throws AuthenticationException|SessionException
103107 */
104108 public function guest (): bool
105109 {
106110 return !$ this ->check ();
107111 }
108112
109113 /**
110- * Check if user is authenticate
114+ * Check if user is authenticated
111115 *
112116 * @return ?Authentication
117+ * @throws AuthenticationException|SessionException
113118 */
114119 public function user (): ?Authentication
115120 {
@@ -121,6 +126,7 @@ public function user(): ?Authentication
121126 *
122127 * @param mixed $user
123128 * @return bool
129+ * @throws AuthenticationException|SessionException
124130 */
125131 public function login (Authentication $ user ): bool
126132 {
@@ -133,6 +139,7 @@ public function login(Authentication $user): bool
133139 * Make direct logout
134140 *
135141 * @return bool
142+ * @throws SessionException|AuthenticationException
136143 */
137144 public function logout (): bool
138145 {
@@ -145,6 +152,7 @@ public function logout(): bool
145152 * Get the user id
146153 *
147154 * @return mixed
155+ * @throws AuthenticationException|SessionException
148156 */
149157 public function id (): mixed
150158 {
0 commit comments