Passed
Push — master ( 765b41...e6bf79 )
by Tim
03:49 queued 01:38
created

SAMLDateTimeValue::validateValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML11\Type;
6
7
use SimpleSAML\SAML11\Assert\Assert;
8
use SimpleSAML\XMLSchema\Type\DateTimeValue;
9
10
/**
11
 * @package simplesaml/saml11
12
 */
13
class SAMLDateTimeValue extends DateTimeValue
14
{
15
    // Lowercase p as opposed to the base-class to covert the timestamp to UTC as demanded by the SAML specifications
16
    public const DATETIME_FORMAT = 'Y-m-d\\TH:i:sp';
17
18
19
    /**
20
     * Validate the value.
21
     *
22
     * @param string $value
23
     * @return void
24
     */
25
    protected function validateValue(string $value): void
26
    {
27
        // Note: value must already be sanitized before validating
28
        Assert::validSAMLDateTime($this->sanitizeValue($value));
29
    }
30
}
31