ItemInformationRequest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 11
c 1
b 0
f 0
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMessageString() 0 9 1
1
<?php
2
3
namespace lordelph\SIP2\Request;
4
5
/**
6
 * ItemInformationRequest may be used to request item information. The ACS should respond with the Item Information
7
 * Response message.
8
 *
9
 * @method setInstitutionId(string $institutionId)
10
 * @method setItemIdentifier(string $itemIdentifier)
11
 * @method setTerminalPassword(string $terminalPassword)
12
 *
13
 * @licence    https://opensource.org/licenses/MIT
14
 * @copyright  John Wohlers <[email protected]>
15
 * @copyright  Paul Dixon <[email protected]>
16
 */
17
class ItemInformationRequest extends SIP2Request
18
{
19
    protected $var = [
20
        'InstitutionId' => [],
21
        'ItemIdentifier' => [],
22
        'TerminalPassword' => ['default' => ''],
23
    ];
24
25 1
    public function getMessageString($withSeq = true, $withCrc = true): string
26
    {
27 1
        $this->newMessage('17');
28 1
        $this->addFixedOption($this->datestamp(), 18);
29 1
        $this->addVarOption('AO', $this->getVariable('InstitutionId'));
30 1
        $this->addVarOption('AB', $this->getVariable('ItemIdentifier'));
31 1
        $this->addVarOption('AC', $this->getVariable('TerminalPassword'));
32
33 1
        return $this->returnMessage($withSeq, $withCrc);
34
    }
35
}
36