-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSerializationResult.php
More file actions
46 lines (39 loc) · 906 Bytes
/
SerializationResult.php
File metadata and controls
46 lines (39 loc) · 906 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
35
36
37
38
39
40
41
42
43
44
45
46
<?php
declare(strict_types=1);
namespace KaririCode\Serializer\Result;
/**
* Immutable result of a serialization pass.
*
* @package KaririCode\Serializer\Result
* @author Walmir Silva <walmir.silva@kariricode.org>
* @since 3.1.0 ARFA 1.3
*/
final readonly class SerializationResult
{
/**
* @param array<string, mixed> $originalData
*/
public function __construct(
public array $originalData,
public string $payload,
public string $format,
) {
}
public function getPayload(): string
{
return $this->payload;
}
public function getFormat(): string
{
return $this->format;
}
/** @return array<string, mixed> */
public function getOriginalData(): array
{
return $this->originalData;
}
public function getPayloadSize(): int
{
return \strlen($this->payload);
}
}