Passed
Push — master ( 65060b...2b54a2 )
by Julito
10:15
created

ImsLtiServiceReadResponse::generateBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 9
rs 10
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
/**
5
 * Class ImsLtiReadServiceResponse
6
 */
7
class ImsLtiServiceReadResponse extends ImsLtiServiceResponse
8
{
9
    /**
10
     * ImsLtiServiceReadResponse constructor.
11
     *
12
     * @param ImsLtiServiceResponseStatus $statusInfo
13
     * @param mixed|null                  $bodyParam
14
     */
15
    public function __construct(ImsLtiServiceResponseStatus $statusInfo, $bodyParam = null)
16
    {
17
        $statusInfo->setOperationRefIdentifier('readResult');
18
19
        parent::__construct($statusInfo, $bodyParam);
20
    }
21
22
    /**
23
     * @param SimpleXMLElement $xmlBody
24
     */
25
    protected function generateBody(SimpleXMLElement $xmlBody)
26
    {
27
        $resultResponse = $xmlBody->addChild('readResultResponse');
28
29
        $xmlResultScore = $resultResponse->addChild('result')
30
            ->addChild('resultScore');
31
32
        $xmlResultScore->addChild('language', 'en');
33
        $xmlResultScore->addChild('textString', $this->bodyParams);
34
    }
35
}
36