Total Complexity | 8 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
8 | class AddDuplicationCheckTask extends TaskBase implements Task |
||
9 | { |
||
10 | /** @return string bash variable for use in Travis script */ |
||
11 | public function getFlag(): string |
||
12 | { |
||
13 | return 'DUPLICATE_CODE_CHECK'; |
||
14 | } |
||
15 | |||
16 | |||
17 | public function getCommand(): string |
||
18 | { |
||
19 | return 'duplication'; |
||
20 | } |
||
21 | |||
22 | |||
23 | public function getTravisBeforeScript(): ?string |
||
24 | { |
||
25 | return 'sudo apt remove -y nodejs && curl ' |
||
26 | . '-sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh && sudo bash nodesource_setup.sh ' |
||
27 | . '&& sudo apt install -y build-essential nodejs && which npm && npm install [email protected]'; |
||
28 | } |
||
29 | |||
30 | |||
31 | public function getTravisScript(): ?string |
||
32 | { |
||
33 | return 'node_modules/jscpd/bin/jscpd src && node_modules/jscpd/bin/jscpd tests'; |
||
34 | } |
||
35 | |||
36 | |||
37 | /** @return array<string,string> this command is only run within Travis, as it requires node installed */ |
||
38 | public function getComposerScripts(): array |
||
39 | { |
||
40 | return []; |
||
41 | } |
||
42 | |||
43 | |||
44 | /** @return array<string> */ |
||
45 | public function getComposerPackages(): array |
||
46 | { |
||
47 | return []; |
||
48 | } |
||
49 | |||
50 | |||
51 | /** @return array<string, string> */ |
||
52 | public function filesToCopy(): array |
||
53 | { |
||
54 | return []; |
||
55 | } |
||
56 | |||
57 | |||
58 | public function isCodeCheck(): bool |
||
61 | } |
||
62 | } |
||
63 |