xsNMTOKEN::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
namespace AlgoWeb\xsdTypes;
3
4
/**
5
 * The type xsd:NMTOKEN represents a single string token.  xsd:NMTOKEN values may consist of letters, digits,
6
 * periods (.), hyphens (-), underscores (_), and colons (:).  They may start with any of these characters.
7
 * xsd:NMTOKEN has a whiteSpace facet value of collapse, so any leading or trailing whitespace will be removed.
8
 * However, no whitespace may appear within the value itself.
9
 *
10
 * @package AlgoWeb\xsdTypes
11
 */
12
class xsNMTOKEN extends xsToken
13
{
14
    /**
15
     * Construct.
16
     *
17
     * @param string $value
18
     */
19
    public function __construct($value)
20
    {
21
        parent::__construct($value);
22
        $this->setPatternFacet('(\c)+');
23
        // Added somthing to prevent spaces.
24
        $this->setPatternFacet('[^-\s]*', false);
25
    }
26
}
27