@@ -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'; |
@@ -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; |
@@ -56,6 +56,10 @@ |
||
| 56 | 56 | return true; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string[] $path |
|
| 61 | + * @param string $element |
|
| 62 | + */ |
|
| 59 | 63 | function resolvePath($array, $path, $element) |
| 60 | 64 | { |
| 61 | 65 | while ($path) { |
@@ -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'; |
@@ -288,7 +288,7 @@ |
||
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | $update = implode(',', $updates); |
| 291 | - $query .=" SET {$update}"; |
|
| 291 | + $query .= " SET {$update}"; |
|
| 292 | 292 | case 'SELECT': |
| 293 | 293 | case 'DELETE': |
| 294 | 294 | $this->buildWhere($this->where); |
@@ -283,7 +283,6 @@ discard block |
||
| 283 | 283 | /** |
| 284 | 284 | * Getting items with params |
| 285 | 285 | * |
| 286 | - * @param array $params |
|
| 287 | 286 | * @return array |
| 288 | 287 | */ |
| 289 | 288 | function getItems($options = []) |
@@ -296,7 +295,6 @@ discard block |
||
| 296 | 295 | /** |
| 297 | 296 | * Return count of items with params |
| 298 | 297 | * |
| 299 | - * @param array $params |
|
| 300 | 298 | * @return int |
| 301 | 299 | */ |
| 302 | 300 | function getItemsCount($options = []) |
@@ -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 | } |
@@ -15,6 +15,9 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | public $xml = null; |
| 17 | 17 | |
| 18 | + /** |
|
| 19 | + * @param \SimpleXMLElement $xml |
|
| 20 | + */ |
|
| 18 | 21 | function __construct($xml) |
| 19 | 22 | { |
| 20 | 23 | $this->xml = $xml; |
@@ -79,6 +82,9 @@ discard block |
||
| 79 | 82 | } |
| 80 | 83 | } |
| 81 | 84 | |
| 85 | + /** |
|
| 86 | + * @param \Model $cart |
|
| 87 | + */ |
|
| 82 | 88 | function updateCartItems($cart, $items) |
| 83 | 89 | { |
| 84 | 90 | $itemIds = []; |
@@ -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; |