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

MailDriver::perform()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 3
eloc 6
nc 3
nop 0
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 MailDriver extends Check
9
{
10
    /**
11
     * The check description.
12
     *
13
     * @var string
14
     */
15
    protected $description = 'mail.driver and mail.pretend';
16
17
    /**
18
     * Perform the check.
19
     *
20
     * @return CheckResult
21
     */
22
    public function perform()
23
    {
24
        if ($this->app['config']['mail.driver'] === 'array') {
25
            return $this->fail("Mail driver must not be set to 'log' in production");
26
        }
27
28
        if ($this->app['config']['mail.pretend']) {
29
            return $this->fail("'mail.pretend' must not be set to 'true' in production");
30
        }
31
32
        return $this->ok();
33
    }
34
}
35