Abandon   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 36
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A fire() 0 6 1
1
<?php namespace Bedard\Shop\Console;
2
3
use Bedard\Shop\Models\Cart;
4
use Illuminate\Console\Command;
5
use Lang;
6
7
class Abandon extends Command
8
{
9
    /**
10
     * @var string The console command name.
11
     */
12
    protected $name = 'shop:abandon';
13
14
    /**
15
     * @var string The console command description.
16
     */
17
    protected $description;
18
19
    /**
20
     * Constructor.
21
     *
22
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
23
     */
24
    public function __construct()
25
    {
26
        $this->description = Lang::get('bedard.shop::lang.console.abandon.description');
27
28
        parent::__construct();
29
    }
30
31
    /**
32
     * Execute the console command.
33
     *
34
     * @return void
35
     */
36
    public function fire()
37
    {
38
        Cart::processAbandoned();
39
40
        $this->output->writeln('<info>'.Lang::get('bedard.shop::lang.console.abandon.success').'</info>');
41
    }
42
}
43