ProdQueryRepositoryModule::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
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