AbstractServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 2
b 0
f 0
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getIdentifier() 0 3 1
A setIdentifier() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace League\Container\ServiceProvider;
6
7
use League\Container\ContainerAwareTrait;
8
9
abstract class AbstractServiceProvider implements ServiceProviderInterface
10
{
11
    use ContainerAwareTrait;
12
13
    /**
14
     * @var string
15
     */
16
    protected $identifier;
17
18 12
    public function getIdentifier(): string
19
    {
20 12
        return $this->identifier ?? get_class($this);
21
    }
22
23 3
    public function setIdentifier(string $id): ServiceProviderInterface
24
    {
25 3
        $this->identifier = $id;
26 3
        return $this;
27
    }
28
}
29