Completed
Push — master ( 9a3118...4c04b8 )
by Nate
03:50
created

UpdateById::defaultSegments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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