Compare commits

..

4 commits

Author SHA1 Message Date
Benjamin Renard
6873a7e2a0
Auth\Db: add edit_user CLI command 2024-09-13 18:52:05 +02:00
Benjamin Renard
4a2060458d
Auth\Db: implement update_user() 2024-09-13 18:48:45 +02:00
Benjamin Renard
2ee5c7540b
Auth\Db::add_user(): add check of username uniqueness 2024-09-13 18:43:33 +02:00
Benjamin Renard
e2dca482b3
Auth\User: implement array access interface 2024-09-13 18:27:52 +02:00

View file

@ -7,7 +7,7 @@ use EesyPHP\Log;
use function EesyPHP\ensure_is_array; use function EesyPHP\ensure_is_array;
use function EesyPHP\vardump; use function EesyPHP\vardump;
class User implements \ArrayAccess { class User {
/** /**
* Username * Username
@ -111,47 +111,10 @@ class User implements \ArrayAccess {
/** /**
* ArrayAccess interface * ArrayAccess interface
*/ */
public function offsetExists($offset) { return self :: __isset($offset); }
#[\ReturnTypeWillChange] public function offsetGet($offset){ return self :: __get($offset); }
/** public function offsetSet($offset, $value) { self :: __set($offset, $value); }
* Magic method to check if an dynamic property exist when object is used as an array public function offsetUnset($offset) { self :: __set($offset, null); }
* @param string $offset The property
* @return bool
*/
public function offsetExists($offset) {
return $this -> __isset($offset);
}
#[\ReturnTypeWillChange]
/**
* Magic method to get a dynamic property when object is used as an array
* @param string $offset The property
* @return mixed
*/
public function offsetGet($offset){
return $this -> __get($offset);
}
#[\ReturnTypeWillChange]
/**
* Magic method to set a dynamic property when object is used as an array
* @param string $offset The property
* @param mixed $value The value
* @return void
*/
public function offsetSet($offset, $value) {
$this -> __set($offset, $value);
}
#[\ReturnTypeWillChange]
/**
* Magic method to unset (=set as null) a dynamic property when object is used as an array
* @param string $offset The property
* @return void
*/
public function offsetUnset($offset) {
$this -> __set($offset, null);
}
/** /**
* Check user password * Check user password