filename, json_encode($this, JSON_PRETTY_PRINT)); } public function saveSong(array $song): void { $this->history[$song['id']] = [ 'timestamp' => time(), 'details' => $song, ]; $this->save(); } }