-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Formatter.php
38 lines (23 loc) · 1.33 KB
/
Formatter.php
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
<?php
declare(strict_types=1);
namespace Crell\Serde\Formatter;
use Crell\Serde\Attributes\ClassSettings;
use Crell\Serde\Attributes\Field;
use Crell\Serde\Dict;
use Crell\Serde\Sequence;
use Crell\Serde\Serializer;
interface Formatter
{
public function format(): string;
public function rootField(Serializer $serializer, string $type): Field;
public function serializeInitialize(ClassSettings $classDef, Field $rootField): mixed;
public function serializeFinalize(mixed $runningValue, ClassSettings $classDef): mixed;
public function serializeInt(mixed $runningValue, Field $field, ?int $next): mixed;
public function serializeFloat(mixed $runningValue, Field $field, ?float $next): mixed;
public function serializeString(mixed $runningValue, Field $field, ?string $next): mixed;
public function serializeBool(mixed $runningValue, Field $field, ?bool $next): mixed;
public function serializeSequence(mixed $runningValue, Field $field, Sequence $next, Serializer $serializer): mixed;
public function serializeDictionary(mixed $runningValue, Field $field, Dict $next, Serializer $serializer): mixed;
public function serializeObject(mixed $runningValue, Field $field, Dict $next, Serializer $serializer): mixed;
public function serializeNull(mixed $runningValue, Field $field, mixed $next): mixed;
}