3 Commits

Author SHA1 Message Date
7a7723a140 Update composer.json 2021-03-24 12:10:38 +03:00
5ad486f920 Добавлены методы получения почтового адреса
scope = address
2020-08-17 17:51:52 +03:00
927601d0e0 Update README.md 2020-07-24 12:27:31 +03:00
3 changed files with 24 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ composer require 1sept/oauth2-1sept
## Usage ## Usage
```php ```php
$provider = new Sept\OAuth2\Client\Provider\SeptemberFirst([ $provider = new \Sept\OAuth2\Client\Provider\SeptemberFirstProvider([
'clientId' => 'client_id', 'clientId' => 'client_id',
'clientSecret' => 'secret', 'clientSecret' => 'secret',
'redirectUri' => 'https://example.org/oauth-endpoint', 'redirectUri' => 'https://example.org/oauth-endpoint',

View File

@@ -17,7 +17,7 @@
"1sept" "1sept"
], ],
"require": { "require": {
"php": "^7.0", "php": "^7.3 || ^8",
"league/oauth2-client": "^2.0" "league/oauth2-client": "^2.0"
}, },
"require-dev": { "require-dev": {

View File

@@ -272,6 +272,28 @@ class SeptemberFirstUser implements ResourceOwnerInterface
return $this->getField('timezone'); return $this->getField('timezone');
} }
/**
* Почтовый адрес в строку
*
* @return string|null
* @example ул. Гагарина, д.5, кв. 21, Нижний Новгород
*/
public function getAddressInline(): ?string
{
return $this->getField('address.inline');
}
/**
* Почтовый индекс
*
* @return string|null
* @example 123456
*/
public function getAddressPostalcode(): ?string
{
return $this->getField('address.postal_code');
}
/** /**
* Элемент массива данных о пользователе * Элемент массива данных о пользователе
* *