Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Codeception/Module/Laravel/InteractsWithAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trait InteractsWithAuthentication
* $I->amActingAs($user);
* ```
*/
public function amActingAs(Authenticatable $user, string $guardName = null): void
public function amActingAs(Authenticatable $user, ?string $guardName = null): void
{
if (property_exists($user, 'wasRecentlyCreated') && $user->wasRecentlyCreated) {
$user->wasRecentlyCreated = false;
Expand Down Expand Up @@ -47,7 +47,7 @@ public function amActingAs(Authenticatable $user, string $guardName = null): voi
* @param Authenticatable|array $user
* @param string|null $guardName
*/
public function amLoggedAs($user, string $guardName = null): void
public function amLoggedAs($user, ?string $guardName = null): void
{
if ($user instanceof Authenticatable) {
$this->getAuth()->login($user);
Expand All @@ -69,7 +69,7 @@ public function amLoggedAs($user, string $guardName = null): void
* $I->assertAuthenticatedAs($user);
* ```
*/
public function assertAuthenticatedAs(Authenticatable $user, string $guardName = null): void
public function assertAuthenticatedAs(Authenticatable $user, ?string $guardName = null): void
{
$expected = $this->getAuth()->guard($guardName)->user();

Expand Down Expand Up @@ -97,7 +97,7 @@ public function assertAuthenticatedAs(Authenticatable $user, string $guardName =
* ]);
* ```
*/
public function assertCredentials(array $credentials, string $guardName = null): void
public function assertCredentials(array $credentials, ?string $guardName = null): void
{
$this->assertTrue(
$this->hasCredentials($credentials, $guardName), 'The given credentials are invalid.'
Expand All @@ -115,7 +115,7 @@ public function assertCredentials(array $credentials, string $guardName = null):
* ]);
* ```
*/
public function assertInvalidCredentials(array $credentials, string $guardName = null): void
public function assertInvalidCredentials(array $credentials, ?string $guardName = null): void
{
$this->assertFalse(
$this->hasCredentials($credentials, $guardName), 'The given credentials are valid.'
Expand All @@ -130,7 +130,7 @@ public function assertInvalidCredentials(array $credentials, string $guardName =
* $I->dontSeeAuthentication();
* ```
*/
public function dontSeeAuthentication(string $guardName = null): void
public function dontSeeAuthentication(?string $guardName = null): void
{
$this->assertFalse($this->isAuthenticated($guardName), 'The user is authenticated');
}
Expand All @@ -156,15 +156,15 @@ public function logout(): void
* $I->seeAuthentication();
* ```
*/
public function seeAuthentication(string $guardName = null): void
public function seeAuthentication(?string $guardName = null): void
{
$this->assertTrue($this->isAuthenticated($guardName), 'The user is not authenticated');
}

/**
* Return true if the credentials are valid, false otherwise.
*/
protected function hasCredentials(array $credentials, string $guardName = null): bool
protected function hasCredentials(array $credentials, ?string $guardName = null): bool
{
/** @var GuardHelpers $guard */
$guard = $this->getAuth()->guard($guardName);
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Module/Laravel/InteractsWithConsole.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait InteractsWithConsole
*
* @return string|void
*/
public function callArtisan(string $command, array $parameters = [], OutputInterface $output = null)
public function callArtisan(string $command, array $parameters = [], ?OutputInterface $output = null)
{
$console = $this->getConsoleKernel();
if (!$output) {
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Module/Laravel/InteractsWithViews.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function dontSeeFormErrors(): void
* $I->seeFormErrorMessage('username', 'Invalid Username');
* ```
*/
public function seeFormErrorMessage(string $field, string $errorMessage = null): void
public function seeFormErrorMessage(string $field, ?string $errorMessage = null): void
{
$viewErrorBag = $this->getViewErrorBag();

Expand Down