Code Duplication    Length = 13-15 lines in 2 locations

src/Palladium/Service/Identification.php 2 locations

@@ 153-165 (lines=13) @@
150
    }
151
152
153
    private function checkCookieExpireTime(Entity\CookieIdentity $identity)
154
    {
155
        if ($identity->getExpiresOn() < time()) {
156
            $identity->setStatus(Entity\Identity::STATUS_EXPIRED);
157
158
            $this->logger->info('cookie expired', $this->assembleCookieLogDetails($identity));
159
160
            $mapper = $this->mapperFactory->create(Mapper\CookieIdentity::class);
161
            $mapper->store($identity);
162
163
            throw new IdentityExpired;
164
        }
165
    }
166
167
168
    /**
@@ 175-189 (lines=15) @@
172
     * @param string $key
173
     * @throws \Palladium\Exception\CompromisedCookie if key does not match
174
     */
175
    private function checkCookieKey(Entity\CookieIdentity $identity, $key)
176
    {
177
        if ($identity->matchKey($key) === true) {
178
            return;
179
        }
180
181
        $identity->setStatus(Entity\Identity::STATUS_BLOCKED);
182
183
        $mapper = $this->mapperFactory->create(Mapper\CookieIdentity::class);
184
        $mapper->store($identity);
185
186
        $this->logger->warning('compromised cookie', $this->assembleCookieLogDetails($identity));
187
188
        throw new CompromisedCookie;
189
    }
190
191
192
    /**