PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.0.1
Defender Security – Malware Scanner, Login Security & Firewall v3.0.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / web-auth / metadata-service / src / BiometricAccuracyDescriptor.php

BiometricAccuracyDescriptor.php in Defender Security – Malware Scanner, Login Security & Firewall 3.0.1, at vendor/web-auth/metadata-service/src/BiometricAccuracyDescriptor.php

109 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 /*
6 * The MIT License (MIT)
7 *
8 * Copyright (c) 2014-2021 Spomky-Labs
9 *
10 * This software may be modified and distributed under the terms
11 * of the MIT license. See the LICENSE file for details.
12 */
13
14 namespace Webauthn\MetadataService;
15
16 use Assert\Assertion;
17
18 class BiometricAccuracyDescriptor extends AbstractDescriptor
19 {
20 /**
21 * @var float|null
22 */
23 private $FAR;
24
25 /**
26 * @var float|null
27 */
28 private $FRR;
29
30 /**
31 * @var float|null
32 */
33 private $EER;
34
35 /**
36 * @var float|null
37 */
38 private $FAAR;
39
40 /**
41 * @var int|null
42 */
43 private $maxReferenceDataSets;
44
45 public function __construct(?float $FAR, ?float $FRR, ?float $EER, ?float $FAAR, ?int $maxReferenceDataSets, ?int $maxRetries = null, ?int $blockSlowdown = null)
46 {
47 Assertion::greaterOrEqualThan($maxReferenceDataSets, 0, Utils::logicException('Invalid data. The value of "maxReferenceDataSets" must be a positive integer'));
48 $this->FRR = $FRR;
49 $this->FAR = $FAR;
50 $this->EER = $EER;
51 $this->FAAR = $FAAR;
52 $this->maxReferenceDataSets = $maxReferenceDataSets;
53 parent::__construct($maxRetries, $blockSlowdown);
54 }
55
56 public function getFAR(): ?float
57 {
58 return $this->FAR;
59 }
60
61 public function getFRR(): ?float
62 {
63 return $this->FRR;
64 }
65
66 public function getEER(): ?float
67 {
68 return $this->EER;
69 }
70
71 public function getFAAR(): ?float
72 {
73 return $this->FAAR;
74 }
75
76 public function getMaxReferenceDataSets(): ?int
77 {
78 return $this->maxReferenceDataSets;
79 }
80
81 public static function createFromArray(array $data): self
82 {
83 return new self(
84 $data['FAR'] ?? null,
85 $data['FRR'] ?? null,
86 $data['EER'] ?? null,
87 $data['FAAR'] ?? null,
88 $data['maxReferenceDataSets'] ?? null,
89 $data['maxRetries'] ?? null,
90 $data['blockSlowdown'] ?? null
91 );
92 }
93
94 public function jsonSerialize(): array
95 {
96 $data = [
97 'FAR' => $this->FAR,
98 'FRR' => $this->FRR,
99 'EER' => $this->EER,
100 'FAAR' => $this->FAAR,
101 'maxReferenceDataSets' => $this->maxReferenceDataSets,
102 'maxRetries' => $this->getMaxRetries(),
103 'blockSlowdown' => $this->getBlockSlowdown(),
104 ];
105
106 return Utils::filterNullValues($data);
107 }
108 }
109