Skip to content

Commit

Permalink
Merge 7c3512d into 937c0ac
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiIgna committed Oct 27, 2020
2 parents 937c0ac + 7c3512d commit dd5b3d4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Provider/GenericResourceOwner.php
Expand Up @@ -14,11 +14,15 @@

namespace League\OAuth2\Client\Provider;

use League\OAuth2\Client\Tool\ArrayAccessorTrait;

/**
* Represents a generic resource owner for use with the GenericProvider.
*/
class GenericResourceOwner implements ResourceOwnerInterface
{
use ArrayAccessorTrait;

/**
* @var array
*/
Expand Down Expand Up @@ -46,9 +50,19 @@ public function __construct(array $response, $resourceOwnerId)
*/
public function getId()
{
return $this->response[$this->resourceOwnerId];
return $this->getValueByKey($this->response, $this->resourceOwnerId);
}

/**
* Gets resource owner attribute by key. The key supports dot notation.
*
* @return mixed
*/
public function getAttribute($key)
{
return $this->getValueByKey($this->response, (string) $key);
}

/**
* Returns the raw resource owner response.
*
Expand Down

0 comments on commit dd5b3d4

Please sign in to comment.