Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
MinLengthRule | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
name | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
symbol | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace WsdlToPhp\PackageGenerator\File\Validation; |
6 | |
7 | /** |
8 | * Class MinLengthRule. |
9 | * |
10 | * @see https://www.w3.org/TR/xmlschema-2/#rf-minLength |
11 | * Validation Rule: minLength Valid |
12 | * A value in a ·value space· is facet-valid with respect to ·minLength·, determined as follows: |
13 | * - 1 if the {variety} is ·atomic· then |
14 | * - 1.1 if {primitive type definition} is string or anyURI, then the length of the value, as measured in characters ·must· be greater than or equal to {value}; |
15 | * - 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 greater than or equal to {value}; |
16 | * - 1.3 if {primitive type definition} is QName or NOTATION, then any {value} is facet-valid. |
17 | * - 2 if the {variety} is ·list·, then the length of the value, as measured in list items, ·must· be greater than or equal to {value} |
18 | */ |
19 | final class MinLengthRule extends AbstractLengthRule |
20 | { |
21 | public const NAME = 'minLength'; |
22 | |
23 | public function name(): string |
24 | { |
25 | return self::NAME; |
26 | } |
27 | |
28 | public function symbol(): string |
29 | { |
30 | return self::SYMBOL_MIN_INCLUSIVE; |
31 | } |
32 | } |