<commit_before><?php
namespace ${actorNs};

/**
 * This is a generated class that provides pre-parsed information about a model
 * that is used by various Conductor classes, generated or otherwise.
 *
 * TODO Separate messages into it's own generated class that can be used for
 *      localization.
 *
 * @author <NAME> <<EMAIL>>
 */
class ${actorClass} {

  public function createSuccessMsg() {
    return ucfirst($this->_successMsg('created', '${article}')) . '.';
  }

  public function deleteSuccessMsg() {
    return ucfirst($this->_successMsg('deleted', 'the')) . '.';
  }

  public function duplicateMsg($dupField, $dupValue) {
    $msg = "${article} ${singular} with $dupField '$dupValue' already exists";
    return ucfirst($msg) . '.';
  }

  public function genericErrorMsg($action, $plural = false) {
    if ($plural) {
      $msg = "there was an error $action the ${plural}";
    } else {
      $msg = "there was an error $action ${article} ${singular}";
    }
    $msg .= " Please try again later or contact an administrator if the problem"
          . " persists";
    return ucfirst($msg) . '.';
  }

  public function getDisplayName() {
    return '${singular}';
  }

  public function getDisplayNamePlural() {
    return '${plural}';
  }

  public function getIndefiniteArticle() {
    return '${article}';
  } 

  public function invalidEntityMsg() {
    return "The given ${singular} is not valid because:";
  }

  public function invalidFilterMsg($filter) {
    $msg = "${plural} do not support '$filter' as a filter field";
    return ucfirst($msg) . '.';
  }

  public function invalidSortMsg($sort) {
    $msg = "${plural} do not support '$sort' as a sort field";
    return ucfirst($msg) . '.';
  }

  public function notNullMsg($field) {
    $msg = "the '$field' field of ${article} ${singular} cannot be blank";
    return ucfirst($msg) . '.';
  }

  public function updateSuccessMsg() {
    return ucfirst($this->_successMsg('updated', 'the')) . '.';
  }

  public function _successMsg($action, $article) {
    return "successfully $action $article ${singular}";
  }

}
<commit_msg>Updated model messages template to use code-templates v2 syntax<commit_after><?php
namespace /*# actorNs #*/;

/**
 * This is a generated class that provides pre-parsed information about a model
 * that is used by various Conductor classes, generated or otherwise.
 *
 * TODO Separate messages into it's own generated class that can be used for
 *      localization.
 *
 * @author <NAME> <<EMAIL>>
 */
class /*# actorClass #*/ {

  public function createSuccessMsg() {
    return ucfirst($this->_successMsg('created', '/*# article #*/')) . '.';
  }

  public function deleteSuccessMsg() {
    return ucfirst($this->_successMsg('deleted', 'the')) . '.';
  }

  public function duplicateMsg($dupField, $dupValue) {
    $msg = "/*# article #*/ /*# singular #*/ with $dupField '$dupValue' already exists";
    return ucfirst($msg) . '.';
  }

  public function genericErrorMsg($action, $plural = false) {
    if ($plural) {
      $msg = "there was an error $action the /*# plural #*/";
    } else {
      $msg = "there was an error $action /*# article #*/ /*# singular #*/";
    }
    $msg .= " Please try again later or contact an administrator if the problem"
          . " persists";
    return ucfirst($msg) . '.';
  }

  public function getDisplayName() {
    return '/*# singular #*/';
  }

  public function getDisplayNamePlural() {
    return '/*# plural #*/';
  }

  public function getIndefiniteArticle() {
    return '/*# article #*/';
  } 

  public function invalidEntityMsg() {
    return "The given /*# singular #*/ is not valid because:";
  }

  public function invalidFilterMsg($filter) {
    $msg = "/*# plural #*/ do not support '$filter' as a filter field";
    return ucfirst($msg) . '.';
  }

  public function invalidSortMsg($sort) {
    $msg = "/*# plural #*/ do not support '$sort' as a sort field";
    return ucfirst($msg) . '.';
  }

  public function notNullMsg($field) {
    $msg = "the '$field' field of /*# article #*/ /*# singular #*/ cannot be blank";
    return ucfirst($msg) . '.';
  }

  public function updateSuccessMsg() {
    return ucfirst($this->_successMsg('updated', 'the')) . '.';
  }

  public function _successMsg($action, $article) {
    return "successfully $action $article /*# singular #*/";
  }

}

{'fraction_non_alphanumeric': 0.15790681661693826, 'fraction_numerical': 0.00022951572182694515, 'mean_word_length': 3.2310679611650484, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6701734', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1295, 'n_words': 400}