Passed
Push — main ( ce1342...7e82e7 )
by Michael
03:19
created

Integer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
eloc 2
c 2
b 0
f 1
dl 0
loc 20
ccs 3
cts 3
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A value() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MichaelRubel\ValueObjects\Primitive;
6
7
use MichaelRubel\ValueObjects\ValueObject;
8
9
/**
10
 * @method static static make(int|float|string|null $integer)
11
 */
12
class Integer extends ValueObject
13
{
14
    /**
15
     * Create a new instance of the value object.
16
     *
17
     * @param  int|float|string|null  $integer
18
     */
19 9
    public function __construct(protected int|float|string|null $integer)
20
    {
21
        //
22
    }
23
24
    /**
25
     * Get the object value.
26
     *
27
     * @return int
28
     */
29 9
    public function value(): int
30
    {
31 9
        return (int) $this->integer;
32
    }
33
}
34