From b4d51dde56957337f7ad895eae0c1fb0f25424c7 Mon Sep 17 00:00:00 2001 From: Paolo Agostinetto Date: Thu, 30 Mar 2017 14:27:49 +0200 Subject: [PATCH] Added and fixed docblocks --- Services/FullContact.php | 6 ++++- Services/FullContact/API.php | 4 ++++ Services/FullContact/Company.php | 4 ++++ Services/FullContact/Icon.php | 3 +++ Services/FullContact/Location.php | 13 ++++++++--- Services/FullContact/Name.php | 38 ++++++++++++++++++++++--------- Services/FullContact/Person.php | 16 +++++++++++++ 7 files changed, 69 insertions(+), 15 deletions(-) diff --git a/Services/FullContact.php b/Services/FullContact.php index f7be1f7..ced8a27 100644 --- a/Services/FullContact.php +++ b/Services/FullContact.php @@ -45,7 +45,11 @@ class Services_FullContact protected $_webhookUrl = null; protected $_webhookId = null; + /** + * @var stdClass + */ public $response_obj = null; + public $response_code = null; public $response_json = null; @@ -53,7 +57,7 @@ class Services_FullContact * 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) { diff --git a/Services/FullContact/API.php b/Services/FullContact/API.php index a42a1d1..815b1bd 100644 --- a/Services/FullContact/API.php +++ b/Services/FullContact/API.php @@ -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); diff --git a/Services/FullContact/Company.php b/Services/FullContact/Company.php index bff21fc..a07b0d3 100644 --- a/Services/FullContact/Company.php +++ b/Services/FullContact/Company.php @@ -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')); diff --git a/Services/FullContact/Icon.php b/Services/FullContact/Icon.php index 3305313..6cbf693 100644 --- a/Services/FullContact/Icon.php +++ b/Services/FullContact/Icon.php @@ -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')); diff --git a/Services/FullContact/Location.php b/Services/FullContact/Location.php index b460fdb..27041b7 100644 --- a/Services/FullContact/Location.php +++ b/Services/FullContact/Location.php @@ -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') { @@ -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'; diff --git a/Services/FullContact/Name.php b/Services/FullContact/Name.php index 4280ffb..3896cf1 100644 --- a/Services/FullContact/Name.php +++ b/Services/FullContact/Name.php @@ -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') { @@ -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') { @@ -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') { @@ -78,6 +82,12 @@ 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'; @@ -85,6 +95,12 @@ public function stats($value, $type = 'givenName', $casing = 'titlecase') return $this->response_obj; } + + /** + * @param string $name + * @param string $casing + * @return stdClass + */ public function parser($name, $casing = 'titlecase') { $this->_resourceUri = '/name/parser.json'; diff --git a/Services/FullContact/Person.php b/Services/FullContact/Person.php index 849292e..51e5932 100644 --- a/Services/FullContact/Person.php +++ b/Services/FullContact/Person.php @@ -30,6 +30,10 @@ 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')); @@ -37,6 +41,10 @@ public function lookupByEmail($search) return $this->response_obj; } + /** + * @param string $search + * @return stdClass + */ public function lookupByEmailMD5($search) { $this->_execute(array('emailMD5' => $search, 'method' => 'email')); @@ -44,6 +52,10 @@ public function lookupByEmailMD5($search) return $this->response_obj; } + /** + * @param string $search + * @return stdClass + */ public function lookupByPhone($search) { $this->_execute(array('phone' => $search, 'method' => 'phone')); @@ -51,6 +63,10 @@ public function lookupByPhone($search) return $this->response_obj; } + /** + * @param string $search + * @return stdClass + */ public function lookupByTwitter($search) { $this->_execute(array('twitter' => $search, 'method' => 'twitter'));