xsNOTATION::isOK()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace AlgoWeb\xsdTypes;
4
5
use AlgoWeb\xsdTypes\Facets\LengthTrait;
6
7
/**
8
 * The type xsd:NOTATION represents a reference to a notation.  A notation is a method of interpreting XML and
9
 * non-XML content.  For example, if an element in an XML document contains binary graphics data in JPEG format,
10
 * a notation can be declared to indicate that this is JPEG data.  An attribute of type xsd:NOTATION can then be used
11
 * to indicate which notation applies to the element's content.  A xsd:NOTATION value must be a QName.
12
 *
13
 * xsd:NOTATION is the only built-in type that cannot be the type of attributes or elements.  Instead,
14
 * you must define a new type that restricts xsd:NOTATION, applying one or more enumeration facets.
15
 * Each of these enumeration values must match the name of a declared notation.
16
 * @package AlgoWeb\xsdTypes
17
 */
18
abstract class xsNOTATION extends xsAnySimpleType
19
{
20
    use LengthTrait;
21
22
    /**
23
     * Construct.
24
     *
25
     * @param string $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->checkLength($this->value);
36
        $Qname = new xsQName($this->value);
37
        $this->value = $Qname->__toString();
38
    }
39
}
40