TcpPort   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0
ccs 7
cts 7
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A guard() 0 6 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpValueObjects\Network;
6
7
use PhpValueObjects\AbstractValueObject;
8
9
abstract class TcpPort extends AbstractValueObject
10
{
11 9
    public function __construct(int $value)
12
    {
13 9
        parent::__construct($value);
14 3
    }
15
16 9
    protected function guard($value): void
17
    {
18 9
        if ($value < 0 || $value > 65535) {
19 6
            $this->throwException($value);
20
        }
21 3
    }
22
}
23