Completed
Push — master ( dbe031...1e3a1a )
by Marcel
01:42
created

XDebugIsNotEnabled   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 4 1
A check() 0 4 1
A message() 0 4 1
1
<?php
2
3
namespace BeyondCode\SelfDiagnosis\Checks;
4
5
use BeyondCode\SelfDiagnosis\Checks\Check;
6
7
class XDebugIsNotEnabled implements Check
8
{
9
    /**
10
     * The name of the check.
11
     *
12
     * @return string
13
     */
14
    public function name(array $config): string
15
    {
16
        return 'The xdebug extension is not active.';
17
    }
18
19
    /**
20
     * Perform the actual verification of this check.
21
     *
22
     * @return bool
23
     */
24
    public function check(array $config): bool
25
    {
26
        return extension_loaded('xdebug') === false;
27
    }
28
29
    /**
30
     * The error message to display in case the check does not pass.
31
     *
32
     * @return string
33
     */
34
    public function message(array $config): string
35
    {
36
        return 'You should not have the "xdebug" PHP extension activated in production.';
37
    }
38
}
39