ServerTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 3
Bugs 2 Features 0
Metric Value
wmc 2
c 3
b 2
f 0
lcom 0
cbo 3
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A flush() 0 8 2
1
<?php namespace AdammBalogh\KeyValueStore\Implementation;
2
3
use AdammBalogh\KeyValueStore\Exception\InternalException;
4
5
trait ServerTrait
6
{
7
    use AdapterTrait;
8
9
    /**
10
     * Removes all keys.
11
     *
12
     * @return void
13
     *
14
     * @throws \AdammBalogh\KeyValueStore\Exception\InternalException
15
     */
16
    public function flush()
17
    {
18
        try {
19
            $this->getAdapter()->flush();
20
        } catch (\Exception $e) {
21
            throw new InternalException($e->getMessage(), $e->getCode(), $e);
22
        }
23
    }
24
}
25