| Total Complexity | 6 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class Steam extends \SocialConnect\OpenID\AbstractProvider |
||
| 15 | { |
||
| 16 | const NAME = 'steam'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * {@inheritdoc} |
||
| 20 | */ |
||
| 21 | 3 | public function getOpenIdUrl() |
|
| 22 | { |
||
| 23 | 3 | return 'https://steamcommunity.com/openid/id'; |
|
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * {@inheritdoc} |
||
| 28 | */ |
||
| 29 | 2 | public function getBaseUri() |
|
| 30 | { |
||
| 31 | 2 | return 'https://api.steampowered.com/'; |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritdoc} |
||
| 36 | */ |
||
| 37 | 3 | public function getName() |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritDoc} |
||
| 44 | */ |
||
| 45 | 2 | protected function parseUserIdFromIdentity($identity): string |
|
| 46 | { |
||
| 47 | 2 | preg_match( |
|
| 48 | 2 | '/7[0-9]{15,25}/', |
|
| 49 | $identity, |
||
| 50 | $matches |
||
| 51 | ); |
||
| 52 | |||
| 53 | 2 | return (string) $matches[0]; |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritDoc} |
||
| 58 | */ |
||
| 59 | 1 | public function prepareRequest(string $method, string $uri, array &$headers, array &$query, AccessTokenInterface $accessToken = null): void |
|
| 60 | { |
||
| 61 | 1 | $query['key'] = $this->consumer->getKey(); |
|
| 62 | 1 | } |
|
| 63 | |||
| 64 | /** |
||
| 65 | * {@inheritdoc} |
||
| 66 | */ |
||
| 67 | 1 | public function getIdentity(AccessTokenInterface $accessToken) |
|
| 82 | } |
||
| 83 | } |
||
| 84 |