|
7 | 7 |
|
8 | 8 | abstract class GenerateClient extends Command |
9 | 9 | { |
10 | | - /** |
11 | | - * @var string |
12 | | - * Client name: js or php, must be set in child classes |
13 | | - */ |
14 | | - protected $client; |
| 10 | + /** Client name: js or php, must be set in child classes */ |
| 11 | + protected string $client; |
15 | 12 |
|
16 | | - /** |
17 | | - * @var string |
18 | | - * Generator name, one of valid openapi generators names |
19 | | - */ |
20 | | - protected $generator; |
| 13 | + /** Generator name, one of valid openapi generators names */ |
| 14 | + protected string $generator; |
21 | 15 |
|
22 | | - /** |
23 | | - * @var string |
24 | | - */ |
25 | | - protected $apidocDir; |
| 16 | + protected string $apidocDir; |
26 | 17 |
|
27 | | - /** |
28 | | - * @var string |
29 | | - */ |
30 | | - protected $outputDir; |
| 18 | + protected string $outputDir; |
31 | 19 |
|
32 | | - /** |
33 | | - * @var string |
34 | | - */ |
35 | | - protected $gitUser; |
| 20 | + protected string $gitUser; |
36 | 21 |
|
37 | | - /** |
38 | | - * @var string |
39 | | - */ |
40 | | - protected $gitRepo; |
| 22 | + protected string $gitRepo; |
41 | 23 |
|
42 | | - /** |
43 | | - * @var string |
44 | | - */ |
45 | | - protected $gitHost; |
| 24 | + protected string $gitHost; |
46 | 25 |
|
47 | | - /** |
48 | | - * @var array |
49 | | - */ |
50 | | - protected $params; |
| 26 | + protected array $params; |
51 | 27 |
|
52 | | - /** |
53 | | - * @var string |
54 | | - */ |
55 | | - protected $templateDir; |
| 28 | + protected string $templateDir; |
56 | 29 |
|
57 | | - /** |
58 | | - * @var array |
59 | | - */ |
60 | | - protected $filesToIgnoreDuringCleanup; |
| 30 | + protected array $filesToIgnoreDuringCleanup; |
61 | 31 |
|
62 | 32 | public function __construct() |
63 | 33 | { |
@@ -90,11 +60,11 @@ public function handle(): int |
90 | 60 | return self::SUCCESS; |
91 | 61 | } |
92 | 62 |
|
93 | | - protected abstract function patchClientPackage(): void; |
| 63 | + abstract protected function patchClientPackage(): void; |
94 | 64 |
|
95 | 65 | private function generateClientPackage(): int |
96 | 66 | { |
97 | | - $bin = 'npx @openapitools/openapi-generator-cli'; |
| 67 | + $bin = 'npx --yes @openapitools/openapi-generator-cli'; |
98 | 68 | $i = escapeshellarg($this->apidocDir . DIRECTORY_SEPARATOR . "index.yaml"); |
99 | 69 | $g = escapeshellarg($this->generator); |
100 | 70 | $o = escapeshellarg($this->outputDir); |
@@ -143,6 +113,7 @@ private function getAdditionalParamsArgument(): string |
143 | 113 | return collect($this->params) |
144 | 114 | ->map(function ($value, $name) { |
145 | 115 | $escapedValue = PHP_OS_FAMILY !== 'Windows' ? str_replace("\\", "\\\\", $value) : $value; |
| 116 | + |
146 | 117 | return "$name=$escapedValue"; |
147 | 118 | }) |
148 | 119 | ->join(','); |
|
0 commit comments