Skip to content

Commit 7732869

Browse files
authored
fix: allow firstName & lastName to be nullable
1 parent a191218 commit 7732869

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/DTO/UserRepresentationDTO.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public function __construct(
1919
public string $username,
2020
public bool $emailVerified,
2121
public string $name,
22-
public string $firstName,
23-
public string $lastName,
22+
public ?string $firstName,
23+
public ?string $lastName,
2424
public string $email,
2525
public ?bool $enabled,
2626
public ?int $createdTimestamp,
@@ -86,8 +86,8 @@ public static function fromArray(array $data, ?string $client_id = null): self
8686
username: $data['preferred_username'],
8787
emailVerified: $data['email_verified'],
8888
name: $data['name'],
89-
firstName: $data['given_name'],
90-
lastName: $data['family_name'],
89+
firstName: $data['given_name'] ?? null,
90+
lastName: $data['family_name'] ?? null,
9191
email: $data['email'],
9292
enabled: $data['enabled'] ?? null,
9393
createdTimestamp: $data['createdTimestamp'] ?? null,

0 commit comments

Comments
 (0)