Cache::handleCacheNotFound()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 5
cp 0
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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