@@ -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) |
@@ -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 { |
@@ -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'; |
@@ -190,12 +190,12 @@ discard block |
||
| 190 | 190 | $newValue = ''; |
| 191 | 191 | foreach ($value as $item) { |
| 192 | 192 | if ($newValue) { |
| 193 | - $newValue.=','; |
|
| 193 | + $newValue .= ','; |
|
| 194 | 194 | } |
| 195 | 195 | if (is_string($item)) { |
| 196 | - $newValue .='"' . $item . '"'; |
|
| 196 | + $newValue .= '"' . $item . '"'; |
|
| 197 | 197 | } else { |
| 198 | - $newValue .=$item; |
|
| 198 | + $newValue .= $item; |
|
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | $value = '(' . $newValue . ')'; |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | $update = implode(',', $updates); |
| 312 | - $query .=" SET {$update}"; |
|
| 312 | + $query .= " SET {$update}"; |
|
| 313 | 313 | case 'SELECT': |
| 314 | 314 | case 'DELETE': |
| 315 | 315 | $this->buildWhere($this->where); |
@@ -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 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | function parseColsForModel($cols = []) |
| 27 | 27 | { |
| 28 | - $modelCols = [ 'labels' => [], 'cols' => [], 'relations' => []]; |
|
| 28 | + $modelCols = ['labels' => [], 'cols' => [], 'relations' => []]; |
|
| 29 | 29 | foreach ($cols as $col) { |
| 30 | 30 | $modelCols['labels'][$col['code']] = $col['label']; |
| 31 | 31 | $colType = !empty($col['type']['primary']) ? $col['type']['primary'] : $col['type']; |
@@ -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; |
@@ -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); |
@@ -187,16 +187,16 @@ discard block |
||
| 187 | 187 | { |
| 188 | 188 | $pos = strpos($source, $rawTag) - 1; |
| 189 | 189 | echo substr($source, 0, $pos); |
| 190 | - return substr($source, ( $pos + strlen($rawTag) + 2)); |
|
| 190 | + return substr($source, ($pos + strlen($rawTag) + 2)); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | public function getHref($type, $params) |
| 194 | 194 | { |
| 195 | 195 | $href = ''; |
| 196 | 196 | if (is_string($params)) { |
| 197 | - $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $params; |
|
| 197 | + $href = ($this->app->type != 'app' ? '/' . $this->app->name : '') . $params; |
|
| 198 | 198 | } elseif (empty($params['template']) && !empty($params['file'])) { |
| 199 | - $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $params['file']; |
|
| 199 | + $href = ($this->app->type != 'app' ? '/' . $this->app->name : '') . $params['file']; |
|
| 200 | 200 | } elseif (!empty($params['template']) && !empty($params['file'])) { |
| 201 | 201 | $href = $this->app->templatesPath . "/{$this->template->name}/{$type}/{$params['file']}"; |
| 202 | 202 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | $this->checkNeedLibs(); |
| 257 | 257 | $this->parseCss(); |
| 258 | - echo "\n <script src='" . Statics::file(($this->app->type != 'app' ? '/' . $this->app->name : '' ) . "/static/system/js/Inji.js") . "'></script>"; |
|
| 258 | + echo "\n <script src='" . Statics::file(($this->app->type != 'app' ? '/' . $this->app->name : '') . "/static/system/js/Inji.js") . "'></script>"; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | public function parseCss() |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | if (file_exists($path)) { |
| 280 | 280 | $this->loadedCss[$href] = $href; |
| 281 | 281 | $urls[$href] = $path; |
| 282 | - $timeStr.=filemtime($path); |
|
| 282 | + $timeStr .= filemtime($path); |
|
| 283 | 283 | } else { |
| 284 | 284 | echo "\n <link href='{$href}' rel='stylesheet' type='text/css' />"; |
| 285 | 285 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | if (strpos($css, '//') !== false) |
| 331 | 331 | $href = $css; |
| 332 | 332 | else |
| 333 | - $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css; |
|
| 333 | + $href = ($this->app->type != 'app' ? '/' . $this->app->name : '') . $css; |
|
| 334 | 334 | $hrefs[$href] = $href; |
| 335 | 335 | } |
| 336 | 336 | break; |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | if (strpos($css, '//') !== false) |
| 357 | 357 | $href = $css; |
| 358 | 358 | else |
| 359 | - $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css; |
|
| 359 | + $href = ($this->app->type != 'app' ? '/' . $this->app->name : '') . $css; |
|
| 360 | 360 | $hrefs[$href] = $href; |
| 361 | 361 | } |
| 362 | 362 | break; |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | if (file_exists($path)) { |
| 418 | 418 | $nativeUrl[$script] = $script; |
| 419 | 419 | $urls[$script] = $path; |
| 420 | - $timeStr.=filemtime($path); |
|
| 420 | + $timeStr .= filemtime($path); |
|
| 421 | 421 | } else { |
| 422 | 422 | $noParsedScripts[$script] = $script; |
| 423 | 423 | } |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | if (!empty($script['name'])) { |
| 433 | 433 | $onLoadModules[$script['name']] = $script['name']; |
| 434 | 434 | } |
| 435 | - $timeStr.=filemtime($path); |
|
| 435 | + $timeStr .= filemtime($path); |
|
| 436 | 436 | } else { |
| 437 | 437 | $noParsedScripts[$script] = $script; |
| 438 | 438 | } |
@@ -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); |
@@ -16,13 +16,13 @@ |
||
| 16 | 16 | if ($level == 0) |
| 17 | 17 | $return = "["; |
| 18 | 18 | foreach ($data as $key => $item) { |
| 19 | - $return .= "\n" . str_repeat(' ', ( $level * 4 + 4)) . "'{$key}' => "; |
|
| 19 | + $return .= "\n" . str_repeat(' ', ($level * 4 + 4)) . "'{$key}' => "; |
|
| 20 | 20 | if (!is_array($item)) |
| 21 | 21 | $return .= "'{$item}',"; |
| 22 | 22 | else { |
| 23 | 23 | $return .= "["; |
| 24 | 24 | $return .= rtrim(self::genArray($item, $level + 1), ','); |
| 25 | - $return .= "\n" . str_repeat(' ', ( $level * 4 + 4)) . "],"; |
|
| 25 | + $return .= "\n" . str_repeat(' ', ($level * 4 + 4)) . "],"; |
|
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | if ($level == 0) |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -require_once( INJI_SYSTEM_DIR . '/init.php' ); |
|
| 38 | +require_once(INJI_SYSTEM_DIR . '/init.php'); |
|
| 39 | 39 | /** |
| 40 | 40 | * System error messages |
| 41 | 41 | */ |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $html = "<{$tag}"; |
| 25 | 25 | if ($attributes && is_array($attributes)) { |
| 26 | 26 | foreach ($attributes as $key => $value) { |
| 27 | - $html .=" {$key} = '"; |
|
| 27 | + $html .= " {$key} = '"; |
|
| 28 | 28 | if (!is_array($value)) { |
| 29 | 29 | $html .= addcslashes($value, "'"); |
| 30 | 30 | } else { |