Skip to content

Commit

Permalink
Dev: phpdoc and Scrutinizer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Dec 21, 2016
1 parent 7cea596 commit 1688f71
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -61,7 +61,7 @@ class LimeExpressionManager {
/**
* sPreviewMode used for relevance equation force to 1 in preview mode
* Maybe we can set it public
* @var string
* @var string|boolean
*/
private $sPreviewMode=false;
/**
Expand Down Expand Up @@ -3591,8 +3591,8 @@ private function _recursivelyFindAntecdentArrayFilters($qroot, $aflist, $afelist
* The long part of this function should only be called once per page display (e.g. only if $fieldMap changes)
*
* @param integer $surveyid
* @param boolean $forceRefresh
* @param boolean $anonymized
* @param boolean|null $forceRefresh
* @param boolean|null $anonymized
* @param boolean $allOnOnePage - if true (like for survey_format), uses certain optimizations
* @return boolean - true if $fieldmap had been re-created, so ExpressionManager variables need to be re-set
*/
Expand Down Expand Up @@ -5160,7 +5160,7 @@ static function NavigateForwards($force=false) {
'invalidSQs'=>$result['invalidSQs'],
);
return $LEM->lastMoveResult;
break;
// NB: No break needed
case 'group':
// First validate the current group
$LEM->StartProcessingPage();
Expand Down Expand Up @@ -5339,7 +5339,7 @@ static function NavigateForwards($force=false) {

/**
* Write values to database.
* @param array $updatedValues
* @param array|null $updatedValues
* @param boolean $finished - true if the survey needs to be finalized
* @return string
*/
Expand Down Expand Up @@ -8853,7 +8853,7 @@ private function _GetVarAttribute($name,$attr,$default,$gseq,$qseq)
{
case 'varName':
return $name;
break;
// NB: No break needed
case 'code':
case 'NAOK':
if (isset($var['code'])) {
Expand Down Expand Up @@ -8896,7 +8896,6 @@ private function _GetVarAttribute($name,$attr,$default,$gseq,$qseq)
// NB: No break needed
case 'value':
case 'valueNAOK':
{
$type = $var['type'];
$code = $this->_GetVarAttribute($name,'code',$default,$gseq,$qseq);
switch($type)
Expand Down Expand Up @@ -8943,8 +8942,7 @@ private function _GetVarAttribute($name,$attr,$default,$gseq,$qseq)
break;
}
return $value;
}
break;
// NB: No break needed
case 'jsName':
if ($this->surveyMode=='survey'
|| ($this->surveyMode=='group' && $gseq != -1 && isset($var['gseq']) && $gseq == $var['gseq'])
Expand Down Expand Up @@ -9088,6 +9086,7 @@ private function _GetVarAttribute($name,$attr,$default,$gseq,$qseq)
}
return $shown;
}
// NB: No break needed
case 'relevanceStatus':
$gseq = (isset($var['gseq'])) ? $var['gseq'] : -1;
$qid = (isset($var['qid'])) ? $var['qid'] : -1;
Expand All @@ -9102,15 +9101,17 @@ private function _GetVarAttribute($name,$attr,$default,$gseq,$qseq)
$qrel = (isset($_SESSION[$this->sessid]['relevanceStatus'][$qid]) ? $_SESSION[$this->sessid]['relevanceStatus'][$qid] : 0);
$sqrel = (isset($_SESSION[$this->sessid]['relevanceStatus'][$rowdivid]) ? $_SESSION[$this->sessid]['relevanceStatus'][$rowdivid] : 1); // true by default - only want false if a subquestion is irrelevant
return ($grel && $qrel && $sqrel);
// NB: No break needed
case 'onlynum':
if (isset($args[1]) && ($args[1]=='value' || $args[1]=='valueNAOK')) {
return 1;
}
return (isset($var[$attr])) ? $var[$attr] : $default;
break;
// NB: No break needed
default:
print 'UNDEFINED ATTRIBUTE: ' . $attr . "<br />\n";
return $default;
// NB: No break needed
}
return $default; // and throw and error?
}
Expand Down

0 comments on commit 1688f71

Please sign in to comment.