From 5c4a804ddb4942687d5b8495d1ede51873cd412b Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sat, 9 Feb 2013 16:46:55 +0100 Subject: [PATCH] Fix SpaceBeforeOpenBrace errors --- apps/files_external/ajax/addRootCertificate.php | 2 +- apps/files_external/lib/streamwrapper.php | 2 +- apps/files_external/lib/swift.php | 2 +- apps/files_external/lib/webdav.php | 2 +- apps/files_versions/lib/versions.php | 2 +- apps/user_ldap/ajax/deleteConfiguration.php | 4 ++-- apps/user_ldap/lib/connection.php | 4 ++-- lib/api.php | 2 +- lib/app.php | 6 +++--- lib/base.php | 2 +- lib/connector/sabre/request.php | 2 +- lib/fileproxy/fileoperations.php | 2 +- lib/fileproxy/quota.php | 2 +- lib/files/cache/permissions.php | 2 +- lib/files/storage/common.php | 10 +++++----- lib/installer.php | 12 ++++++------ lib/ocs/privatedata.php | 2 +- lib/util.php | 4 ++-- settings/oauth.php | 8 ++++---- 19 files changed, 36 insertions(+), 36 deletions(-) diff --git a/apps/files_external/ajax/addRootCertificate.php b/apps/files_external/ajax/addRootCertificate.php index ba8a14d2ea1..7794238ab36 100644 --- a/apps/files_external/ajax/addRootCertificate.php +++ b/apps/files_external/ajax/addRootCertificate.php @@ -14,7 +14,7 @@ fclose($fh); $filename = $_FILES['rootcert_import']['name']; $view = new \OC\Files\View('/'.\OCP\User::getUser().'/files_external/uploads'); -if (!$view->file_exists('')){ +if (!$view->file_exists('')) { $view->mkdir(''); } diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php index 7c3ddcf8a2c..ff7e2238bd1 100644 --- a/apps/files_external/lib/streamwrapper.php +++ b/apps/files_external/lib/streamwrapper.php @@ -12,7 +12,7 @@ abstract class StreamWrapper extends \OC\Files\Storage\Common{ private $ready = false; protected function init(){ - if($this->ready){ + if($this->ready) { return; } $this->ready = true; diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index cbf2007052b..8ffa9d8552d 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -290,7 +290,7 @@ class SWIFT extends \OC\Files\Storage\Common{ } private function init(){ - if($this->ready){ + if($this->ready) { return; } $this->ready = true; diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index 2a953ac63f4..f54cdc06228 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -49,7 +49,7 @@ class DAV extends \OC\Files\Storage\Common{ } private function init(){ - if($this->ready){ + if($this->ready) { return; } $this->ready = true; diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index b54bc4a4422..b4ef88a6e87 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -94,7 +94,7 @@ class Storage { // expire old revisions if necessary $newSize = self::expire($filename, $versionsSize); - if ( $newSize != $versionsSize ) { + if ( $newSize != $versionsSize ) { \OCP\Config::setAppValue('files_versions', 'size', $versionsSize); } } diff --git a/apps/user_ldap/ajax/deleteConfiguration.php b/apps/user_ldap/ajax/deleteConfiguration.php index b7d633a049d..ade57110d34 100644 --- a/apps/user_ldap/ajax/deleteConfiguration.php +++ b/apps/user_ldap/ajax/deleteConfiguration.php @@ -27,9 +27,9 @@ OCP\JSON::checkAppEnabled('user_ldap'); OCP\JSON::callCheck(); $prefix = $_POST['ldap_serverconfig_chooser']; -if(\OCA\user_ldap\lib\Helper::deleteServerConfiguration($prefix)){ +if(\OCA\user_ldap\lib\Helper::deleteServerConfiguration($prefix)) { OCP\JSON::success(); } else { $l=OC_L10N::get('user_ldap'); OCP\JSON::error(array('message' => $l->t('Failed to delete the server configuration'))); -} \ No newline at end of file +} diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 933f2f42074..9a37920e35d 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -192,7 +192,7 @@ class Connection { private function getValue($varname) { static $defaults; - if(is_null($defaults)){ + if(is_null($defaults)) { $defaults = $this->getDefaults(); } return \OCP\Config::getAppValue($this->configID, @@ -336,7 +336,7 @@ class Connection { case 'ldapBaseGroups': case 'ldapAttributesForUserSearch': case 'ldapAttributesForGroupSearch': - if(is_array($value)){ + if(is_array($value)) { $value = implode("\n", $value); } break; diff --git a/lib/api.php b/lib/api.php index abf1c3b0036..70e3028b68a 100644 --- a/lib/api.php +++ b/lib/api.php @@ -82,7 +82,7 @@ class OC_API { // Prepare the request variables if($_SERVER['REQUEST_METHOD'] == 'PUT') { parse_str(file_get_contents("php://input"), $parameters['_put']); - } else if($_SERVER['REQUEST_METHOD'] == 'DELETE'){ + } else if($_SERVER['REQUEST_METHOD'] == 'DELETE') { parse_str(file_get_contents("php://input"), $parameters['_delete']); } $name = $parameters['_route']; diff --git a/lib/app.php b/lib/app.php index bf7eeef0181..7eab1405781 100644 --- a/lib/app.php +++ b/lib/app.php @@ -157,7 +157,7 @@ class OC_App{ */ public static function isShipped($appid){ $info = self::getAppInfo($appid); - if(isset($info['shipped']) && $info['shipped']=='true'){ + if(isset($info['shipped']) && $info['shipped']=='true') { return true; } else { return false; @@ -247,7 +247,7 @@ class OC_App{ OC_Appconfig::setValue( $app, 'enabled', 'no' ); // check if app is a shipped app or not. if not delete - if(!OC_App::isShipped( $app )){ + if(!OC_App::isShipped( $app )) { OC_Installer::removeApp( $app ); } } @@ -726,7 +726,7 @@ class OC_App{ $app1[$i]['ocs_id'] = $app['id']; $app1[$i]['internal'] = $app1[$i]['active'] = 0; $app1[$i]['update'] = false; - if($app['label']=='recommended'){ + if($app['label']=='recommended') { $app1[$i]['internallabel'] = 'Recommended'; $app1[$i]['internalclass'] = 'recommendedapp'; }else{ diff --git a/lib/base.php b/lib/base.php index c60a97100f4..fea9e3ca3a6 100644 --- a/lib/base.php +++ b/lib/base.php @@ -550,7 +550,7 @@ class OC { } $request = OC_Request::getPathInfo(); - if(substr($request, -3) !== '.js'){// we need these files during the upgrade + if(substr($request, -3) !== '.js') {// we need these files during the upgrade self::checkMaintenanceMode(); self::checkUpgrade(); } diff --git a/lib/connector/sabre/request.php b/lib/connector/sabre/request.php index 97a27996bf3..d70c25c4e70 100644 --- a/lib/connector/sabre/request.php +++ b/lib/connector/sabre/request.php @@ -40,7 +40,7 @@ class OC_Connector_Sabre_Request extends Sabre_HTTP_Request { * @return string */ public function getRawServerValue($field) { - if($field == 'REQUEST_URI'){ + if($field == 'REQUEST_URI') { return $this->getUri(); } else{ diff --git a/lib/fileproxy/fileoperations.php b/lib/fileproxy/fileoperations.php index 47ccd8f8c26..b2ff2e7e5e9 100644 --- a/lib/fileproxy/fileoperations.php +++ b/lib/fileproxy/fileoperations.php @@ -28,7 +28,7 @@ class OC_FileProxy_FileOperations extends OC_FileProxy{ static $rootView; public function premkdir($path) { - if(!self::$rootView){ + if(!self::$rootView) { self::$rootView = new \OC\Files\View(''); } return !self::$rootView->file_exists($path); diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php index 7e0f631c8fb..07d1d250e4d 100644 --- a/lib/fileproxy/quota.php +++ b/lib/fileproxy/quota.php @@ -95,7 +95,7 @@ class OC_FileProxy_Quota extends OC_FileProxy{ } public function preCopy($path1, $path2) { - if(!self::$rootView){ + if(!self::$rootView) { self::$rootView = new \OC\Files\View(''); } return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==-1); diff --git a/lib/files/cache/permissions.php b/lib/files/cache/permissions.php index d0968337f02..e24c05b10a3 100644 --- a/lib/files/cache/permissions.php +++ b/lib/files/cache/permissions.php @@ -18,7 +18,7 @@ class Permissions { * @param \OC\Files\Storage\Storage|string $storage */ public function __construct($storage){ - if($storage instanceof \OC\Files\Storage\Storage){ + if($storage instanceof \OC\Files\Storage\Storage) { $this->storageId = $storage->getId(); }else{ $this->storageId = $storage; diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index ce9e7ead6d1..6935ba00953 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -51,19 +51,19 @@ abstract class Common implements \OC\Files\Storage\Storage { } public function getPermissions($path){ $permissions = 0; - if($this->isCreatable($path)){ + if($this->isCreatable($path)) { $permissions |= \OCP\PERMISSION_CREATE; } - if($this->isReadable($path)){ + if($this->isReadable($path)) { $permissions |= \OCP\PERMISSION_READ; } - if($this->isUpdatable($path)){ + if($this->isUpdatable($path)) { $permissions |= \OCP\PERMISSION_UPDATE; } - if($this->isDeletable($path)){ + if($this->isDeletable($path)) { $permissions |= \OCP\PERMISSION_DELETE; } - if($this->isSharable($path)){ + if($this->isSharable($path)) { $permissions |= \OCP\PERMISSION_SHARE; } return $permissions; diff --git a/lib/installer.php b/lib/installer.php index c86f801b5fc..aa192880af0 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -270,12 +270,12 @@ class OC_Installer{ public static function isUpdateAvailable( $app ) { $ocsid=OC_Appconfig::getValue( $app, 'ocsid', ''); - if($ocsid<>''){ + if($ocsid<>'') { $ocsdata=OC_OCSClient::getApplication($ocsid); $ocsversion= (string) $ocsdata['version']; $currentversion=OC_App::getAppVersion($app); - if($ocsversion<>$currentversion){ + if($ocsversion<>$currentversion) { return($ocsversion); }else{ @@ -326,22 +326,22 @@ class OC_Installer{ */ public static function removeApp( $name, $options = array()) { - if(isset($options['keeppreferences']) and $options['keeppreferences']==false ){ + if(isset($options['keeppreferences']) and $options['keeppreferences']==false ) { // todo // remove preferences } - if(isset($options['keepappconfig']) and $options['keepappconfig']==false ){ + if(isset($options['keepappconfig']) and $options['keepappconfig']==false ) { // todo // remove app config } - if(isset($options['keeptables']) and $options['keeptables']==false ){ + if(isset($options['keeptables']) and $options['keeptables']==false ) { // todo // remove app database tables } - if(isset($options['keepfiles']) and $options['keepfiles']==false ){ + if(isset($options['keepfiles']) and $options['keepfiles']==false ) { // todo // remove user files } diff --git a/lib/ocs/privatedata.php b/lib/ocs/privatedata.php index 311b24269dd..971a5c2ad31 100644 --- a/lib/ocs/privatedata.php +++ b/lib/ocs/privatedata.php @@ -46,7 +46,7 @@ class OC_OCS_Privatedata { $app = addslashes(strip_tags($parameters['app'])); $key = addslashes(strip_tags($parameters['key'])); $value = OC_OCS::readData('post', 'value', 'text'); - if(OC_Preferences::setValue($user, $app, $key, $value)){ + if(OC_Preferences::setValue($user, $app, $key, $value)) { return new OC_OCS_Result(null, 100); } } diff --git a/lib/util.php b/lib/util.php index a4e7271adcd..59e67f2a5f1 100755 --- a/lib/util.php +++ b/lib/util.php @@ -246,8 +246,8 @@ class OC_Util { $handler = ini_get("session.save_handler"); if($handler == "files") { $tmpDir = session_save_path(); - if($tmpDir != ""){ - if(!@is_writable($tmpDir)){ + if($tmpDir != "") { + if(!@is_writable($tmpDir)) { $errors[]=array('error' => 'The temporary folder used by PHP to save the session data is either incorrect or not writable! Please check : '.session_save_path().'
', 'hint'=>'Please ask your server administrator to grant write access or define another temporary folder.'); } diff --git a/settings/oauth.php b/settings/oauth.php index 8dba9b33a53..07b7ae5c31d 100644 --- a/settings/oauth.php +++ b/settings/oauth.php @@ -15,7 +15,7 @@ switch($operation){ case 'register': // Here external apps can register with an ownCloud - if(empty($_GET['name']) || empty($_GET['url'])){ + if(empty($_GET['name']) || empty($_GET['url'])) { // Invalid request echo 401; } else { @@ -54,13 +54,13 @@ switch($operation){ foreach($consumer['scopes'] as $requiredapp){ // App scopes are in this format: app_$appname $requiredapp = end(explode('_', $requiredapp)); - if(!in_array($requiredapp, $apps)){ + if(!in_array($requiredapp, $apps)) { $notfound[] = $requiredapp; } } - if(!empty($notfound)){ + if(!empty($notfound)) { // We need more apps :( Show error - if(count($notfound)==1){ + if(count($notfound)==1) { $message = 'requires that you have an extra app installed on your ownCloud. Please contact your ownCloud administrator and ask them to install the app below.'; } else { $message = 'requires that you have some extra apps installed on your ownCloud. Please contract your ownCloud administrator and ask them to install the apps below.'; -- 2.39.5