xsToken   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
namespace AlgoWeb\xsdTypes;
3
4
/**
5
 * The type xsd:token represents a character string that may contain any Unicode character allowed by XML.
6
 * Certain characters, namely the "less than" symbol (<) and the ampersand (&), must be escaped
7
 * (using the entities &lt; and &amp;, respectively) when used in strings in XML instances.
8
 *
9
 * The name xsd:token may be slightly confusing because it implies that there may be only one token with no whitespace.
10
 * In fact, there can be whitespace in a token value.  The xsd:token type has a whiteSpace facet of collapse, which
11
 * means that the processor replaces each carriage return, line feed, and tab by a single space. After this replacement,
12
 * each group of consecutive spaces is collapsed into one space character, and all leading and trailing spaces are
13
 * removed.  This processing is equivalent to the processing of non-CDATA attribute values in XML 1.0.
14
 *
15
 * @package AlgoWeb\xsdTypes
16
 */
17
class xsToken extends xsNormalizedString
18
{
19
    /**
20
     * Construct.
21
     *
22
     * @param string $value
23
     */
24
    public function __construct($value)
25
    {
26
        parent::__construct($value);
27
        $this->setWhiteSpaceFacet('collapse');
28
    }
29
}
30