ItemStatusUpdateResponse   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 14
c 1
b 0
f 0
dl 0
loc 23
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 ItemStatusUpdateResponse provides the response from a ItemStatusUpdateRequest
7
 *
8
 * @method getPropertiesOk()
9
 * @method getTransactionDate()
10
 * @method getItemIdentifier()
11
 * @method getTitleIdentifier()
12
 * @method getItemProperties()
13
 * @method getScreenMessage()
14
 * @method getPrintLine()
15
 * @method getSequenceNumber()
16
 *
17
 * @licence    https://opensource.org/licenses/MIT
18
 * @copyright  John Wohlers <[email protected]>
19
 * @copyright  Paul Dixon <[email protected]>
20
 */
21
class ItemStatusUpdateResponse extends SIP2Response
22
{
23
    //fixed part of response contains these
24
    protected $var = [
25
        'PropertiesOk' => [],
26
        'TransactionDate' => [],
27
    ];
28
29
    //variable part of the response allowed to contain these...
30
    protected $allowedVariables=[
31
        self::AB_ITEM_IDENTIFIER,
32
        self::AJ_TITLE_IDENTIFIER,
33
        self::CH_ITEM_PROPERTIES,
34
        self::AF_SCREEN_MESSAGE,
35
        self::AG_PRINT_LINE,
36
        self::AY_SEQUENCE_NUMBER
37
    ];
38
39 1
    public function __construct($raw)
40
    {
41 1
        $this->setVariable('PropertiesOk', substr($raw, 2, 1));
42 1
        $this->setVariable('TransactionDate', substr($raw, 3, 18));
43 1
        $this->parseVariableData($raw, 21);
44 1
    }
45
}
46