| Total Complexity | 8 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types = 1); |
||
| 8 | class AddPHPStanTask extends TaskBase implements Task |
||
| 9 | { |
||
| 10 | /** @return string bash variable for use in Travis script */ |
||
| 11 | public function getFlag(): string |
||
| 12 | { |
||
| 13 | return 'PHPSTAN_TEST'; |
||
| 14 | } |
||
| 15 | |||
| 16 | |||
| 17 | public function getCommand(): string |
||
| 18 | { |
||
| 19 | return 'phpstan'; |
||
| 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/phpstan analyse --level=6 -c tests/phpstan.neon src/'; |
||
| 32 | } |
||
| 33 | |||
| 34 | |||
| 35 | /** @return array<string,string> */ |
||
| 36 | public function getComposerScripts(): array |
||
| 37 | { |
||
| 38 | return ["phpstan" => "vendor/bin/phpstan analyse --level=6 -c tests/phpstan.neon src/"]; |
||
| 39 | } |
||
| 40 | |||
| 41 | |||
| 42 | /** @return array<string> */ |
||
| 43 | public function getComposerPackages(): array |
||
| 44 | { |
||
| 45 | return ['phpstan/phpstan-strict-rules', 'phpstan/extension-installer']; |
||
| 46 | } |
||
| 47 | |||
| 48 | |||
| 49 | /** @return array<string, string> */ |
||
| 50 | public function filesToCopy(): array |
||
| 51 | { |
||
| 52 | return ['files/phpstan.neon' => 'TESTS_DIR/phpstan.neon']; |
||
| 53 | } |
||
| 54 | |||
| 55 | |||
| 56 | public function isCodeCheck(): bool |
||
| 59 | } |
||
| 60 | } |
||
| 61 |