Code Duplication    Length = 10-11 lines in 2 locations

src/Palladium/Service/Identification.php 2 locations

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