Skip to content

Commit

Permalink
[1.x] Remove unused JetBrains Attributes (#64)
Browse files Browse the repository at this point in the history
* [1.x] Remove unused JetBrains Attributes

* [1.x] Fixes static analysis
  • Loading branch information
DarkGhostHunter authored Feb 20, 2024
1 parent 48eaa33 commit 54c3044
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 27 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
"illuminate/encryption": "9.*|10.*"
},
"require-dev": {
"orchestra/testbench": "^7.22|8.*",
"jetbrains/phpstorm-attributes": "*"
"orchestra/testbench": "^7.22|8.*"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 1 addition & 3 deletions src/Attestation/Validator/Pipes/CompileAttestationObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Closure;
use Illuminate\Http\Request;
use JetBrains\PhpStorm\ArrayShape;
use Laragear\WebAuthn\Attestation\AttestationObject;
use Laragear\WebAuthn\Attestation\AuthenticatorData;
use Laragear\WebAuthn\Attestation\Formats\None;
Expand Down Expand Up @@ -67,10 +66,9 @@ public function handle(AttestationValidation $validation, Closure $next): mixed
* Returns an array map from a BASE64 encoded CBOR string.
*
* @param \Illuminate\Http\Request $request
* @return array
* @return array{fmt: string, attStmt: array, authData: \Laragear\WebAuthn\ByteBuffer}
* @throws \Laragear\WebAuthn\Exceptions\AttestationException
*/
#[ArrayShape(["fmt" => "string", "attStmt" => "array", "authData" => ByteBuffer::class])]
protected function decodeCborBase64(Request $request): array
{
try {
Expand Down
4 changes: 1 addition & 3 deletions src/ByteBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Illuminate\Contracts\Support\Jsonable;
use InvalidArgumentException;
use JetBrains\PhpStorm\ArrayShape;
use JsonSerializable;
use OutOfBoundsException;
use Stringable;
Expand Down Expand Up @@ -373,9 +372,8 @@ public function toJson($options = 0): string
/**
* Returns an array of data for serialization.
*
* @return array
* @return array{binaryData: string}
*/
#[ArrayShape(['binaryData' => "string"])]
public function __serialize(): array
{
return ['binaryData' => static::encodeBase64Url($this->binaryData)];
Expand Down
8 changes: 1 addition & 7 deletions src/Http/Requests/AssertedRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use JetBrains\PhpStorm\ArrayShape;
use Laragear\WebAuthn\Contracts\WebAuthnAuthenticatable;

class AssertedRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
* @return array<string, string>
*/
#[ArrayShape([
'id' => "string", 'rawId' => "string", 'response.authenticatorData' => "string",
'response.clientDataJSON' => "string", 'response.signature' => "string", 'response.userHandle' => "string",
'type' => "string"
])]
public function rules(): array
{
return [
Expand Down
7 changes: 1 addition & 6 deletions src/Http/Requests/AttestedRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Laragear\WebAuthn\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use JetBrains\PhpStorm\ArrayShape;
use Laragear\WebAuthn\Attestation\Validator\AttestationValidation;
use Laragear\WebAuthn\Attestation\Validator\AttestationValidator;
use Laragear\WebAuthn\Contracts\WebAuthnAuthenticatable;
Expand Down Expand Up @@ -37,12 +36,8 @@ public function authorize(?WebAuthnAuthenticatable $user): bool
/**
* Get the validation rules that apply to the request.
*
* @return array
* @return array<string, string>
*/
#[ArrayShape([
'id' => "string", 'rawId' => "string", 'response' => "string", 'response.clientDataJSON' => "string",
'response.attestationObject' => "string", 'type' => "string"
])]
public function rules(): array
{
return [
Expand Down
2 changes: 0 additions & 2 deletions src/WebAuthnAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Support\Facades\Date;
use JetBrains\PhpStorm\ArrayShape;
use Laragear\WebAuthn\Models\WebAuthnCredential;

/**
Expand All @@ -21,7 +20,6 @@ trait WebAuthnAuthentication
*
* @return array{name: string, displayName: string}
*/
#[ArrayShape(['name' => "string", 'displayName' => "string"])]
public function webAuthnData(): array
{
return [
Expand Down
4 changes: 0 additions & 4 deletions tests/FakeAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Tests;

use JetBrains\PhpStorm\ArrayShape;

class FakeAuthenticator
{
public const CREDENTIAL_ID = 'owBYu_waGLhAOCg4EFzi6Lr55x51G2dR5yhJi8q2C3tgZQQL2aEi-nK3I54J6ILj70pJzR_6QxvA5XER17d7NA9EFe2QH3VoJYQGpO8G5yDoFQvsdkxNhioyMyhyQHNrAgTMGyfigIMCfhjk9te7LNYl9K5GbWRc4TGeQl1vROjBtTNm3GdpEOqp9RijWd-ShQZ95eHoc8SA_-8vzCyfmy-wI_K4ZqlQNNl85Fzg2GIBcC2zvcJhLYy1A2kw6JoBTAmz1ZCCgkTKWhzUvAJQpMpu40M67FqE0WkGZfSJ9A';
Expand All @@ -23,7 +21,6 @@ class FakeAuthenticator
*
* @return array
*/
#[ArrayShape(['id' => "string", 'type' => "string", 'rawId' => "string", 'response' => "string[]"])]
public static function attestationResponse(): array
{
return [
Expand All @@ -42,7 +39,6 @@ public static function attestationResponse(): array
*
* @return array
*/
#[ArrayShape(['id' => "string", 'type' => "string", 'rawId' => "string", 'response' => "string[]"])]
public static function assertionResponse(): array
{
return [
Expand Down

0 comments on commit 54c3044

Please sign in to comment.