Code Duplication    Length = 3-3 lines in 2 locations

models/User.php 2 locations

@@ 357-359 (lines=3) @@
354
    {
355
        $oldRegisterFields = $this->module->registrationFields;
356
        $this->module->registrationFields = ['password', 'name'];
357
        if ($this->getIsNewRecord() == false) {
358
            throw new \RuntimeException('Calling "' . __CLASS__ . '::' . __METHOD__ . '" on existing user');
359
        }
360
        $generatedPassword = false;
361
        if (empty($this->password)) {
362
            // password autogenerate
@@ 390-392 (lines=3) @@
387
     */
388
    public function register()
389
    {
390
        if ($this->getIsNewRecord() == false) {
391
            throw new \RuntimeException('Calling "' . __CLASS__ . '::' . __METHOD__ . '" on existing user');
392
        }
393
        if (!$this->module->enableRegistration) {
394
            $this->addError('registration', Yii::t('activeuser_general', 'Registration is not available'));
395
            return false;