Completed
Push — master ( b54d1f...cbe69e )
by Adam
02:43
created

VOFloat::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3.072

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
ccs 4
cts 5
cp 0.8
rs 9.4285
c 1
b 0
f 0
cc 3
eloc 4
nc 2
nop 1
crap 3.072
1
<?php
2
3
namespace BestServedCold\PhalueObjects;
4
5
use BestServedCold\PhalueObjects\Exception\InvalidTypeException;
6
7
/**
8
 * Class VOFloat
9
 *
10
 * @package   BestServedCold\PhalueObjects\Mathematical
11
 * @author    Adam Lewis <[email protected]>
12
 * @copyright Copyright (c) 2015 Best Served Cold Media Limited
13
 * @license   http://http://opensource.org/licenses/GPL-3.0 GPL License
14
 * @link      http://bestservedcold.com
15
 * @since     0.0.1-alpha
16
 * @version   0.0.2-alpha
17
 */
18
class VOFloat extends ValueObject
19
{
20
    /**
21
     * @param $value
22
     */
23 6
    public function __construct($value)
24
    {
25 6
        if (!is_float($value) && ! is_int($value)) {
26
            throw new InvalidTypeException($value, [ 'float' ]);
27
        }
28
29 6
        parent::__construct($value);
30 6
    }
31
}
32