MemoryFailerDriverConfigurator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 26
ccs 7
cts 7
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A available() 0 3 1
A scheme() 0 3 1
A configure() 0 5 1
1
<?php
2
3
namespace Bdf\QueueBundle\DependencyInjection\Failer;
4
5
use Bdf\Dsn\DsnRequest;
6
use Bdf\Queue\Failer\MemoryFailedJobRepository;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
/**
10
 * Configurator for `MemoryFailedJobRepository`
11
 * Does not take parameters.
12
 *
13
 * DSN format: "memory:"
14
 */
15
final class MemoryFailerDriverConfigurator implements FailerDriverConfiguratorInterface
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20 8
    public function scheme(): string
21
    {
22 8
        return 'memory';
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 8
    public function available(ContainerBuilder $container): bool
29
    {
30 8
        return true;
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 5
    public function configure(DsnRequest $dsn, ContainerBuilder $container): string
37
    {
38 5
        $container->register(MemoryFailedJobRepository::class, MemoryFailedJobRepository::class);
39
40 5
        return MemoryFailedJobRepository::class;
41
    }
42
}
43