Completed
Push — master ( 9b8f8b...ad8621 )
by Mikaël
29:42
created

MinLengthRule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 17
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
namespace WsdlToPhp\PackageGenerator\File\Validation;
4
5
/**
6
 * Class MinLengthRule
7
 * @link https://www.w3.org/TR/xmlschema-2/#rf-minLength
8
 * Validation Rule: minLength Valid
9
 * A value in a ·value space· is facet-valid with respect to ·minLength·, determined as follows:
10
 *  - 1 if the {variety} is ·atomic· then
11
 *   - 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};
12
 *   - 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};
13
 *   - 1.3 if {primitive type definition} is QName or NOTATION, then any {value} is facet-valid.
14
 *  - 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}
15
 */
16
class MinLengthRule extends AbstractLengthRule
17
{
18
19
    /**
20
     * @return string
21
     */
22 42
    public function name()
23
    {
24 42
        return 'minLength';
25
    }
26
27
    /**
28
     * @return string
29
     */
30 42
    public function symbol()
31
    {
32 42
        return self::SYMBOL_MIN_INCLUSIVE;
33
    }
34
}
35