Skip to content

Commit

Permalink
Scrutinizer Auto-Fixes
Browse files Browse the repository at this point in the history
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
  • Loading branch information
scrutinizer-auto-fixer committed Oct 20, 2017
1 parent 2f255bb commit 5f33529
Show file tree
Hide file tree
Showing 37 changed files with 113 additions and 52 deletions.
2 changes: 1 addition & 1 deletion application/commands/InstallCommand.php
Expand Up @@ -136,7 +136,7 @@ function _executeSQLFile($sFileName)
/**
* @param string $sProperty
* @param string $connectionString
* @return null
* @return string|null
*/
function getDBConnectionStringProperty($sProperty, $connectionString = null)
{
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/SurveyController.php
Expand Up @@ -97,7 +97,7 @@ public function actions()
/**
* Show a message and exit
* @param string $sType : type of message
* @param string[] $aMessage : array of message line to be shown
* @param string[] $aMessages : array of message line to be shown
* @param string[]|null : $aUrl : if url can/must be set
* @param string[]|null $aErrors : array of errors to be shown
* @return void
Expand Down
3 changes: 1 addition & 2 deletions application/controllers/admin/SurveymenuController.php
Expand Up @@ -4,7 +4,7 @@ class SurveymenuController extends Survey_Common_Action
{

/**
* @return array action filters
* @return string[] action filters
*/
public function filters()
{
Expand Down Expand Up @@ -203,7 +203,6 @@ public function massDelete()
/**
* Deletes a particular model.
* If deletion is successful, the browser will be redirected to the 'admin' page.
* @param integer $id the ID of the model to be deleted
*/
public function delete()
{
Expand Down
3 changes: 1 addition & 2 deletions application/controllers/admin/SurveymenuEntryController.php
Expand Up @@ -3,7 +3,7 @@
class SurveymenuEntryController extends Survey_Common_Action
{
/**
* @return array action filters
* @return string[] action filters
*/
public function filters()
{
Expand Down Expand Up @@ -270,7 +270,6 @@ public function massDelete()
/**
* Deletes a particular model.
* If deletion is successful, the browser will be redirected to the 'admin' page.
* @param integer $id the ID of the model to be deleted
*/
public function delete()
{
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/database.php
Expand Up @@ -135,7 +135,7 @@ public function index($sa = null)
* This is a convenience function to update/delete answer default values. If the given
* $defaultvalue is empty then the entry is removed from table defaultvalues
*
* @param mixed $qid Question ID
* @param integer $qid Question ID
* @param integer $scale_id Scale ID
* @param string $specialtype Special type (i.e. for 'Other')
* @param mixed $language Language (defaults are language specific)
Expand Down
1 change: 1 addition & 0 deletions application/controllers/admin/limereplacementfields.php
Expand Up @@ -56,6 +56,7 @@ public function index()
/**
* @param integer $gid
* @param integer $qid
* @param string $surveyformat
* @return array
*/
private function _getQuestionList($action, $gid, $qid, array $fieldmap, $questionType, $surveyformat)
Expand Down
1 change: 1 addition & 0 deletions application/controllers/admin/printablesurvey.php
Expand Up @@ -1612,6 +1612,7 @@ function index($surveyid, $lang = null)
*
* How:
* @param string $template
* @param TemplateConfiguration $oTemplate
*/
private function _populate_template( $oTemplate, $template , $input , $line = '')
{
Expand Down
5 changes: 4 additions & 1 deletion application/controllers/admin/templateoptions.php
Expand Up @@ -19,6 +19,9 @@
class templateoptions extends Survey_Common_Action
{

/**
* @param string $controller
*/
public function __construct($controller=null, $id=null)
{
parent::__construct($controller, $id);
Expand Down Expand Up @@ -93,7 +96,7 @@ public function update($id)
/**
* Updates a particular model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id the ID of the model to be updated
* @param integer $sid the ID of the model to be updated
*/
public function updatesurvey($sid)
{
Expand Down
2 changes: 1 addition & 1 deletion application/core/LSYii_Application.php
Expand Up @@ -193,7 +193,7 @@ public function loadConfig($file)
* @access public
* @param string $name
* @param boolean|mixed $default Value to return when not found, default is false
* @return mixed
* @return string
*/
public function getConfig($name, $default = false)
{
Expand Down
1 change: 1 addition & 0 deletions application/core/LSYii_ClientScript.php
Expand Up @@ -152,6 +152,7 @@ public function registerPackage($name)
/**
* Return a list of all the recursive dependencies of a packages
* eg: If a package A depends on B, and B depends on C, getRecursiveDependencies('A') will return {B,C}
* @param string $sPackageName
*/
public function getRecursiveDependencies($sPackageName)
{
Expand Down
2 changes: 1 addition & 1 deletion application/core/LSYii_Validators.php
Expand Up @@ -80,7 +80,7 @@ protected function validateAttribute($object,$attribute)
* Did we need to do if user don't use inline HTML editor ?
*
* @param string $value
* @return mixed|string
* @return string
*/
public function fixCKeditor($value)
{
Expand Down
12 changes: 12 additions & 0 deletions application/core/LS_Twig_Extension.php
Expand Up @@ -208,6 +208,9 @@ public static function renderCaptcha()
));
}

/**
* @param string $sRessource
*/
public static function assetPublish($sRessource)
{
return App()->getAssetManager()->publish($sRessource);
Expand All @@ -233,6 +236,9 @@ public static function image($sImagePath, $alt='', $htmlOptions=array ( ) )
return CHtml::image($sUrlImgAsset, $alt, $htmlOptions);
}

/**
* @param string $sRessource
*/
public static function getTemplateForRessource($sRessource)
{
$oRTemplate = Template::model()->getInstance();
Expand Down Expand Up @@ -265,11 +271,17 @@ public static function getQuery($sName, $sDefaultValue=null)
return Yii::app()->request->getQuery($sName, $sDefaultValue);
}

/**
* @param string $name
*/
public static function unregisterPackage($name)
{
return Yii::app()->getClientScript()->unregisterPackage($name);
}

/**
* @param string $name
*/
public static function unregisterScriptFile($name)
{
return Yii::app()->getClientScript()->unregisterScriptFile($name);
Expand Down
2 changes: 1 addition & 1 deletion application/core/plugins/AuthLDAP/AuthLDAP.php
Expand Up @@ -161,7 +161,7 @@ public function createNewUser()
* Create a LDAP user
*
* @param string $new_user
* @return null|string New user ID
* @return null|integer New user ID
*/
private function _createNewUser($new_user)
{
Expand Down
1 change: 1 addition & 0 deletions application/helpers/admin/ajax_helper.php
Expand Up @@ -82,6 +82,7 @@ public static function outputNotLoggedIn()
}

/**
* @param string $target
* @return void
*/
public static function outputHtml($html, $target)
Expand Down
19 changes: 13 additions & 6 deletions application/helpers/common_helper.php
Expand Up @@ -41,7 +41,7 @@ function eT($sToTranslate, $sEscapeMode = 'html', $sLanguage = NULL)
* @param string $sTextToTranslate
* @param integer $iCount
* @param string $sEscapeMode
* @return mixed|string
* @return string
*/
function ngT($sTextToTranslate, $iCount, $sEscapeMode = 'html')
{
Expand Down Expand Up @@ -1106,6 +1106,11 @@ function groupOrderThenQuestionOrder($a, $b)


//FIXME insert UestionGroup model to here
/**
* @param integer $sid
* @param integer $gid
* @param integer $shiftvalue
*/
function shiftOrderQuestions($sid,$gid,$shiftvalue) //Function shifts the sortorder for questions
{
$sid=sanitize_int($sid);
Expand All @@ -1125,6 +1130,8 @@ function fixSortOrderGroups($surveyid) //Function rewrites the sortorder for gro

/**
* @param integer $iSurveyID
* @param integer $qid
* @param integer $newgid
*/
function fixMovedQuestionConditions($qid,$oldgid,$newgid, $iSurveyID=NULL) //Function rewrites the cfieldname for a question after group change
{
Expand Down Expand Up @@ -2879,7 +2886,7 @@ function incompleteAnsFilterState()
* isCaptchaEnabled($screen, $usecaptchamode)
* @param string $screen - the screen name for which to test captcha activation
*
* @return boolean - returns true if captcha must be enabled
* @return boolean|null - returns true if captcha must be enabled
**/
function isCaptchaEnabled($screen, $captchamode='')
{
Expand Down Expand Up @@ -3097,7 +3104,7 @@ function reverseTranslateFieldNames($iOldSID,$iNewSID,$aGIDReplacements,$aQIDRep
/**
* put your comment there...
*
* @param mixed $id
* @param integer $id
* @param string $type
* @return bool
*/
Expand Down Expand Up @@ -4284,7 +4291,7 @@ function switchMSSQLIdentityInsert($table,$state)
* Retrieves the last Insert ID realiable for cross-DB applications
*
* @param string $sTableName Needed for Postgres and MSSQL
* @return mixed|string
* @return string
*/
function getLastInsertID($sTableName)
{
Expand Down Expand Up @@ -5137,7 +5144,7 @@ function aEncodingsArray()
*
* @param string $sString string to ellipsize
* @param integer $iMaxLength max length of string
* @param mixed $fPosition int (1|0) or float, .5, .2, etc for position to split
* @param integer $fPosition int (1|0) or float, .5, .2, etc for position to split
* @param string $sEllipsis ellipsis ; Default '...'
* @return string ellipsized string
*/
Expand Down Expand Up @@ -5342,7 +5349,7 @@ function decodeTokenAttributes($oTokenAttributeData){

/**
* @param string $sSerial
* @return mixed|null|string
* @return string|null
*/
function getSerialClass($sSerial) {
$aTypes = array('s' => 'string', 'a' => 'array', 'b' => 'bool', 'i' => 'int', 'd' => 'float', 'N;' => 'NULL');
Expand Down
3 changes: 3 additions & 0 deletions application/helpers/database_helper.php
Expand Up @@ -48,6 +48,9 @@ function dbExecuteAssoc($sql,$inputarr=false,$silent=true)
}


/**
* @param string $sql
*/
function dbQueryOrFalse($sql)
{
try {
Expand Down
6 changes: 3 additions & 3 deletions application/helpers/expressions/em_core_helper.php
Expand Up @@ -273,9 +273,9 @@ public function RDP_GetErrors()

/**
* Get informatin about type mismatch between arguments.
* @param array $arg1
* @param array $arg2
* @return array Like (boolean $bMismatchType, boolean $bBothNumeric, boolean $bBothString)
* @param Token $arg1
* @param Token $arg2
* @return boolean[] Like (boolean $bMismatchType, boolean $bBothNumeric, boolean $bBothString)
*/
private function getMismatchInformation(array $arg1, array $arg2)
{
Expand Down
4 changes: 4 additions & 0 deletions application/helpers/frontend_helper.php
Expand Up @@ -1430,6 +1430,7 @@ function resetAllSessionVariables($surveyid)
* Set totalsteps in session
* @param int $surveyid
* @param array $thissurvey
* @param integer $totalquestions
* @return void
*/
function setTotalSteps($surveyid, array $thissurvey, $totalquestions)
Expand Down Expand Up @@ -1477,6 +1478,9 @@ function breakOutAndCrash($sTemplateViewPath, $totalquestions, $iTotalGroupsWith
renderError($sTitle, $sMessage, $thissurvey, $sTemplateViewPath);
}

/**
* @param string $sTemplateViewPath
*/
function renderError($sTitle='', $sMessage, $thissurvey, $sTemplateViewPath )
{
// Template settings
Expand Down
3 changes: 3 additions & 0 deletions application/helpers/qanda_helper.php
Expand Up @@ -478,6 +478,9 @@ function validation_popup($ia, $notvalidated=null)
}

// TMSW Validation -> EM
/**
* @param boolean $filenotvalidated
*/
function file_validation_popup($ia, $filenotvalidated = null)
{

Expand Down
2 changes: 1 addition & 1 deletion application/helpers/replacements_helper.php
Expand Up @@ -21,7 +21,7 @@
* @param string $line Text to search in
* @param string[] $replacements Array of replacements: Array( <stringtosearch>=><stringtoreplacewith>
* @param mixed[] $redata : array of global var used in the function
* @param void $debugSrc deprecated
* @param string|null $debugSrc deprecated
* @param boolean $anonymized Determines if token data is being used or just replaced with blanks
* @param integer|null $questionNum - needed to support dynamic JavaScript-based tailoring within questions
* @param void $registerdata - deprecated
Expand Down
5 changes: 3 additions & 2 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -1347,6 +1347,7 @@ function upgradeTokenTables181($sMySQLCollation)

/**
* @param string $sFieldType
* @param string $sColumn
*/
function alterColumn($sTable, $sColumn, $sFieldType, $bAllowNull=true, $sDefault='NULL')
{
Expand Down Expand Up @@ -1480,7 +1481,7 @@ function dropUniqueKeyMSSQL($sFieldName, $sTableName)
/**
* This function drops a secondary key of an MSSQL database field by using the field name and the table name
*
* @param mixed $sFieldName
* @param string $sFieldName
* @param mixed $sTableName
*/
function dropSecondaryKeyMSSQL($sFieldName, $sTableName)
Expand Down Expand Up @@ -1510,7 +1511,7 @@ function dropSecondaryKeyMSSQL($sFieldName, $sTableName)
/**
* Drops the primary key of a table
*
* @param mixed $sTablename
* @param string $sTablename
*/
function dropPrimaryKey($sTablename)
{
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/viewHelper.php
Expand Up @@ -213,7 +213,7 @@ public static function putSeparator($sString,$separator){
* @param boolean $bFlat : flattenText or not : completely flat (not like flattenText from common_helper)
* @param integer $iAbbreviated : max string text (if true : allways flat), 0 or false : don't abbreviated
* @param string $sEllipsis if abbreviated : the char to put at end (or middle)
* @param mixed $fPosition if abbreviated position to split (in % : 0 to 1)
* @param integer $fPosition if abbreviated position to split (in % : 0 to 1)
*
* @return string
*/
Expand Down
1 change: 0 additions & 1 deletion application/libraries/PluginManager/PluginManager.php
Expand Up @@ -151,7 +151,6 @@ public function subscribe(iPlugin $plugin, $event, $function = null)
* Unsubscribes a plugin from an event.
* @param iPlugin $plugin Reference to the plugin being unsubscribed.
* @param string $event Name of the event. Use '*', to unsubscribe all events for the plugin.
* @param string $function Optional function of the plugin that was registered.
*/
public function unsubscribe(iPlugin $plugin, $event)
{
Expand Down
2 changes: 1 addition & 1 deletion application/libraries/admin/pdf.php
Expand Up @@ -719,7 +719,7 @@ function addHeader($aPdfLanguageSettings, $sSiteName, $sDefaultHeaderString)
*
* Add GID text to PDF
* @param $sGroupName - Group name
* @param $sGroupDescription - Group description
* @param string $sGroupDescription - Group description
* @param $bAllowBreakPage - Allow break cell in two pages
* @return unknown_type
*/
Expand Down
2 changes: 1 addition & 1 deletion application/models/AdminTheme.php
Expand Up @@ -276,7 +276,7 @@ public static function touchSubDirectories( $sPath )
}

/**
* @return array
* @return string[]
*/
public static function getOtherAssets()
{
Expand Down
5 changes: 3 additions & 2 deletions application/models/Participant.php
Expand Up @@ -720,6 +720,7 @@ public function getParticipantsSharedCount($userid)
* @param order
* @param search
* @param userid
* @param string $order
* @return array
*/
public function getParticipants($page, $limit,$attid, $order = null, $search = null, $userid = null)
Expand Down Expand Up @@ -2016,9 +2017,9 @@ public function copyToCentral($surveyid, $aAttributesToBeCreated, $aMapped, $ove

/**
* The purpose of this function is to check for duplicate in participants
* @param array $fields
* @param string $fields
* @param string $output
* @return mixed
* @return string
*/
public function checkforDuplicate($fields, $output="bool")
{
Expand Down

0 comments on commit 5f33529

Please sign in to comment.