From e2dca482b374b92642af18841cd03015672b9ad9 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 13 Sep 2024 18:26:23 +0200 Subject: [PATCH] Auth\User: implement array access interface --- src/Auth/User.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Auth/User.php b/src/Auth/User.php index e39bd6c..95976fd 100644 --- a/src/Auth/User.php +++ b/src/Auth/User.php @@ -108,6 +108,14 @@ class User { } } + /** + * ArrayAccess interface + */ + public function offsetExists($offset) { return self :: __isset($offset); } + public function offsetGet($offset){ return self :: __get($offset); } + public function offsetSet($offset, $value) { self :: __set($offset, $value); } + public function offsetUnset($offset) { self :: __set($offset, null); } + /** * Check user password * @param string $password