MoipSeedsCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 3
c 5
b 0
f 0
lcom 0
cbo 0
dl 0
loc 40
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A fire() 0 10 2
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