Cache   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 28
ccs 0
cts 7
cp 0
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