Passed
Push — master ( 083753...993590 )
by Kirill
03:25
created

EnvSuppressErrors::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Valentin V (Vvval)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Http\Middleware\ErrorHandlerMiddleware;
13
14
use Spiral\Boot\EnvironmentInterface;
15
16
class EnvSuppressErrors implements SuppressErrorsInterface
17
{
18
    /** @var EnvironmentInterface */
19
    private $environment;
20
21
    /**
22
     * @param EnvironmentInterface $environment
23
     */
24
    public function __construct(EnvironmentInterface $environment)
25
    {
26
        $this->environment = $environment;
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function suppressed(): bool
33
    {
34
        return !$this->environment->get('DEBUG', false);
35
    }
36
}
37