ScriptinjectorModule::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Package\Module;
6
7
use Ray\Compiler\ScriptInjector;
8
use Ray\Di\AbstractModule;
9
use Ray\Di\InjectorInterface;
10
11
class ScriptinjectorModule extends AbstractModule
12
{
13
    /** @var string */
14
    private $scriptDir;
15
16
    public function __construct(string $scriptDir, ?AbstractModule $module = null)
17
    {
18
        $this->scriptDir = $scriptDir;
19
        parent::__construct($module);
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected function configure(): void
26
    {
27
        $this->bind(InjectorInterface::class)->toInstance(new ScriptInjector($this->scriptDir));
28
    }
29
}
30