ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SubjectConfirmationResponseToMatches.php
Go to the documentation of this file.
1<?php
2
4
9
12{
13 private $response;
14
16 {
17 $this->response = $response;
18 }
19
20 public function validate(
21 SubjectConfirmation $subjectConfirmation,
23 ) {
24 $inResponseTo = $subjectConfirmation->SubjectConfirmationData->InResponseTo;
25 if ($inResponseTo && $this->getInResponseTo() && $this->getInResponseTo() !== $inResponseTo) {
26 $result->addError(sprintf(
27 'InResponseTo in SubjectConfirmationData ("%s") does not match the Response InResponseTo ("%s")',
28 $inResponseTo,
29 $this->getInResponseTo()
30 ));
31 }
32 }
33
34 private function getInResponseTo()
35 {
36 $inResponseTo = $this->response->getInResponseTo();
37 if ($inResponseTo === null) {
38 return false;
39 }
40
41 return $inResponseTo;
42 }
43}
$result
An exception for terminatinating execution or to throw for unit testing.
Simple Result object.
Definition: Result.php:11