ProdQueryRepositoryModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 13
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\QueryRepository;
6
7
use BEAR\RepositoryModule\Annotation\KnownTagTtl;
8
use BEAR\RepositoryModule\Annotation\ResourceObjectPool;
9
use Ray\Di\AbstractModule;
10
use Ray\PsrCacheModule\LocalCacheProvider;
11
use Symfony\Component\Cache\Adapter\AdapterInterface;
12
13
final class ProdQueryRepositoryModule extends AbstractModule
14
{
15
    /**
16
     * {@inheritDoc}
17
     *
18
     * @see https://github.com/symfony/cache/blob/5.3/Adapter/TagAwareAdapter.php
19
     */
20
    protected function configure(): void
21
    {
22
        // Bind ResourceObjectPool to local cache (APCu or File)
23
        $this->bind(AdapterInterface::class)->annotatedWith(ResourceObjectPool::class)->toProvider(LocalCacheProvider::class);
24
        // Boost the performance of symfony/cache
25
        $this->bind()->annotatedWith(KnownTagTtl::class)->toInstance(0.15);
26
    }
27
}
28