Completed
Push — master ( 83dee0...9c2066 )
by Márk
05:19
created

ProductionHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nofw\Foundation\Whoops\Handler;
6
7
use Whoops\Handler\Handler;
8
9
/**
10
 * Production handler stops the execution chain when the application is in production mode.
11
 *
12
 * @author Márk Sági-Kazár <[email protected]>
13
 */
14
class ProductionHandler extends Handler
15
{
16
    /**
17
     * @var bool
18
     */
19
    private $debug = false;
20
21
    public function __construct(bool $debug)
22
    {
23
        $this->debug = $debug;
24
    }
25
26
    public function handle(): int
27
    {
28
        if ($this->debug) {
29
            return Handler::DONE;
30
        }
31
32
        return Handler::QUIT;
33
    }
34
}
35