Passed
Pull Request — master (#92)
by Fèvre
13:40 queued 08:22
created

SidebarComposer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 6 1
1
<?php
2
namespace Xetaravel\View\Composers\Shop;
3
4
use Illuminate\View\View;
5
use Xetaravel\Models\Repositories\ShopItemRepository;
6
use Xetaravel\Models\Repositories\ShopCategoryRepository;
7
8
class SidebarComposer
9
{
10
    /**
11
     * Bind data to the view.
12
     *
13
     * @param  \Illuminate\View\View  $view
14
     *
15
     * @return void
16
     */
17
    public function compose(View $view): void
18
    {
19
        $items = ShopItemRepository::sidebar();
20
        $categories = ShopCategoryRepository::sidebar();
21
22
        $view->with(['items' => $items, 'categories' => $categories]);
23
    }
24
}
25