ModernDetector   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 15
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A detect() 0 11 3
1
<?php
2
3
namespace Buttress\Concrete\Locator\Detector;
4
5
use Buttress\Concrete\Locator\Site;
6
7
class ModernDetector implements Detector
8
{
9
10 9
    public function detect($path)
11
    {
12 9
        if (file_exists($path . '/concrete/config/concrete.php')) {
13 6
            $data = @include $path . '/concrete/config/concrete.php';
14 6
            if (isset($data['version'])) {
15 3
                return (new Site())->setPath($path)->setVersion($data['version']);
16
            }
17 2
        }
18
19 6
        return null;
20
    }
21
}
22