master

laravel/framework

Last updated at: 29/12/2023 09:21

InvokedProcess.php

TLDR

This file defines an interface called InvokedProcess in the Illuminate\Contracts\Process namespace. The interface provides methods for interacting with a running process, such as getting the process ID, sending a signal to the process, checking if the process is still running, and retrieving the standard output and error output of the process.

Methods

id

Get the process ID if the process is still running.

signal

Send a signal to the process.

running

Determine if the process is still running.

output

Get the standard output for the process.

errorOutput

Get the error output for the process.

latestOutput

Get the latest standard output for the process.

latestErrorOutput

Get the latest error output for the process.

wait

Wait for the process to finish and return a ProcessResult object.

<?php

namespace Illuminate\Contracts\Process;

interface InvokedProcess
{
    /**
     * Get the process ID if the process is still running.
     *
     * @return int|null
     */
    public function id();

    /**
     * Send a signal to the process.
     *
     * @param  int  $signal
     * @return $this
     */
    public function signal(int $signal);

    /**
     * Determine if the process is still running.
     *
     * @return bool
     */
    public function running();

    /**
     * Get the standard output for the process.
     *
     * @return string
     */
    public function output();

    /**
     * Get the error output for the process.
     *
     * @return string
     */
    public function errorOutput();

    /**
     * Get the latest standard output for the process.
     *
     * @return string
     */
    public function latestOutput();

    /**
     * Get the latest error output for the process.
     *
     * @return string
     */
    public function latestErrorOutput();

    /**
     * Wait for the process to finish.
     *
     * @param  callable|null  $output
     * @return \Illuminate\Console\Process\ProcessResult
     */
    public function wait(callable $output = null);
}