Completed
Push — master ( 0c0d2f...7c0457 )
by Nate
04:27
created

Batch::defaultSegments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 0
cts 18
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Flipbox\Relay\HubSpot\Segment\Contacts;
4
5
use Flipbox\Relay\HubSpot\Middleware\Contacts\Batch as ContactBatchMiddleware;
6
use Flipbox\Relay\HubSpot\Middleware\Client;
7
use Flipbox\Relay\HubSpot\Middleware\JsonRequest as JsonRequestMiddleware;
8
use Flipbox\Relay\Segments\AbstractSegment;
9
10
class Batch extends AbstractSegment
11
{
12
13
    /**
14
     * @var string
15
     */
16
    public $payload;
17
18
    /**
19
     * @return array
20
     */
21
    protected function defaultSegments(): array
22
    {
23
        return [
24
            'body' => [
25
                'class' => JsonRequestMiddleware::class,
26
                'payload' => $this->payload,
27
                'logger' => $this->getLogger()
28
            ],
29
            'uri' => [
30
                'class' => ContactBatchMiddleware::class,
31
                'logger' => $this->getLogger()
32
            ],
33
            'client' => [
34
                'class' => Client::class,
35
                'logger' => $this->getLogger()
36
            ]
37
        ];
38
    }
39
}
40