MinLengthRule   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 3 1
A symbol() 0 3 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 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