MoipDebitCardCommand::fire()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php namespace SOSTheBlack\Moip\Commands;
2
3
use Moip;
4
use Illuminate\Console\Command;
5
6 View Code Duplication
class MoipDebitCardCommand extends Command {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
7
8
	/**
9
	 * The console command name.
10
	 *
11
	 * @var string
12
	 */
13
	protected $name = 'moip:debitcard';
14
15
	/**
16
	 * The console command description.
17
	 *
18
	 * @var string
19
	 */
20
	protected $description = 'Debit Card settings.';
21
22
	/**
23
	 * Create a new command instance.
24
	 *
25
	 * @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...
26
	 */
27
	public function __construct()
28
	{
29
		parent::__construct();
30
	}
31
32
	/**
33
	 * Execute the console command.
34
	 *
35
	 * @return mixed
36
	 */
37
	public function fire()
38
	{
39
		$moip = Moip::first();
40
		$moip->creditCard = $this->confirm('Cartao de debito ativado? [yes|no]');
41
		$moip->save();
42
	}
43
}
44