EndSessionResponse   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 13
c 1
b 0
f 0
dl 0
loc 22
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
namespace lordelph\SIP2\Response;
4
5
/**
6
 * Class EndSessionResponse provides the response from a EndSessionRequest
7
 *
8
 * @method getEndSession()
9
 * @method getTransactionDate()
10
 * @method getInstitutionId()
11
 * @method getPatronIdentifier()
12
 * @method getScreenMessage()
13
 * @method getPrintLine()
14
 * @method getSequenceNumber()
15
 *
16
 * @licence    https://opensource.org/licenses/MIT
17
 * @copyright  John Wohlers <[email protected]>
18
 * @copyright  Paul Dixon <[email protected]>
19
 */
20
class EndSessionResponse extends SIP2Response
21
{
22
    //fixed part of response contains these
23
    protected $var = [
24
        'EndSession' => [],
25
        'TransactionDate' => []
26
    ];
27
28
    //variable part of the response allowed to contain these...
29
    protected $allowedVariables=[
30
        self::AO_INSTITUTION_ID,
31
        self::AA_PATRON_IDENTIFIER,
32
        self::AF_SCREEN_MESSAGE,
33
        self::AG_PRINT_LINE,
34
        self::AY_SEQUENCE_NUMBER
35
    ];
36
37 4
    public function __construct($raw)
38
    {
39 4
        $this->setVariable('EndSession', substr($raw, 2, 1));
40 4
        $this->setVariable('TransactionDate', substr($raw, 3, 18));
41 4
        $this->parseVariableData($raw, 21);
42 4
    }
43
}
44