Code Duplication    Length = 8-8 lines in 7 locations

src/BenatEspina/StackExchangeApiClient/Api/AccessTokenApi.php 2 locations

@@ 37-44 (lines=8) @@
34
     *
35
     * @return array
36
     */
37
    public function invalidate($accessTokens, array $params = [], $serialize = true)
38
    {
39
        $response = Http::instance()->get(
40
            self::URL . (is_array($accessTokens) ? implode(';', $accessTokens) : $accessTokens) . '/invalidate', $params
41
        );
42
43
        return $serialize === true ? AccessTokenSerializer::serialize($response) : $response;
44
    }
45
46
    /**
47
     * Reads the properties for a set of access tokens.
@@ 77-84 (lines=8) @@
74
     *
75
     * @return array
76
     */
77
    public function deAuthenticate($accessTokens, array $params = [], $serialize = true)
78
    {
79
        $response = Http::instance()->get(
80
            self::URL . (is_array($accessTokens) ? implode(';', $accessTokens) : $accessTokens) . '/de-authenticate', $params
81
        );
82
83
        return $serialize === true ? AccessTokenSerializer::serialize($response) : $response;
84
    }
85
}
86

src/BenatEspina/StackExchangeApiClient/Api/AnswerApi.php 4 locations

@@ 81-88 (lines=8) @@
78
     *
79
     * @return array|Answer
80
     */
81
    public function getOfIds($ids, array $params = self::QUERY_PARAMS, $serialize = true)
82
    {
83
        $response = Http::instance()->get(
84
            self::URL . (is_array($ids) ? implode(';', $ids) : $ids), $params
85
        );
86
87
        return $serialize === true ? AnswerSerializer::serialize($response) : $response;
88
    }
89
90
    /**
91
     * Casts an accept vote on the given answer.
@@ 327-334 (lines=8) @@
324
     *
325
     * @return array|Answer
326
     */
327
    public function getOfQuestionIds($ids, array $params = self::QUERY_PARAMS, $serialize = true)
328
    {
329
        $response = Http::instance()->get(
330
            'questions/' . (is_array($ids) ? implode(';', $ids) : $ids) . self::URL, $params
331
        );
332
333
        return $serialize === true ? AnswerSerializer::serialize($response) : $response;
334
    }
335
336
    /**
337
     * Create a new answer on the given question.
@@ 400-407 (lines=8) @@
397
     *
398
     * @return array|Answer
399
     */
400
    public function getOfUserIds($ids, array $params = self::QUERY_PARAMS, $serialize = true)
401
    {
402
        $response = Http::instance()->get(
403
            'users/' . (is_array($ids) ? implode(';', $ids) : $ids) . '/' . self::URL, $params
404
        );
405
406
        return $serialize === true ? AnswerSerializer::serialize($response) : $response;
407
    }
408
409
    /**
410
     * Returns the answers owned by the user associated with the given access_token.
@@ 445-452 (lines=8) @@
442
     *
443
     * @return array|Answer
444
     */
445
    public function getTopOfUserAndTags($userId, $tags, array $params = self::QUERY_PARAMS, $serialize = true)
446
    {
447
        $response = Http::instance()->get(
448
            'users/' . $userId . '/tags/' . (is_array($tags) ? implode(';', $tags) : $tags) . '/top-' . self::URL, $params
449
        );
450
451
        return $serialize === true ? AnswerSerializer::serialize($response) : $response;
452
    }
453
454
    /**
455
     * Returns the top 30 answers the user associated with the given

src/BenatEspina/StackExchangeApiClient/Api/UserApi.php 1 location

@@ 81-88 (lines=8) @@
78
     *
79
     * @return array|User
80
     */
81
    public function getOfIds($ids, array $params = self::QUERY_PARAMS, $serialize = true)
82
    {
83
        $response = Http::instance()->get(
84
            self::URL . (is_array($ids) ? implode(';', $ids) : $ids), $params
85
        );
86
87
        return $serialize === true ? UserSerializer::serialize($response) : $response;
88
    }
89
90
    /**
91
     * Returns the user associated with the passed access_token.