Completed
Push — master ( d51385...c569d6 )
by Marcel
01:54
created

RoutesAreNotCached   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

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\Development;
4
5
use BeyondCode\SelfDiagnosis\Checks\Check;
6
7
class RoutesAreNotCached implements Check
8
{
9
10
    /**
11
     * The name of the check.
12
     *
13
     * @return string
14
     */
15
    public function name(): string
16
    {
17
        return 'Routes are not cached';
18
    }
19
20
    /**
21
     * Perform the actual verification of this check.
22
     *
23
     * @return bool
24
     */
25
    public function check(): bool
26
    {
27
        return app()->routesAreCached() === 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(): string
36
    {
37
        return 'Your routes should not be cached during development. Call "php artisan route:clear" to clear the route cache.';
38
    }
39
}