X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FTree.php;h=19ecf80bf29620a00fffc7a53f8a0a32cb3bb37e;hb=1e66775e6f88ac33d643ca2d68577ab01dd41dd5;hp=72f8d5e1575cdc224d642cf7bf9ce3b953338689;hpb=e7f7aef7265627c99d27b5e9cecdfe5d3e50f7de;p=civicrm-core.git diff --git a/CRM/Utils/Tree.php b/CRM/Utils/Tree.php index 72f8d5e157..19ecf80bf2 100644 --- a/CRM/Utils/Tree.php +++ b/CRM/Utils/Tree.php @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * @@ -93,7 +93,6 @@ class CRM_Utils_Tree { * @internal param string $rootNode * * @return CRM_Utils_Tree - * @access public */ public function __construct($nodeName) { // create the root node @@ -106,15 +105,12 @@ class CRM_Utils_Tree { /** * Find a node that matches the given string * - * @param string $name name of the node we are searching for. + * @param string $name + * Name of the node we are searching for. * @param array (ref) $parentNode which parent node should we search in ? * - * @return array( - ref) | false node if found else false - * - * @access public + * @return array(ref) | false node if found else false */ - //public function &findNode(&$parentNode, $name) public function &findNode($name, &$parentNode) { // if no parent node specified, please start from root node if (!$parentNode) { @@ -148,12 +144,9 @@ class CRM_Utils_Tree { * Check if node is a leaf node. * Currently leaf nodes are strings and non-leaf nodes are arrays * - * @param array( - ref) $node node which needs to checked - * - * @return boolean + * @param array $node node which needs to checked * - * @access public + * @return bool */ public function isLeafNode(&$node) { return (count($node['children']) ? TRUE : FALSE); @@ -164,14 +157,13 @@ class CRM_Utils_Tree { * * @param string $name * - * @return array (ref) - * - * @access public + * @return array + * (ref) */ public function &createNode($name) { - $node['name'] = $name; + $node['name'] = $name; $node['children'] = array(); - $node['data'] = array(); + $node['data'] = array(); return $node; } @@ -179,12 +171,11 @@ class CRM_Utils_Tree { /** * Add node * - * @param string $parentName - name of the parent ? - * @param array (ref) - node to be added + * @param string $parentName + * Name of the parent ?. + * @param array (ref) $node - node to be added * * @return void - * - * @access public */ public function addNode($parentName, &$node) { $temp = ''; @@ -196,13 +187,11 @@ class CRM_Utils_Tree { /** * Add Data * - * @param string $parentName - name of the parent ? - * @param mixed - data to be added - * @param string - key to be used (optional) + * @param string $parentName Name of the parent ?. + * @param string $childName - key to be used (optional) + * @param mixed $data - data to be added * * @return void - * - * @access public */ public function addData($parentName, $childName, $data) { $temp = ''; @@ -219,11 +208,7 @@ class CRM_Utils_Tree { /** * Get Tree * - * @param none - * * @return tree - * - * @access public */ public function getTree() { return $this->tree; @@ -232,14 +217,10 @@ class CRM_Utils_Tree { /** * Print the tree * - * @param none - * * @return void - * - * @access public */ public function display() { print_r($this->tree); } -} +}