Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.x] use promoted properties for Console events #53851

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/Illuminate/Console/Events/ArtisanStarting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@

class ArtisanStarting
{
/**
* The Artisan application instance.
*
* @var \Illuminate\Console\Application
*/
public $artisan;

/**
* Create a new event instance.
*
* @param \Illuminate\Console\Application $artisan
* @param \Illuminate\Console\Application $artisan The Artisan application instance.
* @return void
*/
public function __construct($artisan)
{
$this->artisan = $artisan;
public function __construct(
public $artisan,
) {
}
}
48 changes: 10 additions & 38 deletions src/Illuminate/Console/Events/CommandFinished.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,20 @@

class CommandFinished
{
/**
* 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;

/**
* The command exit code.
*
* @var int
*/
public $exitCode;

/**
* Create a new event instance.
*
* @param string $command
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param int $exitCode
* @param string $command The command name.
* @param \Symfony\Component\Console\Input\InputInterface $input The console input implementation.
* @param \Symfony\Component\Console\Output\OutputInterface $output The command output implementation.
* @param int $exitCode The command exit code.
* @return void
*/
public function __construct($command, InputInterface $input, OutputInterface $output, $exitCode)
{
$this->input = $input;
$this->output = $output;
$this->command = $command;
$this->exitCode = $exitCode;
public function __construct(
public $command,
public InputInterface $input,
public OutputInterface $output,
public $exitCode,
) {
}
}
37 changes: 8 additions & 29 deletions src/Illuminate/Console/Events/CommandStarting.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,18 @@

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
* @param string $command The command name.
* @param \Symfony\Component\Console\Input\InputInterface $input The console input implementation.
* @param \Symfony\Component\Console\Output\OutputInterface $output The command output implementation.
* @return void
*/
public function __construct($command, InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
$this->command = $command;
public function __construct(
public $command,
public InputInterface $input,
public OutputInterface $output,
) {
}
}
15 changes: 4 additions & 11 deletions src/Illuminate/Console/Events/ScheduledBackgroundTaskFinished.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@

class ScheduledBackgroundTaskFinished
{
/**
* The scheduled event that ran.
*
* @var \Illuminate\Console\Scheduling\Event
*/
public $task;

/**
* Create a new event instance.
*
* @param \Illuminate\Console\Scheduling\Event $task
* @param \Illuminate\Console\Scheduling\Event $task The scheduled event that ran.
* @return void
*/
public function __construct(Event $task)
{
$this->task = $task;
public function __construct(
public Event $task,
) {
}
}
26 changes: 6 additions & 20 deletions src/Illuminate/Console/Events/ScheduledTaskFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,16 @@

class ScheduledTaskFailed
{
/**
* The scheduled event that failed.
*
* @var \Illuminate\Console\Scheduling\Event
*/
public $task;

/**
* The exception that was thrown.
*
* @var \Throwable
*/
public $exception;

/**
* Create a new event instance.
*
* @param \Illuminate\Console\Scheduling\Event $task
* @param \Throwable $exception
* @param \Illuminate\Console\Scheduling\Event $task The scheduled event that failed.
* @param \Throwable $exception The exception that was thrown.
* @return void
*/
public function __construct(Event $task, Throwable $exception)
{
$this->task = $task;
$this->exception = $exception;
public function __construct(
public Event $task,
public Throwable $exception,
) {
}
}
26 changes: 6 additions & 20 deletions src/Illuminate/Console/Events/ScheduledTaskFinished.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,16 @@

class ScheduledTaskFinished
{
/**
* The scheduled event that ran.
*
* @var \Illuminate\Console\Scheduling\Event
*/
public $task;

/**
* The runtime of the scheduled event.
*
* @var float
*/
public $runtime;

/**
* Create a new event instance.
*
* @param \Illuminate\Console\Scheduling\Event $task
* @param float $runtime
* @param \Illuminate\Console\Scheduling\Event $task The scheduled event that ran.
* @param float $runtime The runtime of the scheduled event.
* @return void
*/
public function __construct(Event $task, $runtime)
{
$this->task = $task;
$this->runtime = $runtime;
public function __construct(
public Event $task,
public $runtime,
) {
}
}
15 changes: 4 additions & 11 deletions src/Illuminate/Console/Events/ScheduledTaskSkipped.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@

class ScheduledTaskSkipped
{
/**
* The scheduled event being run.
*
* @var \Illuminate\Console\Scheduling\Event
*/
public $task;

/**
* Create a new event instance.
*
* @param \Illuminate\Console\Scheduling\Event $task
* @param \Illuminate\Console\Scheduling\Event $task The scheduled event being run.
* @return void
*/
public function __construct(Event $task)
{
$this->task = $task;
public function __construct(
public Event $task,
) {
}
}
15 changes: 4 additions & 11 deletions src/Illuminate/Console/Events/ScheduledTaskStarting.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@

class ScheduledTaskStarting
{
/**
* The scheduled event being run.
*
* @var \Illuminate\Console\Scheduling\Event
*/
public $task;

/**
* Create a new event instance.
*
* @param \Illuminate\Console\Scheduling\Event $task
* @param \Illuminate\Console\Scheduling\Event $task The scheduled event being run.
* @return void
*/
public function __construct(Event $task)
{
$this->task = $task;
public function __construct(
public Event $task,
) {
}
}
Loading