<commit_before><?php

class LottoServer extends WebSocketServer {

	protected function connected($user)
	{
		// check current game status
		$game_status = LottoData::instance()->status();

		if($game_status['status'] < 1)
		{
			$this->send($user, json_encode($game_status));
		}
	}

	protected function closed($user) { }

	protected function process($user, $message)
	{
		$this->stdout('> message: '. $message);

		list($command) = explode(':', $message);

		switch ($command) 
		{
/*			case 'status':
				$reply = LottoData::instance()->status();
				break;
*/
			case 'bet':
				list(, $combination) = explode(':', $message);

				$reply = LottoData::instance()->bet($combination);
				break;

			case 'settings':
				$reply = LottoData::instance()->settings();
				break;

			case 'draw':
				LottoData::instance()->draw();

				$reply = LottoData::instance()->status();
				break;

			case 'claim':
				list(, $code) = explode(':', $message);

				$reply = LottoData::instance()->claim($code);
				break;
			
			default:
				$this->stdout('> Unknown command: '. $command);
				break;
		}

		// attach command
		$reply = array('command' => $command) + $reply;

		$this->send($user, json_encode($reply));
	}

}<commit_msg>array cast<commit_after><?php

class LottoServer extends WebSocketServer {

	protected function connected($user)
	{
		// check current game status
		$game_status = LottoData::instance()->status();

		if($game_status['status'] < 1)
		{
			$this->send($user, json_encode($game_status));
		}
	}

	protected function closed($user) { }

	protected function process($user, $message)
	{
		$this->stdout('> message: '. $message);

		list($command) = explode(':', $message);

		switch ($command) 
		{
/*			case 'status':
				$reply = LottoData::instance()->status();
				break;
*/
			case 'bet':
				list(, $combination) = explode(':', $message);

				$reply = LottoData::instance()->bet($combination);
				break;

			case 'settings':
				$reply = LottoData::instance()->settings();
				break;

			case 'draw':
				LottoData::instance()->draw();

				$reply = LottoData::instance()->status();
				break;

			case 'claim':
				list(, $code) = explode(':', $message);

				$reply = LottoData::instance()->claim($code);
				break;
			
			default:
				$this->stdout('> Unknown command: '. $command);
				break;
		}

		// attach command
		$reply = array('command' => $command) + (array) $reply;

		$this->send($user, json_encode($reply));
	}

}
{'fraction_non_alphanumeric': 0.1979633401221996, 'fraction_numerical': 0.000814663951120163, 'mean_word_length': 3.6252354048964217, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 31, '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': '5073297', 'n_tokens_mistral': 967, 'n_tokens_neox': 785, 'n_words': 164}