Completed
Push — master ( 481c33...0c5dca )
by Nate
04:03
created

GetByEmail   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
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 36
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\Contacts;
4
5
use Flipbox\Relay\Middleware\Stash as CacheMiddleware;
6
use Flipbox\Relay\HubSpot\Middleware\Contacts\GetByEmail as ContactByEmailMiddleware;
7
use Flipbox\Relay\HubSpot\Middleware\Client;
8
use Flipbox\Relay\Segments\AbstractSegment;
9
use Psr\Cache\CacheItemPoolInterface;
10
11
class GetByEmail extends AbstractSegment
12
{
13
14
    /**
15
     * @var string
16
     */
17
    public $email;
18
19
    /**
20
     * @var CacheItemPoolInterface
21
     */
22
    public $cache;
23
24
    /**
25
     * @return array
26
     */
27
    protected function defaultSegments(): array
28
    {
29
        return [
30
            'uri' => [
31
                'class' => ContactByEmailMiddleware::class,
32
                'id' => $this->email,
33
                'logger' => $this->getLogger()
34
            ],
35
            'cache' => [
36
                'class' => CacheMiddleware::class,
37
                'pool' => $this->cache,
38
                'logger' => $this->getLogger()
39
            ],
40
            'client' => [
41
                'class' => Client::class,
42
                'logger' => $this->getLogger()
43
            ]
44
        ];
45
    }
46
}
47