1 | <?php |
||
10 | final class FieldHandlerRegistry |
||
11 | { |
||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $handlers; |
||
16 | |||
17 | /** |
||
18 | * FieldHandlerRegistry constructor. |
||
19 | * |
||
20 | * @param array $handlers |
||
21 | */ |
||
22 | public function __construct(iterable $handlers) |
||
26 | |||
27 | /** |
||
28 | * Adds new handler. |
||
29 | * |
||
30 | * @param CustomFieldHandlerInterface $handler |
||
31 | */ |
||
32 | public function addHandler(CustomFieldHandlerInterface $handler): void |
||
36 | |||
37 | /** |
||
38 | * @param Value $value |
||
39 | * |
||
40 | * @return CustomFieldHandlerInterface|null |
||
41 | */ |
||
42 | public function handle(Value $value): ?CustomFieldHandlerInterface |
||
53 | } |
||
54 |