@@ -109,6 +109,7 @@ |
||
| 109 | 109 | /** |
| 110 | 110 | * Returns true if negotiation is enabled for the given response. By default, negotiation is only |
| 111 | 111 | * enabled for pages that have the xml header. |
| 112 | + * @param SS_HTTPResponse $response |
|
| 112 | 113 | */ |
| 113 | 114 | public static function enabled_for($response) { |
| 114 | 115 | $contentType = $response->getHeader("Content-Type"); |
@@ -144,13 +144,13 @@ |
||
| 144 | 144 | * @see http://uk3.php.net/manual/en/function.setcookie.php |
| 145 | 145 | * |
| 146 | 146 | * @param string $name The name of the cookie |
| 147 | - * @param string|array $value The value for the cookie to hold |
|
| 147 | + * @param false|string $value The value for the cookie to hold |
|
| 148 | 148 | * @param int $expiry The number of days until expiry |
| 149 | 149 | * @param string $path The path to save the cookie on (falls back to site base) |
| 150 | 150 | * @param string $domain The domain to make the cookie available on |
| 151 | 151 | * @param boolean $secure Can the cookie only be sent over SSL? |
| 152 | 152 | * @param boolean $httpOnly Prevent the cookie being accessible by JS |
| 153 | - * @return boolean If the cookie was set or not; doesn't mean it's accepted by the browser |
|
| 153 | + * @return boolean|null If the cookie was set or not; doesn't mean it's accepted by the browser |
|
| 154 | 154 | */ |
| 155 | 155 | protected function outputCookie( |
| 156 | 156 | $name, $value, $expiry = 90, $path = null, $domain = null, $secure = false, $httpOnly = true |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | /** |
| 189 | - * @return null|string |
|
| 189 | + * @return string |
|
| 190 | 190 | */ |
| 191 | 191 | public function getBody() { |
| 192 | 192 | return $this->body; |
@@ -385,9 +385,9 @@ discard block |
||
| 385 | 385 | * it's only advisable to send small files through this method. |
| 386 | 386 | * |
| 387 | 387 | * @static |
| 388 | - * @param $fileData |
|
| 388 | + * @param string $fileData |
|
| 389 | 389 | * @param $fileName |
| 390 | - * @param null $mimeType |
|
| 390 | + * @param string $mimeType |
|
| 391 | 391 | * @return SS_HTTPResponse |
| 392 | 392 | */ |
| 393 | 393 | public static function send_file($fileData, $fileName, $mimeType = null) { |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | * This is used by the request handler to prevent infinite parsing loops. |
| 606 | 606 | * |
| 607 | 607 | * @param $pattern |
| 608 | - * @return bool |
|
| 608 | + * @return boolean|null |
|
| 609 | 609 | */ |
| 610 | 610 | public function isEmptyPattern($pattern) { |
| 611 | 611 | if(preg_match('/^([A-Za-z]+) +(.*)$/', $pattern, $matches)) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * No newlines are allowed in the description. |
| 110 | 110 | * If omitted, will default to the standard HTTP description |
| 111 | 111 | * for the given $code value (see {@link $status_codes}). |
| 112 | - * @return SS_HTTPRequest $this |
|
| 112 | + * @return SS_HTTPResponse $this |
|
| 113 | 113 | */ |
| 114 | 114 | public function setStatusCode($code, $description = null) { |
| 115 | 115 | if(isset(self::$status_codes[$code])) $this->statusCode = $code; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * Caution: Will be overwritten by {@link setStatusCode()}. |
| 126 | 126 | * |
| 127 | 127 | * @param string $description |
| 128 | - * @return SS_HTTPRequest $this |
|
| 128 | + * @return SS_HTTPResponse $this |
|
| 129 | 129 | */ |
| 130 | 130 | public function setStatusDescription($description) { |
| 131 | 131 | $this->statusDescription = $description; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | 159 | * @param string $body |
| 160 | - * @return SS_HTTPRequest $this |
|
| 160 | + * @return SS_HTTPResponse $this |
|
| 161 | 161 | */ |
| 162 | 162 | public function setBody($body) { |
| 163 | 163 | $this->body = $body ? (string) $body : $body; // Don't type-cast false-ish values, eg null is null not '' |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
| 168 | - * @return null|string |
|
| 168 | + * @return string |
|
| 169 | 169 | */ |
| 170 | 170 | public function getBody() { |
| 171 | 171 | return $this->body; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * |
| 177 | 177 | * @param string $header Example: "Content-Type" |
| 178 | 178 | * @param string $value Example: "text/xml" |
| 179 | - * @return SS_HTTPRequest $this |
|
| 179 | + * @return SS_HTTPResponse $this |
|
| 180 | 180 | */ |
| 181 | 181 | public function addHeader($header, $value) { |
| 182 | 182 | $this->headers[$header] = $value; |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * e.g. "Content-Type". |
| 207 | 207 | * |
| 208 | 208 | * @param string $header |
| 209 | - * @return SS_HTTPRequest $this |
|
| 209 | + * @return SS_HTTPResponse $this |
|
| 210 | 210 | */ |
| 211 | 211 | public function removeHeader($header) { |
| 212 | 212 | if(isset($this->headers[$header])) unset($this->headers[$header]); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | /** |
| 217 | 217 | * @param string $dest |
| 218 | 218 | * @param int $code |
| 219 | - * @return SS_HTTPRequest $this |
|
| 219 | + * @return SS_HTTPResponse $this |
|
| 220 | 220 | */ |
| 221 | 221 | public function redirect($dest, $code=302) { |
| 222 | 222 | if(!in_array($code, self::$redirect_codes)) $code = 302; |
@@ -316,6 +316,7 @@ discard block |
||
| 316 | 316 | * @param string|SS_HTTPResponse body Either the plaintext content of the error message, or an SS_HTTPResponse |
| 317 | 317 | * object representing it. In either case, the $statusCode and |
| 318 | 318 | * $statusDescription will be the HTTP status of the resulting response. |
| 319 | + * @param string $statusDescription |
|
| 319 | 320 | * @see SS_HTTPResponse::__construct(); |
| 320 | 321 | */ |
| 321 | 322 | public function __construct($body = null, $statusCode = null, $statusDescription = null) { |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | * |
| 355 | 355 | * @param string $property |
| 356 | 356 | * the name of the property |
| 357 | - * @param object $object |
|
| 357 | + * @param string $object |
|
| 358 | 358 | * the object to be set |
| 359 | 359 | */ |
| 360 | 360 | public function addAutoProperty($property, $object) { |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | * The name of the service to update the definition for |
| 449 | 449 | * @param string $property |
| 450 | 450 | * The name of the property to update. |
| 451 | - * @param mixed $value |
|
| 451 | + * @param string $value |
|
| 452 | 452 | * The value to set |
| 453 | 453 | * @param boolean $append |
| 454 | 454 | * Whether to append (the default) when the property is an array |
@@ -753,6 +753,7 @@ discard block |
||
| 753 | 753 | * |
| 754 | 754 | * Will recursively call hasService for each depth of dotting |
| 755 | 755 | * |
| 756 | + * @param string $name |
|
| 756 | 757 | * @return string |
| 757 | 758 | * The name of the service (as it might be different from the one passed in) |
| 758 | 759 | */ |
@@ -929,8 +930,6 @@ discard block |
||
| 929 | 930 | * |
| 930 | 931 | * @param string $name |
| 931 | 932 | * Name of the class to create an object of |
| 932 | - * @param array $args |
|
| 933 | - * Arguments to pass to the constructor |
|
| 934 | 933 | * @return mixed |
| 935 | 934 | */ |
| 936 | 935 | public function createWithArgs($name, $constructorArgs) { |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | protected $fragmentOverride = null; |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * @param RequestHandler $controller |
|
| 39 | 38 | * @param SS_HTTPResponse An existing response to reuse (optional) |
| 40 | 39 | * @param Array $callbacks |
| 40 | + * @param SS_HTTPResponse $response |
|
| 41 | 41 | */ |
| 42 | 42 | public function __construct($callbacks = array(), $response = null) { |
| 43 | 43 | $this->callbacks = $callbacks; |
@@ -61,7 +61,6 @@ discard block |
||
| 61 | 61 | * @param array $extraCallbacks List of anonymous functions or callables returning either a string |
| 62 | 62 | * or SS_HTTPResponse, keyed by their fragment identifier. The 'default' key can |
| 63 | 63 | * be used as a fallback for non-ajax responses. |
| 64 | - * @param array $fragmentOverride Change the response fragments. |
|
| 65 | 64 | * @return SS_HTTPResponse |
| 66 | 65 | */ |
| 67 | 66 | public function respond(SS_HTTPRequest $request, $extraCallbacks = array()) { |
@@ -109,7 +108,7 @@ discard block |
||
| 109 | 108 | /** |
| 110 | 109 | * Set up fragment overriding - will completely replace the incoming fragments. |
| 111 | 110 | * |
| 112 | - * @param array $fragments Fragments to insert. |
|
| 111 | + * @param string[] $fragments Fragments to insert. |
|
| 113 | 112 | */ |
| 114 | 113 | public function setFragmentOverride($fragments) { |
| 115 | 114 | if (!is_array($fragments)) throw new InvalidArgumentException(); |
@@ -121,6 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * Set the DataModel for this request. |
| 124 | + * @param DataModel $model |
|
| 124 | 125 | */ |
| 125 | 126 | public function setDataModel($model) { |
| 126 | 127 | $this->model = $model; |
@@ -238,6 +239,9 @@ discard block |
||
| 238 | 239 | return $this; |
| 239 | 240 | } |
| 240 | 241 | |
| 242 | + /** |
|
| 243 | + * @param SS_HTTPRequest $request |
|
| 244 | + */ |
|
| 241 | 245 | protected function findAction($request) { |
| 242 | 246 | $handlerClass = ($this->class) ? $this->class : get_class($this); |
| 243 | 247 | |
@@ -384,6 +388,7 @@ discard block |
||
| 384 | 388 | |
| 385 | 389 | /** |
| 386 | 390 | * Return the class that defines the given action, so that we know where to check allowed_actions. |
| 391 | + * @return string|null |
|
| 387 | 392 | */ |
| 388 | 393 | protected function definingClassForAction($actionOrigCasing) { |
| 389 | 394 | $action = strtolower($actionOrigCasing); |
@@ -492,6 +497,7 @@ discard block |
||
| 492 | 497 | * or {@link handleRequest()}, but in some based we want to set it manually. |
| 493 | 498 | * |
| 494 | 499 | * @param SS_HTTPRequest |
| 500 | + * @param SS_HTTPRequest $request |
|
| 495 | 501 | */ |
| 496 | 502 | public function setRequest($request) { |
| 497 | 503 | $this->request = $request; |
@@ -273,7 +273,6 @@ discard block |
||
| 273 | 273 | * |
| 274 | 274 | * @deprecated 4.0 Use the "Session.timeout_ips" config setting instead |
| 275 | 275 | * |
| 276 | - * @param array $session_ips Array of IPv4 rules. |
|
| 277 | 276 | */ |
| 278 | 277 | public static function set_timeout_ips($ips) { |
| 279 | 278 | Deprecation::notice('4.0', 'Use the "Session.timeout_ips" config setting instead'); |
@@ -410,6 +409,9 @@ discard block |
||
| 410 | 409 | } |
| 411 | 410 | } |
| 412 | 411 | |
| 412 | + /** |
|
| 413 | + * @param string $name |
|
| 414 | + */ |
|
| 413 | 415 | public function inst_set($name, $val) { |
| 414 | 416 | // Quicker execution path for "."-free names |
| 415 | 417 | if(strpos($name, '.') === false) { |
@@ -458,6 +460,9 @@ discard block |
||
| 458 | 460 | $diffVar[sizeof($var)-1] = $val; |
| 459 | 461 | } |
| 460 | 462 | |
| 463 | + /** |
|
| 464 | + * @param string $name |
|
| 465 | + */ |
|
| 461 | 466 | public function inst_get($name) { |
| 462 | 467 | // Quicker execution path for "."-free names |
| 463 | 468 | if(strpos($name, '.') === false) { |
@@ -219,6 +219,7 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | /** |
| 221 | 221 | * Returns true if the given class implements the given interface |
| 222 | + * @param string $interfaceName |
|
| 222 | 223 | */ |
| 223 | 224 | public static function classImplements($className, $interfaceName) { |
| 224 | 225 | return in_array($className, self::implementorsOf($interfaceName)); |
@@ -269,6 +270,9 @@ discard block |
||
| 269 | 270 | |
| 270 | 271 | private static $method_from_cache = array(); |
| 271 | 272 | |
| 273 | + /** |
|
| 274 | + * @param string $method |
|
| 275 | + */ |
|
| 272 | 276 | public static function has_method_from($class, $method, $compclass) { |
| 273 | 277 | $lClass = strtolower($class); |
| 274 | 278 | $lMethod = strtolower($method); |