ServerTrait::flush()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 2 Features 0
Metric Value
c 2
b 2
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
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