ClusterPoolTrait   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 46
rs 10
c 1
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A driverCheck() 0 3 1
A driverConnect() 0 3 1
A driverWrite() 0 3 1
A driverRead() 0 3 1
A driverClear() 0 3 1
A driverDelete() 0 3 1
1
<?php
2
3
/**
4
 *
5
 * This file is part of Phpfastcache.
6
 *
7
 * @license MIT License (MIT)
8
 *
9
 * For full copyright and license information, please see the docs/CREDITS.txt file.
10
 *
11
 * @author Georges.L (Geolim4) <[email protected]>
12
 *
13
 */
14
15
declare(strict_types=1);
16
17
namespace Phpfastcache\Cluster;
18
19
use Phpfastcache\Core\Item\ExtendedCacheItemInterface;
20
use Psr\Cache\CacheItemInterface;
21
22
trait ClusterPoolTrait
23
{
24
    protected function driverCheck(): bool
25
    {
26
        return true;
27
    }
28
29
    protected function driverConnect(): bool
30
    {
31
        return true;
32
    }
33
34
    /**
35
     * @param ExtendedCacheItemInterface $item
36
     * @return ?array<string, mixed>
37
     */
38
    protected function driverRead(ExtendedCacheItemInterface $item): ?array
39
    {
40
        return null;
41
    }
42
43
    /**
44
     * @param ExtendedCacheItemInterface $item
45
     * @return bool
46
     */
47
    protected function driverWrite(ExtendedCacheItemInterface $item): bool
48
    {
49
        return true;
50
    }
51
52
    /**
53
     * @param string $key
54
     * @param string $encodedKey
55
     * @return bool
56
     */
57
    protected function driverDelete(string $key, string $encodedKey): bool
58
    {
59
        return true;
60
    }
61
62
    /**
63
     * @return bool
64
     */
65
    protected function driverClear(): bool
66
    {
67
        return true;
68
    }
69
}
70