Вход Регистрация
Файл: vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleFinishCommand.php
Строк: 84
<?php

namespace IlluminateConsoleScheduling;

use 
IlluminateConsoleCommand;
use 
IlluminateConsoleEventsScheduledBackgroundTaskFinished;
use 
IlluminateContractsEventsDispatcher;
use 
SymfonyComponentConsoleAttributeAsCommand;

#[AsCommand(name: 'schedule:finish')]
class ScheduleFinishCommand extends Command
{
    
/**
     * The console command name.
     *
     * @var string
     */
    
protected $signature 'schedule:finish {id} {code=0}';

    
/**
     * The name of the console command.
     *
     * This name is used to identify the command during lazy loading.
     *
     * @var string|null
     *
     * @deprecated
     */
    
protected static $defaultName 'schedule:finish';

    
/**
     * The console command description.
     *
     * @var string
     */
    
protected $description 'Handle the completion of a scheduled command';

    
/**
     * Indicates whether the command should be shown in the Artisan command list.
     *
     * @var bool
     */
    
protected $hidden true;

    
/**
     * Execute the console command.
     *
     * @param  IlluminateConsoleSchedulingSchedule  $schedule
     * @return void
     */
    
public function handle(Schedule $schedule)
    {
        
collect($schedule->events())->filter(function ($value) {
            return 
$value->mutexName() == $this->argument('id');
        })->
each(function ($event) {
            
$event->finish($this->laravel$this->argument('code'));

            
$this->laravel->make(Dispatcher::class)->dispatch(new ScheduledBackgroundTaskFinished($event));
        });
    }
}
Онлайн: 0
Реклама