Skip to content

Commit

Permalink
Format comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xemle committed May 26, 2013
1 parent 58930ac commit 5df7349
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 29 deletions.
7 changes: 4 additions & 3 deletions View/Helper/OptionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
* @license GPL-2.0 (http://www.opensource.org/licenses/GPL-2.0)
*/

/** This helper handles the user options which is intialized in app_controller::beforeRender() */
/**
* This helper handles the user options which is intialized in app_controller::beforeRender()
*/
class OptionHelper extends AppHelper
{
var $options = null;
var $options = array();

/**
* Intitialize the options
Expand All @@ -44,4 +46,3 @@ function get($name, $default = null) {
}
}
}
?>
73 changes: 47 additions & 26 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,53 @@ class Search extends Object

var $_data;

/** List of chars to escape on setParam() */
/**
* List of chars to escape on setParam()
*/
var $escapeChars = '=,/';

/** Clears all parameters and set them to the defaults*/
/**
* Clears all parameters and set them to the defaults
*/
function clear() {
$this->_data = array();
}

/** Returns all parameters
@return Parameter array */
/**
* Returns all parameters
*
* @return Parameter array
*/
function getParams() {
return $this->_data;
}

/** Set all parameters
@param data Parameter array
@note The parameters are not validated! */
/**
* Set all parameters
*
* @param data Parameter array
* @note The parameters are not validated!
*/
function setParams($data = array()) {
$this->_data = $data;
}

/** Validate parameter value.
@note Overwritten by inherited classes */
/**
* Validate parameter value.
*
* @note Overwritten by inherited classes
*/
function validate($name, $value) {
return true;
}

/** Returns parameter
@param name Name of parameter
@param default Default value, if the parameter does not exists. Default
value is null */
/**
* Returns parameter
*
* @param name Name of parameter
* @param default Default value, if the parameter does not exists. Default
* value is null
*/
function getParam($name, $default = null) {
if (!empty($this->_data[$name])) {
return $this->_data[$name];
Expand All @@ -59,12 +75,15 @@ function getParam($name, $default = null) {
}
}

/** Set a singular parameter
@param name Parameter name
@param value Parameter value
@param validate Optional parameter to validate the parameter. Default is
true
@return True on success */
/**
* Set a singular parameter
*
* @param name Parameter name
* @param value Parameter value
* @param validate Optional parameter to validate the parameter. Default is
* true
* @return True on success
*/
function setParam($name, $value, $validate = true) {
if ($validate === false || $this->validate($name, $value)) {
$this->_data[$name] = $value;
Expand All @@ -74,12 +93,15 @@ function setParam($name, $value, $validate = true) {
}
}

/** Add a parameter to an array.
@param name Parameter name.
@param value Parameter value (which will be pluralized)
@param validate Optional parameter to validate the parameter. Default is
true
@note The name will be pluralized. */
/**
* Add a parameter to an array.
*
* @param name Parameter name.
* @param value Parameter value (which will be pluralized)
* @param validate Optional parameter to validate the parameter. Default is
* true
* @note The name will be pluralized.
*/
function addParam($name, $value, $validate = true) {
$name = Inflector::pluralize($name);
if (is_array($value)) {
Expand Down Expand Up @@ -227,4 +249,3 @@ function decode($input) {
return $out;
}
}
?>

0 comments on commit 5df7349

Please sign in to comment.