Completed
Push — master ( a8687a...737d23 )
by Joachim
07:33
created

Recipient::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
namespace Loevgaard\Linkmobility\ValueObject;
3
4
use Assert\Assert;
5
6
class Recipient extends StringValueObject
7
{
8 4
    public function __construct(string $value)
9
    {
10
        // valid formats can be found here: https://linkmobility.atlassian.net/wiki/spaces/COOL/pages/26017807/08.+Messages#id-08.Messages-recipients
11 4
        Assert::that($value)->regex('/^(\+|c)?[0-9]+$/i');
12
13 3
        parent::__construct($value);
14 3
    }
15
}
16