<commit_before><?php

/**
 * gittorama - a websvn for git
 * Copyright (C) 2010  <NAME> <<EMAIL>>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @license http://www.gnu.org/licenses/agpl-3.0.html  GNU AGPL 3.0
 */

class Controller
{

	/**
	 * @var StdClass
	 */
	protected $view;

	/**
	 * @var array
	 */
	private $params;

	/**
	 * @var Configuration
	 */
	private $userConfig;

	public function  __construct(Configuration $config, array $params)
	{
		$this->view = new StdClass;
		$this->userConfig = $config;
		$this->params = $params;
	}

	/**
	 * Render a view script.
	 *
	 * @param string $name
	 */
	public function render($name)
	{
		$viewScript = APPLICATION_PATH . '/View/' . $name . '.phtml';
		new View($this->view, $viewScript, true, $this->getParams());
	}

	/**
	 * Get request params.
	 *
	 * @return array
	 */
	protected function getParams()
	{
		return $this->params;
	}

	/**
	 * Gets the value of the specified request parameter.
	 * If that parameter is not in the request, provides the specified default value.
	 *
	 * @param string $param
	 * @param mixed $defaultValue
	 * @return mixed
	 */
	protected function getParam($param, $defaultValue)
	{<commit_msg>if a parameters is missing, we assume it as null<commit_after><?php

/**
 * gittorama - a websvn for git
 * Copyright (C) 2010  <NAME> <<EMAIL>>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @license http://www.gnu.org/licenses/agpl-3.0.html  GNU AGPL 3.0
 */

class Controller
{

	/**
	 * @var StdClass
	 */
	protected $view;

	/**
	 * @var array
	 */
	private $params;

	/**
	 * @var Configuration
	 */
	private $userConfig;

	public function  __construct(Configuration $config, array $params)
	{
		$this->view = new StdClass;
		$this->userConfig = $config;
		$this->params = $params;
	}

	/**
	 * Render a view script.
	 *
	 * @param string $name
	 */
	public function render($name)
	{
		$viewScript = APPLICATION_PATH . '/View/' . $name . '.phtml';
		new View($this->view, $viewScript, true, $this->getParams());
	}

	/**
	 * Get request params.
	 *
	 * @return array
	 */
	protected function getParams()
	{
		return $this->params;
	}

	/**
	 * Gets the value of the specified request parameter.
	 * If that parameter is not in the request, provides the specified default value.
	 *
	 * @param string $param
	 * @param mixed $defaultValue
	 * @return mixed
	 */
	protected function getParam($param, $defaultValue = null)
	{
{'fraction_non_alphanumeric': 0.11546840958605664, 'fraction_numerical': 0.004901960784313725, 'mean_word_length': 3.2315668202764978, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '7557658', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1074, 'n_words': 426}