Code Duplication    Length = 10-11 lines in 2 locations

src/Palladium/Service/Identification.php 2 locations

@@ 142-151 (lines=10) @@
139
    }
140
141
142
    private function checkCookieExpireTime(Entity\CookieIdentity $identity)
143
    {
144
        if ($identity->getExpiresOn() < time()) {
145
            $this->logger->info('cookie expired', $this->assembleCookieLogDetails($identity));
146
147
            $this->changeIdentityStatus($identity, Entity\Identity::STATUS_EXPIRED);
148
149
            throw new IdentityExpired;
150
        }
151
    }
152
153
154
    private function changeIdentityStatus(Entity\Identity $identity, int $status)
@@ 169-179 (lines=11) @@
166
     * @param string $key
167
     * @throws \Palladium\Exception\CompromisedCookie if key does not match
168
     */
169
    private function checkCookieKey(Entity\CookieIdentity $identity, $key)
170
    {
171
        if ($identity->matchKey($key) === true) {
172
            return;
173
        }
174
175
        $this->changeIdentityStatus($identity, Entity\Identity::STATUS_BLOCKED);
176
        $this->logger->warning('compromised cookie', $this->assembleCookieLogDetails($identity));
177
178
        throw new CompromisedCookie;
179
    }
180
181
182
    private function assembleCookieLogDetails(Entity\CookieIdentity $identity): array