@@ -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'; |
@@ -186,12 +186,12 @@ discard block |
||
186 | 186 | $newValue = ''; |
187 | 187 | foreach ($value as $item) { |
188 | 188 | if ($newValue) { |
189 | - $newValue.=','; |
|
189 | + $newValue .= ','; |
|
190 | 190 | } |
191 | 191 | if (is_string($item)) { |
192 | - $newValue .='"' . $item . '"'; |
|
192 | + $newValue .= '"' . $item . '"'; |
|
193 | 193 | } else { |
194 | - $newValue .=$item; |
|
194 | + $newValue .= $item; |
|
195 | 195 | } |
196 | 196 | } |
197 | 197 | $value = '(' . $newValue . ')'; |
@@ -270,12 +270,12 @@ discard block |
||
270 | 270 | $newValue = ''; |
271 | 271 | foreach ($value as $item) { |
272 | 272 | if ($newValue) { |
273 | - $newValue.=','; |
|
273 | + $newValue .= ','; |
|
274 | 274 | } |
275 | 275 | if (is_string($item)) { |
276 | - $newValue .='"' . $item . '"'; |
|
276 | + $newValue .= '"' . $item . '"'; |
|
277 | 277 | } else { |
278 | - $newValue .=$item; |
|
278 | + $newValue .= $item; |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | $value = '(' . $newValue . ')'; |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | } |
382 | 382 | } |
383 | 383 | $update = implode(',', $updates); |
384 | - $query .=" SET {$update}"; |
|
384 | + $query .= " SET {$update}"; |
|
385 | 385 | case 'SELECT': |
386 | 386 | case 'DELETE': |
387 | 387 | $this->buildWhere($this->where); |
@@ -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 | */ |
@@ -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 |
@@ -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']); |
@@ -437,6 +437,9 @@ discard block |
||
437 | 437 | } |
438 | 438 | } |
439 | 439 | |
440 | + /** |
|
441 | + * @param boolean $new |
|
442 | + */ |
|
440 | 443 | public function logChanges($new) { |
441 | 444 | if (!App::$cur->db->connect || !App::$cur->dashboard) { |
442 | 445 | return false; |
@@ -539,7 +542,7 @@ discard block |
||
539 | 542 | /** |
540 | 543 | * Information extractor for col relations path |
541 | 544 | * |
542 | - * @param string|array $info |
|
545 | + * @param string $info |
|
543 | 546 | * @return array |
544 | 547 | */ |
545 | 548 | public static function parseColRecursion($info) { |
@@ -625,7 +628,7 @@ discard block |
||
625 | 628 | * Generate params string for col by name |
626 | 629 | * |
627 | 630 | * @param string $colName |
628 | - * @return boolean|string |
|
631 | + * @return false|string |
|
629 | 632 | */ |
630 | 633 | public static function genColParams($colName) { |
631 | 634 | if (empty(static::$cols[$colName]) || static::$storage['type'] == 'moduleConfig') { |
@@ -780,7 +783,7 @@ discard block |
||
780 | 783 | /** |
781 | 784 | * return relations list |
782 | 785 | * |
783 | - * @return array |
|
786 | + * @return string |
|
784 | 787 | */ |
785 | 788 | public static function relations() { |
786 | 789 | return []; |
@@ -1303,7 +1306,7 @@ discard block |
||
1303 | 1306 | * |
1304 | 1307 | * @param array $params |
1305 | 1308 | * @param array $where |
1306 | - * @return boolean |
|
1309 | + * @return false|null |
|
1307 | 1310 | */ |
1308 | 1311 | public static function update($params, $where = []) { |
1309 | 1312 | static::fixPrefix($params); |
@@ -307,7 +307,7 @@ |
||
307 | 307 | if (is_array($counts)) { |
308 | 308 | $sum = 0; |
309 | 309 | foreach ($counts as $count) { |
310 | - $sum +=$count['count']; |
|
310 | + $sum += $count['count']; |
|
311 | 311 | } |
312 | 312 | return $sum; |
313 | 313 | } |
@@ -268,7 +268,7 @@ |
||
268 | 268 | $result->send(); |
269 | 269 | } |
270 | 270 | |
271 | - $item->sales ++; |
|
271 | + $item->sales++; |
|
272 | 272 | $item->save(); |
273 | 273 | |
274 | 274 | if (empty($_GET['count'])) |
@@ -72,12 +72,12 @@ |
||
72 | 72 | { |
73 | 73 | $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]); |
74 | 74 | if ($warehouse) { |
75 | - $warehouse->count +=(float) $count; |
|
75 | + $warehouse->count += (float) $count; |
|
76 | 76 | $warehouse->save(); |
77 | 77 | } else { |
78 | 78 | $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]); |
79 | 79 | if ($warehouse) { |
80 | - $warehouse->count +=(float) $count; |
|
80 | + $warehouse->count += (float) $count; |
|
81 | 81 | $warehouse->save(); |
82 | 82 | } |
83 | 83 | } |
@@ -133,7 +133,7 @@ |
||
133 | 133 | foreach ($cart->cartItems as $cartItem) { |
134 | 134 | $isset = false; |
135 | 135 | foreach ($cItems as $key => $cItem) { |
136 | - if (!($cItem['item_id'] == $cartItem->item_id )) { |
|
136 | + if (!($cItem['item_id'] == $cartItem->item_id)) { |
|
137 | 137 | continue; |
138 | 138 | } |
139 | 139 | $isset = true; |