Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance the resource owner object #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions src/Provider/KeycloakResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,56 @@ public function getName()
return $this->response['name'] ?: null;
}

/**
* Get resource owner email verification
*
* @return bool
*/
public function getEmailVerified()
{
return $this->response['email_verified'] ?? false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u use ?: instead of ?? like in other functions

}

/**
* Get resource owner family name
*
* @return string|null
*/
public function getFamilyName()
{
return $this->response['family_name'] ?: null;
}

/**
* Get resource owner given name
*
* @return string|null
*/
public function getGivenName()
{
return $this->response['given_name'] ?: null;
}

/**
* Get resource owner preferred username
*
* @return string|null
*/
public function getPreferredUsername()
{
return $this->response['preferred_username'] ?? null;
}

/**
* Get resource owner picture
*
* @return string|null
*/
public function getPicture()
{
return $this->response['picture'] ?? null;
}

/**
* Return all of the owner details available as an array.
*
Expand Down