Code Duplication    Length = 11-11 lines in 3 locations

src/Service/SiteService.php 3 locations

@@ 19-29 (lines=11) @@
16
    /**
17
     * @return Site[]
18
     */
19
    public function getSites(): array
20
    {
21
        $path = 'sites';
22
23
        $response = $this->getClient()->sendRequest('GET', $path);
24
25
        /** @var Site[] $models */
26
        $models = $this->getModelFactory()->createMany(Site::class, $response);
27
28
        return $models;
29
    }
30
31
    /**
32
     * @param int $id
@@ 36-46 (lines=11) @@
33
     *
34
     * @return Site
35
     */
36
    public function getSite(int $id): Site
37
    {
38
        $path = sprintf('sites/%d', $id);
39
40
        $response = $this->getClient()->sendRequest('GET', $path);
41
42
        /** @var Site $model */
43
        $model = $this->getModelFactory()->create(Site::class, $response);
44
45
        return $model;
46
    }
47
48
    /**
49
     * @param SitePostMessage $message
@@ 99-109 (lines=11) @@
96
     *
97
     * @return Site[]
98
     */
99
    public function getPlatformChildren(PlatformChildrenListMessage $message): array
100
    {
101
        $path = sprintf('platform/%d/children', $message->getSiteId());
102
103
        $response = $this->getClient()->sendRequest('GET', $path);
104
105
        /** @var Site[] $models */
106
        $models = $this->getModelFactory()->createMany(Site::class, $response);
107
108
        return $models;
109
    }
110
}
111