<commit_before><?php

	class RestServer {
		private $serviceClasses = array();

		public function addServiceClass($serviceClass) {
			$this->serviceClasses[count($this->serviceClasses)] = $serviceClass;
		}
	
		public function handle() {
			$requestAttributes = $this->getRequestAttributeArray();

			if ($this->methodIsDefinedInRequest()) {
				$method = $requestAttributes["method"];

				$serviceClass = $this->getClassContainingMethod($method);
					
				if ($serviceClass != null) {
					$ref = new ReflectionMethod($serviceClass, $method);
					$params = $ref->getParameters();
					$paramCount = count($params);
					$pArray = array();
					$paramStr = "";
					
					$iterator = 0;
					
					foreach ($params as $param) {
						$pArray[strtolower($param->getName())] = null;
						$paramStr .= $param->getName();
						if ($iterator != $paramCount-1) {
							$paramStr .= ", ";
						}
						
						$iterator++;
					}<commit_msg>custom error on access to private methods<commit_after><?php

	class RestServer {
		private $serviceClasses = array();

		public function addServiceClass($serviceClass) {
			$this->serviceClasses[count($this->serviceClasses)] = $serviceClass;
		}
	
		public function handle() {
			$requestAttributes = $this->getRequestAttributeArray();

			if ($this->methodIsDefinedInRequest()) {
				$method = $requestAttributes["method"];

				$serviceClass = $this->getClassContainingMethod($method);
					
				if ($serviceClass != null) {
					$ref = new ReflectionMethod($serviceClass, $method);
					if (!$ref->isPublic()) {
						echo json_encode(array('error' => 'API call is invalid.'));
					        return ;
					}
					$params = $ref->getParameters();
					$paramCount = count($params);
					$pArray = array();
					$paramStr = "";
					
					$iterator = 0;
					
					foreach ($params as $param) {
						$pArray[strtolower($param->getName())] = null;
						$paramStr .= $param->getName();
						if ($iterator != $paramCount-1) {
							$paramStr .= ", ";
						}
						
						$iterator++;
					}
{'fraction_non_alphanumeric': 0.161829808165273, 'fraction_numerical': 0.001967535661583866, 'mean_word_length': 3.0118343195266273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '2678728', 'n_tokens_mistral': 811, 'n_tokens_neox': 578, 'n_words': 117}