Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public function __invoke($data): callable |
||
38 | { |
||
39 | foreach ($this->transformations as $type => $transformation) { |
||
40 | if (!$data instanceof $type) { |
||
41 | continue; |
||
42 | } |
||
43 | |||
44 | try { |
||
45 | return $this->resolve($transformation); |
||
46 | } catch (\Throwable $e) { |
||
47 | throw new TransformationNotFound($data, null, $e); |
||
48 | } |
||
49 | } |
||
50 | |||
51 | throw new TransformationNotFound($data); |
||
52 | } |
||
63 |