Completed
Push — master ( 7c2ac0...7f1c12 )
by Dmitry
08:32
created

Clear   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 15
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 3
1
<?php
2
3
namespace Basis\Jobs\Tarantool;
4
5
use Tarantool\Client;
6
use Tarantool\Schema\Index;
7
8
class Clear
9
{
10
    public function run(Client $client)
11
    {
12
        $schema = $client->getSpace('_vspace');
13
        $response = $schema->select([], Index::SPACE_NAME);
14
        $data = $response->getData();
15
        foreach ($data as $row) {
16
            if ($row[1] == 0) {
17
                // user space
18
                $client->evaluate('box.space.'.$row[2].':drop{}');
19
            }
20
        }
21
    }
22
}