CacheNamespaceModule   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A configure() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Package\Module;
6
7
use Ray\Di\AbstractModule;
8
9
class CacheNamespaceModule extends AbstractModule
10
{
11
    /** @var string */
12
    private $cacheNamespace;
13
14
    public function __construct(string $cacheNamespace, ?AbstractModule $module = null)
15
    {
16
        $this->cacheNamespace = $cacheNamespace;
17
        parent::__construct($module);
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    protected function configure(): void
24
    {
25
        $this->bind()->annotatedWith('cache_namespace')->toInstance($this->cacheNamespace);
26
    }
27
}
28