Skip to content

Commit

Permalink
Cleanup process handling after dropping temp-file handling
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and sebastianbergmann committed Mar 28, 2024
1 parent 500149c commit 51e0bee
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 33 deletions.
4 changes: 0 additions & 4 deletions src/Util/PHP/AbstractPhpProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ abstract class AbstractPhpProcess

public static function factory(): self
{
if (PHP_OS_FAMILY === 'Windows') {
return new WindowsPhpProcess;
}

return new DefaultPhpProcess;
}

Expand Down
7 changes: 1 addition & 6 deletions src/Util/PHP/DefaultPhpProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DefaultPhpProcess extends AbstractPhpProcess
*/
public function runJob(string $job, array $settings = []): array
{
if ($this->stdin || $this->useTemporaryFile()) {
if ($this->stdin) {
if (!($this->tempFile = tempnam(sys_get_temp_dir(), 'phpunit_')) ||
file_put_contents($this->tempFile, $job) === false) {
throw new PhpProcessException(
Expand Down Expand Up @@ -143,9 +143,4 @@ protected function cleanup(): void
unlink($this->tempFile);
}
}

protected function useTemporaryFile(): bool
{
return false;
}
}
23 changes: 0 additions & 23 deletions src/Util/PHP/WindowsPhpProcess.php

This file was deleted.

0 comments on commit 51e0bee

Please sign in to comment.