Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
LengthRule
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 name
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 symbol
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace 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 */
17final class LengthRule extends AbstractLengthRule
18{
19    public const NAME = 'length';
20
21    public function name(): string
22    {
23        return self::NAME;
24    }
25
26    public function symbol(): string
27    {
28        return self::SYMBOL_STRICT;
29    }
30}