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