RenewAllRequest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
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 20
ccs 8
cts 8
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMessageString() 0 10 1
1
<?php
2
3
namespace lordelph\SIP2\Request;
4
5
/**
6
 * RenewAllRequest is used to renew all items that the patron has checked out. The ACS should respond with a Renew All
7
 * Response message.
8
 *
9
 * @method setInstitutionId(string $institutionId)
10
 * @method setPatronIdentifier(string $patron)
11
 * @method setPatronPassword(string $patronPassword)
12
 * @method setTerminalPassword(string $terminalPassword)
13
 * @method setFeeAcknowledged(string $yn)
14
 *
15
 * @licence    https://opensource.org/licenses/MIT
16
 * @copyright  John Wohlers <[email protected]>
17
 * @copyright  Paul Dixon <[email protected]>
18
 */
19
class RenewAllRequest extends SIP2Request
20
{
21
    protected $var = [
22
        'InstitutionId' => [],
23
        'PatronIdentifier' => [],
24
        'PatronPassword' => ['default' => ''],
25
        'TerminalPassword' => ['default' => ''],
26
        'FeeAcknowledged' => ['type' => 'YN', 'default' => 'N'],
27
    ];
28
29 1
    public function getMessageString($withSeq = true, $withCrc = true): string
30
    {
31 1
        $this->newMessage('65');
32 1
        $this->addVarOption('AO', $this->getVariable('InstitutionId'));
33 1
        $this->addVarOption('AA', $this->getVariable('PatronIdentifier'));
34 1
        $this->addVarOption('AD', $this->getVariable('PatronPassword'), true);
35 1
        $this->addVarOption('AC', $this->getVariable('TerminalPassword'), true);
36 1
        $this->addVarOption('BO', $this->getVariable('FeeAcknowledged'), true);
37
38 1
        return $this->returnMessage($withSeq, $withCrc);
39
    }
40
}
41