Psr6NullModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Package\Module;
6
7
use Override;
8
use Psr\Cache\CacheItemPoolInterface;
9
use Ray\Di\AbstractModule;
10
use Ray\Di\Scope;
11
use Ray\PsrCacheModule\Annotation\Local;
12
use Ray\PsrCacheModule\Annotation\Shared;
13
use Symfony\Component\Cache\Adapter\NullAdapter;
14
15
/**
16
 * Provides CacheItemPoolInterface and derived bindings
17
 *
18
 * The following bindings are provided:
19
 *
20
 * CacheItemPoolInterface:Ray\PsrCacheModule\Annotation\Local
21
 * CacheItemPoolInterface:Ray\PsrCacheModule\Annotation\Shared
22
 */
23
final class Psr6NullModule extends AbstractModule
24
{
25
    #[Override]
26
    protected function configure(): void
27
    {
28
        $this->bind(CacheItemPoolInterface::class)->annotatedWith(Local::class)->to(NullAdapter::class)->in(Scope::SINGLETON);
29
        $this->bind(CacheItemPoolInterface::class)->annotatedWith(Shared::class)->to(NullAdapter::class)->in(Scope::SINGLETON);
30
    }
31
}
32