public` invites exactly the confusion this feature cannot afford. */ enum CommentVisibility: string { case OnlyMe = 'only_me'; case StaffOnly = 'staff_only'; case Clients = 'clients'; case Everyone = 'everyone'; /** * English label — also the translation key. * * @param bool $forStaff Whose end of the conversation is reading. */ public function label(bool $forStaff = true): string { return match ($this) { self::OnlyMe => 'Only me', self::StaffOnly => 'Staff only', self::Clients => $forStaff ? 'Staff and clients' : 'Staff', self::Everyone => 'Everyone', }; } /** * The one-line explanation shown under the option in the composer. * English text — also the translation key. */ public function description(bool $forStaff = true): string { return match ($this) { self::OnlyMe => 'A private note. Nobody else can read it, staff included.', self::StaffOnly => 'The team working on this file. No client ever sees it.', self::Clients => $forStaff ? 'The team, and everyone this file is shared with. Clients cannot see each other.' : 'The team behind this file. No other client can see it.', self::Everyone => 'Everyone above, plus anyone who opens this file without logging in.', }; } /** * Whether a client may choose this audience. Staff-only notes are not * theirs to write, and there is no third party for them to address. */ public function availableToClients(): bool { return $this !== self::StaffOnly; } }