/** * @param object $command * @return object[] Resulting events */ public function handle($command) { $events = $this->invokeMethod('handle', $command); $this->applyEvents($events); $this->store->save($events); return $events; }
function appendEvents() { file_put_contents($this->file, $this->getContent()); $this->store->save($this->getEvents()); $this->assert->size(json_decode(file_get_contents($this->file), true)['events'], 4); }