<commit_before><?php

class SyncTool {
	// take a server as parameter and return a HttpSocket object using the ssl options defined in the server settings
	public function setupHttpSocket($server) {
		$params = array();
		App::uses('HttpSocket', 'Network/Http');
		if ($server['Server']['cert_file'])	$params['ssl_cafile'] = APP . "files" . DS . "certs" . DS . $server['Server']['id'] . '.pem';
		if ($server['Server']['self_signed']) $params['ssl_allow_self_signed'] = $server['Server']['self_signed'];
		$HttpSocket = new HttpSocket($params);

		$proxy = Configure::read('Proxy');
		if(!empty($proxy['host']) && !empty($proxy['port'])) {
			if(!empty($proxy['method']) && !empty($proxy['user']) && !empty($proxy['password'])) {
				$HttpSocket->configProxy($proxy['host'], $proxy['port']);
			} else {
				$HttpSocket->configProxy($proxy['host'], $proxy['port'], $proxy['method'], $proxy['user'], $proxy['password']);
			}
		}
		return $HttpSocket;
	}
}
<commit_msg>configProxy() checks for empty arguments, no need to do it twice<commit_after><?php

class SyncTool {
	// take a server as parameter and return a HttpSocket object using the ssl options defined in the server settings
	public function setupHttpSocket($server) {
		$params = array();
		App::uses('HttpSocket', 'Network/Http');
		if ($server['Server']['cert_file'])	$params['ssl_cafile'] = APP . "files" . DS . "certs" . DS . $server['Server']['id'] . '.pem';
		if ($server['Server']['self_signed']) $params['ssl_allow_self_signed'] = $server['Server']['self_signed'];
		$HttpSocket = new HttpSocket($params);

		$proxy = Configure::read('Proxy');
		$HttpSocket->configProxy($proxy['host'], $proxy['port'], $proxy['method'], $proxy['user'], $proxy['password']);

		return $HttpSocket;
	}
}

{'fraction_non_alphanumeric': 0.21322690992018245, 'fraction_numerical': 0.0, 'mean_word_length': 5.882352941176471, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '4007844', 'n_tokens_mistral': 571, 'n_tokens_neox': 540, 'n_words': 128}