| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 1 | public function __invoke(DeleteAgenda $wished): void |
|
| 32 | { |
||
| 33 | 1 | $agenda = $this->agendas->get($wished->identity()); |
|
| 34 | 1 | $agenda->delete(); |
|
| 35 | |||
| 36 | $this |
||
| 37 | 1 | ->events |
|
| 38 | 1 | ->matching(new Agenda($wished->identity())) |
|
| 39 | 1 | ->foreach(function(Event $event): void { |
|
| 40 | 1 | ($this->cancelEvent)(new CancelEvent($event->identity())); |
|
| 41 | 1 | }); |
|
| 42 | |||
| 43 | 1 | $this->agendas->remove($agenda->identity()); |
|
| 44 | 1 | } |
|
| 46 |