AbstractCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A bootLogger() 0 8 2
1
<?php
2
/**
3
 * This file is part of laravel.su package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace App\Console\Commands;
10
11
use Psr\Log\LoggerInterface;
12
use Illuminate\Console\Command;
13
use Monolog\Handler\StreamHandler;
14
use Illuminate\Foundation\Application;
15
16
/**
17
 * Class AbstractCommand.
18
 */
19
abstract class AbstractCommand extends Command
20
{
21
    /**
22
     * @param Application $app
23
     */
24
    protected function bootLogger(Application $app)
25
    {
26
        if ($app->isLocal()) {
27
            $app->make(LoggerInterface::class)
28
                ->getMonolog()
29
                ->pushHandler(new StreamHandler('php://stdout'));
30
        }
31
    }
32
}
33