Code Duplication    Length = 10-10 lines in 4 locations

src/Pinterest/Api.php 4 locations

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