Code Duplication    Length = 10-10 lines in 4 locations

src/Pinterest/Api.php 4 locations

@@ 102-111 (lines=10) @@
99
     *
100
     * @return Response The response
101
     */
102
    private function fetchUser(Request $request)
103
    {
104
        $request->setFields(User::fields());
105
106
        return $this->execute($request, function (Response $response) {
107
            $mapper = new Mapper(new User());
108
109
            return $mapper->toSingle($response);
110
        });
111
    }
112
113
    /**
114
     * Fetch a single board and processes the response.
@@ 122-131 (lines=10) @@
119
     *
120
     * @return Response The response
121
     */
122
    private function fetchBoard(Request $request)
123
    {
124
        $request->setFields(Board::fields());
125
126
        return $this->execute($request, function (Response $response) {
127
            $mapper = new Mapper(new Board());
128
129
            return $mapper->toSingle($response);
130
        });
131
    }
132
133
    /**
134
     * Fetch a single pin and processes the response.
@@ 142-151 (lines=10) @@
139
     *
140
     * @return Response The response
141
     */
142
    private function fetchPin(Request $request)
143
    {
144
        $request->setFields(Pin::fields());
145
146
        return $this->execute($request, function (Response $response) {
147
            $mapper = new Mapper(new Pin());
148
149
            return $mapper->toSingle($response);
150
        });
151
    }
152
153
    /**
154
     * Fetch multiple boards and processes the response.
@@ 184-193 (lines=10) @@
181
     *
182
     * @return Response The response
183
     */
184
    private function fetchMultipleUsers(Request $request)
185
    {
186
        $request->setFields(User::fields());
187
188
        return $this->execute($request, function (Response $response) {
189
            $mapper = new Mapper(new User());
190
191
            return $mapper->toList($response);
192
        });
193
    }
194
195
    /**
196
     * Fetches multiple pins and processes the response.