Update::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace LE_ACME2\Request\Account;
4
5
use LE_ACME2\Response;
6
7
use LE_ACME2\Exception;
8
9
use LE_ACME2\Account;
10
11
class Update extends AbstractLocation {
12
13
    protected $_newEmail;
14
15
    public function __construct(Account $account, $newEmail) {
16
17
        parent::__construct($account);
18
19
        $this->_newEmail = $newEmail;
20
    }
21
22
    protected function _getPayload() : array {
23
24
        return [
25
            'contact' => $this->_buildContactPayload($this->_newEmail),
26
        ];
27
    }
28
29
    /**
30
     * @throws Exception\InvalidResponse
31
     * @throws Exception\RateLimitReached
32
     * @throws Exception\ServiceUnavailable
33
     */
34
    public function getResponse() : Response\Account\Update {
35
        return new Response\Account\Update($this->_getRawResponse());
36
    }
37
}
38