Hub   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 50
ccs 0
cts 27
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A dailyLimit() 0 13 1
A dailyLimitRelay() 0 15 4
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipbox/hubspot/blob/master/LICENSE.md
6
 * @link       https://github.com/flipbox/hubspot
7
 */
8
9
namespace Flipbox\HubSpot\Resources;
10
11
use Flipbox\HubSpot\Connections\ConnectionInterface;
12
use Flipbox\HubSpot\HubSpot;
13
use Flipbox\Relay\HubSpot\Builder\Resources\Limit\Daily\Read;
14
use Psr\Http\Message\ResponseInterface;
15
use Psr\Log\LoggerInterface;
16
use Psr\SimpleCache\CacheInterface;
17
18
/**
19
 * @author Flipbox Factory <[email protected]>
20
 * @since 2.0.0
21
 */
22
class Hub
23
{
24
    /*******************************************
25
     * DAILY LIMIT
26
     *******************************************/
27
28
    /**
29
     * @param ConnectionInterface $connection
30
     * @param CacheInterface $cache
31
     * @param LoggerInterface|null $logger
32
     * @param array $config
33
     * @return ResponseInterface
34
     */
35
    public static function dailyLimit(
36
        ConnectionInterface $connection = null,
37
        CacheInterface $cache = null,
38
        LoggerInterface $logger = null,
39
        array $config = []
40
    ): ResponseInterface {
41
        return static::dailyLimitRelay(
42
            $connection,
43
            $cache,
44
            $logger,
45
            $config
46
        )();
47
    }
48
49
    /**
50
     * @param ConnectionInterface $connection
51
     * @param CacheInterface $cache
52
     * @param LoggerInterface|null $logger
53
     * @param array $config
54
     * @return callable
55
     */
56
    public static function dailyLimitRelay(
57
        ConnectionInterface $connection = null,
58
        CacheInterface $cache = null,
59
        LoggerInterface $logger = null,
60
        array $config = []
61
    ): callable {
62
        $builder = new Read(
63
            $connection ?: HubSpot::getConnection(),
64
            $cache ?: HubSpot::getCache(),
65
            $logger ?: HubSpot::getLogger(),
66
            $config
67
        );
68
69
        return $builder->build();
70
    }
71
}
72