Sender   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php declare(strict_types=1);
2
namespace Loevgaard\Linkmobility\ValueObject;
3
4
use Assert\Assert;
5
6
class Sender extends StringValueObject
7
{
8 6
    public function __construct(string $value)
9
    {
10
        // if the sender is alphanumeric, test the length
11 6
        if (!preg_match('/^\+[0-9]+$/i', $value)) {
12 5
            Assert::that($value)->maxLength(11);
13
        }
14
15 5
        parent::__construct($value);
16 5
    }
17
}
18