wordpress-seo
/
vendor_prefixed
/
league
/
oauth2-client
/
src
/
Provider
/
GenericResourceOwner.php
GenericResourceOwner.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI trunk, at vendor_prefixed/league/oauth2-client/src/Provider/GenericResourceOwner.php
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This file is part of the league/oauth2-client library |
| 5 | * |
| 6 | * For the full copyright and license information, please view the LICENSE |
| 7 | * file that was distributed with this source code. |
| 8 | * |
| 9 | * @copyright Copyright (c) Alex Bilbie <hello@alexbilbie.com> |
| 10 | * @license http://opensource.org/licenses/MIT MIT |
| 11 | * @link http://thephpleague.com/oauth2-client/ Documentation |
| 12 | * @link https://packagist.org/packages/league/oauth2-client Packagist |
| 13 | * @link https://github.com/thephpleague/oauth2-client GitHub |
| 14 | */ |
| 15 | namespace YoastSEO_Vendor\League\OAuth2\Client\Provider; |
| 16 | |
| 17 | /** |
| 18 | * Represents a generic resource owner for use with the GenericProvider. |
| 19 | */ |
| 20 | class GenericResourceOwner implements \YoastSEO_Vendor\League\OAuth2\Client\Provider\ResourceOwnerInterface |
| 21 | { |
| 22 | /** |
| 23 | * @var array |
| 24 | */ |
| 25 | protected $response; |
| 26 | /** |
| 27 | * @var string |
| 28 | */ |
| 29 | protected $resourceOwnerId; |
| 30 | /** |
| 31 | * @param array $response |
| 32 | * @param string $resourceOwnerId |
| 33 | */ |
| 34 | public function __construct(array $response, $resourceOwnerId) |
| 35 | { |
| 36 | $this->response = $response; |
| 37 | $this->resourceOwnerId = $resourceOwnerId; |
| 38 | } |
| 39 | /** |
| 40 | * Returns the identifier of the authorized resource owner. |
| 41 | * |
| 42 | * @return mixed |
| 43 | */ |
| 44 | public function getId() |
| 45 | { |
| 46 | return $this->response[$this->resourceOwnerId]; |
| 47 | } |
| 48 | /** |
| 49 | * Returns the raw resource owner response. |
| 50 | * |
| 51 | * @return array |
| 52 | */ |
| 53 | public function toArray() |
| 54 | { |
| 55 | return $this->response; |
| 56 | } |
| 57 | } |
| 58 |