Fixes static analysis

This commit is contained in:
Italo
2022-07-27 14:47:04 -04:00
committed by GitHub
parent d18c9dcc5a
commit 397f119432
5 changed files with 5 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ class MayRetrieveCredentialsIdForUser
* Adapt all credentials into an `allowCredentials` digestible array. * Adapt all credentials into an `allowCredentials` digestible array.
* *
* @param \Illuminate\Database\Eloquent\Collection<int, \Laragear\WebAuthn\Models\WebAuthnCredential> $credentials * @param \Illuminate\Database\Eloquent\Collection<int, \Laragear\WebAuthn\Models\WebAuthnCredential> $credentials
* @phpstan-ignore-next-line
* @return \Illuminate\Support\Collection<int, array{id?: mixed, type: string, transports?: non-empty-array<int, string>}> * @return \Illuminate\Support\Collection<int, array{id?: mixed, type: string, transports?: non-empty-array<int, string>}>
*/ */
protected function parseCredentials(EloquentCollection $credentials): Collection protected function parseCredentials(EloquentCollection $credentials): Collection

View File

@@ -415,6 +415,7 @@ class ByteBuffer implements JsonSerializable, Jsonable, Stringable
*/ */
public static function fromBase64(string $base64): static public static function fromBase64(string $base64): static
{ {
/** @var string|false $bin */
$bin = base64_decode($base64); $bin = base64_decode($base64);
if (false === $bin) { if (false === $bin) {

View File

@@ -138,7 +138,6 @@ class CborDecoder
$val = static::parseExtraLength($val, $buf, $offset); $val = static::parseExtraLength($val, $buf, $offset);
// @phpstan-ingnore-next-line
try { try {
return static::parseItemData($type, $val, $buf, $offset); return static::parseItemData($type, $val, $buf, $offset);
} catch (InvalidArgumentException $e) { } catch (InvalidArgumentException $e) {
@@ -249,7 +248,7 @@ class CborDecoder
* @param \Laragear\WebAuthn\ByteBuffer $buf * @param \Laragear\WebAuthn\ByteBuffer $buf
* @param $offset * @param $offset
* @return \Laragear\WebAuthn\ByteBuffer|array|bool|float|int|string|null * @return \Laragear\WebAuthn\ByteBuffer|array|bool|float|int|string|null
* @throws \Laragear\WebAuthn\Exceptions\DataException * @throws \Laragear\WebAuthn\Exceptions\DataException|\InvalidArgumentException
*/ */
protected static function parseItemData( protected static function parseItemData(
int $type, int $type,

View File

@@ -59,6 +59,7 @@ class AssertedRequest extends FormRequest
if ($auth->attempt($this->validated(), $remember ?? $this->hasRemember())) { if ($auth->attempt($this->validated(), $remember ?? $this->hasRemember())) {
$this->session()->regenerate($destroySession); $this->session()->regenerate($destroySession);
// @phpstan-ignore-next-line
return $auth->user(); return $auth->user();
} }

View File

@@ -102,6 +102,7 @@ class WebAuthnCredential extends Model
*/ */
public function authenticatable(): MorphTo public function authenticatable(): MorphTo
{ {
// @phpstan-ignore-next-line
return $this->morphTo('authenticatable'); return $this->morphTo('authenticatable');
} }