Total Complexity | 6 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class TransformerRegistry |
||
10 | { |
||
11 | /** @var CanTransform[] */ |
||
12 | protected $transformerByResourceClass = []; |
||
13 | |||
14 | /** |
||
15 | * @param CanTransform $transformer |
||
16 | * @param bool $override |
||
17 | * @return $this |
||
18 | * @throws DuplicateResourceTransformerException |
||
19 | */ |
||
20 | 12 | public function addTransformer(CanTransform $transformer, bool $override = false) |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param mixed $resource |
||
39 | * @return CanTransform |
||
40 | * @throws TransformerNotFoundException |
||
41 | */ |
||
42 | 12 | public function getTransformer($resource): CanTransform |
|
57 |