<commit_before><?php

namespace MergadoClient;


class UrlBuilder
{
	protected $url;

	protected $mode;

	const BASEURL = 'http://app.mergado.com/api';
	const BASEURL_DEV = 'http://dev.mergado.com/api';
	const BASEURL_LAB = 'http://lab.mergado.com/api';

	public function __construct($mode = null) {

		$this->resetUrl();
	}

	public function resetUrl() {

		if ($this->mode == 'dev') {
			return static::BASEURL_DEV;
		} else if ($this->mode == 'local') {
			return static::BASEURL_LAB;
		} else {
			return static::BASEURL;
		}

	}

	/**
	 * @param $method
	 * @param array $args
	 * @return $this
	 */
	public function appendFromMethod($method, array $args) {
		$this->url .= '/'.strtolower(urlencode($method));
		if($args){
			$this->url .= '/'.urlencode($args[0]);
		}

		return $this;
	}

	/**
	 * @param $name
	 * @return $this
	 */
	public function appendFromProperty($name) {
		$this->url .= '/'.strtolower(urlencode($name));
		return $this;
	}


	/**
	 * @return string
	 */
	public function buildUrl() {
		$builtUrl = $this->url;
		$this->resetUrl();
		return $builtUrl;
	}

}<commit_msg>Fixed bug<commit_after><?php

namespace MergadoClient;


class UrlBuilder
{
	protected $url;

	protected $mode;

	const BASEURL = 'http://app.mergado.com/api';
	const BASEURL_DEV = 'http://dev.mergado.com/api';
	const BASEURL_LAB = 'http://lab.mergado.com/api';

	public function __construct($mode = null) {

		$this->resetUrl();
	}

	public function resetUrl() {

		if ($this->mode == 'dev') {
			$this->url = static::BASEURL_DEV;
		} else if ($this->mode == 'local') {
			$this->url = static::BASEURL_LAB;
		} else {
			$this->url = static::BASEURL;
		}

	}

	/**
	 * @param $method
	 * @param array $args
	 * @return $this
	 */
	public function appendFromMethod($method, array $args) {
		$this->url .= '/'.strtolower(urlencode($method));
		if($args){
			$this->url .= '/'.urlencode($args[0]);
		}

		return $this;
	}

	/**
	 * @param $name
	 * @return $this
	 */
	public function appendFromProperty($name) {
		$this->url .= '/'.strtolower(urlencode($name));
		return $this;
	}


	/**
	 * @return string
	 */
	public function buildUrl() {
		$builtUrl = $this->url;
		$this->resetUrl();
		return $builtUrl;
	}

}
{'fraction_non_alphanumeric': 0.19258589511754068, 'fraction_numerical': 0.0009041591320072332, 'mean_word_length': 3.356299212598425, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '1343015', 'n_tokens_mistral': 888, 'n_tokens_neox': 794, 'n_words': 161}