Completed
Push — master ( a40ed3...30c58f )
by butschster
23s queued 19s
created

MailerConfig::getQueueConnection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\SendIt\Config;
13
14
use Spiral\Core\InjectableConfig;
15
16
final class MailerConfig extends InjectableConfig
17
{
18
    public const CONFIG = 'mailer';
19
20
    /** @var array */
21
    protected $config = [
22
        'dsn' => '',
23
        'from' => '',
24
        'queue' => null,
25
        'pipeline' => null,
26
        'queueConnection' => null,
27
    ];
28
29
    public function getDSN(): string
30
    {
31
        return $this->config['dsn'];
32
    }
33
34
    public function getFromAddress(): string
35
    {
36
        return $this->config['from'];
37
    }
38
39
    /**
40
     * @deprecated since v2.9.
41
     */
42
    public function getQueuePipeline(): ?string
43
    {
44
        return $this->getQueue();
45
    }
46
47
    public function getQueue(): ?string
48
    {
49
        return $this->config['queue'] ?? $this->config['pipeline'] ?? null;
50
    }
51
52
    public function getQueueConnection(): ?string
53
    {
54
        return $this->config['queueConnection'] ?? null;
55
    }
56
}
57