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

MinLengthRule::symbol()   A

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
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