| Total Complexity | 7 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class UuidToItemTransformer implements DataTransformerInterface |
||
| 14 | { |
||
| 15 | private $itemRepository; |
||
| 16 | |||
| 17 | public function __construct(ItemRepository $itemRepository) |
||
| 18 | { |
||
| 19 | $this->itemRepository = $itemRepository; |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Transforms an object (item) to a UuidInterface |
||
| 24 | * |
||
| 25 | * @param Item|null $item |
||
| 26 | * @return UuidInterface|string |
||
| 27 | */ |
||
| 28 | public function reverseTransform($item) |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Transforms a UuidInterface to an object (Item). |
||
| 39 | * |
||
| 40 | * @param string|null $itemId |
||
| 41 | * @return Item|null |
||
| 42 | * @throws TransformationFailedException if object (Item) is not found. |
||
| 43 | */ |
||
| 44 | public function transform($itemId) |
||
| 59 | } |
||
| 60 | } |