<commit_before><?php
/* 
 * Copyright (c) 2008, <NAME> <[<EMAIL>>; <NAME> <[<EMAIL>>
 * All rights reserved. 
 */

/**
 * Json class, Json response conteiner controller
 *
 * @version	1
 * @package	Utils
 * @author	<NAME> <<EMAIL>>
 * @author	<NAME> <<EMAIL>>
 */
class Json{
	
	/**
	* Temporary data array
	*
	* @var		array
	* @access	private
	*/
	private $json = array();
	
	/**
	* Singleton instance
	*
	* @staticvar	Json
	* @access		private
	* @static
	*/
	static $instance = false;
	
	/**
	* Constructor, Initialize the Json object
	*
	* @return	void
	*/
	private function __construct(){
		$this->json = array(
			"status" => 1,
			"message" => "",
			"errors" => array(),
			"packages" => array()
		);
	}
	
	/**
	* Load a Json object instance
	*
	* @return	Json
	*/
	public static function getInstance(){
		if (!self::$instance) self::$instance = new self();
		return self::$instance;
	}
	
	/**
	* Set json response sucess status
	*
	* @param	string	$status		New Status
	* @param	string	$mensagem	Status message
	* @return	bool
	*/
	public function set($status, $message="", $errors=""){
		if ($errors == "") $errors = array();
		$this->getInstance();
		$this->json["status"] = $status;
		$this->json["errors"] = $errors;
		if ($message!="") $this->json["message"] = $message;
		return true;	
	}
	
	/**
	* Add data package
	*
	* @param	mixed	$name		Package name
	* @param	mixed	$values		Package values
	* @return	void
	*/
	public function addPackage($name, $values){
		$this->json["packages"][$name] = $values;
	}
	
	/**
	* Convert data to json
	*
	* @return	string
	*/
	public function render(){
		foreach (DAO::getAll() as $k => $p) $this->addDAO($k, $p);
		return json_encode($this->json);
	}
}<commit_msg>Wrong name of the method was been used<commit_after><?php
/* 
 * Copyright (c) 2008, <NAME> <[<EMAIL>>; <NAME> <[<EMAIL>>
 * All rights reserved. 
 */

/**
 * Json class, Json response conteiner controller
 *
 * @version	1
 * @package	Utils
 * @author	<NAME> <<EMAIL>>
 * @author	<NAME> <<EMAIL>>
 */
class Json{
	
	/**
	* Temporary data array
	*
	* @var		array
	* @access	private
	*/
	private $json = array();
	
	/**
	* Singleton instance
	*
	* @staticvar	Json
	* @access		private
	* @static
	*/
	static $instance = false;
	
	/**
	* Constructor, Initialize the Json object
	*
	* @return	void
	*/
	private function __construct(){
		$this->json = array(
			"status" => 1,
			"message" => "",
			"errors" => array(),
			"packages" => array()
		);
	}
	
	/**
	* Load a Json object instance
	*
	* @return	Json
	*/
	public static function getInstance(){
		if (!self::$instance) self::$instance = new self();
		return self::$instance;
	}
	
	/**
	* Set json response sucess status
	*
	* @param	string	$status		New Status
	* @param	string	$mensagem	Status message
	* @return	bool
	*/
	public function set($status, $message="", $errors=""){
		if ($errors == "") $errors = array();
		$this->getInstance();
		$this->json["status"] = $status;
		$this->json["errors"] = $errors;
		if ($message!="") $this->json["message"] = $message;
		return true;	
	}
	
	/**
	* Add data package
	*
	* @param	mixed	$name		Package name
	* @param	mixed	$values		Package values
	* @return	void
	*/
	public function addPackage($name, $values){
		$this->json["packages"][$name] = $values;
	}
	
	/**
	* Convert data to json
	*
	* @return	string
	*/
	public function render(){
		foreach (DAO::getAll() as $k => $p) $this->addPackage($k, $p);
		return json_encode($this->json);
	}
}
{'fraction_non_alphanumeric': 0.18907198612315698, 'fraction_numerical': 0.003469210754553339, 'mean_word_length': 3.3797468354430378, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 53, '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': '6113384', 'n_tokens_mistral': 1336, 'n_tokens_neox': 1258, 'n_words': 331}