The doc comment array<non-empty-string, SerializerInterface> at position 2 could not be parsed: Unknown type name 'non-empty-string' at position 2 in array<non-empty-string, SerializerInterface>.
The doc comment array<non-empty-string, SerializerInterface> at position 2 could not be parsed: Unknown type name 'non-empty-string' at position 2 in array<non-empty-string, SerializerInterface>.
Loading history...
14
212
public function __construct(SerializerInterface $default)
15
{
16
212
$this->default = $default;
17
}
18
19
1
public function serialize(array $payload): string
20
{
21
1
return $this->default->serialize($payload);
22
}
23
24
1
public function deserialize(string $payload): array
25
{
26
1
return $this->default->deserialize($payload);
27
}
28
29
2
public function getSerializer(string $jobType): SerializerInterface
30
{
31
2
if (!$this->hasSerializer($jobType)) {
32
2
return $this->default;
33
}
34
35
2
return $this->serializers[$jobType];
36
}
37
38
3
public function addSerializer(string $jobType, SerializerInterface $serializer): void
39
{
40
3
if (!$this->hasSerializer($jobType)) {
41
3
$this->serializers[$jobType] = $serializer;
42
}
43
}
44
45
3
public function hasSerializer(string $jobType): bool