Passed
Pull Request — master (#6)
by Tim
02:13
created

DateTimeValue::validateValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
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\XML\Type\DateTimeValue as BaseDateTimeValue;
9
10
/**
11
 * @package simplesaml/saml11
12
 */
13
class DateTimeValue extends BaseDateTimeValue
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::validDateTime($this->sanitizeValue($value));
29
    }
30
}
31