identity->identity() === null) { return []; } return [$this->buildPrincipal()]; } public function getPrincipalByPath($path): ?array { if ($this->identity->identity() === null) { return null; } $expected = self::PRINCIPAL_PREFIX . '/' . $this->identity->identifier(); if ($path !== $expected) { return null; } return $this->buildPrincipal(); } public function getGroupMemberSet($principal): array { return []; } public function getGroupMembership($principal): array { return []; } public function setGroupMemberSet($principal, $members): void { // not supported } public function updatePrincipal($path, $propPatch): int { return 403; } public function searchPrincipals($prefixPath, $searchProperties, $test = 'allof'): array { return []; } public function findByUri($uri, $principalPrefix): ?string { return null; } // ------------------------------------------------------------------------- // Helpers // ------------------------------------------------------------------------- private function buildPrincipal(): array { $userId = $this->identity->identifier(); $label = $this->identity->label() ?? $userId; $email = $this->identity->mailAddress() ?? ''; return [ DavProperties::URI => self::PRINCIPAL_PREFIX . '/' . $userId, DavProperties::DISPLAYNAME => $label, DavProperties::SABRE_EMAIL => $email, ]; } }