-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathContent.php
More file actions
45 lines (35 loc) · 1 KB
/
Content.php
File metadata and controls
45 lines (35 loc) · 1 KB
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
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Yoti\Identity\Content;
use Yoti\Exception\EncryptedDataException;
class Content
{
private ?string $profile;
private ?string $extraData;
public function __construct(?string $profile = null, ?string $extraData = null)
{
$this->profile = $profile;
$this->extraData = $extraData;
}
public function getProfile(): ?string
{
if (null !== $this->profile) {
$decoded = base64_decode($this->profile, true);
if ($decoded === false) {
throw new EncryptedDataException('Could not decode data');
}
return $decoded;
}
return null;
}
public function getExtraData(): ?string
{
if (null !== $this->extraData) {
$decoded = base64_decode($this->extraData, true);
if ($decoded === false) {
throw new EncryptedDataException('Could not decode data');
}
return $decoded;
}
return null;
}
}