Fix Scrutinizer issues in mod [_well_know -> contactgroup]

- Remove unused variables and parameter
- Updated function documentation
- Fix formatting
- Add back uninitialized variables
- Simplify nested conditions
This commit is contained in:
Hypolite Petovan
2018-01-04 19:42:48 -05:00
parent 5640c42469
commit 819592c3bd
18 changed files with 359 additions and 368 deletions
+1
View File
@@ -60,6 +60,7 @@ class App {
public $timezone;
public $interactive = true;
public $plugins;
public $plugins_admin = array();
public $apps = array();
public $identities;
public $is_mobile = false;
+1 -1
View File
@@ -130,7 +130,7 @@ class Config
*
* @param string $family The category of the configuration value
* @param string $key The configuration key to set
* @param string $value The value to store
* @param mixed $value The value to store
*
* @return mixed Stored $value or false if the database update failed
*/
+11 -2
View File
@@ -186,13 +186,22 @@ class DBStructure {
return t('Errors encountered performing database changes: ').$message.EOL;
}
public static function update($verbose, $action, $tables = null, $definition = null) {
/**
* Updates DB structure and returns eventual errors messages
*
* @param bool $verbose
* @param bool $action Whether to actually apply the update
* @param array $tables An array of the database tables
* @param array $definition An array of the definition tables
* @return string Empty string if the update is successful, error messages otherwise
*/
public static function update($verbose, $action, array $tables = null, array $definition = null) {
if ($action) {
Config::set('system', 'maintenance', 1);
Config::set('system', 'maintenance_reason', sprintf(t(': Database update'), DBM::date().' '.date('e')));
}
$errors = false;
$errors = '';
logger('updating structure', LOGGER_DEBUG);
+9 -9
View File
@@ -327,8 +327,8 @@ class GContact
}
/**
* @param object $uid user
* @param object $cid cid
* @param integer $uid user
* @param integer $cid cid
* @param integer $start optional, default 0
* @param integer $limit optional, default 9999
* @param boolean $shuffle optional, default false
@@ -365,8 +365,8 @@ class GContact
}
/**
* @param object $uid user
* @param object $zcid zcid
* @param integer $uid user
* @param integer $zcid zcid
* @param integer $start optional, default 0
* @param integer $limit optional, default 9999
* @param boolean $shuffle optional, default false
@@ -397,8 +397,8 @@ class GContact
}
/**
* @param object $uid user
* @param object $cid cid
* @param integer $uid user
* @param integer $cid cid
* @return integer
*/
public static function countAllFriends($uid, $cid)
@@ -420,11 +420,11 @@ class GContact
}
/**
* @param object $uid user
* @param object $cid cid
* @param integer $uid user
* @param integer $cid cid
* @param integer $start optional, default 0
* @param integer $limit optional, default 80
* @return object
* @return array
*/
public static function allFriends($uid, $cid, $start = 0, $limit = 80)
{