Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | static public function get($event) |
||
16 | { |
||
17 | $events = [ |
||
18 | WaitingPayment::CODE => new WaitingPayment(), |
||
19 | InAnalysis::CODE => new InAnalysis(), |
||
20 | PaidEvent::CODE => new PaidEvent(), |
||
21 | AvailableEvent::CODE => new AvailableEvent(), |
||
22 | ContestEvent::CODE => new ContestEvent(), |
||
23 | ReturnedEvent::CODE => new ReturnedEvent(), |
||
24 | CancelledEvent::CODE => new CancelledEvent(), |
||
25 | DebitedEvent::CODE => new DebitedEvent() |
||
26 | ]; |
||
27 | if (!array_key_exists($event, $events)) { |
||
28 | throw new EventException('Unknow Event'); |
||
29 | } |
||
30 | return $events[$event]; |
||
31 | } |
||
32 | } |