Passed
Push — master ( d898ef...46a72e )
by Christopher
02:06 queued 27s
created

xsBase64Binary::isOK()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace AlgoWeb\xsdTypes;
4
5
use AlgoWeb\xsdTypes\Facets\LengthTrait;
6
7
/**
8
 * The type xsd:base64Binary represents binary data as a sequence of binary octets. It uses base64 encoding, as
9
 * described in RFC 2045.The following rules apply to xsd:base64Binary values:
10
 *
11
 * - The following characters are allowed: the letters A to Z (upper and lower case), digits 0 through 9, the plus sign
12
 *     ("+"), the slash ("/"), the equals sign ("=") and XML whitespace characters.
13
 * - XML whitespace characters may appear anywhere in the value.
14
 * - The number of non-whitespace characters must be divisible by 4.
15
 * - Equals signs may only appear at the end of the value, and there may be zero, one or two of them. If there are two
16
 *      equals signs, they must be preceded by one of the following characters: AQgw. If there is only one equals sign,
17
 *      it must be preceded by one of the following characters: AEIMQUYcgkosw048. In either case, there may be
18
 *      whitespace in between the necessary characters and the equals sign(s).
19
 * @package AlgoWeb\xsdTypes
20
 */
21
class xsBase64Binary extends xsAnySimpleType
22
{
23
    use LengthTrait;
24
25
    /**
26
     * Construct
27
     *
28
     * @param string $value
29
     */
30
    public function __construct($value)
31
    {
32
        parent::__construct($value);
33
        $this->setWhiteSpaceFacet("collapse");
34
    }
35
36
    protected function isOK()
37
    {
38
        $this->checkMaxLength($this->__value);
39
        $this->checkMinLength($this->__value);
40
    }
41
}
42