CaptureManager   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 23
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A add() 0 9 1
1
<?php
2
3
namespace Acquia\LiftClient\Manager;
4
5
use Acquia\LiftClient\Entity\CapturePayload;
6
use Acquia\LiftClient\Entity\CapturesResponse;
7
use GuzzleHttp\Psr7\Request;
8
9
class CaptureManager extends ManagerBase
10
{
11
    /**
12
     * Add one or more captures.
13
     *
14
     * @see http://docs.decision-api.acquia.com/#capture_post
15
     *
16
     * @param \Acquia\LiftClient\Entity\CapturePayload $capturePayload
17
     *
18
     * @throws \GuzzleHttp\Exception\RequestException
19
     *
20
     * @return \Acquia\LiftClient\Entity\CapturesResponse
21
     */
22 9
    public function add(CapturePayload $capturePayload)
23
    {
24 9
        $body = $capturePayload->json();
25 9
        $url = '/capture';
26 9
        $request = new Request('POST', $url, [], $body);
27 9
        $data = $this->getResponseJson($request);
28
29 6
        return new CapturesResponse($data);
30 2
    }
31
}
32