MoipSeedsCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace SOSTheBlack\Moip\Commands;
2
3
use Moip;
4
use Illuminate\Console\Command;
5
6
class MoipSeedsCommand extends Command {
7
8
	/**
9
	 * The console command name.
10
	 *
11
	 * @var string
12
	 */
13
	protected $name = 'moip:seeds';
14
15
	/**
16
	 * The console command description.
17
	 *
18
	 * @var string
19
	 */
20
	protected $description = 'Running seeds of package';
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 void
34
	 */
35
	public function fire()
36
	{
37
		$this->comment('running seeds sostheblack/moip');
38
		if (Moip::all()->count() === 0) {
39
			Moip::create([]);
40
			$this->line('<info>Seeded: </info>MoipSeeder');
41
		}
42
		$this->call('db:seed', ['--class' => 'DatabaseMoipSeeder']);
43
		$this->comment('Seeds executados');
44
	}
45
}
46