MoipInstallCommand::migrate()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 3
nc 2
nop 0
1
<?php namespace SOSTheBlack\Moip\Commands;
2
3
use Illuminate\Console\Command;
4
5
class MoipInstallCommand extends Command {
6
7
	/**
8
	 * The console command name.
9
	 *
10
	 * @var string
11
	 */
12
	protected $name = 'moip:install';
13
14
	/**
15
	 * The console command description.
16
	 *
17
	 * @var string
18
	 */
19
	protected $description = 'Complete installation and configuration';
20
21
	/**
22
	 * Create a new command instance.
23
	 */
24
	public function __construct()
25
	{
26
		parent::__construct();
27
	}
28
29
	/**
30
	 * Execute the console command.
31
	 *
32
	 * @return void
33
	 */
34
	public function fire()
35
	{
36
		$this->migrate();
37
		$this->seeds();
38
		$this->config();
39
		$this->assets();
40
		$this->auth();
41
		$this->reason();
42
		$this->receiver();
43
		$this->payment();
44
		$this->urlnotification();
45
		$this->urlreturn();
46
	}
47
48
	/**
49
	 * migrate
50
	 * 
51
	 * @return void
52
	 */
53
	private function migrate()
54
	{
55
		if ($this->confirm('Executar migracoes? [yes|no]')) {
56
			$this->call('moip:migrate');
57
		}
58
	}
59
60
	/**
61
	 * seeds
62
	 * 
63
	 * @return void
64
	 */
65
	private function seeds()
66
	{
67
		if ($this->confirm('Executar seeds do package? [yes|no]')) {
68
			$this->call('moip:seeds');
69
		}
70
	}
71
72
	/**
73
	 * config
74
	 * 
75
	 * @return void
76
	 */
77
	private function config()
78
	{
79
		if ($this->confirm('Publicar arquivo de configuracao? [yes|no]')) {
80
			$this->call('moip:config');
81
		}
82
	}
83
84
	/**
85
	 * assets
86
	 * 
87
	 * @return void
88
	 */
89
	private function assets()
90
	{
91
		if ($this->confirm('Publicar Asses? [yes|no]')) {
92
			$this->call('moip:assets');
93
		}
94
	}
95
96
	/**
97
	 * auth
98
	 * 
99
	 * @return void
100
	 */
101
	private function auth()
102
	{
103
		if ($this->confirm('Configurar credenciais? [yes|no]')) {
104
			$this->call('moip:auth');
105
		}
106
	}
107
108
	/**
109
	 * reason
110
	 * 
111
	 * @return void
112
	 */
113
	private function reason()
114
	{
115
		if ($this->confirm('Configurar motivo da venda? [yes|no]')) {
116
			$this->call('moip:reason');
117
		}
118
	}
119
120
	/**
121
	 * receiver
122
	 * 
123
	 * @return void
124
	 */
125
	private function receiver()
126
	{
127
		if ($this->confirm('Configurar recebedor primario? [yes|no]')) {
128
			$this->call('moip:receiver');
129
		}
130
	}
131
132
	/**
133
	 * payment
134
	 * 
135
	 * @return void
136
	 */
137
	private function payment()
138
	{
139
		if ($this->confirm('Configurar metodos de pagamentos? [yes|no]')) {
140
			$this->call('moip:payment');
141
		}
142
	}
143
	/**
144
	 * urlnotification
145
	 * 
146
	 * @return void
147
	 */
148
	private function urlnotification()
149
	{
150
		if ($this->confirm('Configurar URL NASP? [yes|no]')) {
151
			$this->call('moip:urlnotification');	
152
		}
153
	}
154
155
	/**
156
	 * urlreturn
157
	 * 
158
	 * @return void
159
	 */
160
	private function urlreturn()
161
	{
162
		if ($this->confirm('Configurar URL de retorno? [yes|no]')) {
163
			$this->call('moip:urlreturn');	
164
		}
165
	}
166
}
167