HandlerIdentifier   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 23
ccs 9
cts 9
cp 1
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get() 0 3 1
A ensureNotEmpty() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Mcustiel\OneHundredFour;
6
7
class HandlerIdentifier
8
{
9
    /**
10
     * @var string
11
     */
12
    private $identifier;
13
14 2
    public function __construct(string $identifier)
15
    {
16 2
        $this->ensureNotEmpty($identifier);
17 1
        $this->identifier = $identifier;
18 1
    }
19
20 1
    public function get(): string
21
    {
22 1
        return $this->identifier;
23
    }
24
25
    /** @throws \InvalidArgumentException */
26 2
    private function ensureNotEmpty(string $identifier): void
27
    {
28 2
        if (empty($identifier)) {
29 1
            throw new \InvalidArgumentException('Empty identifier name');
30
        }
31 1
    }
32
}
33