Completed
Push — refactor ( 1ac315 )
by Akihito
05:56
created

DiCompileModule::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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