@@ -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'; |
@@ -53,7 +53,6 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * Load app config |
| 55 | 55 | * |
| 56 | - * @param string $site_name |
|
| 57 | 56 | * @return array |
| 58 | 57 | */ |
| 59 | 58 | public static function app($app = false) |
@@ -74,7 +73,6 @@ discard block |
||
| 74 | 73 | /** |
| 75 | 74 | * Load share config |
| 76 | 75 | * |
| 77 | - * @param string $site_name |
|
| 78 | 76 | * @return array |
| 79 | 77 | */ |
| 80 | 78 | public static function share($module = '') |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | * |
| 44 | 44 | * @param string $eventName |
| 45 | 45 | * @param string $listenCode |
| 46 | - * @param array|function $callback |
|
| 46 | + * @param Closure $callback |
|
| 47 | 47 | * @param boolean $save |
| 48 | 48 | */ |
| 49 | 49 | function listen($eventName, $listenCode, $callback, $save = false) |
@@ -90,6 +90,9 @@ |
||
| 90 | 90 | echo '<tr><th>Memory</th><th>' . $this->convertSize(memory_get_peak_usage()) . ' of ' . ini_get('memory_limit') . '</th></tr></table></div>'; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | + /** |
|
| 94 | + * @param integer $size |
|
| 95 | + */ |
|
| 93 | 96 | function convertSize($size) |
| 94 | 97 | { |
| 95 | 98 | |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | echo "<tr><td>{$log['name']}</td><td" . (round(($log['end'] - $log['start']), 5) > 0.1 ? ' class ="danger"' : '') . ">" . round(($log['end'] - $log['start']), 5) . "</td></tr>"; |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | - echo '<tr><th>Summary</th><th>' . round(( microtime(true) - $this->startTime), 5) . '</th></tr>'; |
|
| 89 | + echo '<tr><th>Summary</th><th>' . round((microtime(true) - $this->startTime), 5) . '</th></tr>'; |
|
| 90 | 90 | echo '<tr><th>Memory</th><th>' . $this->convertSize(memory_get_peak_usage()) . ' of ' . ini_get('memory_limit') . '</th></tr></table></div>'; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | * Check model relations path and load need relations |
| 313 | 313 | * |
| 314 | 314 | * @param string $col |
| 315 | - * @param strig $rootModel |
|
| 315 | + * @param string $rootModel |
|
| 316 | 316 | */ |
| 317 | 317 | static function checkForJoin(&$col, $rootModel) |
| 318 | 318 | { |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | /** |
| 357 | 357 | * Information extractor for col relations path |
| 358 | 358 | * |
| 359 | - * @param string|array $info |
|
| 359 | + * @param string $info |
|
| 360 | 360 | * @return array |
| 361 | 361 | */ |
| 362 | 362 | private static function parseColRecursion($info) |
@@ -428,6 +428,9 @@ discard block |
||
| 428 | 428 | return Model::$cols[static::table()]; |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | + /** |
|
| 432 | + * @param string $colName |
|
| 433 | + */ |
|
| 431 | 434 | static function genColParams($colName) |
| 432 | 435 | { |
| 433 | 436 | if (empty(static::$cols[$colName]) || static::$storage['type'] == 'moduleConfig') { |
@@ -481,7 +484,7 @@ discard block |
||
| 481 | 484 | * Create new col in data base |
| 482 | 485 | * |
| 483 | 486 | * @param string $colName |
| 484 | - * @return boolean |
|
| 487 | + * @return false|null |
|
| 485 | 488 | */ |
| 486 | 489 | static function createCol($colName) |
| 487 | 490 | { |
@@ -566,7 +569,7 @@ discard block |
||
| 566 | 569 | /** |
| 567 | 570 | * return relations list |
| 568 | 571 | * |
| 569 | - * @return array |
|
| 572 | + * @return string |
|
| 570 | 573 | */ |
| 571 | 574 | static function relations() |
| 572 | 575 | { |
@@ -1062,7 +1065,7 @@ discard block |
||
| 1062 | 1065 | * |
| 1063 | 1066 | * @param array $params |
| 1064 | 1067 | * @param array $where |
| 1065 | - * @return boolean |
|
| 1068 | + * @return false|null |
|
| 1066 | 1069 | */ |
| 1067 | 1070 | static function update($params, $where = []) |
| 1068 | 1071 | { |
@@ -1035,7 +1035,7 @@ |
||
| 1035 | 1035 | } else { |
| 1036 | 1036 | $cols .= '*'; |
| 1037 | 1037 | } |
| 1038 | - $cols .=') as `count`' . (!empty($options['cols']) ? ',' . $options['cols'] : ''); |
|
| 1038 | + $cols .= ') as `count`' . (!empty($options['cols']) ? ',' . $options['cols'] : ''); |
|
| 1039 | 1039 | App::$cur->db->cols = $cols; |
| 1040 | 1040 | if (!empty($options['group'])) { |
| 1041 | 1041 | App::$cur->db->group($options['group']); |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | * Get all posible directorys for module files |
| 82 | 82 | * |
| 83 | 83 | * @param string $moduleName |
| 84 | - * @return array |
|
| 84 | + * @return string |
|
| 85 | 85 | */ |
| 86 | 86 | static function getModulePaths($moduleName) |
| 87 | 87 | { |
@@ -82,9 +82,9 @@ |
||
| 82 | 82 | /** |
| 83 | 83 | * Return posible paths for class path |
| 84 | 84 | * |
| 85 | - * @param type $code |
|
| 86 | - * @param type $folder |
|
| 87 | - * @param type $classPath |
|
| 85 | + * @param string $code |
|
| 86 | + * @param string $folder |
|
| 87 | + * @param string $classPath |
|
| 88 | 88 | * @return string |
| 89 | 89 | */ |
| 90 | 90 | static function genFolderPaths($code, $folder, $classPath) |
@@ -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) |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | static function uriParse($uri) |
| 39 | 39 | { |
| 40 | 40 | $answerPos = strpos($uri, '?'); |
| 41 | - $params = array_slice(explode('/', substr($uri, 0, $answerPos ? $answerPos : strlen($uri) )), 1); |
|
| 41 | + $params = array_slice(explode('/', substr($uri, 0, $answerPos ? $answerPos : strlen($uri))), 1); |
|
| 42 | 42 | |
| 43 | 43 | foreach ($params as $key => $param) { |
| 44 | 44 | if ($param != '') { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | static function resizeImage($img_path, $max_width = 1000, $max_height = 1000, $crop = false, $pos = 'center') |
| 86 | 86 | { |
| 87 | 87 | ini_set("gd.jpeg_ignore_warning", 1); |
| 88 | - list( $img_width, $img_height, $img_type, $img_tag ) = getimagesize($img_path); |
|
| 88 | + list($img_width, $img_height, $img_type, $img_tag) = getimagesize($img_path); |
|
| 89 | 89 | switch ($img_type) { |
| 90 | 90 | case 1: |
| 91 | 91 | $img_type = 'gif'; |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | if ($crop === true || $crop == 'q') { |
| 110 | 110 | if ($img_width > $img_height) { |
| 111 | - $imgX = floor(( $img_width - $img_height ) / 2); |
|
| 111 | + $imgX = floor(($img_width - $img_height) / 2); |
|
| 112 | 112 | $imgY = 0; |
| 113 | 113 | $img_width = $img_height; |
| 114 | 114 | $new_width = $max_width; |
| 115 | 115 | $new_height = $max_height; |
| 116 | 116 | } else { |
| 117 | 117 | $imgX = 0; |
| 118 | - $imgY = floor(( $img_height - $img_width ) / 2); |
|
| 118 | + $imgY = floor(($img_height - $img_width) / 2); |
|
| 119 | 119 | $img_height = $img_width; |
| 120 | 120 | $new_width = $max_width; |
| 121 | 121 | $new_height = $max_height; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $new_width = $max_width; |
| 137 | 137 | $new_height = $max_height; |
| 138 | 138 | //Находим начальные координаты (центрируем новое изображение) |
| 139 | - $imgX = (int) (($ow / 2) - ($img_width / 2) ); |
|
| 139 | + $imgX = (int) (($ow / 2) - ($img_width / 2)); |
|
| 140 | 140 | if ($pos == 'center') { |
| 141 | 141 | $imgY = (int) (($oh / 2) - ($img_height / 2)); |
| 142 | 142 | } else { |
@@ -14,6 +14,9 @@ |
||
| 14 | 14 | public $model = null; |
| 15 | 15 | public $type = 'string'; |
| 16 | 16 | |
| 17 | + /** |
|
| 18 | + * @param Model $model |
|
| 19 | + */ |
|
| 17 | 20 | function __construct($model, $key) |
| 18 | 21 | { |
| 19 | 22 | $this->model = $model; |