getDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Sunnysideup\UpgradeToSilverstripe4\Tasks\IndividualTasks;
4
5
use Sunnysideup\UpgradeToSilverstripe4\Api\FindFiles;
6
use Sunnysideup\UpgradeToSilverstripe4\Tasks\Task;
7
8
/**
9
 * Run a dev/build as a smoke test to see if all is well
10
 */
11
class FindYmlExamplesFilesAndChangeExtension extends Task
12
{
13
    protected $taskStep = 's30';
14
15
    protected $extensions = [
16
        'example',
17
        'Example',
18
        'EXAMPLE',
19
    ];
20
21
    public function getTitle()
22
    {
23
        return 'Find YML extension files and change extension temporarily.';
24
    }
25
26
    public function getDescription()
27
    {
28
        return 'In our modules we include a lot of .yml.example files - we want to update those as well.';
29
    }
30
31
    public function runActualTask($params = []): ?string
32
    {
33
        $files = FindFiles::inst()
34
            ->setSearchPath($this->mu()->getGitRootDir())
0 ignored issues
show
Bug introduced by
It seems like getGitRootDir() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
            ->setSearchPath($this->mu()->/** @scrutinizer ignore-call */ getGitRootDir())
Loading history...
35
            ->setExtensions($this->extensions)
36
            ->getFlatFileArray();
37
        print_r($files);
38
        return null;
39
    }
40
41
    protected function hasCommitAndPush()
42
    {
43
        return true;
44
    }
45
}
46