ProdQueryRepositoryModule::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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