MemoryFailerDriverConfigurator::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
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