Remove unused variables

* should make scrutinizer a lot more happy
* reduces maybe memory footprint
This commit is contained in:
Morris Jobke 2015-04-18 16:17:15 +02:00
parent 8cb0d97b10
commit ccf47f40aa
12 changed files with 14 additions and 21 deletions

View File

@ -238,7 +238,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
case 'params': case 'params':
case 'urlParams': case 'urlParams':
if(in_array($name, array('put', 'patch'))) { if(in_array($name, array('put', 'patch'))) {
return $this->getContent($name); return $this->getContent();
} else { } else {
return isset($this->items[$name]) return isset($this->items[$name])
? $this->items[$name] ? $this->items[$name]
@ -252,7 +252,6 @@ class Request implements \ArrayAccess, \Countable, IRequest {
return isset($this[$name]) return isset($this[$name])
? $this[$name] ? $this[$name]
: null; : null;
break;
} }
} }

View File

@ -978,7 +978,6 @@ class OC_Helper {
$quota = OC_Util::getUserQuota(\OCP\User::getUser()); $quota = OC_Util::getUserQuota(\OCP\User::getUser());
if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) { if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
// always get free space / total space from root + mount points // always get free space / total space from root + mount points
$path = '';
return self::getGlobalStorageInfo(); return self::getGlobalStorageInfo();
} }
} }

View File

