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

ResourceModule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 23
ccs 7
cts 7
cp 1
rs 10
c 4
b 0
f 0
wmc 2
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