Issues (36)

src/CAS/XML/AbstractServiceResponse.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\CAS\XML;
6
7
use DOMElement;
8
9
/**
10
 * Class for CAS serviceResponse
11
 *
12
 * @package simplesamlphp/xml-cas
13
 */
14
abstract class AbstractServiceResponse extends AbstractCasElement
15
{
16
    final public const string LOCALNAME = 'serviceResponse';
0 ignored issues
show
A parse error occurred: Syntax error, unexpected T_STRING, expecting '=' on line 16 at column 30
Loading history...
17
18
19
    /**
20
     * Initialize a cas:serviceResponse element
21
     *
22
     * @param \SimpleSAML\CAS\XML\AbstractResponse $response
23
     */
24
    public function __construct(
25
        protected AbstractResponse $response,
26
    ) {
27
    }
28
29
30
    /**
31
     * @return \SimpleSAML\CAS\XML\AbstractResponse
32
     */
33
    public function getResponse(): AbstractResponse
34
    {
35
        return $this->response;
36
    }
37
38
39
    /**
40
     * Convert this ServiceResponse to XML.
41
     *
42
     * @param \DOMElement|null $parent The element we should append this ServiceResponse to.
43
     * @return \DOMElement
44
     */
45
    public function toXML(?DOMElement $parent = null): DOMElement
46
    {
47
        $e = $this->instantiateParentElement($parent);
48
49
        $this->getResponse()->toXML($e);
50
51
        return $e;
52
    }
53
}
54