| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 3 | public function __invoke(AddEvent $wished): void |
|
| 33 | { |
||
| 34 | 3 | if ($this->clock->now()->aheadOf($wished->slot()->start())) { |
|
| 35 | 1 | throw new EventCannotBeDeclaredInThePast($wished->slot()); |
|
| 36 | } |
||
| 37 | |||
| 38 | 2 | if (!$this->agendas->has($wished->agenda())) { |
|
| 39 | 1 | throw new AgendaNotFound($wished->agenda()); |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | $this->events->add( |
|
| 43 | 1 | Event::add( |
|
| 44 | 1 | $wished->identity(), |
|
| 45 | 1 | $wished->agenda(), |
|
| 46 | 1 | $wished->name(), |
|
| 47 | 1 | $wished->slot() |
|
| 48 | ) |
||
| 52 |