Skip to content

Commit 5635768

Browse files
author
Evan Sims
authored
Merge branch 'main' into feat/backchannel-logout
2 parents 11536dd + a53f05c commit 5635768

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

src/Events.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
/**
3131
* @api
32+
*
33+
* @codeCoverageIgnore
3234
*/
3335
final class Events implements EventsContract
3436
{

src/Guards/AuthenticationGuard.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ public function user(): ?Authenticatable
280280
/**
281281
* @var ?Authenticatable $lastResponse
282282
*/
283+
// @codeCoverageIgnoreStart
283284
if (class_exists('\Laravel\Telescope\Telescope')) {
284285
static $depth = 0;
285286
static $lastCalled = null;
@@ -304,6 +305,7 @@ public function user(): ?Authenticatable
304305
++$depth;
305306
$lastCalled = time();
306307
}
308+
// @codeCoverageIgnoreEnd
307309

308310
$currentUser = $this->getCredential()?->getUser();
309311

src/Guards/GuardAbstract.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ final public function processToken(
217217
Events::dispatch($event = new TokenVerificationFailed($token, $invalidTokenException));
218218

219219
if ($event->throwException) {
220+
// @codeCoverageIgnoreStart
220221
throw $invalidTokenException;
222+
// @codeCoverageIgnoreEnd
221223
}
222224

223225
return null;
@@ -242,6 +244,9 @@ final public function sdk(
242244
return $this->sdk->getSdk();
243245
}
244246

247+
/**
248+
* @codeCoverageIgnore
249+
*/
245250
final public function service(): ?InstanceEntityContract
246251
{
247252
return $this->sdk;

src/UserProviderAbstract.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ final public function retrieveByCredentials(array $credentials): ?Authenticatabl
6060
static $lastResponse = null;
6161
static $lastCredentials = null;
6262

63+
// @codeCoverageIgnoreStart
64+
6365
/**
6466
* @var ?Authenticatable $lastResponse
6567
* @var array $lastCredentials
@@ -94,6 +96,8 @@ final public function retrieveByCredentials(array $credentials): ?Authenticatabl
9496
$lastCredentials = $credentials;
9597
}
9698

99+
// @codeCoverageIgnoreEnd
100+
97101
$lastResponse = $this->getRepository()->fromSession($credentials);
98102

99103
$this->withoutRecording(static fn (): bool => Cache::put('auth0_sdk_credential_lookup_' . $hash, $lastResponse, 5));
@@ -222,6 +226,11 @@ protected function setRepositoryName(string $repositoryName): void
222226
$this->repositoryName = $repositoryName;
223227
}
224228

229+
/**
230+
* @codeCoverageIgnore
231+
*
232+
* @param callable $callback
233+
*/
225234
protected function withoutRecording(callable $callback): mixed
226235
{
227236
if (class_exists(self::TELESCOPE)) {

tests/Unit/UserProviderTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,10 @@
157157
expect($provider->getRepository())
158158
->toBeInstanceOf($repository::class);
159159
});
160+
161+
test('retrieveByCredentials() returns `null` when an empty array is provided', function (): void {
162+
$provider = new UserProvider(['model' => uniqid()]);
163+
$repository = new UserRepository();
164+
165+
expect($provider->retrieveByCredentials([]))->toBeNull();
166+
});

0 commit comments

Comments
 (0)