@ -391,13 +391,10 @@ class OC_L10N implements \OCP\IL10N {
switch($type) { switch($type) {
case 'date': case 'date':
return Punic\Calendar::formatDate($value, $width, $locale); return Punic\Calendar::formatDate($value, $width, $locale);
break;
case 'datetime': case 'datetime':
return Punic\Calendar::formatDatetime($value, $width, $locale); return Punic\Calendar::formatDatetime($value, $width, $locale);
break;
case 'time': case 'time':
return Punic\Calendar::formatTime($value, $width, $locale); return Punic\Calendar::formatTime($value, $width, $locale);
break;
default: default:
return false; return false;
} }

View File

@ -25,7 +25,7 @@
class OC_OCS_Cloud { class OC_OCS_Cloud {
public static function getCapabilities($parameters) { public static function getCapabilities() {
$result = array(); $result = array();
list($major, $minor, $micro) = OC_Util::getVersion(); list($major, $minor, $micro) = OC_Util::getVersion();
$result['version'] = array( $result['version'] = array(

View File

@ -23,7 +23,7 @@
class OC_OCS_Config { class OC_OCS_Config {
public static function apiConfig($parameters) { public static function apiConfig() {
$xml['version'] = '1.7'; $xml['version'] = '1.7';
$xml['website'] = 'ownCloud'; $xml['website'] = 'ownCloud';
$xml['host'] = OCP\Util::getServerHost(); $xml['host'] = OCP\Util::getServerHost();

View File

@ -23,7 +23,7 @@
class OC_OCS_Person { class OC_OCS_Person {
public static function check($parameters) { public static function check() {
$login = isset($_POST['login']) ? $_POST['login'] : false; $login = isset($_POST['login']) ? $_POST['login'] : false;
$password = isset($_POST['password']) ? $_POST['password'] : false; $password = isset($_POST['password']) ? $_POST['password'] : false;
if($login && $password) { if($login && $password) {

View File

@ -32,11 +32,9 @@ class MSSQL extends AbstractDatabase {
$masterConnection = @sqlsrv_connect($this->dbhost, $masterConnectionInfo); $masterConnection = @sqlsrv_connect($this->dbhost, $masterConnectionInfo);
if(!$masterConnection) { if(!$masterConnection) {
$entry = null; $entry = '';
if( ($errors = sqlsrv_errors() ) != null) { if( ($errors = sqlsrv_errors() ) != null) {
$entry='DB Error: "'.print_r(sqlsrv_errors()).'"<br />'; $entry='DB Error: "'.print_r(sqlsrv_errors()).'"<br />';
} else {
$entry = '';
} }
throw new \OC\DatabaseSetupException($this->trans->t('MS SQL username and/or password not valid: %s', array($entry)), throw new \OC\DatabaseSetupException($this->trans->t('MS SQL username and/or password not valid: %s', array($entry)),
$this->trans->t('You need to enter either an existing account or the administrator.')); $this->trans->t('You need to enter either an existing account or the administrator.'));

View File

@ -32,7 +32,7 @@ class Hooks extends \OC\Share\Constants {
// Delete any items shared with the deleted user // Delete any items shared with the deleted user
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*share`' $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share`'
.' WHERE `share_with` = ? AND `share_type` = ? OR `share_type` = ?'); .' WHERE `share_with` = ? AND `share_type` = ? OR `share_type` = ?');
$result = $query->execute(array($arguments['uid'], self::SHARE_TYPE_USER, self::$shareTypeGroupUserUnique)); $query->execute(array($arguments['uid'], self::SHARE_TYPE_USER, self::$shareTypeGroupUserUnique));
// Delete any items the deleted user shared // Delete any items the deleted user shared
$query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*share` WHERE `uid_owner` = ?'); $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*share` WHERE `uid_owner` = ?');
$result = $query->execute(array($arguments['uid'])); $result = $query->execute(array($arguments['uid']));

View File

@ -43,7 +43,7 @@ class OC_SubAdmin{
*/ */
public static function createSubAdmin($uid, $gid) { public static function createSubAdmin($uid, $gid) {
$stmt = OC_DB::prepare('INSERT INTO `*PREFIX*group_admin` (`gid`,`uid`) VALUES(?,?)'); $stmt = OC_DB::prepare('INSERT INTO `*PREFIX*group_admin` (`gid`,`uid`) VALUES(?,?)');
$result = $stmt->execute(array($gid, $uid)); $stmt->execute(array($gid, $uid));
OC_Hook::emit( "OC_SubAdmin", "post_createSubAdmin", array( "gid" => $gid )); OC_Hook::emit( "OC_SubAdmin", "post_createSubAdmin", array( "gid" => $gid ));
return true; return true;
} }
@ -56,7 +56,7 @@ class OC_SubAdmin{
*/ */
public static function deleteSubAdmin($uid, $gid) { public static function deleteSubAdmin($uid, $gid) {
$stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `gid` = ? AND `uid` = ?'); $stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `gid` = ? AND `uid` = ?');
$result = $stmt->execute(array($gid, $uid)); $stmt->execute(array($gid, $uid));
OC_Hook::emit( "OC_SubAdmin", "post_deleteSubAdmin", array( "gid" => $gid )); OC_Hook::emit( "OC_SubAdmin", "post_deleteSubAdmin", array( "gid" => $gid ));
return true; return true;
} }
@ -177,7 +177,7 @@ class OC_SubAdmin{
*/ */
public static function post_deleteUser($parameters) { public static function post_deleteUser($parameters) {
$stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `uid` = ?'); $stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `uid` = ?');
$result = $stmt->execute(array($parameters['uid'])); $stmt->execute(array($parameters['uid']));
return true; return true;
} }
@ -188,7 +188,7 @@ class OC_SubAdmin{
*/ */
public static function post_deleteGroup($parameters) { public static function post_deleteGroup($parameters) {
$stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `gid` = ?'); $stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `gid` = ?');
$result = $stmt->execute(array($parameters['gid'])); $stmt->execute(array($parameters['gid']));
return true; return true;
} }
} }

View File

@ -228,9 +228,9 @@ class Tags implements \OCP\ITags {
while ($row = $result->fetch()) { while ($row = $result->fetch()) {
$objId = (int)$row['objid']; $objId = (int)$row['objid'];
if (!isset($entries[$objId])) { if (!isset($entries[$objId])) {
$entry = $entries[$objId] = array(); $entries[$objId] = array();
} }
$entry = $entries[$objId][] = $row['category']; $entries[$objId][] = $row['category'];
} }
if (\OCP\DB::isError($result)) { if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage($result), \OCP\Util::ERROR); \OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage($result), \OCP\Util::ERROR);

View File

@ -81,7 +81,7 @@ class Files {
* @since 5.0.0 * @since 5.0.0
*/ */
public static function streamCopy( $source, $target ) { public static function streamCopy( $source, $target ) {
list($count, $result) = \OC_Helper::streamCopy( $source, $target ); list($count, ) = \OC_Helper::streamCopy( $source, $target );
return $count; return $count;
} }

View File

@ -102,7 +102,7 @@ class RepairLegacyStorages extends BasicEmitter {
$newNumericId = (int)$newNumericId; $newNumericId = (int)$newNumericId;
// try and resolve the conflict // try and resolve the conflict
// check which one of "local::" or "home::" needs to be kept // check which one of "local::" or "home::" needs to be kept
$result = $this->findStorageInCacheStatement->execute(array($oldNumericId, $newNumericId)); $this->findStorageInCacheStatement->execute(array($oldNumericId, $newNumericId));
$row1 = $this->findStorageInCacheStatement->fetch(); $row1 = $this->findStorageInCacheStatement->fetch();
$row2 = $this->findStorageInCacheStatement->fetch(); $row2 = $this->findStorageInCacheStatement->fetch();
$this->findStorageInCacheStatement->closeCursor(); $this->findStorageInCacheStatement->closeCursor();