IntValue   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 23
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A getValue() 0 4 1
1
<?php
2
/**
3
 * User: delboy1978uk
4
 * Date: 13/11/2016
5
 * Time: 13:26
6
 */
7
8
namespace Del\Common\Value;
9
10
use InvalidArgumentException;
11
12
class IntValue extends AbstractValue
13
{
14
    /**
15
     * IntValue constructor.
16
     *
17
     * @param int $value
18
     */
19 1
    public function __construct($value)
20
    {
21 1
        if(!is_numeric($value)) {
22 1
            throw new InvalidArgumentException('Please supply a numeric value');
23
        }
24 1
        $this->value = (int) $value;
25 1
    }
26
27
    /**
28
     * @return int
29
     */
30 1
    public function getValue()
31
    {
32 1
        return parent::getValue();
33
    }
34
}