@@ -128,7 +128,9 @@ public static function createGuard(Application $app, string $name, array $config
128128 /** @disregard P1013 */
129129 $ guard ->setRequest ($ app ->refresh ('request ' , $ guard , 'setRequest ' ));
130130 if (isset ($ config ['remember ' ])) {
131+ // @codeCoverageIgnoreStart
131132 $ guard ->setRememberDuration ($ config ['remember ' ]);
133+ // @codeCoverageIgnoreEnd
132134 }
133135
134136 return $ guard ;
@@ -194,7 +196,9 @@ public function user(): Authenticatable|null
194196 // new authentication state explicitly.
195197 $ this ->authState = self ::AUTH_STATE_STATELESS ;
196198 } elseif ($ userByRecaller !== null ) {
199+ // @codeCoverageIgnoreStart
197200 $ this ->login ($ userByRecaller , true );
201+ // @codeCoverageIgnoreEnd
198202 } else {
199203 // In the other cases, `$this->user` has implicitly been set by
200204 // `parent::setUser` or `$this->login`.
@@ -326,7 +330,9 @@ protected function getUserByToken(): ?Authenticatable
326330
327331 // Skip if token starts with Basic: it is not related to Lychee.
328332 if (Str::startsWith ('Basic ' , $ token )) {
333+ // @codeCoverageIgnoreStart
329334 return null ;
335+ // @codeCoverageIgnoreEnd
330336 }
331337
332338 // Check if token starts with Bearer
@@ -349,8 +355,10 @@ protected function getUserByToken(): ?Authenticatable
349355
350356 return match (true ) {
351357 $ authenticable !== null => $ authenticable ,
358+ // @codeCoverageIgnoreStart
352359 $ hasBearer && $ configThrow => throw new BadRequestHeaderException ('Invalid token ' ),
353360 $ hasBearer => null ,
361+ // @codeCoverageIgnoreEnd
354362 default => throw new BadRequestHeaderException ('Invalid token ' ),
355363 };
356364 }
0 commit comments