Completed
Push — master ( 053977...560004 )
by Christopher
03:12
created

helpers.php ➔ user_model()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
1
<?php
2
3
function projects_config_published()
4
{
5
    return file_exists(config_path('projects.php'));
6
}
7
8
function user_model()
9
{
10
    $user_class = config('projects.user_class');
11
    $repository = (new Illuminate\Config\Repository);
12
    $repository->set('custom', require projects_base_path('/config/projects.php'));
13
14
    if ( ! $user_class) {
15
        $user_class = $repository->get('custom.user_class');
16
    }
17
18
    return new $user_class;
19
}
20
21
function projects_base_path(string $append = '') : string
22
{
23
    return \Illuminate\Support\Str::replaceLast('/src/Helpers', '', dirname(__FILE__)).$append;
24
}
25