@@ -10,6 +10,5 @@ |
||
10 | 10 | * @class WebauthnException |
11 | 11 | * @package Platine\Webauthn\Exception |
12 | 12 | */ |
13 | -class WebauthnException extends Exception |
|
14 | -{ |
|
13 | +class WebauthnException extends Exception { |
|
15 | 14 | } |
@@ -19,8 +19,7 @@ discard block |
||
19 | 19 | * @class AttestationData |
20 | 20 | * @package Platine\Webauthn\Attestation |
21 | 21 | */ |
22 | -class AttestationData implements JsonSerializable |
|
23 | -{ |
|
22 | +class AttestationData implements JsonSerializable { |
|
24 | 23 | /** |
25 | 24 | * The AuthenticatorData instance |
26 | 25 | * @var AuthenticatorData |
@@ -44,8 +43,7 @@ discard block |
||
44 | 43 | * @param string $binary |
45 | 44 | * @param array<string> $allowedFormats |
46 | 45 | */ |
47 | - public function __construct(string $binary, array $allowedFormats) |
|
48 | - { |
|
46 | + public function __construct(string $binary, array $allowedFormats) { |
|
49 | 47 | $enc = CborDecoder::decode($binary); |
50 | 48 | |
51 | 49 | if (! is_array($enc) || ! array_key_exists('fmt', $enc) || ! is_string($enc['fmt'])) { |
@@ -88,8 +86,7 @@ discard block |
||
88 | 86 | * |
89 | 87 | * @return BaseFormat|FidoU2F|None|Packed |
90 | 88 | */ |
91 | - public function getFormat() |
|
92 | - { |
|
89 | + public function getFormat() { |
|
93 | 90 | return $this->format; |
94 | 91 | } |
95 | 92 | |
@@ -172,8 +169,7 @@ discard block |
||
172 | 169 | * {@inheritdoc} |
173 | 170 | * @return mixed |
174 | 171 | */ |
175 | - public function jsonSerialize() |
|
176 | - { |
|
172 | + public function jsonSerialize() { |
|
177 | 173 | return get_object_vars($this); |
178 | 174 | } |
179 | 175 |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | * @class AuthenticatorData |
16 | 16 | * @package Platine\Webauthn\Attestation |
17 | 17 | */ |
18 | -class AuthenticatorData implements JsonSerializable |
|
19 | -{ |
|
18 | +class AuthenticatorData implements JsonSerializable { |
|
20 | 19 | public const EC2_TYPE = 2; |
21 | 20 | public const RSA_TYPE = 3; |
22 | 21 | |
@@ -60,8 +59,7 @@ discard block |
||
60 | 59 | * Create new instance |
61 | 60 | * @param string $binary |
62 | 61 | */ |
63 | - public function __construct(string $binary) |
|
64 | - { |
|
62 | + public function __construct(string $binary) { |
|
65 | 63 | if (strlen($binary) < 37) { |
66 | 64 | throw new WebauthnException('Invalid authenticator data provided'); |
67 | 65 | } |
@@ -225,8 +223,7 @@ discard block |
||
225 | 223 | * {@inheritdoc} |
226 | 224 | * @return mixed |
227 | 225 | */ |
228 | - public function jsonSerialize() |
|
229 | - { |
|
226 | + public function jsonSerialize() { |
|
230 | 227 | return get_object_vars($this); |
231 | 228 | } |
232 | 229 |
@@ -8,8 +8,7 @@ |
||
8 | 8 | * @class None |
9 | 9 | * @package Platine\Webauthn\Attestation\Format |
10 | 10 | */ |
11 | -class None extends BaseFormat |
|
12 | -{ |
|
11 | +class None extends BaseFormat { |
|
13 | 12 | /** |
14 | 13 | * {@inheritdoc} |
15 | 14 | */ |
@@ -12,8 +12,7 @@ |
||
12 | 12 | * @class FidoU2F |
13 | 13 | * @package Platine\Webauthn\Attestation\Format |
14 | 14 | */ |
15 | -class FidoU2F extends BaseFormat |
|
16 | -{ |
|
15 | +class FidoU2F extends BaseFormat { |
|
17 | 16 | /** |
18 | 17 | * The algorithm used |
19 | 18 | * @var int |
@@ -12,8 +12,7 @@ |
||
12 | 12 | * @class Packed |
13 | 13 | * @package Platine\Webauthn\Attestation\Format |
14 | 14 | */ |
15 | -class Packed extends BaseFormat |
|
16 | -{ |
|
15 | +class Packed extends BaseFormat { |
|
17 | 16 | /** |
18 | 17 | * The algorithm used |
19 | 18 | * @var int |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | * @class BaseFormat |
12 | 12 | * @package Platine\Webauthn\Attestation\Format |
13 | 13 | */ |
14 | -abstract class BaseFormat implements JsonSerializable |
|
15 | -{ |
|
14 | +abstract class BaseFormat implements JsonSerializable { |
|
16 | 15 | /** |
17 | 16 | * The attestation object data |
18 | 17 | * @var array<string, mixed> |
@@ -53,8 +52,7 @@ discard block |
||
53 | 52 | /** |
54 | 53 | * Destructor |
55 | 54 | */ |
56 | - public function __destruct() |
|
57 | - { |
|
55 | + public function __destruct() { |
|
58 | 56 | // delete X.509 chain certificate file after use |
59 | 57 | if ($this->x5cTempFile !== null && is_file($this->x5cTempFile)) { |
60 | 58 | unlink($this->x5cTempFile); |
@@ -112,8 +110,7 @@ discard block |
||
112 | 110 | * {@inheritdoc} |
113 | 111 | * @return mixed |
114 | 112 | */ |
115 | - public function jsonSerialize() |
|
116 | - { |
|
113 | + public function jsonSerialize() { |
|
117 | 114 | return get_object_vars($this); |
118 | 115 | } |
119 | 116 |
@@ -12,8 +12,7 @@ |
||
12 | 12 | * @class Tpm |
13 | 13 | * @package Platine\Webauthn\Attestation\Format |
14 | 14 | */ |
15 | -class Tpm extends BaseFormat |
|
16 | -{ |
|
15 | +class Tpm extends BaseFormat { |
|
17 | 16 | public const TPM_GENERATED_VALUE = "\xFF\x54\x43\x47"; |
18 | 17 | public const TPM_ST_ATTEST_CERTIFY = "\x80\x17"; |
19 | 18 | /** |
@@ -10,8 +10,7 @@ |
||
10 | 10 | * @class WebauthnConfiguration |
11 | 11 | * @package Platine\Webauthn |
12 | 12 | */ |
13 | -class WebauthnConfiguration extends AbstractConfiguration |
|
14 | -{ |
|
13 | +class WebauthnConfiguration extends AbstractConfiguration { |
|
15 | 14 | /** |
16 | 15 | * {@inheritdoc} |
17 | 16 | */ |