Passed
Push — multi_binding ( 75a5e8 )
by Akihito
02:09
created

Set::getKey()   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 Ray\Di\Di;
6
7
use Attribute;
8
9
use function sprintf;
10
11
#[Attribute(Attribute::TARGET_PARAMETER), Qualifier]
12
final class Set
13
{
14
    /** @var ""|class-string */
0 ignored issues
show
Documentation Bug introduced by
The doc comment ""|class-string at position 0 could not be parsed: Unknown type name '""' at position 0 in ""|class-string.
Loading history...
15
    public $interface;
16
17
    /** @var string */
18
    public $name;
19
20
    /**
21
     * @param ""|class-string $interface
0 ignored issues
show
Documentation Bug introduced by
The doc comment ""|class-string at position 0 could not be parsed: Unknown type name '""' at position 0 in ""|class-string.
Loading history...
22
     */
23
    public function __construct(string $interface, string $name = '')
24
    {
25
        $this->interface = $interface;
26
        $this->name = $name;
27
    }
28
29
    public function getKey(): string
30
    {
31
        return sprintf('%s-%s', $this->interface, $this->name);
32
    }
33
}
34