Code Duplication    Length = 13-14 lines in 2 locations

src/Schema/Schema.php 2 locations

@@ 25-37 (lines=13) @@
22
        $this->indexSpace = $client->getSpace('_vindex');
23
    }
24
25
    public function getSpaceId($space)
26
    {
27
        if (!array_key_exists($space, $this->spaceId)) {
28
            $response = $this->spaceSpace->select([$space], Index::SPACE_NAME);
29
            $data = $response->getData();
30
            if (!empty($data)) {
31
                $this->spaceId[$space] = $data[0][0];
32
            }
33
        }
34
        if (array_key_exists($space, $this->spaceId)) {
35
            return $this->spaceId[$space];
36
        }
37
    }
38
39
    public function getSpaceName($spaceId)
40
    {
@@ 39-52 (lines=14) @@
36
        }
37
    }
38
39
    public function getSpaceName($spaceId)
40
    {
41
        if (!in_array($spaceId, $this->spaceId)) {
42
            $response = $this->spaceSpace->select([$spaceId], 0);
43
            $data = $response->getData();
44
            if (!empty($data)) {
45
                $this->spaceId[$data[0][2]] = $spaceId;
46
            }
47
        }
48
49
        if (in_array($spaceId, $this->spaceId)) {
50
            return array_search($spaceId, $this->spaceId);
51
        }
52
    }
53
54
    public function hasSpace($space)
55
    {