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

ProductionHandler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 8 2
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