Passed
Push — master ( 78a9c6...7b220b )
by Iman
04:23
created

CbStructure::componentsPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace crocodicstudio\crudbooster\helpers;
4
5
class CbStructure
6
{
7
    public static function componentsPath(string $type = ''): string
8
    {
9
        $componentPath = implode(DIRECTORY_SEPARATOR, ['vendor', 'crocodicstudio', 'crudbooster', 'src', 'views', 'form', 'type_components', $type]);
10
11
        return base_path($componentPath);
12
    }
13
14
    public static function publishedComponentsPath(string $type = ''): string
15
    {
16
        $Path = implode(DIRECTORY_SEPARATOR, ['views', 'vendor', 'crudbooster', 'type_components', $type]);
17
18
        return resource_path($Path);
19
    }
20
21
    public static function controllerPath(string $controller): string
22
    {
23
        return self::controllersDir().$controller.'.php';
24
    }
25
26
    public static function controllersDir(): string
27
    {
28
        $_ = DIRECTORY_SEPARATOR;
29
30
        return app_path('Http'.$_.'Controllers'.$_);
31
    }
32
33
    public static function cbModulesNS(string $path = ''): string
34
    {
35
        return '\crocodicstudio\crudbooster\Modules\\'.$path;
36
    }
37
38
    public static function cbControllersNS(): string
39
    {
40
        return '\crocodicstudio\crudbooster\controllers';
41
    }
42
43
    public static function ctrlNamespace(): string
44
    {
45
        return 'App\Http\Controllers';
46
    }
47
}