MoipReasonCommand::fire()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 5
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 MoipReasonCommand 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:reason';
14
15
	/**
16
	 * The console command description.
17
	 *
18
	 * @var string
19
	 */
20
	protected $description = 'New reason sales.';
21
22
	/**
23
	 * Create a new command instance.
24
	 */
25
	public function __construct()
26
	{
27
		parent::__construct();
28
	}
29
30
	/**
31
	 * Execute the console command.
32
	 *
33
	 * @return mixed
34
	 */
35
	public function fire()
36
	{
37
		$reason = $this->ask('Motivo da venda:');
38
		$moip = Moip::first();
39
		$moip->reason = $reason;
40
		$moip->save();
41
	}
42
}