Code Duplication    Length = 12-12 lines in 3 locations

src/Auth/App.php 1 location

@@ 62-73 (lines=12) @@
59
     *
60
     * @return \EntWeChat\Support\Collection
61
     */
62
    public function user($code = null)
63
    {
64
        if ($this->hasInvalidState()) {
65
            throw new InvalidStateException();
66
        }
67
68
        $params = [
69
            'code' => $code ?: $this->request->get('code'),
70
        ];
71
72
        return $this->parseJSON('get', [self::API_GET_USER_INFO, $params]);
73
    }
74
75
    /**
76
     * @param string $userTicket

src/Auth/Web.php 1 location

@@ 65-76 (lines=12) @@
62
     *
63
     * @return \EntWeChat\Support\Collection
64
     */
65
    public function user($authCode = null)
66
    {
67
        if ($this->hasInvalidState()) {
68
            throw new InvalidStateException();
69
        }
70
71
        $params = [
72
            'auth_code' => $authCode ?: $this->request->get('auth_code'),
73
        ];
74
75
        return $this->parseJSON('json', [self::API_GET_LOGIN_INFO, $params]);
76
    }
77
78
    /**
79
     * {@inheritdoc}.

src/Auth/WorkWeb.php 1 location

@@ 59-70 (lines=12) @@
56
     *
57
     * @return \EntWeChat\Support\Collection
58
     */
59
    public function user($code = null)
60
    {
61
        if ($this->hasInvalidState()) {
62
            throw new InvalidStateException();
63
        }
64
65
        $params = [
66
            'code' => $code ?: $this->request->get('code'),
67
        ];
68
69
        return $this->parseJSON('get', [self::API_GET_USER_INFO, $params]);
70
    }
71
}
72