Code Duplication    Length = 12-15 lines in 2 locations

user_account/controllers/insert_user_account.php 1 location

@@ 62-76 (lines=15) @@
59
    );
60
61
    // Validation using GUMP
62
    if($posted_data)
63
    {
64
        $validated = array();
65
        $errors = array();
66
        $validated = $gump->validate($posted_data, $rules);
67
        if($validated !== true)
68
        {
69
            $errors = \phpskeleton\models\utility::gump_parse_errors($validated);
70
        }
71
        if($errors)
72
        {
73
            $env = $app->environment();
74
            $env["default_validation_errors"] = $errors;
75
        }
76
    }
77
78
    $default_validation_errors = isset($env["default_validation_errors"]) ? $env["default_validation_errors"] : false;
79

webapp_installer/controllers/form.php 1 location

@@ 65-76 (lines=12) @@
62
  );
63
64
  // Validation using GUMP
65
  if ($posted_data) {
66
      $validated = array();
67
      $errors = array();
68
      $validated = $gump->validate($posted_data, $rules);
69
      if ($validated !== true) {
70
          $errors = \phpskeleton\models\utility::gump_parse_errors($validated);
71
      }
72
      if ($errors) {
73
          $env = $app->environment();
74
          $env["default_validation_errors"] = $errors;
75
      }
76
  }
77
78
    $default_validation_errors = isset($env["default_validation_errors"]) ? $env["default_validation_errors"] : false;
79