master

laravel/framework

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

CommandStarting.php

TLDR

This file defines the CommandStarting class, which is used to create an event instance when a console command starts. It contains properties for the command name, console input, and console output.

Classes

CommandStarting

The CommandStarting class is used to create an event instance when a console command starts. It has the following properties:

  • $command: The name of the command.
  • $input: An instance of Symfony\Component\Console\Input\InputInterface representing the console input. It can be null.
  • $output: An instance of Symfony\Component\Console\Output\OutputInterface representing the console output. It can be null.

The class has a constructor that accepts the $command, $input, and $output parameters to initialize the properties.

NOTE: There are no methods in this file.

<?php

namespace Illuminate\Console\Events;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class CommandStarting
{
    /**
     * The command name.
     *
     * @var string
     */
    public $command;

    /**
     * The console input implementation.
     *
     * @var \Symfony\Component\Console\Input\InputInterface|null
     */
    public $input;

    /**
     * The command output implementation.
     *
     * @var \Symfony\Component\Console\Output\OutputInterface|null
     */
    public $output;

    /**
     * Create a new event instance.
     *
     * @param  string  $command
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
     * @return void
     */
    public function __construct($command, InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;
        $this->command = $command;
    }
}