<commit_before><?php

/**
 * OpenPNEFormAutoGenerate is the base class for forms that generate its widgets automatically
 *
 * @package    OpenPNE
 * @subpackage form
 * @author     <NAME> <<EMAIL>>
 */
abstract class OpenPNEFormAutoGenerate extends sfForm
{
  protected function generateWidget($field, $choices = array())
  {
    $params = array();

    if ($field['Caption'])
    {
      $params['label'] = $field['Caption'];
    }

    if ($choices)
    {
      $params['choices'] = $choices;
    }
    elseif (!empty($field['Choices']))
    {
      $params['choices'] = $field['Choices'];
    }

    if ($field['Default'])
    {
      $params['default'] = $field['Default'];
    }

    switch ($field['FormType']) {
      case 'checkbox':
        $obj = new sfWidgetFormSelectCheckbox($params);
        break;
      case 'select':
        $obj = new sfWidgetFormSelect($params);
        break;
      case 'radio':
        $obj = new sfWidgetFormSelectRadio($params);
        break;
      case 'textarea':
        $obj = new sfWidgetFormTextarea($params);
        break;
      case 'rich_textarea':<commit_msg>fixed notice<commit_after><?php

/**
 * OpenPNEFormAutoGenerate is the base class for forms that generate its widgets automatically
 *
 * @package    OpenPNE
 * @subpackage form
 * @author     <NAME> <<EMAIL>>
 */
abstract class OpenPNEFormAutoGenerate extends sfForm
{
  protected function generateWidget($field, $choices = array())
  {
    $params = array();

    if ($field['Caption'])
    {
      $params['label'] = $field['Caption'];
    }

    if ($choices)
    {
      $params['choices'] = $choices;
    }
    elseif (!empty($field['Choices']))
    {
      $params['choices'] = $field['Choices'];
    }

    if (!empty($field['Default']))
    {
      $params['default'] = $field['Default'];
    }

    switch ($field['FormType']) {
      case 'checkbox':
        $obj = new sfWidgetFormSelectCheckbox($params);
        break;
      case 'select':
        $obj = new sfWidgetFormSelect($params);
        break;
      case 'radio':
        $obj = new sfWidgetFormSelectRadio($params);
        break;
      case 'textarea':
        $obj = new sfWidgetFormTextarea($params);
        break;
      case 'rich_textarea':
{'fraction_non_alphanumeric': 0.15270935960591134, 'fraction_numerical': 0.0, 'mean_word_length': 2.698675496688742, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '6876900', 'n_tokens_mistral': 678, 'n_tokens_neox': 665, 'n_words': 152}