Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added and fixed a few docblocks #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Services/FullContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ class Services_FullContact
protected $_webhookUrl = null;
protected $_webhookId = null;

/**
* @var stdClass
*/
public $response_obj = null;

public $response_code = null;
public $response_json = null;

/**
* The base constructor needs the API key available from here:
* http://fullcontact.com/getkey
*
* @param type $api_key
* @param string $api_key
*/
public function __construct($api_key)
{
Expand Down
4 changes: 4 additions & 0 deletions Services/FullContact/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

class Services_FullContact_API extends Services_FullContact_Person
{
/**
* Services_FullContact_API constructor.
* @param string $api_key
*/
public function __construct($api_key)
{
parent::__construct($api_key);
Expand Down
4 changes: 4 additions & 0 deletions Services/FullContact/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class Services_FullContact_Company extends Services_FullContact
protected $_supportedMethods = array('domain');
protected $_resourceUri = '/company/lookup.json';

/**
* @param string $search
* @return stdClass
*/
public function lookupByDomain($search)
{
$this->_execute(array('domain' => $search, 'method' => 'domain'));
Expand Down
3 changes: 3 additions & 0 deletions Services/FullContact/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class Services_FullContact_Icon extends Services_FullContact
protected $_supportedMethods = array('available');
protected $_resourceUri = '/icon/';

/**
* @return stdClass
*/
public function available()
{
$this->_execute(array('method' => 'available'));
Expand Down
13 changes: 10 additions & 3 deletions Services/FullContact/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ class Services_FullContact_Location extends Services_FullContact
/**
* This takes a name and breaks it into its individual parts.
*
* @param type $name
* @param type $casing -> valid values are uppercase, lowercase, titlecase
* @return type
* @param string $place
* @param bool $includeZeroPopulation
* @param string $casing valid values are uppercase, lowercase, titlecase
* @return stdClass
*/
public function normalizer($place, $includeZeroPopulation = false, $casing = 'titlecase')
{
Expand All @@ -48,6 +49,12 @@ public function normalizer($place, $includeZeroPopulation = false, $casing = 'ti
return $this->response_obj;
}

/**
* @param string $place
* @param bool $includeZeroPopulation
* @param string $casing
* @return stdClass
*/
public function enrichment($place, $includeZeroPopulation = false, $casing = 'titlecase')
{
$includeZeroPopulation = ($includeZeroPopulation) ? 'true' : 'false';
Expand Down
38 changes: 27 additions & 11 deletions Services/FullContact/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ class Services_FullContact_Name extends Services_FullContact
* @var $_supportedMethods
*/
protected $_supportedMethods = array('normalizer', 'deducer', 'similarity', 'stats', 'parser');

/**
* @var string
*/
protected $_resourceUri = '';

/**
* This takes a name and breaks it into its individual parts.
*
* @param type $name
* @param type $casing -> valid values are uppercase, lowercase, titlecase
* @return type
* @param string $name
* @param string $casing -> valid values are uppercase, lowercase, titlecase
* @return stdClass
*/
public function normalizer($name, $casing = 'titlecase')
{
Expand All @@ -49,10 +53,10 @@ public function normalizer($name, $casing = 'titlecase')
* This resolves a person's name from either their email address or a
* username. This is basically a wrapper for the Person lookup methods.
*
* @param type $name
* @param type $type -> valid values are email and username
* @param type $casing -> valid values are uppercase, lowercase, titlecase
* @return type
* @param string $value
* @param string $type
* @param string $casing
* @return stdClass
*/
public function deducer($value, $type = 'email', $casing = 'titlecase')
{
Expand All @@ -65,10 +69,10 @@ public function deducer($value, $type = 'email', $casing = 'titlecase')
/**
* These are two names to compare.
*
* @param type $name1
* @param type $name2
* @param type $casing
* @return type
* @param string $name1
* @param string $name2
* @param string $casing
* @return stdClass
*/
public function similarity($name1, $name2, $casing = 'titlecase')
{
Expand All @@ -78,13 +82,25 @@ public function similarity($name1, $name2, $casing = 'titlecase')
return $this->response_obj;
}

/**
* @param string $value
* @param string $type
* @param string $casing
* @return stdClass
*/
public function stats($value, $type = 'givenName', $casing = 'titlecase')
{
$this->_resourceUri = '/name/stats.json';
$this->_execute(array($type => $value, 'method' => 'stats', 'casing' => $casing));

return $this->response_obj;
}

/**
* @param string $name
* @param string $casing
* @return stdClass
*/
public function parser($name, $casing = 'titlecase')
{
$this->_resourceUri = '/name/parser.json';
Expand Down
16 changes: 16 additions & 0 deletions Services/FullContact/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,43 @@ class Services_FullContact_Person extends Services_FullContact
protected $_supportedMethods = array('email', 'phone', 'twitter');
protected $_resourceUri = '/person.json';

/**
* @param string $search
* @return stdClass
*/
public function lookupByEmail($search)
{
$this->_execute(array('email' => $search, 'method' => 'email'));

return $this->response_obj;
}

/**
* @param string $search
* @return stdClass
*/
public function lookupByEmailMD5($search)
{
$this->_execute(array('emailMD5' => $search, 'method' => 'email'));

return $this->response_obj;
}

/**
* @param string $search
* @return stdClass
*/
public function lookupByPhone($search)
{
$this->_execute(array('phone' => $search, 'method' => 'phone'));

return $this->response_obj;
}

/**
* @param string $search
* @return stdClass
*/
public function lookupByTwitter($search)
{
$this->_execute(array('twitter' => $search, 'method' => 'twitter'));
Expand Down