GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

FieldValue   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 91
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 1
dl 0
loc 91
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getFieldDefinitionId() 0 4 1
A getDataFloat() 0 4 1
A getDataInt() 0 4 1
A getDataText() 0 4 1
A withStringValue() 0 7 1
A withIntValue() 0 8 1
A withFloatValue() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\InformationCollection\API\Value\Legacy;
6
7
use Netgen\InformationCollection\API\Value\ValueObject;
8
9
class FieldValue extends ValueObject
10
{
11
    /**
12
     * @var int
13
     *
14
     * previous $contentClassAttributeId
15
     */
16
    protected $fieldDefinitionId;
17
18
    /**
19
     * @var float
20
     */
21
    protected $dataFloat = 0.0;
22
23
    /**
24
     * @var int
25
     */
26
    protected $dataInt = 0;
27
28
    /**
29
     * @var string
30
     */
31
    protected $dataText = '';
32
33
    public function __construct(int $fieldDefinitionId, string $dataText, int $dataInt = 0, float $dataFloat = 0.0)
34
    {
35
        $this->fieldDefinitionId = $fieldDefinitionId;
36
        $this->dataInt = $dataInt;
37
        $this->dataFloat = $dataFloat;
38
        $this->dataText = $dataText;
39
    }
40
41
    /**
42
     * @return int
43
     */
44
    public function getFieldDefinitionId(): int
45
    {
46
        return $this->fieldDefinitionId;
47
    }
48
49
    /**
50
     * @return float
51
     */
52
    public function getDataFloat(): float
53
    {
54
        return $this->dataFloat;
55
    }
56
57
    /**
58
     * @return int
59
     */
60
    public function getDataInt(): int
61
    {
62
        return $this->dataInt;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getDataText(): string
69
    {
70
        return $this->dataText;
71
    }
72
73
    public static function withStringValue(int $fieldDefinitionId, string $dataText): self
74
    {
75
        return new self(
76
            $fieldDefinitionId,
77
            $dataText
78
        );
79
    }
80
81
    public static function withIntValue(int $fieldDefinitionId, int $dataInt): self
82
    {
83
        return new self(
84
            $fieldDefinitionId,
85
            '',
86
            $dataInt
87
        );
88
    }
89
90
    public static function withFloatValue(int $fieldDefinitionId, float $dataFloat): self
91
    {
92
        return new self(
93
            $fieldDefinitionId,
94
            '',
95
            0,
96
            $dataFloat
97
        );
98
    }
99
}
100