<commit_before><?php
class UIHelper 
{
	public static function addClasses($params,$extra = null)
	{
		$icon_class =  (isset($params['ui-icon']))?' sf_button-icon-left ':'';
		$UIClasses = ' ' .$extra .' sf_button ' . $icon_class . ' ui-corner-all ';
		$uparams = is_array($params['params']) ? $params['params'] : sfToolkit::stringToArray($params['params']);
    if (isset($uparams['class']))
		{
			$uparams['class'] .= $UIClasses;
		}
		else
		{
			$uparams['class'] = $UIClasses;
		}
		return self::arrayToString($uparams);
	}
	
	public static function getClasses($params)
	{
		$table = sfToolkit::stringToArray($params);
		return $table['class'];
	}
	
	public static function addIcon($params)
	{
		if (isset($params['ui-icon']) && $params['ui-icon'] != '')
		{
			return '<span class="ui-icon ui-icon-'.$params['ui-icon'].'"></span>';
		}
	}
	
	public static function arrayToString($params)
	{
		$tp = '';
		
		foreach ($params as $key => $val)
		{
			$tp .= "$key=$val ";
		}
		return $tp;
	}
	
}<commit_msg>[sfAdminThemejRollerPlugin] fixed coding standards, adde some phpdoc<commit_after><?php

class UIHelper 
{
  /**
   * Adds UI CSS classes
   *
   * @param array $params An array of parameters
   * @param string $extra Extra CSS classes
   * @return string
   * @static
   */
	static public function addClasses(array $params, $extra = '')
	{
		$iconClass = (isset($params['ui-icon'])) ?' sf_button-icon-left ' : '';
		$uiClasses = sprintf(' %s sf_button %s ui-corner-all', $extra, $iconClass);
		$uiParams  = is_array($params['params']) ? $params['params'] : sfToolkit::stringToArray($params['params']);
		$uiParams['class'] = $UIClasses;

		return self::arrayToString($uiParams);
	}

  /**
   * Returns the CSS classes to apply as a string
   *
   * @param string $params
   * @return string
   * @static
   */
	static public function getClasses($params)
	{
		$table = sfToolkit::stringToArray($params);

		return $table['class'];
	}

  /**
   * Adds an UI icon
   *
   * @param array $params An array of parameters
   * @return string
   * @static
   */
	static public function addIcon(array $params)
	{
		if (!empty($params['ui-icon']))
		{
			return sprintf('<span class="ui-icon ui-icon-%s"></span>', $params['ui-icon']);
		}
	}

  /**
   * Converts an associative array to a string
   *
   * @param array $params The associative array
   * @return string
   * @static
   */
	static public function arrayToString(array $params)
	{
	  $result = '';
	  foreach ($params as $key => $value)
	  {
	    $result .= sprintf('%s=%s ', $key, $value);
	  }

    return $result;
	}
}
{'fraction_non_alphanumeric': 0.18129107073830691, 'fraction_numerical': 0.0, 'mean_word_length': 3.5483304042179262, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3356984', 'n_tokens_mistral': 940, 'n_tokens_neox': 879, 'n_words': 198}