Total Complexity | 8 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
21 | class SimpleSaleRepository implements SaleRepositoryInterface |
||
22 | { |
||
23 | protected $sale; |
||
24 | |||
25 | public function __construct(?SaleInterface $sale = null) |
||
26 | { |
||
27 | $this->sale = $sale; |
||
28 | } |
||
29 | |||
30 | public function findId(SaleInterface $sale) |
||
31 | { |
||
32 | return $this->sale->getId(); |
||
33 | } |
||
34 | |||
35 | public function findByAction(ActionInterface $action) |
||
36 | { |
||
37 | return $this->sale; |
||
38 | } |
||
39 | |||
40 | public function findByOrder(OrderInterface $order) |
||
41 | { |
||
42 | $sales = []; |
||
43 | foreach ($order->getActions() as $actionKey => $action) { |
||
44 | $sales[$actionKey] = $this->findByAction($action); |
||
45 | } |
||
46 | |||
47 | return $sales; |
||
48 | } |
||
49 | |||
50 | public function findAllActive(Specification $specification, ?DateTimeImmutable $time): array |
||
51 | { |
||
52 | throw new Exception('not implemented'); |
||
53 | } |
||
54 | |||
55 | public function findByIds(array $ids) |
||
56 | { |
||
57 | throw new Exception('not implemented'); |
||
58 | } |
||
59 | |||
60 | public function findById(string $id): ?object |
||
61 | { |
||
62 | throw new Exception('not implemented'); |
||
63 | } |
||
65 |