Code Duplication    Length = 9-11 lines in 2 locations

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

@@ 89-99 (lines=11) @@
86
        if ($form->isSubmitted() && $form->isValid()) {
87
            log_info('会員編集開始');
88
89
            if ($Customer->getPassword() === $this->eccubeConfig['eccube_default_password']) {
90
                $Customer->setPassword($previous_password);
91
            } else {
92
                $encoder = $this->encoderFactory->getEncoder($Customer);
93
                if ($Customer->getSalt() === null) {
94
                    $Customer->setSalt($encoder->createSalt());
95
                }
96
                $Customer->setPassword(
97
                    $encoder->encodePassword($Customer->getPassword(), $Customer->getSalt())
98
                );
99
            }
100
            $this->entityManager->flush();
101
102
            log_info('会員編集完了');

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

@@ 101-109 (lines=9) @@
98
99
                $encoder = $this->encoderFactory->getEncoder($Customer);
100
101
                if ($Customer->getPassword() === $this->eccubeConfig['eccube_default_password']) {
102
                    $Customer->setPassword($previous_password);
103
                } else {
104
                    if ($Customer->getSalt() === null) {
105
                        $Customer->setSalt($encoder->createSalt());
106
                        $Customer->setSecretKey($this->customerRepository->getUniqueSecretKey());
107
                    }
108
                    $Customer->setPassword($encoder->encodePassword($Customer->getPassword(), $Customer->getSalt()));
109
                }
110
111
                // 退会ステータスに更新の場合、ダミーのアドレスに更新
112
                $newStatusId = $Customer->getStatus()->getId();