Skip to content

Commit

Permalink
Dev: added comments on setVarFromArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Nov 21, 2016
1 parent 6400ebc commit 5d81d4c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1351,6 +1351,15 @@ private function moveSubmitIfNeeded($redata)
}


/**
* The run method fed $redata with using get_defined_var(). So it was very hard to move a piece of code from the run method to a new one.
* To make it easier, private variables has been added to this class:
* So when a piece of code changes a variable (a variable that originally was finally added to redata get_defined_var()), now, it also changes its private variable version.
* Then, before performing the get_defined_var, the private variables are used to recreate those variables. So we can move piece of codes to sub methods.
* setVarFromArgs($args) will set the original state of those private variables using the parameter $args passed to the run() method
*
* @params array $args
*/
private function setVarFromArgs($args)
{
extract($args);
Expand Down

0 comments on commit 5d81d4c

Please sign in to comment.