init
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/*!
|
||||
* Hybridauth
|
||||
* https://hybridauth.github.io | https://github.com/hybridauth/hybridauth
|
||||
* (c) 2017 Hybridauth authors | https://hybridauth.github.io/license.html
|
||||
*/
|
||||
|
||||
namespace Hybridauth\User;
|
||||
|
||||
use Hybridauth\Exception\UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* Hybridauth\User\Activity
|
||||
*/
|
||||
final class Activity
|
||||
{
|
||||
/**
|
||||
* activity id on the provider side, usually given as integer
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $id = null;
|
||||
|
||||
/**
|
||||
* activity date of creation
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $date = null;
|
||||
|
||||
/**
|
||||
* activity content as a string
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $text = null;
|
||||
|
||||
/**
|
||||
* user who created the activity
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $user = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->user = new \stdClass();
|
||||
|
||||
// typically, we should have a few information about the user who created the event from social apis
|
||||
$this->user->identifier = null;
|
||||
$this->user->displayName = null;
|
||||
$this->user->profileURL = null;
|
||||
$this->user->photoURL = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent the providers adapters from adding new fields.
|
||||
*
|
||||
* @throws UnexpectedValueException
|
||||
* @var string $name
|
||||
*
|
||||
* @var mixed $value
|
||||
*
|
||||
*/
|
||||
public function __set($name, $value)
|
||||
{
|
||||
// phpcs:ignore
|
||||
throw new UnexpectedValueException(sprintf('Adding new property "%s\' to %s is not allowed.', $name, __CLASS__));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/*!
|
||||
* Hybridauth
|
||||
* https://hybridauth.github.io | https://github.com/hybridauth/hybridauth
|
||||
* (c) 2017 Hybridauth authors | https://hybridauth.github.io/license.html
|
||||
*/
|
||||
|
||||
namespace Hybridauth\User;
|
||||
|
||||
use Hybridauth\Exception\UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* Hybridauth\User\Contact
|
||||
*/
|
||||
final class Contact
|
||||
{
|
||||
/**
|
||||
* The Unique contact user ID
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $identifier = null;
|
||||
|
||||
/**
|
||||
* User website, blog, web page
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $webSiteURL = null;
|
||||
|
||||
/**
|
||||
* URL link to profile page on the IDp web site
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $profileURL = null;
|
||||
|
||||
/**
|
||||
* URL link to user photo or avatar
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $photoURL = null;
|
||||
|
||||
/**
|
||||
* User displayName provided by the IDp or a concatenation of first and last name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $displayName = null;
|
||||
|
||||
/**
|
||||
* A short about_me
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $description = null;
|
||||
|
||||
/**
|
||||
* User email. Not all of IDp grant access to the user email
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $email = null;
|
||||
|
||||
/**
|
||||
* Prevent the providers adapters from adding new fields.
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
*
|
||||
* @throws UnexpectedValueException
|
||||
*/
|
||||
public function __set($name, $value)
|
||||
{
|
||||
throw new UnexpectedValueException(sprintf('Adding new property "%s" to %s is not allowed.', $name, __CLASS__));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
/*!
|
||||
* Hybridauth
|
||||
* https://hybridauth.github.io | https://github.com/hybridauth/hybridauth
|
||||
* (c) 2017 Hybridauth authors | https://hybridauth.github.io/license.html
|
||||
*/
|
||||
|
||||
namespace Hybridauth\User;
|
||||
|
||||
use Hybridauth\Exception\UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* Hybridauth\Userobject represents the current logged in user profile.
|
||||
*/
|
||||
final class Profile
|
||||
{
|
||||
/**
|
||||
* The Unique user's ID on the connected provider
|
||||
*
|
||||
* @var int|null
|
||||
*/
|
||||
public $identifier = null;
|
||||
|
||||
/**
|
||||
* User website, blog, web page
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $webSiteURL = null;
|
||||
|
||||
/**
|
||||
* URL link to profile page on the IDp web site
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $profileURL = null;
|
||||
|
||||
/**
|
||||
* URL link to user photo or avatar
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $photoURL = null;
|
||||
|
||||
/**
|
||||
* User displayName provided by the IDp or a concatenation of first and last name.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $displayName = null;
|
||||
|
||||
/**
|
||||
* A short about_me
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $description = null;
|
||||
|
||||
/**
|
||||
* User's first name
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $firstName = null;
|
||||
|
||||
/**
|
||||
* User's last name
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $lastName = null;
|
||||
|
||||
/**
|
||||
* male or female
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $gender = null;
|
||||
|
||||
/**
|
||||
* Language
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $language = null;
|
||||
|
||||
/**
|
||||
* User age, we don't calculate it. we return it as is if the IDp provide it.
|
||||
*
|
||||
* @var int|null
|
||||
*/
|
||||
public $age = null;
|
||||
|
||||
/**
|
||||
* User birth Day
|
||||
*
|
||||
* @var int|null
|
||||
*/
|
||||
public $birthDay = null;
|
||||
|
||||
/**
|
||||
* User birth Month
|
||||
*
|
||||
* @var int|null
|
||||
*/
|
||||
public $birthMonth = null;
|
||||
|
||||
/**
|
||||
* User birth Year
|
||||
*
|
||||
* @var int|null
|
||||
*/
|
||||
public $birthYear = null;
|
||||
|
||||
/**
|
||||
* User email. Note: not all of IDp grant access to the user email
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $email = null;
|
||||
|
||||
/**
|
||||
* Verified user email. Note: not all of IDp grant access to verified user email
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $emailVerified = null;
|
||||
|
||||
/**
|
||||
* Phone number
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $phone = null;
|
||||
|
||||
/**
|
||||
* Complete user address
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $address = null;
|
||||
|
||||
/**
|
||||
* User country
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $country = null;
|
||||
|
||||
/**
|
||||
* Region
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $region = null;
|
||||
|
||||
/**
|
||||
* City
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $city = null;
|
||||
|
||||
/**
|
||||
* Postal code
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $zip = null;
|
||||
|
||||
/**
|
||||
* An extra data which is related to the user
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $data = [];
|
||||
|
||||
/**
|
||||
* Prevent the providers adapters from adding new fields.
|
||||
*
|
||||
* @throws UnexpectedValueException
|
||||
* @var mixed $value
|
||||
*
|
||||
* @var string $name
|
||||
*/
|
||||
public function __set($name, $value)
|
||||
{
|
||||
throw new UnexpectedValueException(sprintf('Adding new property "%s" to %s is not allowed.', $name, __CLASS__));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user