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

Integer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 0
c 1
b 0
f 1
dl 0
loc 2
ccs 1
cts 1
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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