@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * @param View $view |
| 26 | - * @return $this |
|
| 26 | + * @return View|null |
|
| 27 | 27 | */ |
| 28 | 28 | public function compose(View $view) |
| 29 | 29 | { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Get ad-blocks for extended banners block. |
| 19 | 19 | * |
| 20 | - * @param $count |
|
| 20 | + * @param integer $count |
|
| 21 | 21 | * @return mixed |
| 22 | 22 | */ |
| 23 | 23 | public function getBigAdBlocks($count = null) |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * Get small adblocks for homepage. |
| 34 | 34 | * |
| 35 | - * @param null $count |
|
| 35 | + * @param integer $count |
|
| 36 | 36 | * @return mixed |
| 37 | 37 | */ |
| 38 | 38 | public function getSmallAdBlocks($count = null) |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | /** |
| 48 | 48 | * Get adblocks for right sidebar of homepage. |
| 49 | 49 | * |
| 50 | - * @param null $count |
|
| 50 | + * @param integer $count |
|
| 51 | 51 | * @return mixed |
| 52 | 52 | */ |
| 53 | 53 | public function getRightSideBarAdBlocks($count = null) |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * |
| 40 | 40 | * @param Request $request |
| 41 | 41 | * @param $code |
| 42 | - * @return mixed |
|
| 42 | + * @return \Illuminate\Http\RedirectResponse|null |
|
| 43 | 43 | */ |
| 44 | 44 | public function confirm(Request $request, $code) |
| 45 | 45 | { |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | /** |
| 40 | 40 | * Get list of unchanged/static filters. |
| 41 | 41 | * |
| 42 | - * @return array |
|
| 42 | + * @return string[] |
|
| 43 | 43 | */ |
| 44 | 44 | final static public function getStaticFilters() |
| 45 | 45 | { |
@@ -78,17 +78,20 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | protected function applyFilter(Request $request, $category, $subcategory, $perPage = 12) |
| 80 | 80 | { |
| 81 | - if($filters = $request->all() ? : false) |
|
| 82 | - list($static, $dynamic) = $this->separateFilters($filters); |
|
| 81 | + if($filters = $request->all() ? : false) { |
|
| 82 | + list($static, $dynamic) = $this->separateFilters($filters); |
|
| 83 | + } |
|
| 83 | 84 | |
| 84 | 85 | $query = $category->products() |
| 85 | 86 | ->getQuery()->select('products.*'); |
| 86 | 87 | |
| 87 | - if(isset($static) && $static = $this->clearStaticFilters($static)) |
|
| 88 | - $query = $this->applyStaticFilter($query, $static); |
|
| 88 | + if(isset($static) && $static = $this->clearStaticFilters($static)) { |
|
| 89 | + $query = $this->applyStaticFilter($query, $static); |
|
| 90 | + } |
|
| 89 | 91 | |
| 90 | - if(isset($dynamic) && $dynamic = $this->clearDynamicFilters($dynamic, $category)) |
|
| 91 | - $query = $this->applyDynamicFilter($query, $dynamic); |
|
| 92 | + if(isset($dynamic) && $dynamic = $this->clearDynamicFilters($dynamic, $category)) { |
|
| 93 | + $query = $this->applyDynamicFilter($query, $dynamic); |
|
| 94 | + } |
|
| 92 | 95 | |
| 93 | 96 | $query->join('lots', 'lots.id', '=', 'products.lot_id') |
| 94 | 97 | ->where('lots.status', Lot::STATUS_COMPLETE) |
@@ -205,8 +208,9 @@ discard block |
||
| 205 | 208 | { |
| 206 | 209 | list($group, $tag) = $this->parseDynamicFilter($filter); |
| 207 | 210 | |
| 208 | - if (isset($available_filters[$group])) |
|
| 209 | - return in_array($tag, $available_filters[$group]); |
|
| 211 | + if (isset($available_filters[$group])) { |
|
| 212 | + return in_array($tag, $available_filters[$group]); |
|
| 213 | + } |
|
| 210 | 214 | } |
| 211 | 215 | }, ARRAY_FILTER_USE_KEY); |
| 212 | 216 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * @param SaveProductRequest $request |
| 103 | 103 | * @param Product $product |
| 104 | - * @return mixed |
|
| 104 | + * @return \Symfony\Component\HttpFoundation\Response |
|
| 105 | 105 | */ |
| 106 | 106 | public function save(SaveProductRequest $request, Lot $lot, Product $product) |
| 107 | 107 | { |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | * @param Request $request |
| 209 | 209 | * @param Lot $lot |
| 210 | 210 | * |
| 211 | - * @return string |
|
| 211 | + * @return \Symfony\Component\HttpFoundation\Response |
|
| 212 | 212 | */ |
| 213 | 213 | public function remove(Request $request, Lot $lot) |
| 214 | 214 | { |
@@ -245,6 +245,9 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | |
| 248 | + /** |
|
| 249 | + * @param SaveProductRequest $request |
|
| 250 | + */ |
|
| 248 | 251 | private function saveSpecificationsPrice($request, Product $product) |
| 249 | 252 | { |
| 250 | 253 | //dd($request->get('spec_price')); |
@@ -299,7 +302,7 @@ discard block |
||
| 299 | 302 | * |
| 300 | 303 | * @param Request $request |
| 301 | 304 | * |
| 302 | - * @return void |
|
| 305 | + * @return \Symfony\Component\HttpFoundation\Response |
|
| 303 | 306 | */ |
| 304 | 307 | public function removeSpec(Request $request) |
| 305 | 308 | { |
@@ -340,7 +343,7 @@ discard block |
||
| 340 | 343 | * @param $image |
| 341 | 344 | * @param Product $product |
| 342 | 345 | * |
| 343 | - * @return mixed |
|
| 346 | + * @return Image|null |
|
| 344 | 347 | */ |
| 345 | 348 | public function addImage($image, Product $product) |
| 346 | 349 | { |
@@ -107,15 +107,18 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $product = $this->products->saveProduct($product, $request->all()); |
| 109 | 109 | |
| 110 | - if (!empty($spec_price = $request->get('spec_price'))) |
|
| 111 | - $this->saveSpecificationsPrice($request,$product); |
|
| 110 | + if (!empty($spec_price = $request->get('spec_price'))) { |
|
| 111 | + $this->saveSpecificationsPrice($request,$product); |
|
| 112 | + } |
|
| 112 | 113 | |
| 113 | - if (!empty($spec = $request->get('spec'))) |
|
| 114 | - $this->saveSpecifications($spec, $product); |
|
| 114 | + if (!empty($spec = $request->get('spec'))) { |
|
| 115 | + $this->saveSpecifications($spec, $product); |
|
| 116 | + } |
|
| 115 | 117 | |
| 116 | - if (!empty($fileInput = $request->file('image'))) |
|
| 117 | - array_walk($fileInput, function($image) use (&$product){ |
|
| 118 | + if (!empty($fileInput = $request->file('image'))) { |
|
| 119 | + array_walk($fileInput, function($image) use (&$product){ |
|
| 118 | 120 | $this->addImage($image, $product); |
| 121 | + } |
|
| 119 | 122 | }); |
| 120 | 123 | |
| 121 | 124 | /* if (!empty($specs = $request->get('i_spec'))) |
@@ -289,8 +292,9 @@ discard block |
||
| 289 | 292 | { |
| 290 | 293 | array_walk($specs, function($data, $product){ |
| 291 | 294 | $spec = $this->improvedSpecs->find($spec_id); |
| 292 | - if($spec) |
|
| 293 | - $this->improvedSpecs->update($spec, $data); |
|
| 295 | + if($spec) { |
|
| 296 | + $this->improvedSpecs->update($spec, $data); |
|
| 297 | + } |
|
| 294 | 298 | }); |
| 295 | 299 | } |
| 296 | 300 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * @param View $view |
| 26 | - * @return $this |
|
| 26 | + * @return View|null |
|
| 27 | 27 | */ |
| 28 | 28 | public function compose(View $view) |
| 29 | 29 | { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @param $key |
| 36 | 36 | * @param $value |
| 37 | - * @param null $group |
|
| 37 | + * @param string $group |
|
| 38 | 38 | * @return mixed |
| 39 | 39 | */ |
| 40 | 40 | public function setMeta($meta_data, $group = null) |
@@ -111,6 +111,10 @@ discard block |
||
| 111 | 111 | $this->getRepository()->removeByKey($key); |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | + |
|
| 115 | + /** |
|
| 116 | + * @param string $group |
|
| 117 | + */ |
|
| 114 | 118 | public function removeMetaGroupById($group=null, $id=null) |
| 115 | 119 | { |
| 116 | 120 | if ($id!=null) { |
@@ -23,8 +23,9 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function getMeta($key, $group = null) |
| 25 | 25 | { |
| 26 | - if (is_null($group)) |
|
| 27 | - return $this->meta()->whereKeyUnique($key)->first(); |
|
| 26 | + if (is_null($group)) { |
|
| 27 | + return $this->meta()->whereKeyUnique($key)->first(); |
|
| 28 | + } |
|
| 28 | 29 | |
| 29 | 30 | return $this->meta()->whereKeyUnique($key)->group($group)->first(); |
| 30 | 31 | } |
@@ -57,13 +58,15 @@ discard block |
||
| 57 | 58 | */ |
| 58 | 59 | public function updateMeta($meta, $meta_data, $group = null) |
| 59 | 60 | { |
| 60 | - if(is_numeric($meta)) |
|
| 61 | - $meta = $this->getRepository()->getModel()->find((int) $meta)->first(); |
|
| 61 | + if(is_numeric($meta)) { |
|
| 62 | + $meta = $this->getRepository()->getModel()->find((int) $meta)->first(); |
|
| 63 | + } |
|
| 62 | 64 | |
| 63 | 65 | $meta->key = $meta_data['key']; |
| 64 | 66 | $meta->value = $meta_data['value']; |
| 65 | - if(isset($group)) |
|
| 66 | - $meta->group = $group; |
|
| 67 | + if(isset($group)) { |
|
| 68 | + $meta->group = $group; |
|
| 69 | + } |
|
| 67 | 70 | |
| 68 | 71 | $meta->save(); |
| 69 | 72 | return $meta; |
@@ -90,8 +93,9 @@ discard block |
||
| 90 | 93 | */ |
| 91 | 94 | public function removeMeta($meta_data, $group = null) |
| 92 | 95 | { |
| 93 | - if(isset($group)) |
|
| 94 | - return $this->unsetMeta($meta_data['key_unique'], $group); |
|
| 96 | + if(isset($group)) { |
|
| 97 | + return $this->unsetMeta($meta_data['key_unique'], $group); |
|
| 98 | + } |
|
| 95 | 99 | |
| 96 | 100 | return $this->unsetMeta($meta_data['key_unique']); |
| 97 | 101 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Create meta. |
| 19 | 19 | * |
| 20 | - * @param $metaable |
|
| 20 | + * @param HasMeta $metaable |
|
| 21 | 21 | * @param $key |
| 22 | 22 | * @param $value |
| 23 | 23 | * @param $group |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * Remove by id. |
| 54 | 54 | * |
| 55 | - * @param $id |
|
| 55 | + * @param integer $id |
|
| 56 | 56 | * @return mixed |
| 57 | 57 | */ |
| 58 | 58 | public function removeById($id) |
@@ -68,6 +68,10 @@ discard block |
||
| 68 | 68 | ->first() |
| 69 | 69 | ->delete(); |
| 70 | 70 | } |
| 71 | + |
|
| 72 | + /** |
|
| 73 | + * @param integer $id |
|
| 74 | + */ |
|
| 71 | 75 | public function removeGroupById($group, $id) |
| 72 | 76 | { |
| 73 | 77 | return self::getModel() |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Create meta. |
| 19 | 19 | * |
| 20 | - * @param $metaable |
|
| 20 | + * @param HasMeta $metaable |
|
| 21 | 21 | * @param $key |
| 22 | 22 | * @param $value |
| 23 | 23 | * @param $group |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * Remove by id. |
| 53 | 53 | * |
| 54 | - * @param $id |
|
| 54 | + * @param integer $id |
|
| 55 | 55 | * @return mixed |
| 56 | 56 | */ |
| 57 | 57 | public function removeById($id) |