PreconditionValidator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\Response\Validation;
6
7
use SimpleSAML\SAML2\Configuration\Destination;
8
use SimpleSAML\SAML2\Response\Validation\ConstraintValidator\DestinationMatches;
9
use SimpleSAML\SAML2\Response\Validation\ConstraintValidator\IsSuccessful;
10
11
/**
12
 * Validates the preconditions that have to be met prior to processing of the response.
13
 */
14
class PreconditionValidator extends Validator
15
{
16
    /**
17
     * Constructor for PreconditionValidator
18
     *
19
     * @param \SimpleSAML\SAML2\Configuration\Destination $destination
20
     */
21
    public function __construct(Destination $destination)
22
    {
23
        // move to DI
24
        $this->addConstraintValidator(new IsSuccessful());
25
        $this->addConstraintValidator(new DestinationMatches($destination));
26
    }
27
}
28