Code Duplication    Length = 14-15 lines in 2 locations

src/Palladium/Service/Identification.php 2 locations

@@ 53-66 (lines=14) @@
50
            throw new EmailNotFound;
51
        }
52
53
        if ($identity->matchKey($password) === false) {
54
            $this->logger->warning('wrong password', [
55
                'input' => [
56
                    'identifier' => $identifier,
57
                    'key' => md5($password),
58
                ],
59
                'account' => [
60
                    'user' => $identity->getUserId(),
61
                    'identity' => $identity->getId(),
62
                ],
63
            ]);
64
65
            throw new PasswordNotMatch;
66
        }
67
68
        $this->registerUsageOfIdentity($identity);
69
        $cookie = $this->createCookieIdentity($identity);
@@ 305-319 (lines=15) @@
302
303
        $mapper = $this->mapperFactory->create(Mapper\EmailIdentity::class);
304
305
        if ($identity->matchKey($oldKey) === false) {
306
            $this->logger->warning('wrong password', [
307
                'input' => [
308
                    'user' => $userId,
309
                    'old-key' => md5($oldKey),
310
                    'new-key' => md5($newKey),
311
                ],
312
                'account' => [
313
                    'user' => $identity->getUserId(),
314
                    'identity' => $identity->getId(),
315
                ],
316
            ]);
317
318
            throw new PasswordNotMatch;
319
        }
320
321
        $identity->setKey($newKey);
322
        $mapper->store($identity);