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