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.
Completed
Push — master ( c7f4e3...a41792 )
by Mario
18:09
created

AttributeValue   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __toString() 0 16 4
A getDataInt() 0 4 1
A getDataFloat() 0 4 1
A getDataText() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\InformationCollection\API\Value;
6
7
class AttributeValue extends ValueObject
8
{
9
    /**
10
     * @var int
11
     */
12
    protected $dataInt;
13
14
    /**
15
     * @var float
16
     */
17
    protected $dataFloat;
18
19
    /**
20
     * @var string
21
     */
22
    protected $dataText;
23
24
    public function __construct(int $dataInt, float $dataFloat, string $dataText)
25
    {
26
        $this->dataInt = $dataInt;
27
        $this->dataFloat = $dataFloat;
28
        $this->dataText = $dataText;
29
    }
30
31
    public function __toString()
32
    {
33
        if (!empty($this->dataText)) {
34
            return $this->dataText;
35
        }
36
37
        if (!empty($this->dataInt)) {
38
            return $this->dataInt;
39
        }
40
41
        if (!empty($this->dataFloat)) {
42
            return $this->dataFloat;
43
        }
44
45
        return '';
46
    }
47
48
    /**
49
     * @return int
50
     */
51
    public function getDataInt(): int
52
    {
53
        return $this->dataInt;
54
    }
55
56
    /**
57
     * @return float
58
     */
59
    public function getDataFloat(): float
60
    {
61
        return $this->dataFloat;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getDataText(): string
68
    {
69
        return $this->dataText;
70
    }
71
}
72