Mage   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A domain() 0 21 5
1
<?php
2
3
namespace Omatech\Mage\Core;
4
5
use Exception;
6
7
class Mage
8
{
9
    /**
10
     * @param string $domain
11
     * @return mixed
12
     * @throws Exception
13
     */
14 5
    public static function domain(string $domain)
15
    {
16 5
        switch ($domain) {
17 5
            case 'Permissions':
18 1
                $facade = app('mage.permissions');
19 1
                break;
20 4
            case 'Roles':
21 1
                $facade = app('mage.roles');
22 1
                break;
23 3
            case 'Users':
24 1
                $facade = app('mage.users');
25 1
                break;
26 2
            case 'Translations':
27 1
                $facade = app('mage.translations');
28 1
                break;
29
            default:
30 1
                throw new Exception();
31
        }
32
33 4
        return $facade;
34
    }
35
}
36