Code Duplication    Length = 7-7 lines in 2 locations

src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationRecipientMatches.php 1 location

@@ 28-34 (lines=7) @@
25
        Result $result
26
    ) {
27
        $recipient = $subjectConfirmation->SubjectConfirmationData->Recipient;
28
        if ($recipient && !$this->destination->equals(new Destination($recipient))) {
29
            $result->addError(sprintf(
30
                'Recipient in SubjectConfirmationData ("%s") does not match the current destination ("%s")',
31
                $recipient,
32
                $this->destination
33
            ));
34
        }
35
    }
36
}
37

src/SAML2/Response/Validation/ConstraintValidator/DestinationMatches.php 1 location

@@ 26-32 (lines=7) @@
23
    public function validate(Response $response, Result $result)
24
    {
25
        $destination = $response->getDestination();
26
        if (!$this->expectedDestination->equals(new Destination($destination))) {
27
            $result->addError(sprintf(
28
                'Destination in response "%s" does not match the expected destination "%s"',
29
                $destination,
30
                $this->expectedDestination
31
            ));
32
        }
33
    }
34
}
35