Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 107-116 (lines=10) @@
104
                    $app['orm.em']->persist($CustomerAddress);
105
                }
106
107
                if ($Customer->getPassword() === $app['config']['default_password']) {
108
                    $Customer->setPassword($previous_password);
109
                } else {
110
                    if ($Customer->getSalt() === null) {
111
                        $Customer->setSalt($app['eccube.repository.customer']->createSalt(5));
112
                    }
113
                    $Customer->setPassword(
114
                        $app['eccube.repository.customer']->encryptPassword($app, $Customer)
115
                    );
116
                }
117
118
                $app['orm.em']->persist($Customer);
119

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

@@ 69-78 (lines=10) @@
66
67
        if ($form->isSubmitted() && $form->isValid()) {
68
69
            if ($Customer->getPassword() === $app['config']['default_password']) {
70
                $Customer->setPassword($previous_password);
71
            } else {
72
                if ($Customer->getSalt() === null) {
73
                    $Customer->setSalt($app['eccube.repository.customer']->createSalt(5));
74
                }
75
                $Customer->setPassword(
76
                    $app['eccube.repository.customer']->encryptPassword($app, $Customer)
77
                );
78
            }
79
            $app['orm.em']->flush();
80
81
            $event = new EventArgs(