From ad861e3e8e938cb0fdf0915a500d82acc659b52a Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sun, 8 Nov 2009 15:30:40 -0500 Subject: [PATCH] Update/fix phpdoc --- .../lib/Horde/Service/Facebook.php | 3 +- .../lib/Horde/Service/Facebook/Auth.php | 45 +++++++++------- .../lib/Horde/Service/Facebook/Base.php | 8 ++- .../lib/Horde/Service/Facebook/BatchRequest.php | 22 ++++---- .../lib/Horde/Service/Facebook/ErrorCodes.php | 6 +++ .../lib/Horde/Service/Facebook/Events.php | 28 +++++----- .../lib/Horde/Service/Facebook/Exception.php | 7 +++ .../lib/Horde/Service/Facebook/Feeds.php | 16 ++++-- .../lib/Horde/Service/Facebook/Friends.php | 4 +- .../lib/Horde/Service/Facebook/Groups.php | 10 ++-- .../lib/Horde/Service/Facebook/Links.php | 18 +++---- .../lib/Horde/Service/Facebook/Notes.php | 32 ++++++------ .../lib/Horde/Service/Facebook/Notifications.php | 3 +- .../lib/Horde/Service/Facebook/Photos.php | 48 ++++++++--------- .../lib/Horde/Service/Facebook/Request.php | 61 ++++++++++++++++++---- .../lib/Horde/Service/Facebook/Streams.php | 24 +++++---- .../lib/Horde/Service/Facebook/UploadRequest.php | 19 +++++++ .../lib/Horde/Service/Facebook/Users.php | 29 +++++++--- 18 files changed, 245 insertions(+), 138 deletions(-) diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook.php b/framework/Service_Facebook/lib/Horde/Service/Facebook.php index 2893eae40..94b8fb65d 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook.php @@ -59,7 +59,7 @@ class Horde_Service_Facebook /** * The application's API Key * - * @var stirng + * @var string */ protected $_apiKey; @@ -148,7 +148,6 @@ class Horde_Service_Facebook * from an auth_token. Useful if client code wants to * handle this. * - * @param session_key */ public function __construct($api_key, $secret, $context) { diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Auth.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Auth.php index 68a7b22be..7bf67f61d 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Auth.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Auth.php @@ -62,8 +62,11 @@ class Horde_Service_Facebook_Auth /** - * TODO: Probably abstract out a Base class for these? - * @return unknown_type + * Const'r + * + * @param Horde_Service_Facebook $facebook + * @param Horde_Service_Facebook_Request $request + * @param array $params */ public function __construct($facebook, $request, $params = array()) { @@ -74,7 +77,9 @@ class Horde_Service_Facebook_Auth /** * Return a valid FB login URL with necessary GET parameters appended. * - * @return string + * @param string $next URL to return to + * + * @return string The Facebook Login Url */ public function getLoginUrl($next) { @@ -106,7 +111,7 @@ class Horde_Service_Facebook_Auth * * @param string $perm An EXTEND_PERMS_* constant * @param string $success_url URL to redirect to on success - * @param strint $cancel_url URL to redirect to on cancel + * @param string $cancel_url URL to redirect to on cancel * * @return string */ @@ -354,9 +359,9 @@ class Horde_Service_Facebook_Auth * Validates that a given set of parameters match their signature. * Parameters all match a given input prefix, such as "fb_sig". * - * @param array $fb_params An array of all Facebook-sent parameters, not - * including the signature itself. - * @param $expected_sig The expected result to check against. + * @param array $fb_params An array of all Facebook-sent parameters, not + * including the signature itself. + * @param string $expected_sig The expected result to check against. * * @return boolean */ @@ -379,11 +384,11 @@ class Horde_Service_Facebook_Auth * * @return string Hash to be checked against the FB provided signature. */ - public static function generateSignature($params_array, $secret) + public static function generateSignature($params, $secret) { $str = ''; - ksort($params_array); - foreach ($params_array as $k => $v) { + ksort($params); + foreach ($params as $k => $v) { $str .= "$k=$v"; } $str .= $secret; @@ -393,8 +398,8 @@ class Horde_Service_Facebook_Auth /** * Set session cookies. * - * @param string $user FB userid - * @param string $session_key The current session key + * @param string $user FB userid + * @param string $sessionKey The current session key * @param timestamp $expires * * @return void @@ -421,15 +426,16 @@ class Horde_Service_Facebook_Auth /** * Set the current session user in the object and in a cookie. * - * @param string $user The FB userid - * @param string $sessionKey - * @param timestamp $expires + * @param string $user The FB userid + * @param string $sessionKey The current sessionkey + * @param timestamp $expires Expire time + * @param boolean $noCookie If true, do not set a user cookie. * * @return void */ - public function setUser($user, $sessionKey, $expires = null, $no_cookie = false) + public function setUser($user, $sessionKey, $expires = null, $noCookie = false) { - if (!$no_cookie && (!$this->_request->getCookie($this->_facebook->apiKey . '_user') || + if (!$noCookie && (!$this->_request->getCookie($this->_facebook->apiKey . '_user') || $this->_request->getCookie($this->_facebook->apiKey . '_user') != $user)) { $this->setCookies($user, $sessionKey, $expires); @@ -442,8 +448,9 @@ class Horde_Service_Facebook_Auth /** * Revoke a previously authorizied extended permission * - * @param $perm - * @param $uid + * @param string $perm The extended permission to remove. + * @param string $uid The FB userid to remove permission from + * * @return unknown_type */ public function revokeExtendedPermission($perm, $uid) diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Base.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Base.php index 583e3d4b6..9a476a0c5 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Base.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Base.php @@ -15,11 +15,9 @@ abstract class Horde_Service_Facebook_Base protected $_sessionKey; /** - * - * @param $facebook - * @param $request - * @param $params - * @return unknown_type + * @param Horde_Service_Facebook $facebook + * @param Horde_Service_Facebook_Request $request + * @param array $params */ public function __construct($facebook, $request, $params = array()) { diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/BatchRequest.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/BatchRequest.php index 58b1107e3..1559dd61a 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/BatchRequest.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/BatchRequest.php @@ -2,7 +2,11 @@ /** * Horde_Service_Facebook_BatchRequest:: * + * Copyright 2009 The Horde Project (http://www.horde.org) * + * @author Michael J. Rubinsky + * @category Horde + * @package Horde_Service_Facebook */ class Horde_Service_Facebook_BatchRequest extends Horde_Service_Facebook_Request { @@ -26,12 +30,9 @@ class Horde_Service_Facebook_BatchRequest extends Horde_Service_Facebook_Request const BATCH_MODE_SERIAL_ONLY = 2; /** - * - * - * @param $facebook - * @param $http_client - * @param $params - * @return unknown_type + * @param Horde_Service_Facebook $facebook + * @param Horde_Http_Client $http_client + * @param array $params */ public function __construct($facebook, $http_client, $params = array()) { @@ -48,9 +49,12 @@ class Horde_Service_Facebook_BatchRequest extends Horde_Service_Facebook_Request /** * Add a method call to the queue * - * @param $method - * @param $params - * @return unknown_type + * @param $method + * @param $params + * @return unknown_type Returns a reference to the results that will be + * produced when the batch is run. This reference + * should be saved until after the batch is run and + * the results can be examined. */ public function &add($method, $params) { diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/ErrorCodes.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/ErrorCodes.php index da3724039..bb3e9bbc2 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/ErrorCodes.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/ErrorCodes.php @@ -1,6 +1,12 @@ + * @category Horde + * @package Horde_Service_Facebook */ class Horde_Service_Facebook_ErrorCodes { diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Events.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Events.php index 45c57e6e1..d6ccebed4 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Events.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Events.php @@ -13,15 +13,15 @@ /** * Returns events according to the filters specified. * - * @param int $uid (Optional) User associated with events. A null + * @param integer $uid (Optional) User associated with events. A null * parameter will default to the session user. * @param string $eids (Optional) Filter by these comma-separated event * ids. A null parameter will get all events for * the user. - * @param int $start_time (Optional) Filter with this unix time as lower + * @param integer $start_time (Optional) Filter with this unix time as lower * bound. A null or zero parameter indicates no * lower bound. - * @param int $end_time (Optional) Filter with this UTC as upper bound. + * @param integer $end_time (Optional) Filter with this UTC as upper bound. * A null or zero parameter indicates no upper * bound. * @param string $rsvp_status (Optional) Only show events where the given uid @@ -49,7 +49,7 @@ /** * Returns membership list data associated with an event. * - * @param int $eid event id + * @param integer $eid event id * * @return array An assoc array of four membership lists, with keys * 'attending', 'unsure', 'declined', and 'not_replied' @@ -64,10 +64,10 @@ /** * RSVPs the current user to this event. * - * @param int $eid event id - * @param string $rsvp_status 'attending', 'unsure', or 'declined' + * @param integer $eid event id + * @param string $rsvp_status 'attending', 'unsure', or 'declined' * - * @return bool true if successful + * @return boolean */ public function &rsvp($eid, $rsvp_status) { @@ -81,11 +81,11 @@ /** * Cancels an event. Only works for events where application is the admin. * - * @param int $eid event id + * @param integer $eid event id * @param string $cancel_message (Optional) message to send to members of * the event about why it is cancelled * - * @return bool true if successful + * @return boolean */ public function &cancel($eid, $cancel_message = '') { @@ -99,9 +99,9 @@ * Creates an event on behalf of the user is there is a session, otherwise on * behalf of app. Successful creation guarantees app will be admin. * - * @param assoc array $event_info json encoded event information + * @param array $event_info json encoded event information * - * @return int event id + * @return integer event id */ public function &create($event_info) { @@ -113,10 +113,10 @@ /** * Edits an existing event. Only works for events where application is admin. * - * @param int $eid event id - * @param assoc array $event_info json encoded event information + * @param integer $eid event id + * @param array $event_info json encoded event information * - * @return bool true if successful + * @return boolean true if successful */ public function &edit($eid, $event_info) { diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Exception.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Exception.php index 936588f65..89f4c9e16 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Exception.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Exception.php @@ -1,4 +1,11 @@ + * @category Horde + * @package Horde_Service_Facebook + */ class Horde_Service_Facebook_Exception extends Exception { } ?> \ No newline at end of file diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Feeds.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Feeds.php index 170141e3d..efcae4f74 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Feeds.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Feeds.php @@ -1,6 +1,12 @@ + * @category Horde + * @package Horde_Service_Facebook */ class Horde_Service_Facebook_Feeds extends Horde_Service_Facebook_Base @@ -71,9 +77,9 @@ class Horde_Service_Facebook_Feeds extends Horde_Service_Facebook_Base /** * Deactivates a previously registered template bundle. * - * @param string $template_bundle_id The template bundle id + * @param string $id The template bundle id * - * @return bool true on success + * @return boolean */ public function &deactivateTemplateBundleByID($id) { @@ -91,15 +97,15 @@ class Horde_Service_Facebook_Feeds extends Horde_Service_Facebook_Base * * http://wiki.developers.facebook.com/index.php/Feed.publishUserAction * - * @param int $bundleId A template bundle id previously registered + * @param integer $bundleId A template bundle id previously registered * @param array $data See wiki article for syntax * @param array $targetIds (Optional) An array of friend uids of the user * who shared in this action. * @param string $body (Optional) Additional markup that extends * the body of a short story. - * @param int $size (Optional) A story size (see above) + * @param self::STORY_SIZE $size (Optional) A story size (see above) * - * @return bool true on success + * @return boolean */ public function &publishUserAction($bundleId, $data, $targetIds = '', $body = '', $size = self::STORY_SIZE_ONE_LINE) diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Friends.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Friends.php index 65e4e6acf..4373ac679 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Friends.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Friends.php @@ -43,8 +43,8 @@ class Horde_Service_Facebook_Friends extends Horde_Service_Facebook_Base /** * Returns the friends of the current session user. * - * @param int $flid (Optional) Only return friends on this friend list. - * @param int $uid (Optional) Return friends for this user. + * @param integer $flid (Optional) Only return friends on this friend list. + * @param integer $uid (Optional) Return friends for this user. * * @return array An array of friends */ diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Groups.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Groups.php index 0b549cd56..1f18b1c5c 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Groups.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Groups.php @@ -13,10 +13,10 @@ class Horde_Service_Facebook_Groups extends Horde_Service_Facebook_Base /** * Returns groups according to the filters specified. * - * @param int $uid (Optional) User associated with groups. A null - * parameter will default to the session user. - * @param string $gids (Optional) Comma-separated group ids to query. A null - * parameter will get all groups for the user. + * @param integer $uid (Optional) User associated with groups. A null + * parameter will default to the session user. + * @param string $gids (Optional) Comma-separated group ids to query. A null + * parameter will get all groups for the user. * * @return array An array of group objects */ @@ -34,7 +34,7 @@ class Horde_Service_Facebook_Groups extends Horde_Service_Facebook_Base /** * Returns the membership list of a group. * - * @param int $gid Group id + * @param integer $gid Group id * * @return array An array with four membership lists, with keys 'members', * 'admins', 'officers', and 'not_replied' diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Links.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Links.php index eb37f053a..1f0d13305 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Links.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Links.php @@ -13,10 +13,10 @@ class Horde_Service_Facebook_Links extends Horde_Service_Facebook_Base /** * Retrieves links posted by the given user. * - * @param int $uid The user whose links you wish to retrieve - * @param int $limit The maximimum number of links to retrieve - * @param array $link_ids (Optional) Array of specific link - * IDs to retrieve by this user + * @param integer $uid The user whose links you wish to retrieve + * @param integer $limit The maximimum number of links to retrieve + * @param array $link_ids (Optional) Array of specific link + * IDs to retrieve by this user * * @return array An array of links. */ @@ -37,12 +37,12 @@ class Horde_Service_Facebook_Links extends Horde_Service_Facebook_Base /** * Posts a link on Facebook. * - * @param string $url URL/link you wish to post - * @param string $comment (Optional) A comment about this link - * @param int $uid (Optional) User ID that is posting this link; - * defaults to current session user + * @param string $url URL/link you wish to post + * @param string $comment (Optional) A comment about this link + * @param integer $uid (Optional) User ID that is posting this link; + * defaults to current session user * - * @return bool + * @return boolean */ public function &post($url, $comment = '', $uid = null) { diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Notes.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Notes.php index 05d5757cd..882dc49c2 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Notes.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Notes.php @@ -15,12 +15,12 @@ class Horde_Service_Facebook_Notes extends Horde_Service_Facebook_Base /** * Creates a note with the specified title and content. * - * @param string $title Title of the note. - * @param string $content Content of the note. - * @param int $uid (Optional) The user for whom you are creating a - * note; defaults to current session user + * @param string $title Title of the note. + * @param string $content Content of the note. + * @param integer $uid The user for whom you are creating a note; + * defaults to current session user * - * @return int The ID of the note that was just created. + * @return integer The ID of the note that was just created. */ public function &create($title, $content, $uid = null) { @@ -39,11 +39,11 @@ class Horde_Service_Facebook_Notes extends Horde_Service_Facebook_Base /** * Deletes the specified note. * - * @param int $note_id ID of the note you wish to delete - * @param int $uid (Optional) Owner of the note you wish to delete; - * defaults to current session user + * @param integer $note_id ID of the note you wish to delete + * @param integer $uid Owner of the note you wish to delete; + * defaults to current session user * - * @return bool + * @return boolean */ public function &delete($note_id, $uid = null) { @@ -62,11 +62,11 @@ class Horde_Service_Facebook_Notes extends Horde_Service_Facebook_Base * Edits a note, replacing its title and contents with the title * and contents specified. * - * @param int $note_id ID of the note you wish to edit - * @param string $title Replacement title for the note - * @param string $content Replacement content for the note + * @param integer $note_id ID of the note you wish to edit + * @param string $title Replacement title for the note + * @param string $content Replacement content for the note * - * @return bool + * @return boolean */ public function &edit($note_id, $title, $content) { @@ -87,9 +87,9 @@ class Horde_Service_Facebook_Notes extends Horde_Service_Facebook_Base * Retrieves all notes by a user. If note_ids are specified, * retrieves only those specific notes by that user. * - * @param int $uid User whose notes you wish to retrieve - * @param array $note_ids (Optional) List of specific note - * IDs by this user to retrieve + * @param integer $uid User whose notes you wish to retrieve + * @param array $note_ids (Optional) List of specific note + * IDs by this user to retrieve * * @return array A list of all of the given user's notes, or an empty list * if the viewer lacks permissions or if there are no visible diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Notifications.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Notifications.php index 1b33d4654..98903ebe4 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Notifications.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Notifications.php @@ -39,7 +39,8 @@ class Horde_Service_Facebook_Notifications extends Horde_Service_Facebook_Base * @param string $type Either 'user_to_user' or 'app_to_user' * * @throws Horde_Service_Facebook_Exception - * @return A comma separated list of successful recipients + * + * @return string A comma separated list of successful recipients */ public function &send($to_ids, $notification, $type) { diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Photos.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Photos.php index 6c4003d28..c692b105f 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Photos.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Photos.php @@ -15,8 +15,8 @@ class Horde_Service_Facebook_Photos extends Horde_Service_Facebook_Base * * http://wiki.developers.facebook.com/index.php/Photos.addTag * - * @param int $pid The ID of the photo to be tagged - * @param int $tag_uid The ID of the user being tagged. You must specify + * @param integer $pid The ID of the photo to be tagged + * @param integer $tag_uid The ID of the user being tagged. You must specify * either the $tag_uid or the $tag_text parameter * (unless $tags is specified). * @param string $tag_text Some text identifying the person being tagged. @@ -31,11 +31,11 @@ class Horde_Service_Facebook_Photos extends Horde_Service_Facebook_Base * can contain the tag_uid, tag_text, x, and y * parameters defined above. If specified, the * individual arguments are ignored. - * @param int $owner_uid (Optional) The user ID of the user whose photo - * you are tagging. If this parameter is not - * specified, then it defaults to the session user. + * @param integer $owner_uid (Optional) The user ID of the user whose photo + * you are tagging. If this parameter is not + * specified, then it defaults to the session user. * - * @return bool true on success + * @return boolean */ public function &addTag($pid, $tag_uid, $tag_text, $x, $y, $tags, $uid = 0) { @@ -74,7 +74,7 @@ class Horde_Service_Facebook_Photos extends Horde_Service_Facebook_Base * @param string $visible (Optional) A privacy setting for the album. * One of 'friends', 'friends-of-friends', * 'networks', or 'everyone'. Default 'everyone'. - * @param int $uid (Optional) User id for creating the album; if + * @param integer $uid (Optional) User id for creating the album; if * not specified, the session user is used. * * @return array An album object @@ -110,14 +110,14 @@ class Horde_Service_Facebook_Photos extends Horde_Service_Facebook_Base /** * Returns photos according to the filters specified. * - * @param int $subj_id (Optional) Filter by uid of user tagged in the photos. - * @param int $aid (Optional) Filter by an album, as returned by - * photos_getAlbums. - * @param string $pids (Optional) Restrict to a comma-separated list of pids - * * Note that at least one of these parameters needs to be specified, or an * error is returned. * + * @param integer $subj_id (Optional) Filter by uid of user tagged in the photos. + * @param integer $aid (Optional) Filter by an album, as returned by + * photos_getAlbums. + * @param string $pids (Optional) Restrict to a comma-separated list of pids + * * @return array An array of photo objects. */ public function &get($subj_id = null, $aid = null, $pids = null) @@ -149,14 +149,14 @@ class Horde_Service_Facebook_Photos extends Horde_Service_Facebook_Base /** * Returns the albums created by the given user. * - * @param int $uid (Optional) The uid of the user whose albums you want. - * A null will return the albums of the session user. - * @param string $aids (Optional) A comma-separated list of aids to restricti - * the query. - * * Note that at least one of the (uid, aids) parameters must be specified. * - * @returns an array of album objects. + * @param integer $uid (Optional) The uid of the user whose albums you want. + * A null will return the albums of the session user. + * @param string $aids (Optional) A comma-separated list of aids to restricti + * the query. + * + * @return array of album objects. */ public function &getAlbums($uid = null, $aids = null) { @@ -198,12 +198,12 @@ class Horde_Service_Facebook_Photos extends Horde_Service_Facebook_Base /** * Uploads a photo. * - * @param string $file The location of the photo on the local filesystem. - * @param int $aid (Optional) The album into which to upload the - * photo. - * @param string $caption (Optional) A caption for the photo. - * @param int uid (Optional) The user ID of the user whose photo you - * are uploading + * @param string $file The location of the photo on the local filesystem. + * @param integer $aid (Optional) The album into which to upload the + * photo. + * @param string $caption (Optional) A caption for the photo. + * @param integer $uid (Optional) The user ID of the user whose photo you + * are uploading * * @return array An array of user objects */ diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Request.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Request.php index 2709a6151..eef0c1dae 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Request.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Request.php @@ -16,6 +16,14 @@ class Horde_Service_Facebook_Request protected $_method; protected $_params; + /** + * Const'r + * + * @param Horde_Service_Facebook $facebook + * @param string $method + * @param Horde_Http_Client $http_client + * @param array $params + */ public function __construct($facebook, $method, $http_client, $params = array()) { $this->_facebook = $facebook; @@ -27,11 +35,10 @@ class Horde_Service_Facebook_Request /** * Run this request and return the data. * - * @throws Horde_Service_Facebook_Exception - * * @param string $dataFormat Optionally specify the datatype to return. * - * @return Either raw XML, JSON, or an array of decoded values. + * @return mixed Either raw XML, JSON, or an array of decoded values. + * @throws Horde_Service_Facebook_Exception */ public function &run() { @@ -56,10 +63,13 @@ class Horde_Service_Facebook_Request } /** + * Send a POST request + * + * @param string $method The method to call. + * @param array $params The method parameters. + * + * @return string The request results * @throws Horde_Service_Facebook_Exception - * @param $method - * @param $params - * @return unknown_type */ protected function _postRequest($method, &$params) { @@ -79,10 +89,12 @@ class Horde_Service_Facebook_Request } /** + * Finalize, sanity check, standardze and sign the method parameters, $params + * + * @param string $method The method name + * @param array $params Method parameters * - * @param $method - * @param $params - * @return unknown_type + * @return void */ protected function _finalizeParams($method, &$params) { @@ -101,6 +113,14 @@ class Horde_Service_Facebook_Request $params['sig'] = Horde_Service_Facebook_Auth::generateSignature($params, $this->_facebook->secret); } + /** + * Adds standard facebook api parameters to $params + * + * @param string $method The method name + * @param array $params Method parameters + * + * @return void + */ protected function _addStandardParams($method, &$params) { // Select the correct data format. @@ -125,6 +145,12 @@ class Horde_Service_Facebook_Request } } + /** + * Helper function to convert array to CSV string + * + * @param array $params + * @return string + */ protected function _convertToCsv(&$params) { foreach ($params as $key => &$val) { @@ -135,8 +161,13 @@ class Horde_Service_Facebook_Request } /** + * Create a string suitable for sending as POST data. + * * TODO: Figure out why using http_build_query doesn't work here. * + * @param array $params The parameters array + * + * @return string The POST string */ protected function _createPostString($params) { @@ -148,6 +179,12 @@ class Horde_Service_Facebook_Request return implode('&', $post_params); } + /** + * + * @param string $xml + * + * @return array + */ private function _xmlToResult($xml) { $sxml = simplexml_load_string($xml); @@ -156,6 +193,12 @@ class Horde_Service_Facebook_Request return $result; } + /** + * + * @param string $sxml + * + * @return array + */ private static function _simplexmlToArray($sxml) { $arr = array(); diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Streams.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Streams.php index 203989ff0..84eea90ed 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Streams.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Streams.php @@ -19,11 +19,13 @@ class Horde_Service_Facebook_Streams extends Horde_Service_Facebook_Base * * @param string $viewerId The user id or page id of the page whose stream * to read. - * @param array $sourceIds + * @param array $sourceIds * @param timestamp $start * @param timestamp $end - * @param int $limit - * @param string $filterKey + * @param integer $limit + * @param string $filterKey + * + * @return mixed Method call results. */ function &get($viewerId = '', $sourceIds = array(), $start = '', $end = '', $limit = '', $filterKey = '') @@ -52,7 +54,7 @@ class Horde_Service_Facebook_Streams extends Horde_Service_Facebook_Base * @param string $postId The post id of the post whose comments we are * retrieving. * - * @return array + * @return mixed */ function &getComments($postId) { @@ -94,6 +96,8 @@ class Horde_Service_Facebook_Streams extends Horde_Service_Facebook_Base * see the API docs. * @param string $action_links Array of action links. * @param string $target_id The id of user/page you are publishing to. + * + * @return mixed */ function publish($message = '', $attachment = '', $action_links = '', $target_id = '', $uid = '') { @@ -121,10 +125,10 @@ class Horde_Service_Facebook_Streams extends Horde_Service_Facebook_Base /** * Remove a post from a user's stream * - * @param string $post_id The post id + * @param string $postId The post id * @param string $uid The user id * - * @return unknown_type + * @return mixed */ function remove($postId, $uid = '') { @@ -146,7 +150,7 @@ class Horde_Service_Facebook_Streams extends Horde_Service_Facebook_Base /** * Add a comment to a user's post. * - * @param string $post_id The post id the comment belongs to + * @param string $postId The post id the comment belongs to * @param string $comment The body of the comment (text only, no HTML). * @param string $uid The user id of the user who is posting the * comment. @@ -175,7 +179,7 @@ class Horde_Service_Facebook_Streams extends Horde_Service_Facebook_Base /** * Remove a comment from a post. * - * @param string $comment_id The comment id to remove. + * @param string $commentId The comment id to remove. * @param string $uid User id * * @return boolean @@ -200,10 +204,10 @@ class Horde_Service_Facebook_Streams extends Horde_Service_Facebook_Base /** * Add a "like" to a post. * - * @param string $post_id + * @param string $postId * @param string $uid * - * @return unknown_type + * @return mixed */ function addLike($postId, $uid = '') { diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/UploadRequest.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/UploadRequest.php index 4dbe225be..69ea2396d 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/UploadRequest.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/UploadRequest.php @@ -10,14 +10,33 @@ */ class Horde_Service_Facebook_UploadRequest extends Horde_Service_Facebook_Request { + /** + * Filename to upload + * + * @var string + */ protected $_filename; + /** + * Const'r + * + * @param Horde_Service_Facebook $facebook + * @param string $method + * @param Horde_Http_Client $http_client + * @param string $file + * @param array $params + */ public function __construct($facebook, $method, $http_client, $file, $params = array()) { parent::__construct($facebook, $method, $http_client, $params); $this->_filename = $file; } + /** + * Run the request + * + * @return mixed + */ public function run() { // Ensure we ask for JSON diff --git a/framework/Service_Facebook/lib/Horde/Service/Facebook/Users.php b/framework/Service_Facebook/lib/Horde/Service/Facebook/Users.php index b441f4a8d..3f07ceada 100644 --- a/framework/Service_Facebook/lib/Horde/Service/Facebook/Users.php +++ b/framework/Service_Facebook/lib/Horde/Service/Facebook/Users.php @@ -51,8 +51,11 @@ class Horde_Service_Facebook_Users extends Horde_Service_Facebook_Base * Returns 1 if the user has the specified permission, 0 otherwise. * http://wiki.developers.facebook.com/index.php/Users.hasAppPermission * - * @throws Horde_Service_Facebook_Exception + * @param string $ext_perm The perm to check for. + * @param string $uid The facebook userid to check. + * * @return integer 1 or 0 + * @throws Horde_Service_Facebook_Exception */ public function &hasAppPermission($ext_perm, $uid = null) { @@ -75,6 +78,8 @@ class Horde_Service_Facebook_Users extends Horde_Service_Facebook_Base * Returns whether or not the user corresponding to the current * session object has the give the app basic authorization. * + * @param string $uid Facebook userid + * * @throws Horde_Service_Facebook_Exception * @return boolean true if the user has authorized the app */ @@ -117,13 +122,13 @@ class Horde_Service_Facebook_Users extends Horde_Service_Facebook_Base * Example: setStatus("is loving the API!") * will produce the status "Luke is loving the API!" * - * @param string $status text-only message to set - * @param int $uid user to set for (defaults to the - * logged-in user) - * @param bool $clear whether or not to clear the status, - * instead of setting it - * @param bool $status_includes_verb if true, the word "is" will *not* be - * prepended to the status message + * @param string $status text-only message to set + * @param string $uid user to set for (defaults to the + * logged-in user) + * @param boolean $clear whether or not to clear the status, instead + * of setting it + * @param boolean $includeVerb If true, the word "is" will *not* be + * prepended to the status message * * @return boolean */ @@ -146,6 +151,14 @@ class Horde_Service_Facebook_Users extends Horde_Service_Facebook_Base return $this->_facebook->callMethod('facebook.users.setStatus', $params); } + /** + * Get user's status + * + * @param string $uid + * @param integer $limit + * + * @return mixed + */ public function &getStatus($uid = null, $limit = 1) { if (empty($uid) && !$skey = $this->_facebook->auth->getSessionKey()) { -- 2.11.0