Psr6NullModule::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Package\Module;
6
7
use Psr\Cache\CacheItemPoolInterface;
8
use Ray\Di\AbstractModule;
9
use Ray\Di\Scope;
10
use Ray\PsrCacheModule\Annotation\Local;
11
use Ray\PsrCacheModule\Annotation\Shared;
12
use Symfony\Component\Cache\Adapter\NullAdapter;
13
14
/**
15
 * Provides CacheItemPoolInterface and derived bindings
16
 *
17
 * The following bindings are provided:
18
 *
19
 * CacheItemPoolInterface:Ray\PsrCacheModule\Annotation\Local
20
 * CacheItemPoolInterface:Ray\PsrCacheModule\Annotation\Shared
21
 */
22
final class Psr6NullModule extends AbstractModule
23
{
24
    protected function configure(): void
25
    {
26
        $this->bind(CacheItemPoolInterface::class)->annotatedWith(Local::class)->to(NullAdapter::class)->in(Scope::SINGLETON);
27
        $this->bind(CacheItemPoolInterface::class)->annotatedWith(Shared::class)->to(NullAdapter::class)->in(Scope::SINGLETON);
28
    }
29
}
30