Test Failed
Push — master ( da5def...342071 )
by Christian
04:54
created

Mage::domain()   A

Complexity

Conditions 5
Paths 5

Size

Total Lines 20
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 9.4494

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 5
eloc 16
c 1
b 1
f 0
nc 5
nop 1
dl 0
loc 20
ccs 7
cts 16
cp 0.4375
crap 9.4494
rs 9.4222
1
<?php
2
3
namespace Omatech\Mage\Core;
4
5
use Exception;
6
7
class Mage
8
{
9 1
    public static function domain(string $domain)
10
    {
11 1
        switch ($domain) {
12 1
            case 'Permissions':
13
                $facade = app('mage.permissions');
14
                break;
15 1
            case 'Roles':
16
                $facade = app('mage.roles');
17
                break;
18 1
            case 'Users':
19
                $facade = app('mage.users');
20
                break;
21 1
            case 'Translations':
22
                $facade = app('mage.translations');
23
                break;
24
            default:
25 1
                throw new Exception();
26
        }
27
28
        return $facade;
29
    }
30
}
31