Passed
Pull Request — 1.x (#267)
by Akihito
01:42
created

ResourceModule::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 1
cts 1
cp 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Resource\Module;
6
7
use BEAR\Resource\Annotation\AppName;
8
use Ray\Di\AbstractModule;
9
10
/**
11
 * Provides ResourceInterface and derived bindings
12
 *
13
 * The following module is installed:
14
 *
15
 * AppName
16
 *
17
 * The following module is installed:
18
 *
19
 * ResourceClientModule
20 51
 * AnnotationModule
21
 * EmbedResourceModule
22 51
 * HttpClientModule
23 51
 */
24 51
final class ResourceModule extends AbstractModule
25
{
26
    private string $appName;
27
28
    /**
29 51
     * @param string $appName Application name ex) 'Vendor\Project'
30
     */
31 51
    public function __construct(string $appName = '')
32 51
    {
33 51
        $this->appName = $appName;
34 51
        parent::__construct();
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    protected function configure(): void
41
    {
42
        $this->install(new ResourceClientModule());
43
        $this->install(new AnnotationModule());
44
        $this->install(new EmbedResourceModule());
45
        $this->install(new ());
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected '(', expecting ':' on line 45 at column 27
Loading history...
46
        $this->bind()->annotatedWith(AppName::class)->toInstance($this->appName);
47
    }
48
}
49