Code Duplication    Length = 13-14 lines in 2 locations

src/Schema/Schema.php 2 locations

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