1 | <?php |
||
7 | class PhpQualityTools |
||
8 | { |
||
9 | /** |
||
10 | * @var string $srcDirectory |
||
11 | */ |
||
12 | protected $srcDirectory; |
||
13 | |||
14 | /** |
||
15 | * PhpQualityTools constructor. |
||
16 | * @param string $srcDirectory |
||
17 | */ |
||
18 | public function __construct(string $srcDirectory) |
||
19 | { |
||
20 | echo sprintf('Using source directory: "%s"', $srcDirectory) . PHP_EOL; |
||
21 | $this->srcDirectory = $srcDirectory; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @param string $destination |
||
26 | * @return void |
||
27 | */ |
||
28 | public function install($destination) |
||
35 | |||
36 | /** |
||
37 | * @param string $destination |
||
38 | * @return void |
||
39 | */ |
||
40 | protected function copyStubs(string $destination) |
||
47 | |||
48 | /** |
||
49 | * @param string $destination |
||
50 | * @return void |
||
51 | */ |
||
52 | protected function setUpComposerJson(string $destination) |
||
79 | |||
80 | /** |
||
81 | * @return array |
||
82 | */ |
||
83 | protected function getComposerScripts(): array |
||
97 | |||
98 | /** |
||
99 | * @param string $composerJson |
||
100 | * @return object |
||
101 | */ |
||
102 | protected function readComposerJson(string $composerJson): \stdClass |
||
110 | |||
111 | /** |
||
112 | * @param string $composerJson |
||
113 | * @param array $composerSettings |
||
114 | * @return bool|int |
||
115 | */ |
||
116 | protected function writeComposerJson(string $composerJson, \stdClass $composerSettings) |
||
129 | |||
130 | private function createDestinationIfNotExist($destination) |
||
141 | |||
142 | private function copyFile($filename, $destination) |
||
148 | |||
149 | } |
||
150 |