@@ -45,6 +45,10 @@ discard block |
||
| 45 | 45 | return $cart; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | + /** |
|
| 49 | + * @param string $entity |
|
| 50 | + * @param integer $id |
|
| 51 | + */ |
|
| 48 | 52 | public function load($entity, $id) |
| 49 | 53 | { |
| 50 | 54 | return $this->loadByFields([ |
@@ -59,11 +63,17 @@ discard block |
||
| 59 | 63 | return (int)parent::getQty(); |
| 60 | 64 | } |
| 61 | 65 | |
| 66 | + /** |
|
| 67 | + * @param integer $qty |
|
| 68 | + */ |
|
| 62 | 69 | public function addQty($qty) |
| 63 | 70 | { |
| 64 | 71 | $this->setQty($this->getQty() + (int)$qty); |
| 65 | 72 | } |
| 66 | 73 | |
| 74 | + /** |
|
| 75 | + * @param string $entityName |
|
| 76 | + */ |
|
| 67 | 77 | public function setEntityById($entityName, $id) |
| 68 | 78 | { |
| 69 | 79 | try { |
@@ -107,7 +117,7 @@ discard block |
||
| 107 | 117 | |
| 108 | 118 | /** |
| 109 | 119 | * |
| 110 | - * @param string $entity |
|
| 120 | + * @param string $entityName |
|
| 111 | 121 | * @return Ajde_Model |
| 112 | 122 | */ |
| 113 | 123 | protected function _getEntityModel($entityName) |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * @param $rest_resource |
|
| 72 | - * @param $body |
|
| 71 | + * @param string $rest_resource |
|
| 72 | + * @param string $body |
|
| 73 | 73 | * |
| 74 | 74 | * @return object |
| 75 | 75 | */ |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | /** |
| 84 | 84 | * Retrieves a single object from the REST API. |
| 85 | 85 | * |
| 86 | - * @param $rest_resource |
|
| 86 | + * @param string $rest_resource |
|
| 87 | 87 | * @param string $id Id of the object to retrieve. |
| 88 | 88 | * |
| 89 | 89 | * @return object |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * Get a collection of objects from the REST API. |
| 101 | 101 | * |
| 102 | - * @param $rest_resource |
|
| 102 | + * @param string $rest_resource |
|
| 103 | 103 | * @param int $offset |
| 104 | 104 | * @param int $limit |
| 105 | 105 | * |
@@ -275,6 +275,9 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | + /** |
|
| 279 | + * @param string $status |
|
| 280 | + */ |
|
| 278 | 281 | private static function isPaid($status) |
| 279 | 282 | { |
| 280 | 283 | $status = strtolower($status); |
@@ -285,6 +288,9 @@ discard block |
||
| 285 | 288 | } |
| 286 | 289 | } |
| 287 | 290 | |
| 291 | + /** |
|
| 292 | + * @param string $status |
|
| 293 | + */ |
|
| 288 | 294 | private static function isRefused($status) |
| 289 | 295 | { |
| 290 | 296 | $status = strtolower($status); |
@@ -309,6 +315,10 @@ discard block |
||
| 309 | 315 | return $xml; |
| 310 | 316 | } |
| 311 | 317 | |
| 318 | + /** |
|
| 319 | + * @param DOMElement $element |
|
| 320 | + * @param DOMDocument $xml |
|
| 321 | + */ |
|
| 312 | 322 | private static function appendData(&$element, $xml, $data) |
| 313 | 323 | { |
| 314 | 324 | foreach ($data as $k => $v) { |
@@ -581,7 +581,7 @@ |
||
| 581 | 581 | * Get the UID of the connected user, or 0 |
| 582 | 582 | * if the Facebook user is not connected. |
| 583 | 583 | * |
| 584 | - * @return string the UID if available. |
|
| 584 | + * @return integer the UID if available. |
|
| 585 | 585 | */ |
| 586 | 586 | public function getUser() |
| 587 | 587 | { |
@@ -467,7 +467,7 @@ |
||
| 467 | 467 | * @param $required_audience the expected consumer of the token |
| 468 | 468 | * @param [$issuer] the expected issues, defaults to Google |
| 469 | 469 | * @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS |
| 470 | - * @return token information if valid, false if not |
|
| 470 | + * @return Google_Auth_LoginTicket information if valid, false if not |
|
| 471 | 471 | */ |
| 472 | 472 | public function verifySignedJwtWithCerts( |
| 473 | 473 | $jwt, |
@@ -85,6 +85,9 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | + /** |
|
| 89 | + * @param string $file |
|
| 90 | + */ |
|
| 88 | 91 | private function getWriteableCacheFile($file) |
| 89 | 92 | { |
| 90 | 93 | return $this->getCacheFile($file, true); |
@@ -95,6 +98,9 @@ discard block |
||
| 95 | 98 | return $this->getCacheDir($file, $forWrite) . '/' . md5($file); |
| 96 | 99 | } |
| 97 | 100 | |
| 101 | + /** |
|
| 102 | + * @param boolean $forWrite |
|
| 103 | + */ |
|
| 98 | 104 | private function getCacheDir($file, $forWrite) |
| 99 | 105 | { |
| 100 | 106 | // use the first 2 characters of the hash as a directory prefix |
@@ -110,11 +116,17 @@ discard block |
||
| 110 | 116 | return $storageDir; |
| 111 | 117 | } |
| 112 | 118 | |
| 119 | + /** |
|
| 120 | + * @param string $storageFile |
|
| 121 | + */ |
|
| 113 | 122 | private function acquireReadLock($storageFile) |
| 114 | 123 | { |
| 115 | 124 | return $this->acquireLock(LOCK_SH, $storageFile); |
| 116 | 125 | } |
| 117 | 126 | |
| 127 | + /** |
|
| 128 | + * @param string $storageFile |
|
| 129 | + */ |
|
| 118 | 130 | private function acquireWriteLock($storageFile) |
| 119 | 131 | { |
| 120 | 132 | $rc = $this->acquireLock(LOCK_EX, $storageFile); |
@@ -125,6 +137,9 @@ discard block |
||
| 125 | 137 | return $rc; |
| 126 | 138 | } |
| 127 | 139 | |
| 140 | + /** |
|
| 141 | + * @param integer $type |
|
| 142 | + */ |
|
| 128 | 143 | private function acquireLock($type, $storageFile) |
| 129 | 144 | { |
| 130 | 145 | $mode = $type == LOCK_EX ? "w" : "r"; |
@@ -141,6 +156,9 @@ discard block |
||
| 141 | 156 | return true; |
| 142 | 157 | } |
| 143 | 158 | |
| 159 | + /** |
|
| 160 | + * @param string $storageFile |
|
| 161 | + */ |
|
| 144 | 162 | public function unlock($storageFile) |
| 145 | 163 | { |
| 146 | 164 | if ($this->fh) { |
@@ -108,6 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | 110 | * Adds the scopes available for a service |
| 111 | + * @param string $service |
|
| 111 | 112 | */ |
| 112 | 113 | public function addService($service, $version = false, $availableScopes = []) |
| 113 | 114 | { |
@@ -178,7 +179,7 @@ discard block |
||
| 178 | 179 | } |
| 179 | 180 | |
| 180 | 181 | /** |
| 181 | - * @return array |
|
| 182 | + * @return string |
|
| 182 | 183 | * @visible For Testing |
| 183 | 184 | */ |
| 184 | 185 | public function prepareScopes() |
@@ -223,7 +224,6 @@ discard block |
||
| 223 | 224 | /** |
| 224 | 225 | * Set the IO object |
| 225 | 226 | * |
| 226 | - * @param Google_Io_Abstract $auth |
|
| 227 | 227 | */ |
| 228 | 228 | public function setIo(Google_Io_Abstract $io) |
| 229 | 229 | { |
@@ -234,7 +234,6 @@ discard block |
||
| 234 | 234 | /** |
| 235 | 235 | * Set the Cache object |
| 236 | 236 | * |
| 237 | - * @param Google_Cache_Abstract $auth |
|
| 238 | 237 | */ |
| 239 | 238 | public function setCache(Google_Cache_Abstract $cache) |
| 240 | 239 | { |
@@ -425,7 +424,7 @@ discard block |
||
| 425 | 424 | * @param $required_audience the expected consumer of the token |
| 426 | 425 | * @param [$issuer] the expected issues, defaults to Google |
| 427 | 426 | * @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS |
| 428 | - * @return token information if valid, false if not |
|
| 427 | + * @return Google_Auth_LoginTicket information if valid, false if not |
|
| 429 | 428 | */ |
| 430 | 429 | public function verifySignedJwt($id_token, $cert_location, $audience, $issuer, $max_expiry = null) |
| 431 | 430 | { |
@@ -449,7 +448,7 @@ discard block |
||
| 449 | 448 | * so that you can ask for more or less permission in the auth flow |
| 450 | 449 | * Set this before you call authenticate() though! |
| 451 | 450 | * |
| 452 | - * @param array $scopes , ie: array('https://www.googleapis.com/auth/plus.me', |
|
| 451 | + * @param string $scopes , ie: array('https://www.googleapis.com/auth/plus.me', |
|
| 453 | 452 | * 'https://www.googleapis.com/auth/moderator') |
| 454 | 453 | */ |
| 455 | 454 | public function setScopes($scopes) |
@@ -545,7 +544,7 @@ discard block |
||
| 545 | 544 | * Retrieve custom configuration for a specific class. |
| 546 | 545 | * |
| 547 | 546 | * @param $class string|object - class or instance of class to retrieve |
| 548 | - * @param $key string optional - key to retrieve |
|
| 547 | + * @param string $key string optional - key to retrieve |
|
| 549 | 548 | */ |
| 550 | 549 | public function getClassConfig($class, $key = null) |
| 551 | 550 | { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * Set the base URL that query parameters will be added to. |
| 101 | 101 | * |
| 102 | - * @param $baseUrl string |
|
| 102 | + * @param string $baseUrl string |
|
| 103 | 103 | */ |
| 104 | 104 | public function setBaseUrl($baseUrl) |
| 105 | 105 | { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | /** |
| 132 | 132 | * Set a new query parameter. |
| 133 | 133 | * |
| 134 | - * @param $key - string to set, does not need to be URL encoded |
|
| 134 | + * @param string $key - string to set, does not need to be URL encoded |
|
| 135 | 135 | * @param $value - string to set, does not need to be URL encoded |
| 136 | 136 | */ |
| 137 | 137 | public function setQueryParam($key, $value) |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | - * @return string HTTP Response Code. |
|
| 143 | + * @return integer HTTP Response Code. |
|
| 144 | 144 | */ |
| 145 | 145 | public function getResponseHttpCode() |
| 146 | 146 | { |
@@ -178,7 +178,7 @@ |
||
| 178 | 178 | * Used by the IO lib and also the batch processing. |
| 179 | 179 | * |
| 180 | 180 | * @param $respData |
| 181 | - * @param $headerSize |
|
| 181 | + * @param boolean $headerSize |
|
| 182 | 182 | * @return array |
| 183 | 183 | */ |
| 184 | 184 | public function parseHttpResponse($respData, $headerSize) |