EditorConfigFileCheck::getKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace SilverStripe\ModuleRatings\Check;
4
5
class EditorConfigFileCheck extends AbstractFileCheck
6
{
7
    public function getKey()
8
    {
9
        return 'has_editorconfig_file';
10
    }
11
12
    public function getDescription()
13
    {
14
        return 'Has a .editorconfig file';
15
    }
16
17
    public function run()
18
    {
19
        $files = $this->getFinder()
20
            ->files()
21
            ->ignoreDotFiles(false)
22
            ->in($this->getSuite()->getModuleRoot())
23
            ->name('.editorconfig');
24
25
        $this->setSuccessful(count($files) > 0);
26
    }
27
}
28