Code Duplication    Length = 17-17 lines in 3 locations

src/Manager/RuleManager.php 1 location

@@ 47-63 (lines=17) @@
44
     *
45
     * @return \Acquia\LiftClient\Entity\Rule[]
46
     */
47
    public function query($options = [])
48
    {
49
        $url = '/rules';
50
        $url .= $this->getQueryString($options);
51
52
        // Now make the request.
53
        $request = new Request('GET', $url);
54
        $data = $this->getResponseJson($request);
55
56
        // Get them as Rule objects
57
        $rules = [];
58
        foreach ($data as $dataItem) {
59
            $rules[] = new Rule($dataItem);
60
        }
61
62
        return $rules;
63
    }
64
65
    /**
66
     * Get a specific rule.

src/Manager/SlotManager.php 1 location

@@ 37-53 (lines=17) @@
34
     *
35
     * @return \Acquia\LiftClient\Entity\Slot[]
36
     */
37
    public function query($options = [])
38
    {
39
        $url = '/slots';
40
        $url .= $this->getQueryString($options);
41
42
        // Now make the request.
43
        $request = new Request('GET', $url);
44
        $data = $this->getResponseJson($request);
45
46
        // Get them as Slot objects
47
        $slots = [];
48
        foreach ($data as $dataItem) {
49
            $slots[] = new Slot($dataItem);
50
        }
51
52
        return $slots;
53
    }
54
55
    /**
56
     * Get a specific slot.

src/Manager/GoalManager.php 1 location

@@ 50-66 (lines=17) @@
47
     *
48
     * @return \Acquia\LiftClient\Entity\Goal[]
49
     */
50
    public function query($options = [])
51
    {
52
        $url = '/goals';
53
        $url .= $this->getQueryString($options);
54
55
        // Now make the request.
56
        $request = new Request('GET', $url);
57
        $data = $this->getResponseJson($request);
58
59
        // Get them as Goal objects
60
        $goals = [];
61
        foreach ($data as $dataItem) {
62
            $goals[] = new Goal($dataItem);
63
        }
64
65
        return $goals;
66
    }
67
68
    /**
69
     * Get a specific goal.