iDokladAbstractEnum   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 37
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A createJson() 0 4 1
A __toString() 0 4 1
A __construct() 0 4 1
A getValue() 0 4 1
1
<?php
2
3
namespace Fousky\Component\iDoklad\LOV;
4
5
/**
6
 * @author Lukáš Brzák <[email protected]>
7
 */
8
abstract class iDokladAbstractEnum implements iDokladEnumInterface
9
{
10
    /** @var int $value */
11
    protected $value;
12
13
    /**
14
     * @return int
15
     */
16
    public function createJson(): int
17
    {
18
        return $this->value;
19
    }
20
21
    /**
22
     * @return string
23
     */
24
    public function __toString(): string
25
    {
26
        return (string) $this->value;
27
    }
28
29
    /**
30
     * @param int $value
31
     */
32
    public function __construct(int $value)
33
    {
34
        $this->value = $value;
35
    }
36
37
    /**
38
     * @return int
39
     */
40
    public function getValue(): int
41
    {
42
        return $this->value;
43
    }
44
}
45