xsInteger   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
c 1
b 1
f 0
lcom 0
cbo 1
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 1
1
<?php
2
namespace AlgoWeb\xsdTypes;
3
4
/**
5
 * The type xsd:integer represents an arbitrarily large integer, from which twelve other built-in integer types are
6
 * derived (directly or indirectly).  An xsd:integer is a sequence of digits, optionally preceded by a + or -
7
 * sign.  Leading zeros are permitted, but decimal points are not.
8
 * @package AlgoWeb\xsdTypes
9
 */
10
class xsInteger extends xsDecimal
11
{
12
    /**
13
     * Construct.
14
     *
15
     * @param int $value
16
     */
17
    public function __construct($value)
18
    {
19
        parent::__construct($value);
20
        $this->setFractionDigits(0);
21
        /*
22
         * Match a single character present in the list below [\-+]?
23
         * ? Quantifier — Matches between zero and one times, as many times as possible, giving back as needed
24
         * \- matches the character - literally (case sensitive)
25
         * + matches the character + literally (case sensitive)
26
         * Match a single character present in the list below [0-9]+
27
         * + Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed
28
         * 0-9 a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
29
         */
30
        $this->setPatternFacet('/[\-+]?[0-9]+/');
31
    }
32
}
33