Completed
Pull Request — master (#8)
by Gordon
06:47
created

AddPsalmTask   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

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

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getComposerPackages() 0 3 1
A getTravisBeforeScript() 0 3 1
A getTravisScript() 0 3 1
A filesToCopy() 0 3 1
A isCodeCheck() 0 3 1
A getCommand() 0 3 1
A getComposerScripts() 0 3 1
A getFlag() 0 3 1
1
<?php declare(strict_types = 1);
2
3
namespace Suilven\PHPTravisEnhancer\Task;
4
5
use Suilven\PHPTravisEnhancer\Abstraction\TaskBase;
6
use Suilven\PHPTravisEnhancer\IFace\Task;
7
8
class AddPsalmTask extends TaskBase implements Task
9
{
10
    /** @return string bash variable for use in Travis script */
11
    public function getFlag(): string
12
    {
13
        return 'PSALM_TEST';
14
    }
15
16
17
    public function getCommand(): string
18
    {
19
        return 'psalm';
20
    }
21
22
23
    public function getTravisBeforeScript(): ?string
24
    {
25
        return null;
26
    }
27
28
29
    public function getTravisScript(): ?string
30
    {
31
        return './vendor/bin/psalm --show-info=true;';
32
    }
33
34
35
    /** @return array<string,string> */
36
    public function getComposerScripts(): array
37
    {
38
        return ["psalm" =>"vendor/bin/psalm --show-info=true"];
39
    }
40
41
42
    /** @return array<string> */
43
    public function getComposerPackages(): array
44
    {
45
        return ['vimeo/psalm'];
46
    }
47
48
49
    /** @return array<string, string> */
50
    public function filesToCopy(): array
51
    {
52
        return [];
53
    }
54
55
56
    public function isCodeCheck(): bool
57
    {
58
        return true;
59
    }
60
}
61