Completed
Push — master ( bb22e0...a8c1a4 )
by Iman
15s
created

CbStructure   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A publishedComponentsPath() 0 5 1
A controllerPath() 0 3 1
A controllersDir() 0 4 1
A componentsPath() 0 5 1
A cbModulesNS() 0 3 1
A ctrlNamespace() 0 3 1
1
<?php
2
3
namespace crocodicstudio\crudbooster\helpers;
4
5
class CbStructure
6
{
7
    public static function componentsPath($type = '')
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($type = '')
15
    {
16
        $Path = implode(DIRECTORY_SEPARATOR, ['views', 'vendor', 'crudbooster', 'type_components', $type]);
17
18
        return resource_path($Path);
19
    }
20
21
    public static function controllersDir()
22
    {
23
        $_ = DIRECTORY_SEPARATOR;
24
        return app_path('Http'.$_.'Controllers'.$_);
25
    }
26
27
    public static function controllerPath($controller)
28
    {
29
        return self::controllersDir().$controller.'.php';
30
    }
31
32
    public static function cbModulesNS($path = '')
33
    {
34
        return '\crocodicstudio\crudbooster\Modules\\'.$path;
35
    }
36
37
    public static function ctrlNamespace()
38
    {
39
        return 'App\Http\Controllers';
40
    }
41
}