Completed
Pull Request — master (#42)
by Şəhriyar
383:50 queued 376:33
created

ConfigServiceProvider::register()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 25
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 25
ccs 0
cts 13
cp 0
rs 8.8571
c 1
b 0
f 0
cc 2
eloc 11
nc 2
nop 0
crap 6
1
<?php namespace App\Providers;
2
3
use Illuminate\Support\ServiceProvider;
4
5
class ConfigServiceProvider extends ServiceProvider
6
{
7
    /**
8
     * Overwrite any vendor / package configuration.
9
     *
10
     * This service provider is intended to provide a convenient location for you
11
     * to overwrite any "vendor" or package configuration that you may want to
12
     * modify before the application handles the incoming request / command.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        # Adding Hipchat and Gitter handlers to Monolog logger for non-production environments.
19
        if (!app()->environment('production')) {
20
            /*
21
            |--------------------------
22
            | Hipchat integration
23
            |--------------------------
24
            */
25
            $hipchatConfig = app('config')->get('services.hipchat');
26
            $hipchatHandler = new \Monolog\Handler\HipChatHandler(
27
                $hipchatConfig['token'],
28
                $hipchatConfig['room'],
29
                $hipchatConfig['name'],
30
                false,
31
                $hipchatConfig['level']
32
            );
33
//            $bufferHandlerForHipchat = new \Monolog\Handler\BufferHandler($hipchatHandler);
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
34
            app('log')->getMonolog()->pushHandler($hipchatHandler);
35
        }
36
37
        config([
38
            //
39
        ]);
40
    }
41
}
42