Filesystem   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 24
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A preload() 0 16 2
1
<?php
2
3
declare(strict_types = 1);
4
5
/*
6
 * This file is part of the skeleton package.
7
 *
8
 * (c) Gennady Knyazkin <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Gennadyx\Skeleton\VarSource;
15
16
/**
17
 * Class Filesystem
18
 *
19
 * @author Gennady Knyazkin <[email protected]>
20
 */
21
class Filesystem extends AbstractSource
22
{
23
    use PreloadTrait;
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 2
    protected function preload(): array
29
    {
30 2
        $root = realpath('.');
31 2
        $skeleton = sprintf('%s/skeleton', $root);
32 2
        $name = basename($root);
33
34 2
        if ('composer' === $name) {
35 1
            $name = basename(realpath('..'));
36
        }
37
38
        return [
39 2
            'root'     => $root,
40 2
            'skeleton' => $skeleton,
41 2
            'name'     => $name,
42
        ];
43
    }
44
}
45