mirror of
https://github.com/1sept/oauth2-1sept.git
synced 2024-05-30 17:38:52 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1fe3ca9cd9 | |||
| 7a7723a140 | |||
| 5ad486f920 | |||
| 927601d0e0 | |||
| 4d5db6e092 | |||
| 5a22804f38 |
12
README.md
12
README.md
@@ -5,15 +5,7 @@ This package provides [September First](https://api.1sept.ru) integration for [O
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Add to `composer.json`:
|
Just execute:
|
||||||
```
|
|
||||||
"repositories": [{
|
|
||||||
"type": "vcs",
|
|
||||||
"url": "https://github.com/1sept/oauth2-1sept"
|
|
||||||
}],
|
|
||||||
```
|
|
||||||
|
|
||||||
Then execute:
|
|
||||||
```sh
|
```sh
|
||||||
composer require 1sept/oauth2-1sept
|
composer require 1sept/oauth2-1sept
|
||||||
```
|
```
|
||||||
@@ -21,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',
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ class SeptemberFirstUser implements ResourceOwnerInterface
|
|||||||
*/
|
*/
|
||||||
public function isDefaultAvatar(): bool
|
public function isDefaultAvatar(): bool
|
||||||
{
|
{
|
||||||
return $this->getField('avatar_default');
|
return (bool) $this->getField('avatar_default');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -241,13 +241,23 @@ class SeptemberFirstUser implements ResourceOwnerInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Номер телефона
|
* Номера телефонов
|
||||||
|
*
|
||||||
|
* @return array|null
|
||||||
|
*/
|
||||||
|
public function getPhones(): ?array
|
||||||
|
{
|
||||||
|
return $this->getField('phones');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* СНИЛС
|
||||||
*
|
*
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function getPhone(): ?string
|
public function getSnils(): ?string
|
||||||
{
|
{
|
||||||
return $this->getField('phone');
|
return $this->getField('passport.snils');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -272,6 +282,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');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Элемент массива данных о пользователе
|
* Элемент массива данных о пользователе
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user