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

UpdateById   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 35
ccs 0
cts 19
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A defaultSegments() 0 19 1
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