From 28f74ff6edf4f32a4d9b69100f41368637372c16 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 7 Dec 2022 15:36:06 +0100 Subject: [PATCH] feat: add `__toString()` method to `CasUserInterface` --- src/Security/Core/User/CasUser.php | 5 +++++ src/Security/Core/User/CasUserInterface.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/Security/Core/User/CasUser.php b/src/Security/Core/User/CasUser.php index d9ec1f0..a4fa742 100644 --- a/src/Security/Core/User/CasUser.php +++ b/src/Security/Core/User/CasUser.php @@ -32,6 +32,11 @@ public function __construct(array $data) $this->storage = $data; } + public function __toString(): string + { + return $this->get('user'); + } + public function eraseCredentials(): void { } diff --git a/src/Security/Core/User/CasUserInterface.php b/src/Security/Core/User/CasUserInterface.php index 2e2ea0d..cb4a3ab 100644 --- a/src/Security/Core/User/CasUserInterface.php +++ b/src/Security/Core/User/CasUserInterface.php @@ -16,6 +16,8 @@ interface CasUserInterface extends EquatableInterface, UserInterface { + public function __toString(): string; + /** * @param mixed $default *