Passed
Push — master ( a3fda0...7c0590 )
by Tim
14:58 queued 13:28
created

SAMLDateTimeValue   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\Type;
6
7
use SimpleSAML\SAML2\Assert\Assert;
8
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
9
use SimpleSAML\XMLSchema\Type\DateTimeValue;
10
11
/**
12
 * @package simplesaml/saml2
13
 */
14
class SAMLDateTimeValue extends DateTimeValue
15
{
16
    // Lowercase p as opposed to the base-class to covert the timestamp to UTC as demanded by the SAML specifications
17
    public const string DATETIME_FORMAT = 'Y-m-d\\TH:i:sp';
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_STRING, expecting '=' on line 17 at column 24
Loading history...
18
19
20
    /**
21
     * Validate the value.
22
     */
23
    protected function validateValue(string $value): void
24
    {
25
        // Note: value must already be sanitized before validating
26
        Assert::validSAMLDateTime($this->sanitizeValue($value), ProtocolViolationException::class);
27
    }
28
}
29