<commit_before><?php namespace Orchestra\Services\Validation;

use Orchestra\Support\Validator;

class UserAccount extends Validator {
	
	/**
	 * List of rules.
	 *
	 * @var array
	 */
	protected $rules = array(
		'email'    => array('required', 'email'),
		'fullname' => array('required'),
	);
	
	/**
	 * List of events.
	 *
	 * @var array
	 */
	protected $events = array(
		'orchestra.validate: user.account',
	);

	/**
	 * On register scenario.
	 *
	 * @access protected
	 * @return void
	 */
	protected function onRegister() 
	{
		$this->rules['email'] = array('required', 'email', 'unique:users,email');
	}

	/**
	 * On update password scenario.
	 *
	 * @access protected
	 * @return void
	 */
	protected function onChangePassword()
	{
		$this->rules = array(
			'current_password' => array('required'),
			'new_password'     => array('required', 'different:<PASSWORD>'),
			'confirm_password' => array('<PASSWORD>'),
		);

		$this->events = array();
	}
}<commit_msg>Fixed regression bug with new implementation on Orchestra\Support\Validator.<commit_after><?php namespace Orchestra\Services\Validation;

use Illuminate\Support\Fluent;
use Orchestra\Support\Validator;

class UserAccount extends Validator {
	
	/**
	 * List of rules.
	 *
	 * @var array
	 */
	protected $rules = array(
		'email'    => array('required', 'email'),
		'fullname' => array('required'),
	);
	
	/**
	 * List of events.
	 *
	 * @var array
	 */
	protected $events = array(
		'orchestra.validate: user.account',
	);

	/**
	 * On register scenario.
	 *
	 * @access protected
	 * @return void
	 */
	protected function onRegister() 
	{
		$this->rules['email'] = array('required', 'email', 'unique:users,email');
	}

	/**
	 * On update password scenario.
	 *
	 * @access protected
	 * @return void
	 */
	protected function onChangePassword()
	{
		$this->rules = new Fluent(array(
			'current_password' => array('required'),
			'new_password'     => array('required', 'different:current_password'),
			'confirm_password' => array('same:<PASSWORD>'),
		));

		$this->events = array();
	}
}
{'fraction_non_alphanumeric': 0.1703056768558952, 'fraction_numerical': 0.0, 'mean_word_length': 3.541850220264317, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 22, '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': '5700945', 'n_tokens_mistral': 700, 'n_tokens_neox': 625, 'n_words': 146}