Code Duplication    Length = 15-15 lines in 2 locations

src/Js/Contact.php 1 location

@@ 76-90 (lines=15) @@
73
     *
74
     * @return string
75
     */
76
    public function ticket($forceRefresh = false)
77
    {
78
        $key = self::GROUP_TICKET_CACHE_PREFIX.$this->getAccessToken()->getFingerprint();
79
        $ticket = $this->getCache()->fetch($key);
80
81
        if (!$forceRefresh && !empty($ticket)) {
82
            return $ticket;
83
        }
84
85
        $result = $this->parseJSON('get', [self::API_GROUP_TICKET, ['type' => 'contact']]);
86
87
        $this->getCache()->save($key, $result, $result['expires_in'] - 500);
88
89
        return $result;
90
    }
91
92
    /**
93
     * Build signature.

src/Js/Js.php 1 location

@@ 84-98 (lines=15) @@
81
     *
82
     * @return string
83
     */
84
    public function ticket($forceRefresh = false)
85
    {
86
        $key = self::TICKET_CACHE_PREFIX.$this->getAccessToken()->getFingerprint();
87
        $ticket = $this->getCache()->fetch($key);
88
89
        if (!$forceRefresh && !empty($ticket)) {
90
            return $ticket;
91
        }
92
93
        $result = $this->parseJSON('get', [self::API_TICKET]);
94
95
        $this->getCache()->save($key, $result['ticket'], $result['expires_in'] - 500);
96
97
        return $result['ticket'];
98
    }
99
100
    /**
101
     * Build signature.