From b45f001fb2ace159917df9323ce7447c489a9066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Thu, 13 Nov 2014 10:54:18 +0100 Subject: [PATCH] Fixes DocBlocks in Zend_Feed_Pubsubhubbub Closes #456 and Closes #457 --- .../Feed/Pubsubhubbub/CallbackAbstract.php | 11 ++++-- .../Zend/Feed/Pubsubhubbub/HttpResponse.php | 1 + .../Feed/Pubsubhubbub/Model/ModelAbstract.php | 2 - .../Feed/Pubsubhubbub/Model/Subscription.php | 10 ++++- library/Zend/Feed/Pubsubhubbub/Publisher.php | 15 +++++-- library/Zend/Feed/Pubsubhubbub/Subscriber.php | 39 ++++++++++++------- 6 files changed, 52 insertions(+), 26 deletions(-) diff --git a/library/Zend/Feed/Pubsubhubbub/CallbackAbstract.php b/library/Zend/Feed/Pubsubhubbub/CallbackAbstract.php index 9de8d05b06..eb697a56aa 100644 --- a/library/Zend/Feed/Pubsubhubbub/CallbackAbstract.php +++ b/library/Zend/Feed/Pubsubhubbub/CallbackAbstract.php @@ -70,7 +70,7 @@ abstract class Zend_Feed_Pubsubhubbub_CallbackAbstract * options for the Subscriber without calling all supported setter * methods in turn. * - * @param array|Zend_Config $options Options array or Zend_Config instance + * @param array|Zend_Config|null $config Options array or Zend_Config instance */ public function __construct($config = null) { @@ -82,7 +82,8 @@ public function __construct($config = null) /** * Process any injected configuration options * - * @param array|Zend_Config $options Options array or Zend_Config instance + * @param array|Zend_Config $config Options array or Zend_Config instance + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_CallbackAbstract */ public function setConfig($config) @@ -132,6 +133,7 @@ public function setStorage(Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $s * to background save any verification tokens associated with a subscription * or other. * + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface */ public function getStorage() @@ -150,6 +152,7 @@ public function getStorage() * (i.e. not inherited from) Zend_Controller_Response_Http. * * @param Zend_Feed_Pubsubhubbub_HttpResponse|Zend_Controller_Response_Http $httpResponse + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_CallbackAbstract */ public function setHttpResponse($httpResponse) @@ -188,6 +191,7 @@ public function getHttpResponse() * Defaults to 1 if left unchanged. * * @param string|int $count + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_CallbackAbstract */ public function setSubscriberCount($count) @@ -270,7 +274,8 @@ protected function _getHttpHost() /** * Retrieve a Header value from either $_SERVER or Apache * - * @param string $header + * @param string $header + * @return bool */ protected function _getHeader($header) { diff --git a/library/Zend/Feed/Pubsubhubbub/HttpResponse.php b/library/Zend/Feed/Pubsubhubbub/HttpResponse.php index 21fd4ab122..71ef267dc3 100644 --- a/library/Zend/Feed/Pubsubhubbub/HttpResponse.php +++ b/library/Zend/Feed/Pubsubhubbub/HttpResponse.php @@ -172,6 +172,7 @@ public function canSendHeaders($throw = false) * Set HTTP response code to use with headers * * @param int $code + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_HttpResponse */ public function setHttpResponseCode($code) diff --git a/library/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php b/library/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php index e90fe337f8..8c3a5d5419 100644 --- a/library/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php +++ b/library/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php @@ -47,9 +47,7 @@ class Zend_Feed_Pubsubhubbub_Model_ModelAbstract /** * Constructor * - * @param array $data * @param Zend_Db_Table_Abstract $tableGateway - * @return void */ public function __construct(Zend_Db_Table_Abstract $tableGateway = null) { diff --git a/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php b/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php index bd19d73583..063d04df17 100644 --- a/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php +++ b/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php @@ -44,7 +44,9 @@ class Zend_Feed_Pubsubhubbub_Model_Subscription /** * Save subscription to RDMBS * - * @param array $data + * @param array $data + * @throws Zend_Db_Table_Exception + * @throws Zend_Feed_Pubsubhubbub_Exception * @return bool */ public function setSubscription(array $data) @@ -78,6 +80,8 @@ public function setSubscription(array $data) * Get subscription by ID/key * * @param string $key + * @throws Zend_Db_Table_Exception + * @throws Zend_Feed_Pubsubhubbub_Exception * @return array */ public function getSubscription($key) @@ -98,6 +102,8 @@ public function getSubscription($key) * Determine if a subscription matching the key exists * * @param string $key + * @throws Zend_Db_Table_Exception + * @throws Zend_Feed_Pubsubhubbub_Exception * @return bool */ public function hasSubscription($key) @@ -117,7 +123,7 @@ public function hasSubscription($key) /** * Delete a subscription * - * @param string $key + * @param string $key * @return bool */ public function deleteSubscription($key) diff --git a/library/Zend/Feed/Pubsubhubbub/Publisher.php b/library/Zend/Feed/Pubsubhubbub/Publisher.php index 86088cae31..53e08e7586 100644 --- a/library/Zend/Feed/Pubsubhubbub/Publisher.php +++ b/library/Zend/Feed/Pubsubhubbub/Publisher.php @@ -69,8 +69,8 @@ class Zend_Feed_Pubsubhubbub_Publisher * options for the Publisher without calling all supported setter * methods in turn. * - * @param array|Zend_Config $options Options array or Zend_Config instance - * @return void + * @param array|Zend_Config $config Options array or Zend_Config instance + * @throws Zend_Feed_Pubsubhubbub_Exception */ public function __construct($config = null) { @@ -82,7 +82,8 @@ public function __construct($config = null) /** * Process any injected configuration options * - * @param array|Zend_Config $options Options array or Zend_Config instance + * @param array|Zend_Config $config Options array or Zend_Config instance + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Publisher */ public function setConfig($config) @@ -110,6 +111,7 @@ public function setConfig($config) * Add a Hub Server URL supported by Publisher * * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Publisher */ public function addHubUrl($url) @@ -169,6 +171,7 @@ public function getHubUrls() * Add a URL to a topic (Atom or RSS feed) which has been updated * * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Publisher */ public function addUpdatedTopicUrl($url) @@ -287,8 +290,9 @@ public function notifyAll() /** * Add an optional parameter to the update notification requests * - * @param string $name + * @param string $name * @param string|null $value + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Publisher */ public function setParameter($name, $value = null) @@ -333,6 +337,7 @@ public function setParameters(array $parameters) * Remove an optional parameter for the notification requests * * @param string $name + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Publisher */ public function removeParameter($name) @@ -387,6 +392,8 @@ public function getErrors() /** * Get a basic prepared HTTP client for use * + * @throws Zend_Feed_Pubsubhubbub_Exception + * @throws Zend_Http_Client_Exception * @return Zend_Http_Client */ protected function _getHttpClient() diff --git a/library/Zend/Feed/Pubsubhubbub/Subscriber.php b/library/Zend/Feed/Pubsubhubbub/Subscriber.php index 08b3721f85..61162f27f4 100644 --- a/library/Zend/Feed/Pubsubhubbub/Subscriber.php +++ b/library/Zend/Feed/Pubsubhubbub/Subscriber.php @@ -145,8 +145,8 @@ class Zend_Feed_Pubsubhubbub_Subscriber * options for the Subscriber without calling all supported setter * methods in turn. * - * @param array|Zend_Config $options Options array or Zend_Config instance - * @return void + * @param array|Zend_Config|null $config Options array or Zend_Config instance + * @throws Zend_Feed_Pubsubhubbub_Exception */ public function __construct($config = null) { @@ -158,7 +158,8 @@ public function __construct($config = null) /** * Process any injected configuration options * - * @param array|Zend_Config $options Options array or Zend_Config instance + * @param array|Zend_Config $config Options array or Zend_Config instance + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function setConfig($config) @@ -207,6 +208,7 @@ public function setConfig($config) * event will relate * * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function setTopicUrl($url) @@ -225,6 +227,7 @@ public function setTopicUrl($url) * Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe * event will relate * + * @throws Zend_Feed_Pubsubhubbub_Exception * @return string */ public function getTopicUrl() @@ -241,6 +244,7 @@ public function getTopicUrl() * Set the number of seconds for which any subscription will remain valid * * @param int $seconds + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function setLeaseSeconds($seconds) @@ -270,6 +274,7 @@ public function getLeaseSeconds() * this Subscriber * * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function setCallbackUrl($url) @@ -288,6 +293,7 @@ public function setCallbackUrl($url) * Get the callback URL to be used by Hub Servers when communicating with * this Subscriber * + * @throws Zend_Feed_Pubsubhubbub_Exception * @return string */ public function getCallbackUrl() @@ -309,6 +315,7 @@ public function getCallbackUrl() * order of occurance in the parameter list determines this preference. * * @param string $mode Should be 'sync' or 'async' + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function setPreferredVerificationMode($mode) @@ -339,6 +346,7 @@ public function getPreferredVerificationMode() * Add a Hub Server URL supported by Publisher * * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function addHubUrl($url) @@ -398,7 +406,8 @@ public function getHubUrls() * Add authentication credentials for a given URL * * @param string $url - * @param array $authentication + * @param array $authentication + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function addAuthentication($url, array $authentication) @@ -452,8 +461,9 @@ public function usePathParameter($bool = true) /** * Add an optional parameter to the (un)subscribe requests * - * @param string $name + * @param string $name * @param string|null $value + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function setParameter($name, $value = null) @@ -483,8 +493,8 @@ public function setParameter($name, $value = null) /** * Add an optional parameter to the (un)subscribe requests * - * @param string $name - * @param string|null $value + * @param array $parameters + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function setParameters(array $parameters) @@ -499,6 +509,7 @@ public function setParameters(array $parameters) * Remove an optional parameter for the (un)subscribe requests * * @param string $name + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Subscriber */ public function removeParameter($name) @@ -542,6 +553,7 @@ public function setStorage(Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $s * to background save any verification tokens associated with a subscription * or other. * + * @throws Zend_Feed_Pubsubhubbub_Exception * @return Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface */ public function getStorage() @@ -557,8 +569,6 @@ public function getStorage() /** * Subscribe to one or more Hub Servers using the stored Hub URLs * for the given Topic URL (RSS or Atom feed) - * - * @return void */ public function subscribeAll() { @@ -568,8 +578,6 @@ public function subscribeAll() /** * Unsubscribe from one or more Hub Servers using the stored Hub URLs * for the given Topic URL (RSS or Atom feed) - * - * @return void */ public function unsubscribeAll() { @@ -619,7 +627,8 @@ public function getAsyncHubs() * Executes an (un)subscribe request * * @param string $mode - * @return void + * @throws Zend_Feed_Pubsubhubbub_Exception + * @throws Zend_Http_Client_Exception */ protected function _doRequest($mode) { @@ -669,7 +678,6 @@ protected function _doRequest($mode) /** * Get a basic prepared HTTP client for use * - * @param string $mode Must be "subscribe" or "unsubscribe" * @return Zend_Http_Client */ protected function _getHttpClient() @@ -686,7 +694,8 @@ protected function _getHttpClient() * client's POST body that are specific to the current Hub Server URL * * @param string $hubUrl - * @param mode $hubUrl + * @param string $mode + * @throws Zend_Feed_Pubsubhubbub_Exception * @return string */ protected function _getRequestParameters($hubUrl, $mode) @@ -776,7 +785,6 @@ protected function _getRequestParameters($hubUrl, $mode) * requests to a Hub Server. Follows no particular method, which means * it might be improved/changed in future. * - * @param string $hubUrl The Hub Server URL for which this token will apply * @return string */ protected function _generateVerifyToken() @@ -791,6 +799,7 @@ protected function _generateVerifyToken() * Simple helper to generate a verification token used in (un)subscribe * requests to a Hub Server. * + * @param array $params * @param string $hubUrl The Hub Server URL for which this token will apply * @return string */