| Total Complexity | 6 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class SimplePlanRepository implements PlanRepositoryInterface |
||
| 19 | { |
||
| 20 | protected $plan; |
||
| 21 | |||
| 22 | public function __construct(?PlanInterface $plan = null) |
||
| 23 | { |
||
| 24 | $this->plan = $plan; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function findByAction(ActionInterface $action) |
||
| 28 | { |
||
| 29 | return $this->plan; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function findByOrder(OrderInterface $order) |
||
| 33 | { |
||
| 34 | $plans = []; |
||
| 35 | foreach (array_keys($order->getActions()) as $actionKey) { |
||
| 36 | $plans[$actionKey] = $this->plan; |
||
| 37 | } |
||
| 38 | |||
| 39 | return $plans; |
||
| 40 | } |
||
| 41 | |||
| 42 | public function findByIds(array $ids) |
||
| 43 | { |
||
| 44 | throw new \Exception('not implemented'); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | public function getById(int $id): PlanInterface |
||
| 51 | { |
||
| 52 | throw new \Exception('not implemented'); |
||
| 53 | } |
||
| 55 |