@@ -58,6 +58,10 @@ |
||
| 58 | 58 | self::command('install', false, $path); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + /** |
|
| 62 | + * @param string $command |
|
| 63 | + * @param string $path |
|
| 64 | + */ |
|
| 61 | 65 | static function command($command, $needOutput = true, $path = null) |
| 62 | 66 | { |
| 63 | 67 | include_once 'composer/vendor/autoload.php'; |
@@ -216,6 +216,7 @@ |
||
| 216 | 216 | * @param $number Integer Число на основе которого нужно сформировать окончание |
| 217 | 217 | * @param $endingsArray Array Массив слов или окончаний для чисел (1, 4, 5), |
| 218 | 218 | * например array('яблоко', 'яблока', 'яблок') |
| 219 | + * @param string[] $endingArray |
|
| 219 | 220 | * @return String |
| 220 | 221 | */ |
| 221 | 222 | static function getNumEnding($number, $endingArray) |
@@ -29,6 +29,9 @@ discard block |
||
| 29 | 29 | public $params = []; |
| 30 | 30 | public $distinct = false; |
| 31 | 31 | |
| 32 | + /** |
|
| 33 | + * @param $instance |
|
| 34 | + */ |
|
| 32 | 35 | function __construct($instance = null) |
| 33 | 36 | { |
| 34 | 37 | if (!$instance) { |
@@ -47,6 +50,9 @@ discard block |
||
| 47 | 50 | return $this->curInstance->pdo->lastInsertId(); |
| 48 | 51 | } |
| 49 | 52 | |
| 53 | + /** |
|
| 54 | + * @param string $table |
|
| 55 | + */ |
|
| 50 | 56 | public function select($table) |
| 51 | 57 | { |
| 52 | 58 | $this->operation = 'SELECT'; |
@@ -45,6 +45,10 @@ |
||
| 45 | 45 | return $modelCols; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | + /** |
|
| 49 | + * @param string $colPrefix |
|
| 50 | + * @param string $tableName |
|
| 51 | + */ |
|
| 48 | 52 | function parseColsForTable($cols, $colPrefix, $tableName) |
| 49 | 53 | { |
| 50 | 54 | |
@@ -23,6 +23,9 @@ |
||
| 23 | 23 | public $attributes = []; |
| 24 | 24 | public $indexCol = null; |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param string[] $cols |
|
| 28 | + */ |
|
| 26 | 29 | function setCols($cols) |
| 27 | 30 | { |
| 28 | 31 | $this->cols = $cols; |
@@ -92,6 +92,9 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | + /** |
|
| 96 | + * @param string $user_mail |
|
| 97 | + */ |
|
| 95 | 98 | function passre($user_mail) |
| 96 | 99 | { |
| 97 | 100 | $user = $this->get($user_mail, 'mail'); |
@@ -312,6 +315,9 @@ discard block |
||
| 312 | 315 | return $user->id; |
| 313 | 316 | } |
| 314 | 317 | |
| 318 | + /** |
|
| 319 | + * @param string $pass |
|
| 320 | + */ |
|
| 315 | 321 | function hashpass($pass) |
| 316 | 322 | { |
| 317 | 323 | return password_hash($pass, PASSWORD_DEFAULT); |
@@ -147,6 +147,9 @@ discard block |
||
| 147 | 147 | return $result[1]; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | + /** |
|
| 151 | + * @param string $source |
|
| 152 | + */ |
|
| 150 | 153 | function parseSource($source) |
| 151 | 154 | { |
| 152 | 155 | $tags = $this->parseRaw($source); |
@@ -190,6 +193,9 @@ discard block |
||
| 190 | 193 | return substr($source, ( $pos + strlen($rawTag) + 2)); |
| 191 | 194 | } |
| 192 | 195 | |
| 196 | + /** |
|
| 197 | + * @param string $type |
|
| 198 | + */ |
|
| 193 | 199 | function getHref($type, $params) |
| 194 | 200 | { |
| 195 | 201 | $href = ''; |
@@ -531,6 +537,9 @@ discard block |
||
| 531 | 537 | echo round(( microtime(true) - INJI_TIME_START), 4); |
| 532 | 538 | } |
| 533 | 539 | |
| 540 | + /** |
|
| 541 | + * @param string $type |
|
| 542 | + */ |
|
| 534 | 543 | function customAsset($type, $asset, $lib = false) |
| 535 | 544 | { |
| 536 | 545 | if (!$lib) { |
@@ -549,6 +558,9 @@ discard block |
||
| 549 | 558 | } |
| 550 | 559 | } |
| 551 | 560 | |
| 561 | + /** |
|
| 562 | + * @param string $lineParams |
|
| 563 | + */ |
|
| 552 | 564 | function widget($_widgetName, $_params = [], $lineParams = null) |
| 553 | 565 | { |
| 554 | 566 | $_paths = $this->getWidgetPaths($_widgetName); |
@@ -31,6 +31,9 @@ |
||
| 31 | 31 | return $return; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | + /** |
|
| 35 | + * @param string $path |
|
| 36 | + */ |
|
| 34 | 37 | static function parseClass($path) |
| 35 | 38 | { |
| 36 | 39 | $code = file_get_contents($path); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * the constructor |
| 90 | 90 | * |
| 91 | 91 | * @param array $options |
| 92 | - * @return boolean |
|
| 92 | + * @return boolean|null |
|
| 93 | 93 | * @since 0.5.2 |
| 94 | 94 | */ |
| 95 | 95 | public function __construct($options = false) |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | /** |
| 389 | 389 | * Use this method to get the last error ocurred |
| 390 | 390 | * @param void |
| 391 | - * @return string The last error, that occured |
|
| 391 | + * @return boolean The last error, that occured |
|
| 392 | 392 | */ |
| 393 | 393 | public function get_last_error() |
| 394 | 394 | { |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | /** |
| 399 | 399 | * The actual decoding algorithm |
| 400 | 400 | * @param string |
| 401 | - * @return mixed |
|
| 401 | + * @return false|string |
|
| 402 | 402 | */ |
| 403 | 403 | protected function _decode($encoded) |
| 404 | 404 | { |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | /** |
| 456 | 456 | * The actual encoding algorithm |
| 457 | 457 | * @param string |
| 458 | - * @return mixed |
|
| 458 | + * @return false|string |
|
| 459 | 459 | */ |
| 460 | 460 | protected function _encode($decoded) |
| 461 | 461 | { |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | * Decomposes a Hangul syllable |
| 676 | 676 | * (see http://www.unicode.org/unicode/reports/tr15/#Hangul |
| 677 | 677 | * @param integer 32bit UCS4 code point |
| 678 | - * @return array Either Hangul Syllable decomposed or original 32bit value as one value array |
|
| 678 | + * @return integer[] Either Hangul Syllable decomposed or original 32bit value as one value array |
|
| 679 | 679 | */ |
| 680 | 680 | protected function _hangul_decompose($char) |
| 681 | 681 | { |
@@ -129,41 +129,41 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | foreach ($option as $k => $v) { |
| 131 | 131 | switch ($k) { |
| 132 | - case 'encoding': |
|
| 133 | - switch ($v) { |
|
| 134 | - case 'utf8': |
|
| 135 | - case 'ucs4_string': |
|
| 136 | - case 'ucs4_array': |
|
| 137 | - $this->_api_encoding = $v; |
|
| 132 | + case 'encoding': |
|
| 133 | + switch ($v) { |
|
| 134 | + case 'utf8': |
|
| 135 | + case 'ucs4_string': |
|
| 136 | + case 'ucs4_array': |
|
| 137 | + $this->_api_encoding = $v; |
|
| 138 | + break; |
|
| 139 | + default: |
|
| 140 | + $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 141 | + return false; |
|
| 142 | + } |
|
| 143 | + break; |
|
| 144 | + case 'overlong': |
|
| 145 | + $this->_allow_overlong = ($v) ? true : false; |
|
| 146 | + break; |
|
| 147 | + case 'strict': |
|
| 148 | + $this->_strict_mode = ($v) ? true : false; |
|
| 149 | + break; |
|
| 150 | + case 'idn_version': |
|
| 151 | + if (in_array($v, array('2003', '2008'))) { |
|
| 152 | + $this->_idn_version = $v; |
|
| 153 | + } else { |
|
| 154 | + $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 155 | + } |
|
| 156 | + break; |
|
| 157 | + case 'encode_german_sz': // Deprecated |
|
| 158 | + if (!$v) { |
|
| 159 | + self::$NP['replacemaps'][0xDF] = array(0x73, 0x73); |
|
| 160 | + } else { |
|
| 161 | + unset(self::$NP['replacemaps'][0xDF]); |
|
| 162 | + } |
|
| 138 | 163 | break; |
| 139 | 164 | default: |
| 140 | - $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 165 | + $this->_error('Set Parameter: Unknown option '.$k); |
|
| 141 | 166 | return false; |
| 142 | - } |
|
| 143 | - break; |
|
| 144 | - case 'overlong': |
|
| 145 | - $this->_allow_overlong = ($v) ? true : false; |
|
| 146 | - break; |
|
| 147 | - case 'strict': |
|
| 148 | - $this->_strict_mode = ($v) ? true : false; |
|
| 149 | - break; |
|
| 150 | - case 'idn_version': |
|
| 151 | - if (in_array($v, array('2003', '2008'))) { |
|
| 152 | - $this->_idn_version = $v; |
|
| 153 | - } else { |
|
| 154 | - $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 155 | - } |
|
| 156 | - break; |
|
| 157 | - case 'encode_german_sz': // Deprecated |
|
| 158 | - if (!$v) { |
|
| 159 | - self::$NP['replacemaps'][0xDF] = array(0x73, 0x73); |
|
| 160 | - } else { |
|
| 161 | - unset(self::$NP['replacemaps'][0xDF]); |
|
| 162 | - } |
|
| 163 | - break; |
|
| 164 | - default: |
|
| 165 | - $this->_error('Set Parameter: Unknown option '.$k); |
|
| 166 | - return false; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | return true; |
@@ -180,13 +180,13 @@ discard block |
||
| 180 | 180 | // Optionally set |
| 181 | 181 | if ($one_time_encoding) { |
| 182 | 182 | switch ($one_time_encoding) { |
| 183 | - case 'utf8': |
|
| 184 | - case 'ucs4_string': |
|
| 185 | - case 'ucs4_array': |
|
| 186 | - break; |
|
| 187 | - default: |
|
| 188 | - $this->_error('Unknown encoding '.$one_time_encoding); |
|
| 189 | - return false; |
|
| 183 | + case 'utf8': |
|
| 184 | + case 'ucs4_string': |
|
| 185 | + case 'ucs4_array': |
|
| 186 | + break; |
|
| 187 | + default: |
|
| 188 | + $this->_error('Unknown encoding '.$one_time_encoding); |
|
| 189 | + return false; |
|
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | // Make sure to drop any newline characters around |
@@ -255,18 +255,18 @@ discard block |
||
| 255 | 255 | // The output is UTF-8 by default, other output formats need conversion here |
| 256 | 256 | // If one time encoding is given, use this, else the objects property |
| 257 | 257 | switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { |
| 258 | - case 'utf8': |
|
| 259 | - return $return; |
|
| 260 | - break; |
|
| 261 | - case 'ucs4_string': |
|
| 262 | - return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); |
|
| 263 | - break; |
|
| 264 | - case 'ucs4_array': |
|
| 265 | - return $this->_utf8_to_ucs4($return); |
|
| 266 | - break; |
|
| 267 | - default: |
|
| 268 | - $this->_error('Unsupported output format'); |
|
| 269 | - return false; |
|
| 258 | + case 'utf8': |
|
| 259 | + return $return; |
|
| 260 | + break; |
|
| 261 | + case 'ucs4_string': |
|
| 262 | + return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); |
|
| 263 | + break; |
|
| 264 | + case 'ucs4_array': |
|
| 265 | + return $this->_utf8_to_ucs4($return); |
|
| 266 | + break; |
|
| 267 | + default: |
|
| 268 | + $this->_error('Unsupported output format'); |
|
| 269 | + return false; |
|
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
@@ -281,16 +281,16 @@ discard block |
||
| 281 | 281 | // Forcing conversion of input to UCS4 array |
| 282 | 282 | // If one time encoding is given, use this, else the objects property |
| 283 | 283 | switch ($one_time_encoding ? $one_time_encoding : $this->_api_encoding) { |
| 284 | - case 'utf8': |
|
| 285 | - $decoded = $this->_utf8_to_ucs4($decoded); |
|
| 286 | - break; |
|
| 287 | - case 'ucs4_string': |
|
| 288 | - $decoded = $this->_ucs4_string_to_ucs4($decoded); |
|
| 289 | - case 'ucs4_array': |
|
| 290 | - break; |
|
| 291 | - default: |
|
| 292 | - $this->_error('Unsupported input format: '.($one_time_encoding ? $one_time_encoding : $this->_api_encoding)); |
|
| 293 | - return false; |
|
| 284 | + case 'utf8': |
|
| 285 | + $decoded = $this->_utf8_to_ucs4($decoded); |
|
| 286 | + break; |
|
| 287 | + case 'ucs4_string': |
|
| 288 | + $decoded = $this->_ucs4_string_to_ucs4($decoded); |
|
| 289 | + case 'ucs4_array': |
|
| 290 | + break; |
|
| 291 | + default: |
|
| 292 | + $this->_error('Unsupported input format: '.($one_time_encoding ? $one_time_encoding : $this->_api_encoding)); |
|
| 293 | + return false; |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | // No input, no output, what else did you expect? |
@@ -303,35 +303,35 @@ discard block |
||
| 303 | 303 | foreach ($decoded as $k => $v) { |
| 304 | 304 | // Make sure to use just the plain dot |
| 305 | 305 | switch($v) { |
| 306 | - case 0x3002: |
|
| 307 | - case 0xFF0E: |
|
| 308 | - case 0xFF61: |
|
| 309 | - $decoded[$k] = 0x2E; |
|
| 310 | - // Right, no break here, the above are converted to dots anyway |
|
| 311 | - // Stumbling across an anchoring character |
|
| 312 | - case 0x2E: |
|
| 313 | - case 0x2F: |
|
| 314 | - case 0x3A: |
|
| 315 | - case 0x3F: |
|
| 316 | - case 0x40: |
|
| 317 | - // Neither email addresses nor URLs allowed in strict mode |
|
| 318 | - if ($this->_strict_mode) { |
|
| 319 | - $this->_error('Neither email addresses nor URLs are allowed in strict mode.'); |
|
| 320 | - return false; |
|
| 321 | - } else { |
|
| 322 | - // Skip first char |
|
| 323 | - if ($k) { |
|
| 324 | - $encoded = ''; |
|
| 325 | - $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
| 326 | - if ($encoded) { |
|
| 327 | - $output .= $encoded; |
|
| 328 | - } else { |
|
| 329 | - $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
| 306 | + case 0x3002: |
|
| 307 | + case 0xFF0E: |
|
| 308 | + case 0xFF61: |
|
| 309 | + $decoded[$k] = 0x2E; |
|
| 310 | + // Right, no break here, the above are converted to dots anyway |
|
| 311 | + // Stumbling across an anchoring character |
|
| 312 | + case 0x2E: |
|
| 313 | + case 0x2F: |
|
| 314 | + case 0x3A: |
|
| 315 | + case 0x3F: |
|
| 316 | + case 0x40: |
|
| 317 | + // Neither email addresses nor URLs allowed in strict mode |
|
| 318 | + if ($this->_strict_mode) { |
|
| 319 | + $this->_error('Neither email addresses nor URLs are allowed in strict mode.'); |
|
| 320 | + return false; |
|
| 321 | + } else { |
|
| 322 | + // Skip first char |
|
| 323 | + if ($k) { |
|
| 324 | + $encoded = ''; |
|
| 325 | + $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
| 326 | + if ($encoded) { |
|
| 327 | + $output .= $encoded; |
|
| 328 | + } else { |
|
| 329 | + $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
| 330 | + } |
|
| 331 | + $output .= chr($decoded[$k]); |
|
| 330 | 332 | } |
| 331 | - $output .= chr($decoded[$k]); |
|
| 333 | + $last_begin = $k + 1; |
|
| 332 | 334 | } |
| 333 | - $last_begin = $k + 1; |
|
| 334 | - } |
|
| 335 | 335 | } |
| 336 | 336 | } |
| 337 | 337 | // Catch the rest of the string |