codespell: CRM/*
[civicrm-core.git] / CRM / Utils / Tree.php
index cbbafa0f4d7357479479214bfff6b6c97e0e16ed..2bcfa98ada6174a2798ef2cdfe059648fb4d9f1f 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -63,7 +63,7 @@
  * All nodes of the tree (including root and leaf node) contain the following properties
  *       Name      - what is the node name ?
  *       Children  - who are it's children
- *       Data      - any other auxillary data
+ *       Data      - any other auxiliary data
  *
  *
  * Internally all nodes are an array with the following keys
  *
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id: $
  *
  */
 class CRM_Utils_Tree {
 
   /**
-   * Store the tree information as a string or array
+   * Store the tree information as a string or array.
    * @var string|array
    */
   private $tree;
@@ -103,16 +103,14 @@ class CRM_Utils_Tree {
   }
 
   /**
-   * Find a node that matches the given string
+   * Find a node that matches the given string.
    *
    * @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
+   * @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) {
@@ -146,17 +144,16 @@ 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
+   * @param array $node node which needs to checked
    *
-   * @return boolean
+   * @return bool
    */
   public function isLeafNode(&$node) {
     return (count($node['children']) ? TRUE : FALSE);
   }
 
   /**
-   * Create a node
+   * Create a node.
    *
    * @param string $name
    *
@@ -172,11 +169,11 @@ class CRM_Utils_Tree {
   }
 
   /**
-   * Add node
+   * Add node.
    *
    * @param string $parentName
    *   Name of the parent ?.
-   * @param array (ref) - node to be added
+   * @param array (ref) $node - node to be added
    *
    * @return void
    */
@@ -188,12 +185,11 @@ class CRM_Utils_Tree {
   }
 
   /**
-   * Add Data
+   * 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
    */
@@ -210,9 +206,7 @@ class CRM_Utils_Tree {
   }
 
   /**
-   * Get Tree
-   *
-   * @param none
+   * Get Tree.
    *
    * @return tree
    */
@@ -221,13 +215,12 @@ class CRM_Utils_Tree {
   }
 
   /**
-   * Print the tree
-   *
-   * @param none
+   * Print the tree.
    *
    * @return void
    */
   public function display() {
     print_r($this->tree);
   }
+
 }