Completed
Pull Request — master (#26)
by
unknown
01:28
created

ConfigurationIsNotCached   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 33
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 ConfigurationIsNotCached implements Check
8
{
9
10
    /**
11
     * The name of the check.
12
     *
13
     * @return string
14
     */
15
    public function name(array $config): string
16
    {
17
        return 'Configuration is not cached';
18
    }
19
20
    /**
21
     * Perform the actual verification of this check.
22
     *
23
     * @return bool
24
     */
25
    public function check(array $config): bool
26
    {
27
        return app()->configurationIsCached() === false;
28
    }
29
30
    /**
31
     * The error message to display in case the check does not pass.
32
     *
33
     * @return string
34
     */
35
    public function message(array $config): string
36
    {
37
        return 'Your configuration files should not be cached during development. Call "php artisan config:clear" to clear the config cache.';
38
    }
39
}
40