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 is a significant refactoring, replacing the old getUserBy*()
functions with a new Principal class, and replacing the old
CalDAVPrincipal class with a new DAVPrincipal class which extends
the Principal class.
At this point all regression tests pass (again) but there could
well be issues for people who use alternative authenticators
such as LDAP, although I have endeavoured to resolve those
potential issues.
Signed-off-by: Andrew McMillan <andrew@morphoss.com>