Total Complexity | 6 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class LintAll extends Task |
||
13 | { |
||
14 | protected $taskStep = 's30'; |
||
15 | |||
16 | public function getTitle() |
||
17 | { |
||
18 | return 'Lint all php code.'; |
||
19 | } |
||
20 | |||
21 | public function getDescription() |
||
24 | Goes through all the folders and uses the sake-lint-all function (this will need to be installed).'; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * [runActualTask description] |
||
29 | * @param array $params not currently used for this task |
||
30 | */ |
||
31 | public function runActualTask($params = []): ?string |
||
32 | { |
||
33 | if (PHP2CommandLineSingleton::commandExists('sake-lint-all')) { |
||
34 | foreach ($this->mu()->getExistingModuleDirLocations() as $moduleDir) { |
||
|
|||
35 | $this->mu()->execMe( |
||
36 | $this->mu()->getWebRootDirLocation(), |
||
37 | 'sake-lint-all ' . $moduleDir, |
||
38 | 'Linting all PHP files in ' . $moduleDir, |
||
39 | true |
||
40 | ); |
||
41 | } |
||
42 | } else { |
||
43 | return 'You need to install sake-lint-all to use this task: https://github.com/sunnysideup/silverstripe-easy-coding-standards'; |
||
44 | } |
||
45 | return null; |
||
46 | } |
||
47 | |||
48 | protected function hasCommitAndPush() |
||
51 | } |
||
52 | } |
||
53 |