Code Duplication    Length = 13-15 lines in 2 locations

src/Palladium/Service/Identification.php 2 locations

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