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 (Throwable $e) { $this->logger->error($e); } } }