ConfigServiceProvider::register()   B
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 25
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 25
ccs 13
cts 13
cp 1
rs 8.8571
cc 2
eloc 11
nc 2
nop 0
crap 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 19
    public function register()
17
    {
18
        # Adding Hipchat and Gitter handlers to Monolog logger for non-production environments.
19 19
        if (!app()->environment('production')) {
20
            /*
21
            |--------------------------
22
            | Hipchat integration
23
            |--------------------------
24
            */
25 19
            $hipchatConfig = app('config')->get('services.hipchat');
26 19
            $hipchatHandler = new \Monolog\Handler\HipChatHandler(
27 19
                $hipchatConfig['token'],
28 19
                $hipchatConfig['room'],
29 19
                $hipchatConfig['name'],
30 19
                false,
31 19
                $hipchatConfig['level']
32
            );
33
//            $bufferHandlerForHipchat = new \Monolog\Handler\BufferHandler($hipchatHandler);
34 19
            app('log')->getMonolog()->pushHandler($hipchatHandler);
35
        }
36
37 19
        config([
38
            //
39 19
        ]);
40 19
    }
41
}
42