Passed
Pull Request — master (#855)
by Alexander
06:24
created

MailerConfig::getTransportFactories()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\SendIt\Config;
6
7
use Spiral\Core\InjectableConfig;
8
9
final class MailerConfig extends InjectableConfig
10
{
11
    public const CONFIG = 'mailer';
12
13 23
    public function __construct(
14
        array $config = [
15
            'dsn' => '',
16
            'from' => '',
17
            'queue' => null,
18
            'queueConnection' => null,
19
            'transportFactories' => []
20
        ]
21
    ) {
22 23
        parent::__construct($config);
23
    }
24
25 10
    public function getDSN(): string
26
    {
27 10
        return $this->config['dsn'] ?? '';
28
    }
29
30 7
    public function getFromAddress(): string
31
    {
32 7
        return $this->config['from'] ?? '';
33
    }
34
35 7
    public function getQueue(): ?string
36
    {
37 7
        return $this->config['queue'] ?? null;
38
    }
39
40 4
    public function getQueueConnection(): ?string
41
    {
42 4
        return $this->config['queueConnection'] ?? null;
43
    }
44
45
    /**
46
     * @return list<class-string<\Symfony\Component\Mailer\Transport\TransportFactoryInterface>>
0 ignored issues
show
Bug introduced by
The type Spiral\SendIt\Config\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
47
     */
48 8
    public function getTransportFactories(): array
49
    {
50 8
        return $this->config['transportFactories'] ?? [];
51
    }
52
}
53