Test Failed
Branch master (b2d1de)
by Banciu N. Cristian Mihai
05:41 queued 02:07
created

BaseCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 10
c 1
b 0
f 0
dl 0
loc 41
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A handle() 0 10 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BinaryCube\CarrotMQ\Support\Laravel\Console\Commands;
6
7
use Illuminate\Console\Command;
0 ignored issues
show
Bug introduced by
The type Illuminate\Console\Command was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use BinaryCube\CarrotMQ\CarrotMQ;
9
use Illuminate\Support\Facades\Log;
0 ignored issues
show
Bug introduced by
The type Illuminate\Support\Facades\Log was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
/**
12
 * Class BaseCommand
13
 */
14
abstract class BaseCommand extends Command
15
{
16
17
    /**
18
     * @var CarrotMQ
19
     */
20
    protected $carrot;
21
22
    /**
23
     * Constructor.
24
     *
25
     * @param CarrotMQ $carrot
26
     */
27
    public function __construct(CarrotMQ $carrot)
28
    {
29
        $this->carrot = $carrot;
30
31
        parent::__construct();
32
    }
33
34
    /**
35
     * Execute the console command.
36
     *
37
     * @return integer
38
     */
39
    public function handle()
40
    {
41
        try {
42
            return $this->handleInternal();
43
        } catch (\Exception $exception) {
44
            $this->error('Something went wrong! Check the log for more information.');
45
            Log::error((string) $exception);
46
        }
47
48
        return 0;
49
    }
50
51
    /**
52
     * @return integer
53
     */
54
    abstract protected function handleInternal();
55
56
}
57