LengthRule::symbol()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WsdlToPhp\PackageGenerator\File\Validation;
6
7
/**
8
 * @see https://www.w3.org/TR/xmlschema-2/#rf-length
9
 * Validation Rule: Length Valid
10
 * A value in a ·value space· is facet-valid with respect to ·length·, determined as follows:
11
 *  - 1 if the {variety} is ·atomic· then
12
 *   - 1.1 if {primitive type definition} is string or anyURI, then the length of the value, as measured in characters ·must· be equal to {value};
13
 *   - 1.2 if {primitive type definition} is hexBinary or base64Binary, then the length of the value, as measured in octets of the binary data, ·must· be equal to {value};
14
 *   - 1.3 if {primitive type definition} is QName or NOTATION, then any {value} is facet-valid.
15
 *  - 2 if the {variety} is ·list·, then the length of the value, as measured in list items, ·must· be equal to {value}
16
 */
17
final class LengthRule extends AbstractLengthRule
18
{
19
    public const NAME = 'length';
20
21 4
    public function name(): string
22
    {
23 4
        return self::NAME;
24
    }
25
26 4
    public function symbol(): string
27
    {
28 4
        return self::SYMBOL_STRICT;
29
    }
30
}
31