Completed
Push — master ( 95a747...5e84db )
by Nekrasov
02:10
created

QueueDriver   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A perform() 0 14 3
1
<?php
2
3
namespace Arrilot\SystemCheck\Checks\Laravel\Production;
4
5
use Arrilot\SystemCheck\Checks\Check;
6
use Arrilot\SystemCheck\CheckResult;
7
8
class QueueDriver extends Check
9
{
10
    /**
11
     * The check description.
12
     *
13
     * @var string
14
     */
15
    protected $description = 'queue.default';
16
17
    /**
18
     * Perform the check.
19
     *
20
     * @return CheckResult
21
     */
22
    public function perform()
23
    {
24
        $driver = $this->app['config']['queue.default'];
25
26
        if ($driver === 'null') {
27
            return $this->fail("Default queue driver must not be set to 'null' in production");
28
        }
29
30
        if ($driver === 'sync') {
31
            return $this->note('Sync queue driver is not recommended for production');
32
        }
33
34
        return $this->ok();
35
    }
36
}
37