Skip to content

Commit c2710ff

Browse files
committed
ci
1 parent d045d74 commit c2710ff

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

src/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function setTarget(string $idleTimeout = '30s'): self
8888
throw new VoltTestException('Invalid idle timeout format. Use <number>[s|m|h]');
8989
}
9090
$this->target['idle_timeout'] = $idleTimeout;
91+
9192
return $this;
9293
}
9394

src/Platform.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static function installBinary($testing = false): void
9999
{
100100
$platform = self::detectPlatform($testing);
101101

102-
if (!array_key_exists($platform, self::SUPPORTED_PLATFORMS)) {
102+
if (! array_key_exists($platform, self::SUPPORTED_PLATFORMS)) {
103103
throw new \RuntimeException("Platform $platform is not supported");
104104
}
105105

@@ -113,8 +113,8 @@ public static function installBinary($testing = false): void
113113
$targetFile .= '.exe';
114114
}
115115

116-
if (!is_dir($binDir)) {
117-
if (!mkdir($binDir, 0755, true)) {
116+
if (! is_dir($binDir)) {
117+
if (! mkdir($binDir, 0755, true)) {
118118
throw new \RuntimeException("Failed to create directory: $binDir");
119119
}
120120
}
@@ -135,6 +135,7 @@ public static function installBinary($testing = false): void
135135
$fp = fopen($tempFile, 'w');
136136
if ($fp === false) {
137137
curl_close($ch);
138+
138139
throw new \RuntimeException("Failed to open temporary file for writing");
139140
}
140141

@@ -145,7 +146,7 @@ public static function installBinary($testing = false): void
145146
CURLOPT_FAILONERROR => true,
146147
CURLOPT_TIMEOUT => 300,
147148
CURLOPT_CONNECTTIMEOUT => 30,
148-
CURLOPT_HTTPHEADER => ['User-Agent: volt-test-php-sdk']
149+
CURLOPT_HTTPHEADER => ['User-Agent: volt-test-php-sdk'],
149150
]);
150151

151152
if (curl_exec($ch) === false) {
@@ -160,15 +161,15 @@ public static function installBinary($testing = false): void
160161
curl_close($ch);
161162
fclose($fp);
162163

163-
if (!file_exists($tempFile) || filesize($tempFile) === 0) {
164+
if (! file_exists($tempFile) || filesize($tempFile) === 0) {
164165
throw new \RuntimeException("Downloaded file is empty or missing");
165166
}
166167

167-
if (!rename($tempFile, $targetFile)) {
168+
if (! rename($tempFile, $targetFile)) {
168169
throw new \RuntimeException("Failed to move downloaded binary to: $targetFile");
169170
}
170171

171-
if (!chmod($targetFile, 0755)) {
172+
if (! chmod($targetFile, 0755)) {
172173
throw new \RuntimeException("Failed to set executable permissions on binary");
173174
}
174175

@@ -179,6 +180,7 @@ public static function installBinary($testing = false): void
179180
if (file_exists($tempFile)) {
180181
unlink($tempFile);
181182
}
183+
182184
throw $e;
183185
}
184186
}

src/ProcessManager.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
class ProcessManager
88
{
99
private string $binaryPath;
10+
1011
private $currentProcess = null;
1112

1213
public function __construct(string $binaryPath)
@@ -33,7 +34,7 @@ public function execute(array $config, bool $streamOutput): string
3334
[$success, $process, $pipes] = $this->openProcess();
3435
$this->currentProcess = $process;
3536

36-
if (!$success || !is_array($pipes)) {
37+
if (! $success || ! is_array($pipes)) {
3738
throw new RuntimeException('Failed to start process of volt test');
3839
}
3940

@@ -62,6 +63,7 @@ public function execute(array $config, bool $streamOutput): string
6263
$this->currentProcess = null;
6364
if ($exitCode !== 0) {
6465
echo "\nError: " . trim($stderrContent) . "\n";
66+
6567
return '';
6668
}
6769
}
@@ -96,7 +98,7 @@ protected function openProcess(): array
9698
['bypass_shell' => true]
9799
);
98100

99-
if (!is_resource($process)) {
101+
if (! is_resource($process)) {
100102
return [false, null, []];
101103
}
102104

@@ -128,6 +130,7 @@ private function handleProcess(array $pipes, bool $streamOutput): string
128130
if (feof($pipe)) {
129131
fclose($pipe);
130132
unset($pipes[$type]);
133+
131134
continue;
132135
}
133136
}
@@ -155,7 +158,7 @@ protected function writeInput($pipe, string $input): void
155158

156159
protected function closeProcess($process): int
157160
{
158-
if (!is_resource($process)) {
161+
if (! is_resource($process)) {
159162
return -1;
160163
}
161164

@@ -167,4 +170,4 @@ protected function closeProcess($process): int
167170

168171
return proc_close($process);
169172
}
170-
}
173+
}

src/Request.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public function toArray(): array
109109
if (count($this->headers) > 0) {
110110
$array['header'] = $this->headers;
111111
}
112+
112113
return $array;
113114
}
114115

tests/Units/ProcessManagerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public static function outputProvider(): array
6363
];
6464
}
6565

66-
6766
public function testLongRunningProcess(): void
6867
{
6968
$longOutput = str_repeat("Output line\n", 100);

0 commit comments

Comments
 (0)