xsNMTOKEN   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 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