Test Failed
Push — main ( 8c0949...0df40c )
by Michael
03:37
created

Integer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 2
c 1
b 0
f 1
dl 0
loc 20
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 $integer)
11
 */
12
class Integer extends ValueObject
13
{
14
    /**
15
     * Create a new instance of the value object.
16
     *
17
     * @param  int|null  $integer
18
     */
19
    public function __construct(protected ?int $integer)
20
    {
21
        //
22
    }
23
24
    /**
25
     * Get the object value.
26
     *
27
     * @return int
28
     */
29
    public function value(): int
30
    {
31
        return (int) $this->integer;
32
    }
33
}
34