Update   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A _getPayload() 0 4 1
A getResponse() 0 2 1
A __construct() 0 5 1
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