ServerTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A flush() 0 6 2
1
<?php namespace AdammBalogh\KeyValueStore\Adapter\SharedMemoryAdapter;
2
3
trait ServerTrait
4
{
5
    /**
6
     * Removes all keys.
7
     *
8
     * @return void
9
     *
10
     * @throws \Exception
11
     */
12
    public function flush()
13
    {
14
        if (!$this->shmProxy->flush($this->client)) {
0 ignored issues
show
Bug introduced by
The property shmProxy does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
Bug introduced by
The property client does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
15
            throw new \Exception('Shm remove error');
16
        }
17
    }
18
}
19