BaseCommand::output()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 2
1
<?php namespace App\Console\Commands;
2
3
use Illuminate\Console\Command;
4
use Symfony\Component\Console\Input\InputOption;
5
use Symfony\Component\Console\Input\InputArgument;
6
7
class BaseCommand extends Command {
8
9
	/**
10
	 * Create a new command instance.
11
	 */
12
	public function __construct()
13
	{
14
		parent::__construct();
15
	}
16
17
	public function output($message, $sendToSlack = true)
18
	{
19
		$message = '`[' . strtoupper(app('env')) . ']` ' . $message;
20
		
21
		$this->info(str_replace('`', '', $message));
22
23
		if ($sendToSlack) {
24
			\Slack::send($message);
25
		}
26
	}
27
}
28