Completed
Push — master ( ca46fd...1d0b8e )
by
unknown
19:27 queued 09:34
created

LocaleComposer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A compose() 0 7 1
1
<?php
2
3
namespace BBSLab\NovaTranslation\Http\View\Composers;
4
5
use BBSLab\NovaTranslation\NovaTranslation;
6
use Illuminate\View\View;
7
8
class LocaleComposer
9
{
10
    /**
11
     * Bind data to the view.
12
     *
13
     * @param  \Illuminate\View\View  $view
14
     * @return void
15
     * @throws \Exception
16
     */
17
    public function compose(View $view)
18
    {
19
        $view->with([
20
            'locale' => $current = NovaTranslation::currentLocale(),
21
            'locales' => NovaTranslation::otherLocales($current),
22
        ]);
23
    }
24
}
25