Passed
Push — master ( 1d5b12...ea0462 )
by Anton
02:31
created

AuthConfig::wire()   A

Complexity

Conditions 5
Paths 4

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 15
rs 9.6111
cc 5
nc 4
nop 1
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\Auth\Config;
13
14
use Spiral\Core\Container\Autowire;
15
use Spiral\Core\InjectableConfig;
16
17
/**
18
 * Manages auth http transport configuration.
19
 */
20
final class AuthConfig extends InjectableConfig
21
{
22
    // Configuration source.
23
    public const CONFIG = 'auth';
24
25
    /**
26
     * @return string
27
     */
28
    public function getDefaultTransport(): string
29
    {
30
        return $this->config['defaultTransport'];
31
    }
32
33
    /**
34
     * @return Autowire[]
35
     */
36
    public function getTransports(): array
37
    {
38
        return array_map([Autowire::class, 'wire'], $this->config['transports']);
39
    }
40
}
41