Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
slince committed Oct 4, 2023
1 parent 03f7110 commit 8700ee2
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,26 @@ final class Process implements ProcessInterface
/**
* @var string
*/
protected string $status = self::STATUS_READY;
private string $status = self::STATUS_READY;

/**
* @var \Closure
*/
protected \Closure $callback;
protected ?int $pid = null;
protected ?int $statusInfo = null;
protected ?int $exitCode;
protected ?string $exitCodeText;
protected ?int $stopSignal;
protected ?int $termSignal;
private \Closure $callback;
private ?int $pid = null;
private ?int $statusInfo = null;
private ?int $exitCode;
private ?string $exitCodeText;
private ?int $stopSignal;
private ?int $termSignal;

protected static CurrentProcess $currentProcess;
private static CurrentProcess $currentProcess;

public function __construct(callable $callback)
{
if (!function_exists('pcntl_fork')) {
throw new RuntimeException('The Process class relies on ext-pcntl, which is not available on your PHP installation.');
}
if ($callback instanceof \Closure) {
\Closure::bind($callback, null);
}
$this->callback = $callback;
}

Expand Down Expand Up @@ -137,7 +134,7 @@ public function signal(int $signal): void
posix_kill($this->getPid(), $signal);
}

protected function updateStatus(bool $blocking): void
private function updateStatus(bool $blocking): void
{
if (!$this->isAliveStatus()) {
return;
Expand Down

0 comments on commit 8700ee2

Please sign in to comment.