1 | <?php |
||
11 | abstract class ToolHandler |
||
12 | { |
||
13 | const COMPOSER_VENDOR_DIR = '/../../../../../../'; |
||
14 | const COMPOSER_INSTALLED_FILE = 'composer/installed.json'; |
||
15 | |||
16 | /** @var OutputHandlerInterface */ |
||
17 | protected $outputHandler; |
||
18 | /** @var OutputInterface */ |
||
19 | protected $output; |
||
20 | |||
21 | /** @var array */ |
||
22 | private $tools = array( |
||
23 | 'phpcs' => 'squizlabs/php_codesniffer', |
||
24 | 'php-cs-fixer' => 'fabpot/php-cs-fixer', |
||
25 | 'phpmd' => 'phpmd/phpmd', |
||
26 | 'phpunit' => 'phpunit/phpunit', |
||
27 | 'phpunit-randomizer' => 'fiunchinho/phpunit-randomizer', |
||
28 | 'jsonlint' => 'seld/jsonlint', |
||
29 | ); |
||
30 | /** @var array */ |
||
31 | private $installedPackages = array(); |
||
32 | |||
33 | /** |
||
34 | * @param OutputHandlerInterface $outputHandler |
||
35 | */ |
||
36 | public function __construct(OutputHandlerInterface $outputHandler) |
||
48 | |||
49 | /** |
||
50 | * @param OutputInterface $outputInterface |
||
51 | */ |
||
52 | public function setOutput(OutputInterface $outputInterface) |
||
56 | |||
57 | /** |
||
58 | * @param \Exception $exceptionClass |
||
59 | * @param string $errorText |
||
60 | */ |
||
61 | protected function writeOutputError(\Exception $exceptionClass, $errorText) |
||
66 | |||
67 | /** |
||
68 | * @param string $tool |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | protected function getBinPath($tool) |
||
85 | } |
||
86 |