<commit_before><?php

namespace helpers;

class FormProcessorImpl implements \helpers\FormProcessor {

	/**
	 * @see \helpers\FormProcessor#processOnSubmit($form)
	 */
	static function processOnSubmit(\models\RegistrationForm &$form) {
		// Registrations from outside Poland and Toastmasters are put on hold
		// for review
		if ('outside' == $form->getField('country')
				|| 'None' == $form->getField('home-club')) {
			$form->setStatusValue('pending-review');
		}

		// Check if a custom club name was entered
		if ($form->hasField('home-club-custom')
				&& $form->getField('home-club-custom')) {
			$dictionaryDao = new \models\DictionaryDao();
			$dictionaryDao->createClub($form->getField('home-club-custom'));

			$form->setField('home-club', $form->getField('home-club-custom'));
			$form->clearField('home-club-custom');
		}

		// We don't need to store the consent field
		if ($form->hasField('data-collection-consent')) {
			$form->clearField('data-collection-consent');
		}
	}

}<commit_msg>Correcting case of people entering weird names<commit_after><?php

namespace helpers;

class FormProcessorImpl implements \helpers\FormProcessor {

	/**
	 * @see \helpers\FormProcessor#processOnSubmit($form)
	 */
	static function processOnSubmit(\models\RegistrationForm &$form) {
		// Make sure full name case is correct. Some people enter weird things
		// like ALL CAPS strings.
		$form->setField(
			'full-name',
			mb_convert_case(
				mb_strtolower($form->getField('full-name')),
				MB_CASE_TITLE
				)
			);

		// Registrations from outside Poland and Toastmasters are put on hold
		// for review
		if ('outside' == $form->getField('country')
				|| 'None' == $form->getField('home-club')) {
			$form->setStatusValue('pending-review');
		}

		// Check if a custom club name was entered
		if ($form->hasField('home-club-custom')
				&& $form->getField('home-club-custom')) {
			$dictionaryDao = new \models\DictionaryDao();
			$dictionaryDao->createClub($form->getField('home-club-custom'));

			$form->setField('home-club', $form->getField('home-club-custom'));
			$form->clearField('home-club-custom');
		}

		// We don't need to store the consent field
		if ($form->hasField('data-collection-consent')) {
			$form->clearField('data-collection-consent');
		}
	}

}
{'fraction_non_alphanumeric': 0.1673254281949934, 'fraction_numerical': 0.0, 'mean_word_length': 4.1076233183856505, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '2115543', 'n_tokens_mistral': 802, 'n_tokens_neox': 708, 'n_words': 147}