ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SubjectConfirmationResponseToMatches.php
Go to the documentation of this file.
1 <?php
2 
4 
9 
12 {
13  private $response;
14 
15  public function __construct(Response $response)
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
Simple Result object.
Definition: Result.php:10