File tree Expand file tree Collapse file tree 3 files changed +6
-19
lines changed
src/Symfony/Component/Process Expand file tree Collapse file tree 3 files changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -130,9 +130,7 @@ jobs:
130
130
echo SYMFONY_REQUIRE=">=$([ '${{ matrix.mode }}' = low-deps ] && echo 5.4 || echo $SYMFONY_VERSION)" >> $GITHUB_ENV
131
131
[[ "${{ matrix.mode }}" = *-deps ]] && mv composer.json.phpunit composer.json || true
132
132
133
- if [[ "${{ matrix.mode }}" = low-deps ]]; then
134
- echo SYMFONY_PHPUNIT_REQUIRE="nikic/php-parser:^4.18" >> $GITHUB_ENV
135
- fi
133
+ echo SYMFONY_PHPUNIT_REQUIRE="nikic/php-parser:^4.18" >> $GITHUB_ENV
136
134
137
135
- name : Install dependencies
138
136
run : |
Original file line number Diff line number Diff line change @@ -80,7 +80,6 @@ class Process implements \IteratorAggregate
80
80
private WindowsPipes |UnixPipes $ processPipes ;
81
81
82
82
private ?int $ latestSignal = null ;
83
- private ?int $ cachedExitCode = null ;
84
83
85
84
private static ?bool $ sigchild = null ;
86
85
@@ -1289,21 +1288,10 @@ protected function updateStatus(bool $blocking)
1289
1288
return ;
1290
1289
}
1291
1290
1292
- $ this ->processInformation = proc_get_status ($ this ->process );
1293
- $ running = $ this ->processInformation ['running ' ];
1294
-
1295
- // In PHP < 8.3, "proc_get_status" only returns the correct exit status on the first call.
1296
- // Subsequent calls return -1 as the process is discarded. This workaround caches the first
1297
- // retrieved exit status for consistent results in later calls, mimicking PHP 8.3 behavior.
1298
- if (\PHP_VERSION_ID < 80300 ) {
1299
- if (!isset ($ this ->cachedExitCode ) && !$ running && -1 !== $ this ->processInformation ['exitcode ' ]) {
1300
- $ this ->cachedExitCode = $ this ->processInformation ['exitcode ' ];
1301
- }
1302
-
1303
- if (isset ($ this ->cachedExitCode ) && !$ running && -1 === $ this ->processInformation ['exitcode ' ]) {
1304
- $ this ->processInformation ['exitcode ' ] = $ this ->cachedExitCode ;
1305
- }
1291
+ if ($ this ->processInformation ['running ' ] ?? true ) {
1292
+ $ this ->processInformation = proc_get_status ($ this ->process );
1306
1293
}
1294
+ $ running = $ this ->processInformation ['running ' ];
1307
1295
1308
1296
$ this ->readPipes ($ running && $ blocking , '\\' !== \DIRECTORY_SEPARATOR || !$ running );
1309
1297
Original file line number Diff line number Diff line change @@ -712,9 +712,10 @@ public function testProcessIsSignaledIfStopped()
712
712
$ this ->markTestSkipped ('Windows does not support POSIX signals ' );
713
713
}
714
714
715
- $ process = $ this ->getProcessForCode ( 'sleep(32); ' );
715
+ $ process = $ this ->getProcess ([ 'sleep ' , ' 32 ' ] );
716
716
$ process ->start ();
717
717
$ process ->stop ();
718
+ var_dump ($ process );
718
719
$ this ->assertTrue ($ process ->hasBeenSignaled ());
719
720
$ this ->assertEquals (15 , $ process ->getTermSignal ()); // SIGTERM
720
721
}
You can’t perform that action at this time.
0 commit comments