mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-06-11 05:20:17 +00:00
Stop copying all fields from the Principal object.
PHP 8.2 deprecates dynmically adding properties. See: https://php.watch/versions/8.2/dynamic-properties-deprecated This arbitary copying of all fields tickles these deprecation warnings, and just below we copy exactly the fields we need. I reckon this loop is redundant.
This commit is contained in:
parent
8162b9f850
commit
46feee1ec7
@ -377,10 +377,6 @@ class HTTPAuthSession {
|
||||
$principal = new Principal('username',$principal->username);
|
||||
}
|
||||
|
||||
// Assign each field in the selected record to the object
|
||||
foreach( $principal AS $k => $v ) {
|
||||
$this->{$k} = $v;
|
||||
}
|
||||
if ( !get_class($principal) == 'Principal' ) {
|
||||
throw new Exception('HTTPAuthSession::AssignSessionDetails could not find a Principal object');
|
||||
}
|
||||
|
||||
@ -64,11 +64,6 @@ class PublicSession {
|
||||
|
||||
$principal = new Principal('username','unauthenticated');
|
||||
|
||||
// Assign each field in the selected record to the object
|
||||
foreach( $principal AS $k => $v ) {
|
||||
$this->{$k} = $v;
|
||||
}
|
||||
|
||||
$this->username = $principal->username();
|
||||
$this->user_no = $principal->user_no();
|
||||
$this->principal_id = $principal->principal_id();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user