@@ -470,11 +470,17 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | protected $extraConfigSources = array(); |
| 472 | 472 | |
| 473 | + /** |
|
| 474 | + * @param string $class |
|
| 475 | + */ |
|
| 473 | 476 | public function extraConfigSourcesChanged($class) { |
| 474 | 477 | unset($this->extraConfigSources[$class]); |
| 475 | 478 | $this->cache->clean("__{$class}"); |
| 476 | 479 | } |
| 477 | 480 | |
| 481 | + /** |
|
| 482 | + * @param integer $sourceOptions |
|
| 483 | + */ |
|
| 478 | 484 | protected function getUncached($class, $name, $sourceOptions, &$result, $suppress, &$tags) { |
| 479 | 485 | $tags[] = "__{$class}"; |
| 480 | 486 | $tags[] = "__{$class}__{$name}"; |
@@ -603,7 +609,7 @@ discard block |
||
| 603 | 609 | * replace the current array value, you'll need to call remove first. |
| 604 | 610 | * |
| 605 | 611 | * @param $class string - The class to update a configuration value for |
| 606 | - * @param $name string - The configuration property name to update |
|
| 612 | + * @param string $name string - The configuration property name to update |
|
| 607 | 613 | * @param $value any - The value to update with |
| 608 | 614 | * |
| 609 | 615 | * Arrays are recursively merged into current configuration as "latest" - for associative arrays the passed value |
@@ -648,15 +654,6 @@ discard block |
||
| 648 | 654 | * |
| 649 | 655 | * @param string $class The class to remove a configuration value from |
| 650 | 656 | * @param string $name The configuration name |
| 651 | - * @param mixed $key An optional key to filter against. |
|
| 652 | - * If referenced config value is an array, only members of that array that match this key will be removed |
|
| 653 | - * Must also match value if provided to be removed |
|
| 654 | - * @param mixed $value And optional value to filter against. |
|
| 655 | - * If referenced config value is an array, only members of that array that match this value will be removed |
|
| 656 | - * If referenced config value is not an array, value will be removed only if it matches this argument |
|
| 657 | - * Must also match key if provided and referenced config value is an array to be removed |
|
| 658 | - * |
|
| 659 | - * Matching is always by "==", not by "===" |
|
| 660 | 657 | */ |
| 661 | 658 | public function remove($class, $name /*,$key = null*/ /*,$value = null*/) { |
| 662 | 659 | $argc = func_num_args(); |
@@ -735,6 +732,10 @@ discard block |
||
| 735 | 732 | $this->cache = $cloned; |
| 736 | 733 | } |
| 737 | 734 | |
| 735 | + /** |
|
| 736 | + * @param integer $key |
|
| 737 | + * @param integer $val |
|
| 738 | + */ |
|
| 738 | 739 | public function set($key, $val, $tags = array()) { |
| 739 | 740 | // Find an index to set at |
| 740 | 741 | $replacing = null; |
@@ -775,7 +776,7 @@ discard block |
||
| 775 | 776 | * For a more robust cache checking, use {@link checkAndGet()} |
| 776 | 777 | * |
| 777 | 778 | * @param string $key The cache key |
| 778 | - * @return variant Cached value, if hit. False otherwise |
|
| 779 | + * @return boolean Cached value, if hit. False otherwise |
|
| 779 | 780 | */ |
| 780 | 781 | public function get($key) { |
| 781 | 782 | list($hit, $result) = $this->checkAndGet($key); |
@@ -803,6 +804,9 @@ discard block |
||
| 803 | 804 | } |
| 804 | 805 | } |
| 805 | 806 | |
| 807 | + /** |
|
| 808 | + * @param string $tag |
|
| 809 | + */ |
|
| 806 | 810 | public function clean($tag = null) { |
| 807 | 811 | if ($tag) { |
| 808 | 812 | foreach ($this->cache as $i => $v) { |
@@ -841,6 +845,10 @@ discard block |
||
| 841 | 845 | $this->cache = array(); |
| 842 | 846 | } |
| 843 | 847 | |
| 848 | + /** |
|
| 849 | + * @param integer $key |
|
| 850 | + * @param integer $val |
|
| 851 | + */ |
|
| 844 | 852 | public function set($key, $val, $tags = array()) { |
| 845 | 853 | foreach($tags as $t) { |
| 846 | 854 | if(!isset($this->tags[$t])) { |
@@ -859,6 +867,11 @@ discard block |
||
| 859 | 867 | return $this->miss ? ($this->hit / $this->miss) : 0; |
| 860 | 868 | } |
| 861 | 869 | |
| 870 | + /** |
|
| 871 | + * @param integer $key |
|
| 872 | + * |
|
| 873 | + * @return boolean |
|
| 874 | + */ |
|
| 862 | 875 | public function get($key) { |
| 863 | 876 | list($hit, $result) = $this->checkAndGet($key); |
| 864 | 877 | return $hit ? $result : false; |
@@ -878,6 +891,9 @@ discard block |
||
| 878 | 891 | } |
| 879 | 892 | } |
| 880 | 893 | |
| 894 | + /** |
|
| 895 | + * @param string $tag |
|
| 896 | + */ |
|
| 881 | 897 | public function clean($tag = null) { |
| 882 | 898 | if($tag) { |
| 883 | 899 | if(isset($this->tags[$tag])) { |
@@ -7,9 +7,27 @@ |
||
| 7 | 7 | * @subpackage manifest |
| 8 | 8 | */ |
| 9 | 9 | interface ManifestCache { |
| 10 | + |
|
| 11 | + /** |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 10 | 14 | public function __construct($name); |
| 15 | + |
|
| 16 | + /** |
|
| 17 | + * @param string $key |
|
| 18 | + */ |
|
| 11 | 19 | public function load($key); |
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * @param string $key |
|
| 23 | + * |
|
| 24 | + * @return void |
|
| 25 | + */ |
|
| 12 | 26 | public function save($data, $key); |
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * @return void |
|
| 30 | + */ |
|
| 13 | 31 | public function clear(); |
| 14 | 32 | } |
| 15 | 33 | |
@@ -30,6 +30,9 @@ |
||
| 30 | 30 | self::$instance = $instance; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | + /** |
|
| 34 | + * @param string $base |
|
| 35 | + */ |
|
| 33 | 36 | public function __construct($base = null) { |
| 34 | 37 | $this->base = $base ? $base : BASE_PATH; |
| 35 | 38 | } |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | /** |
| 74 | 74 | * @param array |
| 75 | 75 | * |
| 76 | - * @return HTML |
|
| 76 | + * @return DBField |
|
| 77 | 77 | */ |
| 78 | 78 | public function getAttributesHTML($attrs = null) { |
| 79 | 79 | $exclude = (is_string($attrs)) ? func_get_args() : null; |
@@ -64,6 +64,10 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | protected $config; |
| 66 | 66 | |
| 67 | + /** |
|
| 68 | + * @param string $name |
|
| 69 | + * @param string $title |
|
| 70 | + */ |
|
| 67 | 71 | public function __construct($name, $title = null, $value = ""){ |
| 68 | 72 | $this->config = $this->config()->default_config; |
| 69 | 73 | |
@@ -74,6 +78,9 @@ discard block |
||
| 74 | 78 | parent::__construct($name, $title, $value); |
| 75 | 79 | } |
| 76 | 80 | |
| 81 | + /** |
|
| 82 | + * @param Form $form |
|
| 83 | + */ |
|
| 77 | 84 | public function setForm($form) { |
| 78 | 85 | parent::setForm($form); |
| 79 | 86 | |
@@ -84,6 +91,9 @@ discard block |
||
| 84 | 91 | return $this; |
| 85 | 92 | } |
| 86 | 93 | |
| 94 | + /** |
|
| 95 | + * @param string $name |
|
| 96 | + */ |
|
| 87 | 97 | public function setName($name) { |
| 88 | 98 | parent::setName($name); |
| 89 | 99 | |
@@ -96,7 +106,7 @@ discard block |
||
| 96 | 106 | |
| 97 | 107 | /** |
| 98 | 108 | * @param array $properties |
| 99 | - * @return string |
|
| 109 | + * @return DBHTMLText |
|
| 100 | 110 | */ |
| 101 | 111 | public function FieldHolder($properties = array()) { |
| 102 | 112 | $config = array( |
@@ -110,7 +120,7 @@ discard block |
||
| 110 | 120 | |
| 111 | 121 | /** |
| 112 | 122 | * @param array $properties |
| 113 | - * @return string |
|
| 123 | + * @return DBHTMLText |
|
| 114 | 124 | */ |
| 115 | 125 | public function Field($properties = array()) { |
| 116 | 126 | Requirements::css(FRAMEWORK_DIR . '/client/dist/styles/DatetimeField.css'); |
@@ -223,6 +233,9 @@ discard block |
||
| 223 | 233 | return $this; |
| 224 | 234 | } |
| 225 | 235 | |
| 236 | + /** |
|
| 237 | + * @param boolean $bool |
|
| 238 | + */ |
|
| 226 | 239 | public function setReadonly($bool) { |
| 227 | 240 | parent::setReadonly($bool); |
| 228 | 241 | $this->dateField->setReadonly($bool); |
@@ -240,6 +253,7 @@ discard block |
||
| 240 | 253 | |
| 241 | 254 | /** |
| 242 | 255 | * @param FormField |
| 256 | + * @param DateField $field |
|
| 243 | 257 | */ |
| 244 | 258 | public function setDateField($field) { |
| 245 | 259 | $expected = $this->getName() . '[date]'; |
@@ -265,6 +279,7 @@ discard block |
||
| 265 | 279 | |
| 266 | 280 | /** |
| 267 | 281 | * @param FormField |
| 282 | + * @param TimeField $field |
|
| 268 | 283 | */ |
| 269 | 284 | public function setTimeField($field) { |
| 270 | 285 | $expected = $this->getName() . '[time]'; |
@@ -312,7 +327,7 @@ discard block |
||
| 312 | 327 | * to set field-specific config options. |
| 313 | 328 | * |
| 314 | 329 | * @param string $name |
| 315 | - * @param mixed $val |
|
| 330 | + * @param string $val |
|
| 316 | 331 | */ |
| 317 | 332 | public function setConfig($name, $val) { |
| 318 | 333 | $this->config[$name] = $val; |
@@ -330,7 +345,7 @@ discard block |
||
| 330 | 345 | * to get field-specific config options. |
| 331 | 346 | * |
| 332 | 347 | * @param String $name Optional, returns the whole configuration array if empty |
| 333 | - * @return mixed |
|
| 348 | + * @return string|null |
|
| 334 | 349 | */ |
| 335 | 350 | public function getConfig($name = null) { |
| 336 | 351 | if($name) { |
@@ -340,6 +355,9 @@ discard block |
||
| 340 | 355 | } |
| 341 | 356 | } |
| 342 | 357 | |
| 358 | + /** |
|
| 359 | + * @param RequiredFields $validator |
|
| 360 | + */ |
|
| 343 | 361 | public function validate($validator) { |
| 344 | 362 | $dateValid = $this->dateField->validate($validator); |
| 345 | 363 | $timeValid = $this->timeField->validate($validator); |
@@ -52,6 +52,10 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | protected $schemaDataType = FormField::SCHEMA_DATA_TYPE_TIME; |
| 54 | 54 | |
| 55 | + /** |
|
| 56 | + * @param string $name |
|
| 57 | + * @param string $title |
|
| 58 | + */ |
|
| 55 | 59 | public function __construct($name, $title = null, $value = ""){ |
| 56 | 60 | if(!$this->locale) { |
| 57 | 61 | $this->locale = i18n::get_locale(); |
@@ -213,7 +217,7 @@ discard block |
||
| 213 | 217 | |
| 214 | 218 | /** |
| 215 | 219 | * @param String $name Optional, returns the whole configuration array if empty |
| 216 | - * @return mixed|array |
|
| 220 | + * @return string|null |
|
| 217 | 221 | */ |
| 218 | 222 | public function getConfig($name = null) { |
| 219 | 223 | if($name) { |
@@ -230,6 +234,9 @@ discard block |
||
| 230 | 234 | return $this->castedCopy('TimeField_Readonly'); |
| 231 | 235 | } |
| 232 | 236 | |
| 237 | + /** |
|
| 238 | + * @param string $class |
|
| 239 | + */ |
|
| 233 | 240 | public function castedCopy($class) { |
| 234 | 241 | $copy = parent::castedCopy($class); |
| 235 | 242 | if($copy->hasMethod('setConfig')) { |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | /** |
| 208 | 208 | * Gets the combined configuration of all LeafAndMain subclasses required by the client app. |
| 209 | 209 | * |
| 210 | - * @return array |
|
| 210 | + * @return string |
|
| 211 | 211 | * |
| 212 | 212 | * WARNING: Experimental API |
| 213 | 213 | */ |
@@ -639,6 +639,9 @@ discard block |
||
| 639 | 639 | } |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | + /** |
|
| 643 | + * @param SS_HTTPRequest $request |
|
| 644 | + */ |
|
| 642 | 645 | public function index($request) { |
| 643 | 646 | return $this->getResponseNegotiator()->respond($request); |
| 644 | 647 | } |
@@ -1953,7 +1956,7 @@ discard block |
||
| 1953 | 1956 | } |
| 1954 | 1957 | |
| 1955 | 1958 | /** |
| 1956 | - * @return String |
|
| 1959 | + * @return DBField |
|
| 1957 | 1960 | */ |
| 1958 | 1961 | public function Locale() { |
| 1959 | 1962 | return DBField::create_field('Locale', i18n::get_locale()); |
@@ -2119,6 +2122,9 @@ discard block |
||
| 2119 | 2122 | return (parent::isFinished() || $this->isFinished); |
| 2120 | 2123 | } |
| 2121 | 2124 | |
| 2125 | + /** |
|
| 2126 | + * @param boolean $bool |
|
| 2127 | + */ |
|
| 2122 | 2128 | public function setIsFinished($bool) { |
| 2123 | 2129 | $this->isFinished = $bool; |
| 2124 | 2130 | } |
@@ -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 '' |
@@ -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) { |