diff --git a/src/Helper/Shell.php b/src/Helper/Shell.php index c45ec30..2d57bf3 100644 --- a/src/Helper/Shell.php +++ b/src/Helper/Shell.php @@ -58,8 +58,8 @@ class Shell /** @var resource The actual process resource returned from proc_open */ protected $process = null; - /** @var int Process starting time in unix timestamp */ - protected int $processStartTime = 0; + /** @var float Process starting time in unix timestamp */ + protected float $processStartTime = 0; /** @var array Status of the process as returned from proc_get_status */ protected ?array $processStatus = null; @@ -104,7 +104,7 @@ protected function isWindows(): bool protected function setInput(): void { - \fwrite($this->pipes[self::STDIN_DESCRIPTOR_KEY], $this->input); + \fwrite($this->pipes[self::STDIN_DESCRIPTOR_KEY], $this->input ?? ''); } protected function updateProcessStatus(): void diff --git a/src/Output/Writer.php b/src/Output/Writer.php index 23e691f..54add92 100644 --- a/src/Output/Writer.php +++ b/src/Output/Writer.php @@ -200,7 +200,7 @@ public function colorizer(): Color */ public function __get(string $name): self { - if (\strpos($this->method, $name) === false) { + if ($this->method === null || !\str_contains($this->method, $name)) { $this->method .= $this->method ? \ucfirst($name) : $name; }