Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
5 / 5
Running
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
5 / 5
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 handle
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
1<?php
2
3
4namespace Qmp\Laravel\CommandsLaravel\Console\Commands;
5
6use Illuminate\Console\Command;
7use Qmp\Laravel\CommandsLaravel\Models\Cron;
8
9class Running extends Command
10{
11    /**
12     * The name and signature of the console command.
13     *
14     * @var string
15     */
16    protected $signature = 'command:running';
17
18    /**
19     * The console command description.
20     *
21     * @var string
22     */
23    protected $description = 'Check if a command is in progress';
24
25    /**
26     * Create a new command instance.
27     *
28     * @return void
29     */
30    public function __construct()
31    {
32        parent::__construct();
33    }
34
35    /**
36     * Execute the console command.
37     *
38     * @return mixed
39     */
40    public function handle()
41    {
42        $crons = Cron::where('running', 1)->get();
43        $this->line($crons->count());
44    }
45}