logger = $logger; } public function deleted(Album $album): void { $this->deleteAlbumCover($album); } private function deleteAlbumCover(Album $album): void { if (!$album->has_cover) { return; } try { unlink($album->cover_path); } catch (Exception $e) { $this->logger->error($e); } } }