MinLengthRule::name()   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
 * 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 14
    public function name(): string
24
    {
25 14
        return self::NAME;
26
    }
27
28 14
    public function symbol(): string
29
    {
30 14
        return self::SYMBOL_MIN_INCLUSIVE;
31
    }
32
}
33