BlogPosts   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
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 57
ccs 0
cts 31
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 15 1
A allRelay() 0 18 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\Blog\Posts\All;
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.5.0
21
 */
22
class BlogPosts
23
{
24
    /*******************************************
25
     * LIST ALL
26
     *******************************************/
27
28
    /**
29
     * @param array $params
30
     * @param ConnectionInterface|null $connection
31
     * @param CacheInterface|null $cache
32
     * @param LoggerInterface $logger
33
     * @param array $config
34
     * @return ResponseInterface
35
     */
36
    public static function all(
37
        array $params = [],
38
        ConnectionInterface $connection = null,
39
        CacheInterface $cache = null,
40
        LoggerInterface $logger = null,
41
        array $config = []
42
    ): ResponseInterface {
43
        return static::allRelay(
44
            $params,
45
            $connection,
46
            $cache,
47
            $logger,
48
            $config
49
        )();
50
    }
51
52
    /**
53
     * @param array $params
54
     * @param ConnectionInterface|null $connection
55
     * @param CacheInterface|null $cache
56
     * @param LoggerInterface $logger
57
     * @param array $config
58
     * @return callable
59
     */
60
    public static function allRelay(
61
        array $params = [],
62
        ConnectionInterface $connection = null,
63
        CacheInterface $cache = null,
64
        LoggerInterface $logger = null,
65
        array $config = []
66
    ): callable {
67
68
        $builder = new All(
69
            $params,
70
            $connection ?: HubSpot::getConnection(),
71
            $cache ?: HubSpot::getCache(),
72
            $logger ?: HubSpot::getLogger(),
73
            $config
74
        );
75
76
        return $builder->build();
77
    }
78
}
79