Completed
Pull Request — master (#126)
by Phil
19:36 queued 04:37
created

AbstractServiceProvider::withSignature()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
ccs 0
cts 0
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php declare(strict_types=1);
2
3
namespace League\Container\ServiceProvider;
4
5
use League\Container\ContainerAwareTrait;
6
7
abstract class AbstractServiceProvider implements ServiceProviderInterface
8
{
9
    use ContainerAwareTrait;
10
11
    /**
12
     * @var array
13
     */
14
    protected $provides = [];
15
16
    /**
17
     * @var string
18
     */
19 18
    protected $signature;
20
21 18
    /**
22 3
     * {@inheritdoc}
23
     */
24
    public function provides(string $alias): bool
25 18
    {
26
        return (in_array($alias, $this->provides));
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function withSignature(string $signature): ServiceProviderInterface
33
    {
34
        $this->signature = $signature;
35
36
        return $this;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function getSignature(): string
43
    {
44
        return (is_null($this->signature)) ? get_class($this) : $this->signature;
45
    }
46
}
47