@@ -39,8 +39,7 @@ |
||
| 39 | 39 | * @class BaseEnum |
| 40 | 40 | * @package Platine\Webauthn\Enum |
| 41 | 41 | */ |
| 42 | -class BaseEnum |
|
| 43 | -{ |
|
| 42 | +class BaseEnum { |
|
| 44 | 43 | /** |
| 45 | 44 | * Return this class all the enumerations |
| 46 | 45 | * @return array<string> |
@@ -37,6 +37,5 @@ |
||
| 37 | 37 | * @class PublicKeyAuthParam |
| 38 | 38 | * @package Platine\Webauthn\Entity |
| 39 | 39 | */ |
| 40 | -class PublicKeyAuthParam extends BaseCredential |
|
| 41 | -{ |
|
| 40 | +class PublicKeyAuthParam extends BaseCredential { |
|
| 42 | 41 | } |
@@ -37,6 +37,5 @@ |
||
| 37 | 37 | * @class UserCredential |
| 38 | 38 | * @package Platine\Webauthn\Entity |
| 39 | 39 | */ |
| 40 | -class UserCredential extends BaseCredential |
|
| 41 | -{ |
|
| 40 | +class UserCredential extends BaseCredential { |
|
| 42 | 41 | } |
@@ -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 | |