@@ -68,8 +68,7 @@ discard block |
||
| 68 | 68 | * Create new instance |
| 69 | 69 | * @param string $binaryData |
| 70 | 70 | */ |
| 71 | - public function __construct(string $binaryData) |
|
| 72 | - { |
|
| 71 | + public function __construct(string $binaryData) { |
|
| 73 | 72 | $this->data = (string)$binaryData; |
| 74 | 73 | $this->length = strlen($binaryData); |
| 75 | 74 | } |
@@ -445,8 +444,7 @@ discard block |
||
| 445 | 444 | * @param array<string, mixed> $data |
| 446 | 445 | * @return void |
| 447 | 446 | */ |
| 448 | - public function __unserialize(array $data) |
|
| 449 | - { |
|
| 447 | + public function __unserialize(array $data) { |
|
| 450 | 448 | if (isset($data['data'])) { |
| 451 | 449 | $value = unserialize($data['data']); |
| 452 | 450 | if ($value === false) { |
@@ -39,8 +39,7 @@ |
||
| 39 | 39 | * @class CborDecoder |
| 40 | 40 | * @package Platine\Webauthn\Helper |
| 41 | 41 | */ |
| 42 | -class CborDecoder |
|
| 43 | -{ |
|
| 42 | +class CborDecoder { |
|
| 44 | 43 | public const CBOR_MAJOR_UNSIGNED_INT = 0; |
| 45 | 44 | public const CBOR_MAJOR_NEGATIVE_INT = 1; |
| 46 | 45 | public const CBOR_MAJOR_BYTE_STRING = 2; |
@@ -48,8 +48,7 @@ discard block |
||
| 48 | 48 | * @class AttestationData |
| 49 | 49 | * @package Platine\Webauthn\Attestation |
| 50 | 50 | */ |
| 51 | -class AttestationData implements JsonSerializable |
|
| 52 | -{ |
|
| 51 | +class AttestationData implements JsonSerializable { |
|
| 53 | 52 | /** |
| 54 | 53 | * The AuthenticatorData instance |
| 55 | 54 | * @var AuthenticatorData |
@@ -73,8 +72,7 @@ discard block |
||
| 73 | 72 | * @param string $binary |
| 74 | 73 | * @param array<string> $allowedFormats |
| 75 | 74 | */ |
| 76 | - public function __construct(string $binary, array $allowedFormats) |
|
| 77 | - { |
|
| 75 | + public function __construct(string $binary, array $allowedFormats) { |
|
| 78 | 76 | $enc = CborDecoder::decode($binary); |
| 79 | 77 | |
| 80 | 78 | if (! is_array($enc) || ! array_key_exists('fmt', $enc) || ! is_string($enc['fmt'])) { |
@@ -44,8 +44,7 @@ discard block |
||
| 44 | 44 | * @class AuthenticatorData |
| 45 | 45 | * @package Platine\Webauthn\Attestation |
| 46 | 46 | */ |
| 47 | -class AuthenticatorData implements JsonSerializable |
|
| 48 | -{ |
|
| 47 | +class AuthenticatorData implements JsonSerializable { |
|
| 49 | 48 | public const EC2_TYPE = 2; |
| 50 | 49 | public const RSA_TYPE = 3; |
| 51 | 50 | |
@@ -89,8 +88,7 @@ discard block |
||
| 89 | 88 | * Create new instance |
| 90 | 89 | * @param string $binary |
| 91 | 90 | */ |
| 92 | - public function __construct(string $binary) |
|
| 93 | - { |
|
| 91 | + public function __construct(string $binary) { |
|
| 94 | 92 | if (strlen($binary) < 37) { |
| 95 | 93 | throw new WebauthnException('Invalid authenticator data provided'); |
| 96 | 94 | } |
@@ -40,8 +40,7 @@ discard block |
||
| 40 | 40 | * @class BaseFormat |
| 41 | 41 | * @package Platine\Webauthn\Attestation\Format |
| 42 | 42 | */ |
| 43 | -abstract class BaseFormat implements JsonSerializable |
|
| 44 | -{ |
|
| 43 | +abstract class BaseFormat implements JsonSerializable { |
|
| 45 | 44 | /** |
| 46 | 45 | * The X5C Chain data |
| 47 | 46 | * @var array<string> |
@@ -68,8 +67,7 @@ discard block |
||
| 68 | 67 | /** |
| 69 | 68 | * Destructor |
| 70 | 69 | */ |
| 71 | - public function __destruct() |
|
| 72 | - { |
|
| 70 | + public function __destruct() { |
|
| 73 | 71 | // delete X.509 chain certificate file after use |
| 74 | 72 | if ($this->x5cTempFile !== null && is_file($this->x5cTempFile)) { |
| 75 | 73 | unlink($this->x5cTempFile); |
@@ -41,8 +41,7 @@ |
||
| 41 | 41 | * @class Tpm |
| 42 | 42 | * @package Platine\Webauthn\Attestation\Format |
| 43 | 43 | */ |
| 44 | -class Tpm extends BaseFormat |
|
| 45 | -{ |
|
| 44 | +class Tpm extends BaseFormat { |
|
| 46 | 45 | public const TPM_GENERATED_VALUE = "\xFF\x54\x43\x47"; |
| 47 | 46 | public const TPM_ST_ATTEST_CERTIFY = "\x80\x17"; |
| 48 | 47 | |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | * @class CredentialPublicKey |
| 44 | 44 | * @package Platine\Webauthn\Entity |
| 45 | 45 | */ |
| 46 | -class CredentialPublicKey implements JsonSerializable |
|
| 47 | -{ |
|
| 46 | +class CredentialPublicKey implements JsonSerializable { |
|
| 48 | 47 | /* |
| 49 | 48 | * Cose encoded keys |
| 50 | 49 | */ |
@@ -117,8 +116,7 @@ discard block |
||
| 117 | 116 | * @param int $offset |
| 118 | 117 | * @param int $endOffset |
| 119 | 118 | */ |
| 120 | - public function __construct(string $binaryData, int $offset, int &$endOffset) |
|
| 121 | - { |
|
| 119 | + public function __construct(string $binaryData, int $offset, int &$endOffset) { |
|
| 122 | 120 | $enc = CborDecoder::decodeInPlace($binaryData, $offset, $endOffset); |
| 123 | 121 | |
| 124 | 122 | // COSE key-encoded elliptic curve public key in EC2 format |
@@ -40,8 +40,7 @@ |
||
| 40 | 40 | * @class AuthenticatorSelection |
| 41 | 41 | * @package Platine\Webauthn\Entity |
| 42 | 42 | */ |
| 43 | -class AuthenticatorSelection implements JsonSerializable |
|
| 44 | -{ |
|
| 43 | +class AuthenticatorSelection implements JsonSerializable { |
|
| 45 | 44 | /** |
| 46 | 45 | * The authenticator attachment |
| 47 | 46 | * @var string |
@@ -39,8 +39,7 @@ discard block |
||
| 39 | 39 | * @class RelyingParty |
| 40 | 40 | * @package Platine\Webauthn\Entity |
| 41 | 41 | */ |
| 42 | -class RelyingParty implements JsonSerializable |
|
| 43 | -{ |
|
| 42 | +class RelyingParty implements JsonSerializable { |
|
| 44 | 43 | /** |
| 45 | 44 | * The relying party id |
| 46 | 45 | * @var string |
@@ -65,8 +64,7 @@ discard block |
||
| 65 | 64 | * @param string $name |
| 66 | 65 | * @param string $logo |
| 67 | 66 | */ |
| 68 | - public function __construct(string $id, string $name, string $logo = '') |
|
| 69 | - { |
|
| 67 | + public function __construct(string $id, string $name, string $logo = '') { |
|
| 70 | 68 | $this->id = $id; |
| 71 | 69 | $this->name = $name; |
| 72 | 70 | $this->logo = $logo; |