ViewsLoaderTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 33
rs 10
c 1
b 1
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A loadViewsFromContainers() 0 6 1
A loadViewsFromShip() 0 4 1
A loadViews() 0 6 2
1
<?php
2
3
namespace App\Ship\Engine\Loaders;
4
5
use File;
6
7
/**
8
 * Class ViewsLoaderTrait.
9
 *
10
 * @author  Mahmoud Zalt <[email protected]>
11
 */
12
trait ViewsLoaderTrait
13
{
14
15
    /**
16
     * @param $containerName
17
     */
18
    public function loadViewsFromContainers($containerName)
19
    {
20
        $containerViewDirectory = base_path('app/Containers/' . $containerName . '/UI/WEB/Views/');
21
22
        $this->loadViews($containerViewDirectory, $containerName);
23
    }
24
25
    /**
26
     * @param void
27
     */
28
    public function loadViewsFromShip()
29
    {
30
        // ..
31
    }
32
33
    /**
34
     * @param $directory
35
     * @param $containerName
36
     */
37
    private function loadViews($directory, $containerName)
38
    {
39
        if (File::isDirectory($directory)) {
40
            $this->loadViewsFrom($directory, strtolower($containerName));
0 ignored issues
show
Bug introduced by
The method loadViewsFrom() does not exist on App\Ship\Engine\Loaders\ViewsLoaderTrait. Did you maybe mean loadViewsFromContainers()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
41
        }
42
    }
43
44
}
45