Test Failed
Push — master ( 83b4ef...37cc60 )
by Gianluca
19:45 queued 19:45
created

ShopController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A page() 0 8 2
1
<?php
2
3
4
namespace Mongi\Mongicommerce\Http\Controllers\shop;
5
6
7
use Mongi\Mongicommerce\Http\Controllers\Controller;
8
use Mongi\Mongicommerce\Libraries\Template;
9
use Mongi\Mongicommerce\Models\Category;
10
use Mongi\Mongicommerce\Models\Product;
11
12
class ShopController extends Controller
13
{
14
    public function page($id=null){
15
        $products = Template::getProducts($id);
16
        $category = Category::find($id);
17
        $category_name = '';
18
        if($category){
19
            $category_name = $category->name;
20
        };
21
        return view('mongicommerce.pages.shop',compact('products','category_name'));
22
    }
23
}
24