MainComposer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A compose() 0 6 2
1
<?php
2
3
namespace App\Http\ViewComposers;
4
use App\Repositories\LotRepository;
5
use Illuminate\Contracts\View\View;
6
7
class MainComposer extends Composer
8
{
9
    /**
10
     * @var LotRepository
11
     */
12
    protected $lots;
13
14
15
    /**
16
     * AddLotComposer constructor.
17
     * @param LotRepository $lotRepository
18
     */
19
    public function __construct(
20
        LotRepository $lotRepository
21
    ) {
22
        $this->lots = $lotRepository;
23
    }
24
25
    /**
26
     * Bind view to data.
27
     * 
28
     * @param View $view
29
     * @return $this
30
     */
31
    public function compose(View $view)
32
    {
33
        $comision   = \Auth::check() ? $this->lots->userLotsPendingComision(\Auth::user()) : 0;
34
        return $view
35
            ->with('comision', $comision);
36
    }
37
}