Passed
Push — master ( d898ef...46a72e )
by Christopher
02:06 queued 27s
created

xsFloat   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isOK() 0 4 1
1
<?php
2
3
namespace AlgoWeb\xsdTypes;
4
5
use AlgoWeb\xsdTypes\Facets\MinMaxTrait;
6
7
/**
8
 * The type xsd:float represents an IEEE single-precision 32-bit floating-point number. The format of xsd:float
9
 * values is a mantissa (a number which conforms to the type decimal) followed, optionally, by the character "E"
10
 * or "e" followed by an exponent. The exponent must be an integer. For example, 3E2 represents 3 times 10 to
11
 * the 2nd power, or 300. The exponent must be an integer.
12
 *
13
 * In addition, the following values are valid: INF (infinity), -INF (negative infinity), and NaN (Not a Number).
14
 * INF is considered to be greater than all other values, while -INF is less than all other values.
15
 * The value NaN cannot be compared to any other values, although it equals itself.
16
 * @package AlgoWeb\xsdTypes
17
 */
18
class xsFloat extends xsAnySimpleType
19
{
20
    use MinMaxTrait;
21
22
    /**
23
     * Construct
24
     *
25
     * @param float $value
26
     */
27
    public function __construct($value)
28
    {
29
        parent::__construct($value);
30
        $this->setWhiteSpaceFacet("collapse");
31
    }
32
33
    protected function isOK()
34
    {
35
        $this->CheckMinMax($this->__value);
36
    }
37
}
38