Code Duplication    Length = 11-12 lines in 2 locations

src/SMG/UserBundle/Controller/UsersController.php 2 locations

@@ 194-205 (lines=12) @@
191
        $emailAssert->message = 'bst.email.invalid';
192
193
        $errors = $validator->validateValue($contactInfo, $emailAssert);
194
        if (count($errors) === 0) {
195
            $this->get('logger')->info(
196
                'updated email of '.
197
                $user->getId().
198
                ' with '.
199
                $contactInfo
200
            );
201
            $user->setEmail($contactInfo);
202
            $manager->updateUser($user);
203
204
            return $this->handleView(new View());
205
        }
206
207
        // we set user directly here so we can reuse the validator
208
        // of User entity for phone number
@@ 213-223 (lines=11) @@
210
        $user->setPhoneNumber($phoneNumber);
211
212
        $errors = $validator->validate($user, ['phone_check']);
213
        if (count($errors) === 0) {
214
            $this->get('logger')->info(
215
                'updated phone of '.
216
                $user->getId().
217
                ' with '.
218
                $phoneNumber
219
            );
220
            $manager->updateUser($user);
221
222
            return $this->handleView(new View());
223
        }
224
225
        return $this->handleView(
226
            new View(