GitAttributesFileCheck   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 9
c 1
b 1
f 0
dl 0
loc 21
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A run() 0 9 1
A getKey() 0 3 1
1
<?php
2
3
namespace SilverStripe\ModuleRatings\Check;
4
5
class GitAttributesFileCheck extends AbstractFileCheck
6
{
7
    public function getKey()
8
    {
9
        return 'has_gitattributes_file';
10
    }
11
12
    public function getDescription()
13
    {
14
        return 'Has a .gitattributes file';
15
    }
16
17
    public function run()
18
    {
19
        $files = $this->getFinder()
20
            ->files()
21
            ->ignoreDotFiles(false)
22
            ->in($this->getSuite()->getModuleRoot())
23
            ->name('.gitattributes');
24
25
        $this->setSuccessful(count($files) > 0);
26
    }
27
}
28