]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove unused variables
authorMorris Jobke <hey@morrisjobke.de>
Sat, 18 Apr 2015 14:17:15 +0000 (16:17 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Sat, 18 Apr 2015 14:35:19 +0000 (16:35 +0200)
* should make scrutinizer a lot more happy
* reduces maybe memory footprint

12 files changed:
lib/private/appframework/http/request.php
lib/private/helper.php
lib/private/l10n.php
lib/private/ocs/cloud.php
lib/private/ocs/config.php
lib/private/ocs/person.php
lib/private/setup/mssql.php
lib/private/share/hooks.php
lib/private/subadmin.php
lib/private/tags.php
lib/public/files.php
lib/repair/repairlegacystorages.php

index 002c1151adcf91bf5daa3b874433b9a52cea7c1b..eb2a118a0f64c17f2bc86a79343b1a7bb87c7bf1 100644 (file)
@@ -238,7 +238,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
                        case 'params':
                        case 'urlParams':
                                if(in_array($name, array('put', 'patch'))) {
-                                       return $this->getContent($name);
+                                       return $this->getContent();
                                } else {
                                        return isset($this->items[$name])
                                                ? $this->items[$name]
@@ -252,7 +252,6 @@ class Request implements \ArrayAccess, \Countable, IRequest {
                                return isset($this[$name])
                                        ? $this[$name]
                                        : null;
-                               break;
                }
        }
 
index 11311d7c55f0411d74f92ab9293802bca61a74ef..35c5147e2faac375d9470ac89fa08dac183125ce 100644 (file)
@@ -978,7 +978,6 @@ class OC_Helper {
                        $quota = OC_Util::getUserQuota(\OCP\User::getUser());
                        if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
                                // always get free space / total space from root + mount points
-                               $path = '';
                                return self::getGlobalStorageInfo();
                        }
                }
index 59f26423afa7a70f92cfb91f8ea27f6ac9f7caa9..b070a299a167811b6d0dfe594efcf22377de201d 100644 (file)
@@ -391,13 +391,10 @@ class OC_L10N implements \OCP\IL10N {
                switch($type) {
                        case 'date':
                                return Punic\Calendar::formatDate($value, $width, $locale);
-                               break;
                        case 'datetime':
                                return Punic\Calendar::formatDatetime($value, $width, $locale);
-                               break;
                        case 'time':
                                return Punic\Calendar::formatTime($value, $width, $locale);
-                               break;
                        default:
                                return false;
                }
index 8d3ed1f1cb4ac0412f1a3eda4cca66a12de149c5..f662bde28587f551cd2e200b3adc00196043563b 100644 (file)
@@ -25,7 +25,7 @@
 
 class OC_OCS_Cloud {
 
-       public static function getCapabilities($parameters) {
+       public static function getCapabilities() {
                $result = array();
                list($major, $minor, $micro) = OC_Util::getVersion();
                $result['version'] = array(
index 295da5b01d33b5d507354cfa25502cc587ad0531..fc9640b6cc43fd9fcbafb0805a3431bcc3ae2603 100644 (file)
@@ -23,7 +23,7 @@
 
 class OC_OCS_Config {
 
-       public static function apiConfig($parameters) {
+       public static function apiConfig() {
                $xml['version'] = '1.7';
                $xml['website'] = 'ownCloud';
                $xml['host'] = OCP\Util::getServerHost();
index 0e0d75305d1f23c4869f416d1c5c43f6c0d605cd..0059982c55e3e0f175db9e2cdfc4bb72a9b3723d 100644 (file)
@@ -23,7 +23,7 @@
 
 class OC_OCS_Person {
 
-       public static function check($parameters) {
+       public static function check() {
                $login = isset($_POST['login']) ? $_POST['login'] : false;
                $password = isset($_POST['password']) ? $_POST['password'] : false;
                if($login && $password) {
index 8a4904b92438f52a925e47e669a1c0eb7cb39d82..f8815259af4b92be67986a517bb47abbb9c4b9c4 100644 (file)
@@ -32,11 +32,9 @@ class MSSQL extends AbstractDatabase {
 
                $masterConnection = @sqlsrv_connect($this->dbhost, $masterConnectionInfo);
                if(!$masterConnection) {
-                       $entry = null;
+                       $entry = '';
                        if( ($errors = sqlsrv_errors() ) != null) {
                                $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)),
                                        $this->trans->t('You need to enter either an existing account or the administrator.'));
index 968a2d5c19bfca4aaf417c21bf8b05ce3f0d0e10..6eff4cc246f3ff1cfe3cf8d9894d4c8456bc99cb 100644 (file)
@@ -32,7 +32,7 @@ class Hooks extends \OC\Share\Constants {
                // Delete any items shared with the deleted user
                $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share`'
                        .' 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
                $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*share` WHERE `uid_owner` = ?');
                $result = $query->execute(array($arguments['uid']));
index 10ef87bac18e8e7d4bf7410ec8f83fd5b3b15eb5..ec4f9f3b8991cfc980206decbd3a60b314525180 100644 (file)
@@ -43,7 +43,7 @@ class OC_SubAdmin{
         */
        public static function createSubAdmin($uid, $gid) {
                $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 ));
                return true;
        }
@@ -56,7 +56,7 @@ class OC_SubAdmin{
         */
        public static function deleteSubAdmin($uid, $gid) {
                $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 ));
                return true;
        }
@@ -177,7 +177,7 @@ class OC_SubAdmin{
         */
        public static function post_deleteUser($parameters) {
                $stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `uid` = ?');
-               $result = $stmt->execute(array($parameters['uid']));
+               $stmt->execute(array($parameters['uid']));
                return true;
        }
 
@@ -188,7 +188,7 @@ class OC_SubAdmin{
         */
        public static function post_deleteGroup($parameters) {
                $stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `gid` = ?');
-               $result = $stmt->execute(array($parameters['gid']));
+               $stmt->execute(array($parameters['gid']));
                return true;
        }
 }
index 975b6dbfe0d25f6c1ae965e33e2bc7d38a92521e..dc5740603ca0eb2f1ec2f092c55f972170d1edd8 100644 (file)
@@ -228,9 +228,9 @@ class Tags implements \OCP\ITags {
                                while ($row = $result->fetch()) {
                                        $objId = (int)$row['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)) {
                                        \OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage($result), \OCP\Util::ERROR);
index 57747a4c354d4808a381f0cbc882f3d20c7dce74..5de7f242976f2f244ccdf1db17ddc7f2b88cb935 100644 (file)
@@ -81,7 +81,7 @@ class Files {
         * @since 5.0.0
         */
        public static function streamCopy( $source, $target ) {
-               list($count, $result) = \OC_Helper::streamCopy( $source, $target );
+               list($count, ) = \OC_Helper::streamCopy( $source, $target );
                return $count;
        }
 
index 7086f2a8d2d6a7ae4f69206a4b54047bbdf4a807..1bc49678f0db6ab9612e2f14f36ecbb8ae7b0a37 100644 (file)
@@ -102,7 +102,7 @@ class RepairLegacyStorages extends BasicEmitter {
                        $newNumericId = (int)$newNumericId;
                        // try and resolve the conflict
                        // 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();
                        $row2 = $this->findStorageInCacheStatement->fetch();
                        $this->findStorageInCacheStatement->closeCursor();