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

SAMLDateTimeValue   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateValue() 0 4 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