From 691b02976b88b373cc093d04beef59835547c815 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Sun, 31 May 2026 18:22:50 +0100 Subject: [PATCH] fix: asterisk for stderr output closes #58 --- example/05-process-test.php | 4 ++-- src/Pool.php | 2 +- test/phpunit/PoolTest.php | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example/05-process-test.php b/example/05-process-test.php index d70c6c6..74d543f 100644 --- a/example/05-process-test.php +++ b/example/05-process-test.php @@ -33,7 +33,7 @@ fwrite(STDOUT, "[$name] $output"); } if(strlen($error) > 0) { - fwrite(STDOUT, "[$name ERROR] $error"); + fwrite(STDOUT, "[$name *] $error"); } } @@ -43,4 +43,4 @@ echo "Program quit. Exit codes:" . PHP_EOL; echo "numbers.php exited with code " . $procNum->close() . PHP_EOL; -echo "letters.php exited with code " . $procLet->close() . PHP_EOL; \ No newline at end of file +echo "letters.php exited with code " . $procLet->close() . PHP_EOL; diff --git a/src/Pool.php b/src/Pool.php index 80f6649..91c7576 100644 --- a/src/Pool.php +++ b/src/Pool.php @@ -60,7 +60,7 @@ public function read(int $pipe = Process::PIPE_OUT):string { foreach($outLines as $line) { if($pipe === Process::PIPE_ERROR) { - $output .= "[$name ERROR] $line"; + $output .= "[$name *] $line"; } else { $output .= "[$name] $line"; diff --git a/test/phpunit/PoolTest.php b/test/phpunit/PoolTest.php index 3b14713..83d29b3 100644 --- a/test/phpunit/PoolTest.php +++ b/test/phpunit/PoolTest.php @@ -86,11 +86,11 @@ public function testRead() { ); self::assertStringContainsString( - "[test2 ERROR] Here is an error from proc2", + "[test2 *] Here is an error from proc2", $error ); self::assertStringContainsString( - "[test1 ERROR] Here is an error from proc1", + "[test1 *] Here is an error from proc1", $error ); } @@ -126,11 +126,11 @@ public function testReadError() { $error = $sut->readError(); self::assertStringContainsString( - "[test2 ERROR] Here is an error from proc2", + "[test2 *] Here is an error from proc2", $error ); self::assertStringContainsString( - "[test1 ERROR] Here is an error from proc1", + "[test1 *] Here is an error from proc1", $error ); }