Merge pull request #4822 from kurund/indentation-fixes
[civicrm-core.git] / CRM / Core / State.php
index 48d67bbb9c9a5f342fc443f1a90d432fcdc2a783..a926d48e2181af81d97da84f501914d7c89772c7 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 class CRM_Core_State {
 
   /**
-   * state name
+   * State name
    * @var string
    */
   protected $_name;
 
   /**
-   * this is a combination "OR" of the STATE_* constants defined below
+   * This is a combination "OR" of the STATE_* constants defined below
    * @var int
    */
   protected $_type;
 
   /**
-   * the state that precedes this state
-   * @var object
+   * The state that precedes this state
+   * @var CRM_Core_State
    */
   protected $_back;
 
   /**
-   * the state that succeeds this state
-   * @var object
+   * The state that succeeds this state
+   * @var CRM_Core_State
    */
   protected $_next;
 
   /**
    * The state machine that this state is part of
-   * @var object
+   * @var CRM_Core_StateMachine
    */
   protected $_stateMachine;
 
@@ -74,27 +74,20 @@ class CRM_Core_State {
    * bring in more complexity to the framework. For now, lets keep it simple
    * @var int
    */
-  CONST START = 1, FINISH = 2, SIMPLE = 4;
+  const START = 1, FINISH = 2, SIMPLE = 4;
 
   /**
-   * constructor
+   * Constructor
    *
-   * @param $name
-   * @param $type
-   * @param $back
-   * @param $next
-   * @param $stateMachine
+   * @param string $name internal name of the state
+   * @param int $type state type
+   * @param CRM_Core_State $back state that precedes this state
+   * @param CRM_Core_State $next state that follows  this state
+   * @param CRM_Core_StateMachine $stateMachine statemachine that this states belongs to
    *
-   * @internal param \the $string internal name of the state
-   * @internal param \the $int state type
-   * @internal param \the $object state that precedes this state
-   * @internal param \the $object state that follows  this state
-   * @internal param \the $object statemachine that this states belongs to
-   *
-   * @return \CRM_Core_State
-  @access public
+   * @return CRM_Core_State
    */
-  function __construct($name, $type, $back, $next, &$stateMachine) {
+  public function __construct($name, $type, $back, $next, &$stateMachine) {
     $this->_name = $name;
     $this->_type = $type;
     $this->_back = $back;
@@ -103,7 +96,7 @@ class CRM_Core_State {
     $this->_stateMachine = &$stateMachine;
   }
 
-  function debugPrint() {
+  public function debugPrint() {
     CRM_Core_Error::debug("{$this->_name}, {$this->_type}", "{$this->_back}, {$this->_next}");
   }
 
@@ -113,9 +106,8 @@ class CRM_Core_State {
    * @param object the CRM_Core_Form element under consideration
    *
    * @return mixed does a jump to the back state
-   * @access public
    */
-  function handleBackState(&$page) {
+  public function handleBackState(&$page) {
     if ($this->_type & self::START) {
       $page->handle('display');
     }
@@ -131,9 +123,8 @@ class CRM_Core_State {
    * @param object the CRM_Core_Form element under consideration
    *
    * @return mixed does a jump to the nextstate
-   * @access public
    */
-  function handleNextState(&$page) {
+  public function handleNextState(&$page) {
     if ($this->_type & self::FINISH) {
       $page->handle('process');
     }
@@ -148,9 +139,8 @@ class CRM_Core_State {
    * to display the navigation labels or potential path
    *
    * @return string
-   * @access public
    */
-  function getNextState() {
+  public function getNextState() {
     if ($this->_type & self::FINISH) {
       return NULL;
     }
@@ -167,9 +157,8 @@ class CRM_Core_State {
    * @param object the QFC data container
    *
    * @return void
-   * @access public
    */
-  function validate(&$data) {
+  public function validate(&$data) {
     $data['valid'][$this->_name] = TRUE;
   }
 
@@ -180,42 +169,37 @@ class CRM_Core_State {
    * @param object the QFC data container
    *
    * @return void
-   * @access public
    */
-  function invalidate(&$data) {
+  public function invalidate(&$data) {
     $data['valid'][$this->_name] = NULL;
   }
 
   /**
-   * getter for name
+   * Getter for name
    *
    * @return string
-   * @access public
    */
-  function getName() {
+  public function getName() {
     return $this->_name;
   }
 
   /**
-   * setter for name
+   * Setter for name
    *
    * @param string
    *
    * @return void
-   * @access public
    */
-  function setName($name) {
+  public function setName($name) {
     $this->_name = $name;
   }
 
   /**
-   * getter for type
+   * Getter for type
    *
    * @return int
-   * @access public
    */
-  function getType() {
+  public function getType() {
     return $this->_type;
   }
 }
-