DefaultFolderStructure   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 57
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A basePath() 0 4 1
A viewPaths() 0 6 1
A storagePath() 0 4 1
A viewCachePath() 0 4 1
A cachePath() 0 4 1
1
<?php
2
3
namespace Mosaic\Common\Conventions;
4
5
class DefaultFolderStructure implements FolderStructureConvention
6
{
7
    /**
8
     * @var string
9
     */
10
    private $basePath;
11
12
    /**
13
     * @param string $basePath
14
     */
15 5
    public function __construct(string $basePath)
16
    {
17 5
        $this->basePath = rtrim($basePath, '\/');
18 5
    }
19
20
    /**
21
     * @return string
22
     */
23 1
    public function basePath() : string
24
    {
25 1
        return $this->basePath;
26
    }
27
28
    /**
29
     * @return array
30
     */
31 1
    public function viewPaths() : array
32
    {
33
        return [
34 1
            $this->basePath . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'views'
35
        ];
36
    }
37
38
    /**
39
     * @return string
40
     */
41 3
    public function storagePath() : string
42
    {
43 3
        return $this->basePath . DIRECTORY_SEPARATOR . 'storage';
44
    }
45
46
    /**
47
     * @return string
48
     */
49 1
    public function viewCachePath() : string
50
    {
51 1
        return $this->storagePath() . DIRECTORY_SEPARATOR . 'views';
52
    }
53
54
    /**
55
     * @return string
56
     */
57 1
    public function cachePath() : string
58
    {
59 1
        return $this->storagePath() . DIRECTORY_SEPARATOR . 'cache';
60
    }
61
}
62