Compare commits
4 commits
a4e21e6046
...
6873a7e2a0
Author | SHA1 | Date | |
---|---|---|---|
|
6873a7e2a0 | ||
|
4a2060458d | ||
|
2ee5c7540b | ||
|
e2dca482b3 |
1 changed files with 5 additions and 42 deletions
|
@ -7,7 +7,7 @@ use EesyPHP\Log;
|
|||
use function EesyPHP\ensure_is_array;
|
||||
use function EesyPHP\vardump;
|
||||
|
||||
class User implements \ArrayAccess {
|
||||
class User {
|
||||
|
||||
/**
|
||||
* Username
|
||||
|
@ -111,47 +111,10 @@ class User implements \ArrayAccess {
|
|||
/**
|
||||
* ArrayAccess interface
|
||||
*/
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
/**
|
||||
* Magic method to check if an dynamic property exist when object is used as an array
|
||||
* @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);
|
||||
}
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue