Completed
Pull Request — master (#42)
by Şəhriyar
446:28 queued 439:35
created

ConfigServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 37
ccs 0
cts 13
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B register() 0 25 2
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