Completed
Push — develop ( 2f90e1...bffb25 )
by Kirill
07:59
created

GitterHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of GitterBot package.
4
 *
5
 * @author Serafim <[email protected]>
6
 * @date 28.01.2016 16:27
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace App\Exceptions;
12
13
use Gitter\Handlers\DebugErrorHandler;
14
use Gitter\Handlers\ErrorHandlerInterface;
15
16
/**
17
 * Class GitterHandler
18
 * @package App\Exceptions
19
 */
20
class GitterHandler implements ErrorHandlerInterface
21
{
22
    /**
23
     * @var DebugErrorHandler
24
     */
25
    protected $debugHandler;
26
27
    /**
28
     * GitterHandler constructor.
29
     */
30
    public function __construct()
31
    {
32
        $this->debugHandler = new DebugErrorHandler();
33
    }
34
35
    /**
36
     * @param \Throwable $e
37
     */
38
    public function fire(\Throwable $e)
39
    {
40
        if (app()->isLocal()) {
41
            $this->debugHandler->fire($e);
42
        }
43
    }
44
}
45