@@ -18,7 +18,7 @@ trait InteractsWithAuthentication
18
18
* $I->amActingAs($user);
19
19
* ```
20
20
*/
21
- public function amActingAs (Authenticatable $ user , string $ guardName = null ): void
21
+ public function amActingAs (Authenticatable $ user , ? string $ guardName = null ): void
22
22
{
23
23
if (property_exists ($ user , 'wasRecentlyCreated ' ) && $ user ->wasRecentlyCreated ) {
24
24
$ user ->wasRecentlyCreated = false ;
@@ -47,7 +47,7 @@ public function amActingAs(Authenticatable $user, string $guardName = null): voi
47
47
* @param Authenticatable|array $user
48
48
* @param string|null $guardName
49
49
*/
50
- public function amLoggedAs ($ user , string $ guardName = null ): void
50
+ public function amLoggedAs ($ user , ? string $ guardName = null ): void
51
51
{
52
52
if ($ user instanceof Authenticatable) {
53
53
$ this ->getAuth ()->login ($ user );
@@ -69,7 +69,7 @@ public function amLoggedAs($user, string $guardName = null): void
69
69
* $I->assertAuthenticatedAs($user);
70
70
* ```
71
71
*/
72
- public function assertAuthenticatedAs (Authenticatable $ user , string $ guardName = null ): void
72
+ public function assertAuthenticatedAs (Authenticatable $ user , ? string $ guardName = null ): void
73
73
{
74
74
$ expected = $ this ->getAuth ()->guard ($ guardName )->user ();
75
75
@@ -97,7 +97,7 @@ public function assertAuthenticatedAs(Authenticatable $user, string $guardName =
97
97
* ]);
98
98
* ```
99
99
*/
100
- public function assertCredentials (array $ credentials , string $ guardName = null ): void
100
+ public function assertCredentials (array $ credentials , ? string $ guardName = null ): void
101
101
{
102
102
$ this ->assertTrue (
103
103
$ this ->hasCredentials ($ credentials , $ guardName ), 'The given credentials are invalid. '
@@ -115,7 +115,7 @@ public function assertCredentials(array $credentials, string $guardName = null):
115
115
* ]);
116
116
* ```
117
117
*/
118
- public function assertInvalidCredentials (array $ credentials , string $ guardName = null ): void
118
+ public function assertInvalidCredentials (array $ credentials , ? string $ guardName = null ): void
119
119
{
120
120
$ this ->assertFalse (
121
121
$ this ->hasCredentials ($ credentials , $ guardName ), 'The given credentials are valid. '
@@ -130,7 +130,7 @@ public function assertInvalidCredentials(array $credentials, string $guardName =
130
130
* $I->dontSeeAuthentication();
131
131
* ```
132
132
*/
133
- public function dontSeeAuthentication (string $ guardName = null ): void
133
+ public function dontSeeAuthentication (? string $ guardName = null ): void
134
134
{
135
135
$ this ->assertFalse ($ this ->isAuthenticated ($ guardName ), 'The user is authenticated ' );
136
136
}
@@ -156,15 +156,15 @@ public function logout(): void
156
156
* $I->seeAuthentication();
157
157
* ```
158
158
*/
159
- public function seeAuthentication (string $ guardName = null ): void
159
+ public function seeAuthentication (? string $ guardName = null ): void
160
160
{
161
161
$ this ->assertTrue ($ this ->isAuthenticated ($ guardName ), 'The user is not authenticated ' );
162
162
}
163
163
164
164
/**
165
165
* Return true if the credentials are valid, false otherwise.
166
166
*/
167
- protected function hasCredentials (array $ credentials , string $ guardName = null ): bool
167
+ protected function hasCredentials (array $ credentials , ? string $ guardName = null ): bool
168
168
{
169
169
/** @var GuardHelpers $guard */
170
170
$ guard = $ this ->getAuth ()->guard ($ guardName );
0 commit comments