Application   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 33
ccs 0
cts 22
cp 0
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getAvailableLocales() 0 6 1
A getDefaultLocale() 0 6 1
A isAdmin() 0 4 1
A isSite() 0 4 1
A getScope() 0 4 1
1
<?php
2
/*
3
 * This file is part of the Laravel Platfourm package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\Platfourm\Foundation;
12
13
use Illuminate\Foundation\Application as LaravelApplication;
14
15
class Application extends LaravelApplication
16
{
17
18
    public function getAvailableLocales()
19
    {
20
        $locales = $this['multilang']->getLocales();
21
22
        return array_keys($locales);
23
    }
24
25
    public function getDefaultLocale()
26
    {
27
        $locale = config('multilang.default_locale', 'en');
28
29
        return $locale;
30
    }
31
32
    public function isAdmin()
33
    {
34
        return $this->getScope() == 'admin';
35
    }
36
37
    public function isSite()
38
    {
39
        return !$this->isAdmin();
40
    }
41
42
    public function getScope()
43
    {
44
        return $this['config']->get('app.scope', 'global');
45
    }
46
47
}
48