Factory::create()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 9
nc 2
nop 1
dl 0
loc 14
ccs 0
cts 12
cp 0
crap 6
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Auth;
6
7
use Canvas\Models\Users;
8
9
class Factory
10
{
11
    /**
12
     * Create the Auth factory
13
     *
14
     * @param integer $ecosystem_auth
15
     * @return Auth
16
     */
17
    public static function create(bool $ecosystemAuth)
18
    {
19
        $user = null;
20
        switch ($ecosystemAuth) {
21
            case false:
22
                $user = new App();
23
                break;
24
            
25
            default:
26
                $user = new Users();
27
                break;
28
        }
29
30
        return $user;
31
    }
32
    
33
}