DefaultFolderStructure::basePath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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