Code Duplication    Length = 9-11 lines in 2 locations

src/Eccube/Controller/Admin/Customer/CustomerEditController.php 1 location

@@ 137-145 (lines=9) @@
134
                    $this->entityManager->persist($CustomerAddress);
135
                }
136
137
                if ($Customer->getPassword() === $this->eccubeConfig['eccube_default_password']) {
138
                    $Customer->setPassword($previous_password);
139
                } else {
140
                    if ($Customer->getSalt() === null) {
141
                        $Customer->setSalt($encoder->createSalt());
142
                        $Customer->setSecretKey($this->customerRepository->getUniqueSecretKey());
143
                    }
144
                    $Customer->setPassword($encoder->encodePassword($Customer->getPassword(), $Customer->getSalt()));
145
                }
146
147
                $this->entityManager->persist($Customer);
148
                $this->entityManager->flush();

src/Eccube/Controller/Mypage/ChangeController.php 1 location

@@ 102-112 (lines=11) @@
99
        if ($form->isSubmitted() && $form->isValid()) {
100
            log_info('会員編集開始');
101
102
            if ($Customer->getPassword() === $this->eccubeConfig['eccube_default_password']) {
103
                $Customer->setPassword($previous_password);
104
            } else {
105
                $encoder = $this->encoderFactory->getEncoder($Customer);
106
                if ($Customer->getSalt() === null) {
107
                    $Customer->setSalt($encoder->createSalt());
108
                }
109
                $Customer->setPassword(
110
                    $encoder->encodePassword($Customer->getPassword(), $Customer->getSalt())
111
                );
112
            }
113
            $this->entityManager->flush();
114
115
            log_info('会員編集完了');