Completed
Pull Request — master (#96)
by
unknown
03:45
created

SiteNameViewComposer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 17
rs 10
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A compose() 0 4 1
1
<?php
2
3
namespace Modules\Core\Composers;
4
5
use Illuminate\Contracts\View\View;
6
use Illuminate\Support\Facades\App;
7
use Modules\Setting\Contracts\Setting;
8
9
class SiteNameViewComposer
10
{
11
    /**
12
     * @var Setting
13
     */
14
    private $setting;
15
16
    public function __construct(Setting $setting)
17
    {
18
        $this->setting = $setting;
19
    }
20
21
    public function compose(View $view)
22
    {
23
        $view->with('sitename', $this->setting->get('core::site-name', App::getLocale()));
24
    }
25
}
26