Completed
Push — master ( 0c5dca...5c14c5 )
by Nate
02:48
created

UpdateById   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 31
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 1
A getPath() 0 4 1
1
<?php
2
3
namespace Flipbox\Relay\HubSpot\Middleware\Contacts;
4
5
use Psr\Http\Message\RequestInterface;
6
use Psr\Http\Message\ResponseInterface;
7
8
class UpdateById extends AbstractContact
9
{
10
    /**
11
     * @var int
12
     */
13
    public $id;
14
15
    /**
16
     * @inheritdoc
17
     */
18
    public function __invoke(
19
        RequestInterface $request,
20
        ResponseInterface $response,
21
        callable $next = null
22
    ) {
23
        // Prepare request
24
        $request = $this->prepareUri(
25
            $request->withMethod('POST')
26
        );
27
28
        return $next($request, $response);
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    protected function getPath(): string
35
    {
36
        return "contact/email/{$this->id}/profile";
37
    }
38
}
39