Completed
Push — develop ( 2d4f17...d5975b )
by Nate
05:25
created

Cache   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 109
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 28.57%

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 5
dl 0
loc 109
ccs 10
cts 35
cp 0.2857
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultCache() 0 4 1
A handleCacheNotFound() 0 9 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/hubspot/license
6
 * @link       https://www.flipboxfactory.com/software/hubspot/
7
 */
8
9
namespace flipbox\craft\hubspot\services;
10
11
use flipbox\craft\hubspot\HubSpot;
12
use flipbox\craft\integration\services\IntegrationCache;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 1.0.0
17
 */
18
class Cache extends IntegrationCache
19
{
20
    /**
21
     * The override file
22
     */
23
    public $overrideFile = 'hubspot-cache';
24
25
    /**
26
     * @inheritdoc
27
     */
28
    protected function getDefaultCache(): string
29
    {
30
        return HubSpot::getInstance()->getSettings()->getDefaultCache();
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    protected function handleCacheNotFound(string $handle)
37
    {
38
        HubSpot::warning(sprintf(
39
            "Unable to find cache '%s'.",
40
            $handle
41
        ));
42
43
        return parent::handleCacheNotFound($handle);
44
    }
45
}
46