Completed
Push — 1.x ( 0f2e27...4bee37 )
by Akihito
18s queued 16s
created

ScriptInjectorModule::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
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 Ray\Compiler\ScriptInjector;
8
use Ray\Di\AbstractModule;
9
use Ray\Di\InjectorInterface;
10
11
/**
12
 * Provides InjectorInterface
13
 */
14
class ScriptInjectorModule extends AbstractModule
15
{
16
    public function __construct(
17
        private string $scriptDir,
18
        AbstractModule|null $module = null,
19
    ) {
20
        parent::__construct($module);
21
    }
22
23
    /**
24
     * {@inheritDoc}
25
     */
26
    protected function configure(): void
27
    {
28
        $this->bind(InjectorInterface::class)->toInstance(new ScriptInjector($this->scriptDir));
29
    }
30
}
31