-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVaasVerdict.php
More file actions
34 lines (30 loc) · 899 Bytes
/
VaasVerdict.php
File metadata and controls
34 lines (30 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace VaasSdk;
class VaasVerdict
{
public string $sha256;
public Verdict $verdict;
public ?string $detection;
public ?string $fileType;
public ?string $mimeType;
public static function from(array $data): self
{
$verdict = new self();
$verdict->sha256 = $data['sha256'];
$verdict->verdict = Verdict::from($data['verdict']);
$verdict->detection = $data['detection'] ?? null;
$verdict->fileType = $data['fileType'] ?? null;
$verdict->mimeType = $data['mimeType'] ?? null;
return $verdict;
}
public function __toString(): string
{
return json_encode([
'sha256' => $this->sha256,
'verdict' => $this->verdict,
'detection' => $this->detection,
'fileType' => $this->fileType,
'mimeType' => $this->mimeType
]);
}
}