AccountID   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Monobank\ValueObject;
6
7
use Monobank\Exception\AccountException;
8
use Monobank\ValueObject\Traits\ValueToStringTrait;
9
10
/**
11
 * Class AccountID.
12
 */
13
class AccountID
14
{
15
    use ValueToStringTrait;
16
17
    /**
18
     * @param string $value
19
     *
20
     * @throws AccountException
21
     */
22
    public function __construct(string $value)
23
    {
24
        $value = trim($value);
25
26
        if (empty($value)) {
27
            throw AccountException::emptyID();
28
        }
29
30
        $this->value = $value;
31
    }
32
}
33