ProdQueryRepositoryModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 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 Override;
10
use Ray\Di\AbstractModule;
11
use Ray\PsrCacheModule\LocalCacheProvider;
12
use Symfony\Component\Cache\Adapter\AdapterInterface;
13
14
final class ProdQueryRepositoryModule extends AbstractModule
15
{
16
    /**
17
     * {@inheritDoc}
18
     *
19
     * @see https://github.com/symfony/cache/blob/5.3/Adapter/TagAwareAdapter.php
20
     */
21
    #[Override]
22
    protected function configure(): void
23
    {
24
        // Bind ResourceObjectPool to local cache (APCu or File)
25
        $this->bind(AdapterInterface::class)->annotatedWith(ResourceObjectPool::class)->toProvider(LocalCacheProvider::class);
26
        // Boost the performance of symfony/cache
27
        $this->bind()->annotatedWith(KnownTagTtl::class)->toInstance(0.15);
28
    }
29
}
30