@@ -54,6 +54,7 @@ class Process implements \IteratorAggregate
5454private array |string $ commandline ;
5555private ?string $ cwd ;
5656private array $ env = [];
57+ /** @var resource|string|\Iterator|null */
5758private $ input ;
5859private ?float $ starttime = null ;
5960private ?float $ lastOutputTime = null ;
@@ -63,8 +64,11 @@ class Process implements \IteratorAggregate
6364private array $ fallbackStatus = [];
6465private array $ processInformation ;
6566private bool $ outputDisabled = false ;
67+ /** @var resource */
6668private $ stdout ;
69+ /** @var resource */
6770private $ stderr ;
71+ /** @var resource|null */
6872private $ process ;
6973private string $ status = self ::STATUS_READY ;
7074private int $ incrementalOutputOffset = 0 ;
@@ -345,11 +349,12 @@ public function start(callable $callback = null, array $env = [])
345349throw new RuntimeException (sprintf ('The provided cwd "%s" does not exist. ' , $ this ->cwd ));
346350 }
347351
348- $ this -> process = @proc_open ($ commandline , $ descriptors , $ this ->processPipes ->pipes , $ this ->cwd , $ envPairs , $ this ->options );
352+ $ process = @proc_open ($ commandline , $ descriptors , $ this ->processPipes ->pipes , $ this ->cwd , $ envPairs , $ this ->options );
349353
350- if (!\is_resource ($ this -> process )) {
354+ if (!\is_resource ($ process )) {
351355throw new RuntimeException ('Unable to launch a new process. ' );
352356 }
357+ $ this ->process = $ process ;
353358$ this ->status = self ::STATUS_STARTED ;
354359
355360if (isset ($ descriptors [3 ])) {
@@ -1118,7 +1123,7 @@ public function getInput()
11181123 *
11191124 * This content will be passed to the underlying process standard input.
11201125 *
1121- * @param string|int|float|bool| resource|\Traversable|null $input The content
1126+ * @param string|resource|\Traversable|self |null $input The content
11221127 *
11231128 * @return $this
11241129 *
0 commit comments