@@ -12,6 +12,9 @@ discard block |
||
| 12 | 12 | { |
| 13 | 13 | private static $data = []; |
| 14 | 14 | |
| 15 | + /** |
|
| 16 | + * @param string $key |
|
| 17 | + */ |
|
| 15 | 18 | public static function get($key) |
| 16 | 19 | { |
| 17 | 20 | if (!static::exists($key)) { |
@@ -23,6 +26,9 @@ discard block |
||
| 23 | 26 | return static::$data[$key]; |
| 24 | 27 | } |
| 25 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $key |
|
| 31 | + */ |
|
| 26 | 32 | public static function set($key, $value, $force = false) |
| 27 | 33 | { |
| 28 | 34 | if (!is_object($value)) { |
@@ -54,6 +54,9 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + /** |
|
| 58 | + * @param integer $parent_id |
|
| 59 | + */ |
|
| 57 | 60 | protected function _buildBranch($parent_id, $level = 0) { |
| 58 | 61 | $result = ((($level === 0) && ($this->parent_group_apply_to_root === true)) || ($level > 0)) ? $this->parent_group_start_string : null; |
| 59 | 62 | |
@@ -278,6 +281,10 @@ discard block |
||
| 278 | 281 | $this->parent_end_string = $parent_end_string; |
| 279 | 282 | } |
| 280 | 283 | |
| 284 | + /** |
|
| 285 | + * @param string $parent_group_start_string |
|
| 286 | + * @param string $parent_group_end_string |
|
| 287 | + */ |
|
| 281 | 288 | function setParentGroupString($parent_group_start_string, $parent_group_end_string, $apply_to_root = false) { |
| 282 | 289 | $this->parent_group_start_string = $parent_group_start_string; |
| 283 | 290 | $this->parent_group_end_string = $parent_group_end_string; |
@@ -301,6 +308,9 @@ discard block |
||
| 301 | 308 | } |
| 302 | 309 | } |
| 303 | 310 | |
| 311 | + /** |
|
| 312 | + * @param string $spacer_string |
|
| 313 | + */ |
|
| 304 | 314 | function setSpacerString($spacer_string, $spacer_multiplier = 2) { |
| 305 | 315 | $this->spacer_string = $spacer_string; |
| 306 | 316 | $this->spacer_multiplier = $spacer_multiplier; |
@@ -71,6 +71,9 @@ |
||
| 71 | 71 | return $result; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | + /** |
|
| 75 | + * @param string $pathname |
|
| 76 | + */ |
|
| 74 | 77 | public static function displayPath($pathname) |
| 75 | 78 | { |
| 76 | 79 | return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $pathname); |
@@ -50,6 +50,9 @@ discard block |
||
| 50 | 50 | return false; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | + /** |
|
| 54 | + * @param integer $expire |
|
| 55 | + */ |
|
| 53 | 56 | public function exists($expire = null) |
| 54 | 57 | { |
| 55 | 58 | $filename = static::$path . $this->key . '.cache'; |
@@ -139,6 +142,9 @@ discard block |
||
| 139 | 142 | return static::$path; |
| 140 | 143 | } |
| 141 | 144 | |
| 145 | + /** |
|
| 146 | + * @param string $key |
|
| 147 | + */ |
|
| 142 | 148 | public static function clear($key) |
| 143 | 149 | { |
| 144 | 150 | if (!static::hasSafeName($key)) { |
@@ -37,6 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @param array $parameters url, headers, parameters, method, verify_ssl, cafile, certificate, proxy |
| 40 | + * @return string |
|
| 40 | 41 | */ |
| 41 | 42 | |
| 42 | 43 | public static function getResponse(array $parameters) |
@@ -12,6 +12,9 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | class Hash |
| 14 | 14 | { |
| 15 | + /** |
|
| 16 | + * @param string $plain |
|
| 17 | + */ |
|
| 15 | 18 | public static function encrypt($plain, $algo = null) |
| 16 | 19 | { |
| 17 | 20 | if (!isset($algo) || ($algo == 'default') || ($algo == 'bcrypt')) { |
@@ -53,6 +56,9 @@ discard block |
||
| 53 | 56 | return false; |
| 54 | 57 | } |
| 55 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string $plain |
|
| 61 | + */ |
|
| 56 | 62 | public static function verify($plain, $hash) |
| 57 | 63 | { |
| 58 | 64 | $result = false; |
@@ -128,6 +134,10 @@ discard block |
||
| 128 | 134 | return ''; |
| 129 | 135 | } |
| 130 | 136 | |
| 137 | + /** |
|
| 138 | + * @param integer $min |
|
| 139 | + * @param integer $max |
|
| 140 | + */ |
|
| 131 | 141 | public static function getRandomInt($min = null, $max = null, $secure = true) |
| 132 | 142 | { |
| 133 | 143 | if (!isset($min)) { |
@@ -151,6 +161,9 @@ discard block |
||
| 151 | 161 | return $result; |
| 152 | 162 | } |
| 153 | 163 | |
| 164 | + /** |
|
| 165 | + * @param integer $length |
|
| 166 | + */ |
|
| 154 | 167 | public static function getRandomString($length, $type = 'mixed') |
| 155 | 168 | { |
| 156 | 169 | if (!in_array($type, [ |
@@ -35,6 +35,10 @@ discard block |
||
| 35 | 35 | var $portable_hashes; |
| 36 | 36 | var $random_state; |
| 37 | 37 | |
| 38 | + /** |
|
| 39 | + * @param integer $iteration_count_log2 |
|
| 40 | + * @param boolean $portable_hashes |
|
| 41 | + */ |
|
| 38 | 42 | function __construct($iteration_count_log2, $portable_hashes) |
| 39 | 43 | { |
| 40 | 44 | $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; |
@@ -50,6 +54,9 @@ discard block |
||
| 50 | 54 | $this->random_state .= getmypid(); |
| 51 | 55 | } |
| 52 | 56 | |
| 57 | + /** |
|
| 58 | + * @param integer $count |
|
| 59 | + */ |
|
| 53 | 60 | function get_random_bytes($count) |
| 54 | 61 | { |
| 55 | 62 | $output = ''; |
@@ -84,6 +91,9 @@ discard block |
||
| 84 | 91 | return $output; |
| 85 | 92 | } |
| 86 | 93 | |
| 94 | + /** |
|
| 95 | + * @param integer $count |
|
| 96 | + */ |
|
| 87 | 97 | function encode64($input, $count) |
| 88 | 98 | { |
| 89 | 99 | $output = ''; |
@@ -107,6 +117,9 @@ discard block |
||
| 107 | 117 | return $output; |
| 108 | 118 | } |
| 109 | 119 | |
| 120 | + /** |
|
| 121 | + * @param string $input |
|
| 122 | + */ |
|
| 110 | 123 | function gensalt_private($input) |
| 111 | 124 | { |
| 112 | 125 | $output = '$P$'; |
@@ -155,6 +168,9 @@ discard block |
||
| 155 | 168 | return $output; |
| 156 | 169 | } |
| 157 | 170 | |
| 171 | + /** |
|
| 172 | + * @param string $input |
|
| 173 | + */ |
|
| 158 | 174 | function gensalt_extended($input) |
| 159 | 175 | { |
| 160 | 176 | $count_log2 = min($this->iteration_count_log2 + 8, 24); |
@@ -173,6 +189,9 @@ discard block |
||
| 173 | 189 | return $output; |
| 174 | 190 | } |
| 175 | 191 | |
| 192 | + /** |
|
| 193 | + * @param string $input |
|
| 194 | + */ |
|
| 176 | 195 | function gensalt_blowfish($input) |
| 177 | 196 | { |
| 178 | 197 | # This one needs to use a different order of characters and a |
@@ -221,6 +221,9 @@ discard block |
||
| 221 | 221 | return $image; |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | + /** |
|
| 225 | + * @param integer $len |
|
| 226 | + */ |
|
| 224 | 227 | function tep_break_string($string, $len, $break_char = '-') { |
| 225 | 228 | $l = 0; |
| 226 | 229 | $output = ''; |
@@ -333,6 +336,11 @@ discard block |
||
| 333 | 336 | return $geo_zone_id; |
| 334 | 337 | } |
| 335 | 338 | |
| 339 | + /** |
|
| 340 | + * @param boolean $html |
|
| 341 | + * @param string $boln |
|
| 342 | + * @param string $eoln |
|
| 343 | + */ |
|
| 336 | 344 | function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { |
| 337 | 345 | $Qaddress = Registry::get('Db')->get('address_format', 'address_format', ['address_format_id' => (int)$address_format_id]); |
| 338 | 346 | |
@@ -429,6 +437,9 @@ discard block |
||
| 429 | 437 | return $def_state; |
| 430 | 438 | } |
| 431 | 439 | |
| 440 | + /** |
|
| 441 | + * @param string $params |
|
| 442 | + */ |
|
| 432 | 443 | function tep_get_uprid($prid, $params) { |
| 433 | 444 | $uprid = $prid; |
| 434 | 445 | if ( (is_array($params)) && (!strstr($prid, '{')) ) { |
@@ -729,6 +740,9 @@ discard block |
||
| 729 | 740 | |
| 730 | 741 | //// |
| 731 | 742 | // Sets the status of a banner |
| 743 | + /** |
|
| 744 | + * @param integer $status |
|
| 745 | + */ |
|
| 732 | 746 | function tep_set_banner_status($banners_id, $status) { |
| 733 | 747 | $OSCOM_Db = Registry::get('Db'); |
| 734 | 748 | |
@@ -803,6 +817,9 @@ discard block |
||
| 803 | 817 | |
| 804 | 818 | //// |
| 805 | 819 | // Sets the status of a product on special |
| 820 | + /** |
|
| 821 | + * @param integer $status |
|
| 822 | + */ |
|
| 806 | 823 | function tep_set_specials_status($specials_id, $status) { |
| 807 | 824 | $OSCOM_Db = Registry::get('Db'); |
| 808 | 825 | |
@@ -1252,6 +1269,9 @@ discard block |
||
| 1252 | 1269 | |
| 1253 | 1270 | //// |
| 1254 | 1271 | // Wrapper function for round() for php3 compatibility |
| 1272 | + /** |
|
| 1273 | + * @return double |
|
| 1274 | + */ |
|
| 1255 | 1275 | function tep_round($value, $precision) { |
| 1256 | 1276 | return round($value, $precision); |
| 1257 | 1277 | } |
@@ -79,6 +79,9 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | //// |
| 81 | 81 | // Break a word in a string if it is longer than a specified length ($len) |
| 82 | + /** |
|
| 83 | + * @param integer $len |
|
| 84 | + */ |
|
| 82 | 85 | function tep_break_string($string, $len, $break_char = '-') { |
| 83 | 86 | $l = 0; |
| 84 | 87 | $output = ''; |
@@ -246,6 +249,9 @@ discard block |
||
| 246 | 249 | |
| 247 | 250 | //// |
| 248 | 251 | // Wrapper function for round() |
| 252 | + /** |
|
| 253 | + * @return double |
|
| 254 | + */ |
|
| 249 | 255 | function tep_round($number, $precision) { |
| 250 | 256 | if (strpos($number, '.') && (strlen(substr($number, strpos($number, '.')+1)) > $precision)) { |
| 251 | 257 | $number = substr($number, 0, strpos($number, '.') + 1 + $precision + 1); |
@@ -425,6 +431,11 @@ discard block |
||
| 425 | 431 | //// |
| 426 | 432 | // Return a formatted address |
| 427 | 433 | // TABLES: address_format |
| 434 | + /** |
|
| 435 | + * @param boolean $html |
|
| 436 | + * @param string $boln |
|
| 437 | + * @param string $eoln |
|
| 438 | + */ |
|
| 428 | 439 | function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { |
| 429 | 440 | $OSCOM_Db = Registry::get('Db'); |
| 430 | 441 | |
@@ -918,6 +929,9 @@ discard block |
||
| 918 | 929 | |
| 919 | 930 | //// |
| 920 | 931 | // Return a product ID with attributes |
| 932 | + /** |
|
| 933 | + * @param string $params |
|
| 934 | + */ |
|
| 921 | 935 | function tep_get_uprid($prid, $params) { |
| 922 | 936 | if (is_numeric($prid)) { |
| 923 | 937 | $uprid = (int)$prid; |