Completed
Push — develop ( 3605f5...4a88bc )
by Stan
04:14
created

ApcuRepository::increment()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2.0116

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 3
dl 0
loc 11
ccs 6
cts 7
cp 0.8571
crap 2.0116
rs 9.4285
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ApcuRepository::store() 0 3 1
1
<?php
2
3
namespace Krenor\Prometheus\Storage\Repositories;
4
5
use Tightenco\Collect\Support\Collection;
6
7
class ApcuRepository extends SimpleRepository
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12 6
    public function flush(): bool
13
    {
14 6
        return apcu_clear_cache();
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20 6
    protected function retrieve(string $key)
21
    {
22 6
        return apcu_fetch($key);
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 6
    protected function store(string $key, Collection $collection): bool
29
    {
30 6
        return apcu_store($key, $collection);
31
    }
32
}
33