Code Duplication    Length = 10-14 lines in 4 locations

src/Client/MercadoLibreClient.php 4 locations

@@ 125-134 (lines=10) @@
122
     *
123
     * @return array|\JMS\Serializer\scalar|object
124
     */
125
    public function userShow($customer_id)
126
    {
127
        $response = $this->getGuzzleClient()
128
            ->get('/users/' . $customer_id, $this->setQuery());
129
130
        return $this->serializer->deserialize(
131
            $response->getBody()->getContents(),
132
            User::class,
133
            'json'
134
        );
135
    }
136
137
    /**
@@ 166-176 (lines=11) @@
163
        );
164
    }
165
166
    public function itemList($user_id)
167
    {
168
        $response = $this->getGuzzleClient()
169
            ->get('/users/' . $user_id . '/items/search', $this->setQuery());
170
171
        return $this->serializer->deserialize(
172
            $response->getBody()->getContents(),
173
            ItemList::class,
174
            'json'
175
        );
176
    }
177
178
    /**
179
     * Item Show resource
@@ 185-195 (lines=11) @@
182
     *
183
     * @return array|\JMS\Serializer\scalar|object
184
     */
185
    public function itemShow($item_id)
186
    {
187
        $response = $this->getGuzzleClient()
188
            ->get('/items/' . $item_id, $this->setQuery());
189
190
        return $this->serializer->deserialize(
191
            $response->getBody()->getContents(),
192
            Item::class,
193
            'json'
194
        );
195
    }
196
197
    /**
198
     * Item create resource
@@ 204-217 (lines=14) @@
201
     *
202
     * @return array|\JMS\Serializer\scalar|object
203
     */
204
    public function itemCreate(Item $item)
205
    {
206
        $response = $this->getGuzzleClient()
207
            ->post(
208
                '/items',
209
                array_merge($this->setQuery(), $this->setBody($item))
210
            );
211
212
        return $this->serializer->deserialize(
213
            $response->getBody()->getContents(),
214
            Item::class,
215
            'json'
216
        );
217
    }
218
219
    /**
220
     * Set query