@@ -54,6 +54,7 @@ class Process implements \IteratorAggregate
5454 private array |string $ commandline ;
5555 private ?string $ cwd ;
5656 private array $ env = [];
57+ /** @var resource|string|\Iterator|null */
5758 private $ input ;
5859 private ?float $ starttime = null ;
5960 private ?float $ lastOutputTime = null ;
@@ -63,8 +64,11 @@ class Process implements \IteratorAggregate
6364 private array $ fallbackStatus = [];
6465 private array $ processInformation ;
6566 private bool $ outputDisabled = false ;
67+ /** @var resource */
6668 private $ stdout ;
69+ /** @var resource */
6770 private $ stderr ;
71+ /** @var resource|null */
6872 private $ process ;
6973 private string $ status = self ::STATUS_READY ;
7074 private int $ incrementalOutputOffset = 0 ;
@@ -345,11 +349,12 @@ public function start(callable $callback = null, array $env = [])
345349 throw 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 )) {
351355 throw new RuntimeException ('Unable to launch a new process. ' );
352356 }
357+ $ this ->process = $ process ;
353358 $ this ->status = self ::STATUS_STARTED ;
354359
355360 if (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