diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php
index 4cc2c4dce9efe990f2e4e8a3a15876aa253e5c05..f01cb8d212a8eb0a7dac203a491509da912e0183 100644
--- a/apps/files/templates/part.breadcrumb.php
+++ b/apps/files/templates/part.breadcrumb.php
@@ -1,7 +1,7 @@
 <?php if(count($_["breadcrumb"])):?>
 	<div class="crumb">
 		<a href="<?php echo $_['baseURL']; ?>">
-			<img src="<?php echo OCP\image_path('core','places/home.svg');?>" class="svg" />
+			<img src="<?php echo OCP\image_path('core', 'places/home.svg');?>" class="svg" />
 		</a>
 	</div>
 <?php endif;?>
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index 08728622525e963ec6fb195b4ce05152c20a8008..c7cd8ca32de87890a1057fb576e1bb705c0a284a 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -12,7 +12,7 @@ OC_FileProxy::register( new OCA\Encryption\Proxy() );
 
 // User-related hooks
 OCP\Util::connectHook( 'OC_User', 'post_login', 'OCA\Encryption\Hooks', 'login' );
-OCP\Util::connectHook( 'OC_User', 'pre_setPassword','OCA\Encryption\Hooks', 'setPassphrase' );
+OCP\Util::connectHook( 'OC_User', 'pre_setPassword', 'OCA\Encryption\Hooks', 'setPassphrase' );
 
 // Sharing-related hooks
 OCP\Util::connectHook( 'OCP\Share', 'post_shared', 'OCA\Encryption\Hooks', 'postShared' );
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index c7a414c5080926a9b17ca9a18870c1efcf94f74f..437a18669e5f2e8d67bb46a9b01752b0873f896b 100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -692,4 +692,4 @@ class Crypt {
 
 	}
 
-}
\ No newline at end of file
+}
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index d78c69e83db317f6c956a31aa1be2cec68087929..44e668a09c012adb52ec65046bec26210f282902 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -310,7 +310,7 @@ class OC_Mount_Config {
 			foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
 				$content .= "\t\t'".$group."' => array (\n";
 				foreach ($mounts as $mountPoint => $mount) {
-					$content .= "\t\t\t'".addcslashes($mountPoint,"'")."' => ".str_replace("\n", '', var_export($mount, true)).", \n";
+					$content .= "\t\t\t'".addcslashes($mountPoint, "'")."' => ".str_replace("\n", '', var_export($mount, true)).", \n";
 
 				}
 				$content .= "\t\t),\n";
@@ -322,7 +322,7 @@ class OC_Mount_Config {
 			foreach ($data[self::MOUNT_TYPE_USER] as $user => $mounts) {
 				$content .= "\t\t'".$user."' => array (\n";
 				foreach ($mounts as $mountPoint => $mount) {
-					$content .= "\t\t\t'".addcslashes($mountPoint,"'")."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
+					$content .= "\t\t\t'".addcslashes($mountPoint, "'")."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
 				}
 				$content .= "\t\t),\n";
 			}
diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php
index 9a27b63323af79a9a4b51eed27c40ea16db1bff9..9b6c037bb57e6c6a766466a7a61787d5e04dc6ba 100644
--- a/apps/files_external/lib/ftp.php
+++ b/apps/files_external/lib/ftp.php
@@ -68,7 +68,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{
 			case 'ab':
 				//these are supported by the wrapper
 				$context = stream_context_create(array('ftp' => array('overwrite' => true)));
-				return fopen($this->constructUrl($path),$mode, false,$context);
+				return fopen($this->constructUrl($path), $mode, false, $context);
 			case 'r+':
 			case 'w+':
 			case 'wb+':
@@ -89,7 +89,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{
 					$this->getFile($path, $tmpFile);
 				}
 				self::$tempFiles[$tmpFile]=$path;
-				return fopen('close://'.$tmpFile,$mode);
+				return fopen('close://'.$tmpFile, $mode);
 		}
 		return false;
 	}
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index ffba0d000cac3750c047519c3d8aa338bc6e3626..62f6591d25a5dcf4b7b096f57d21aed59f1c6fd9 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -33,7 +33,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
 			$this->share='/'.$this->share;
 		}
 		if(substr($this->share, -1, 1)=='/') {
-			$this->share = substr($this->share,0,-1);
+			$this->share = substr($this->share, 0, -1);
 		}
 	}
 
diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php
index ff7e2238bd11a965c8c9d1921105bfc6f906d906..a631e7ce06aafbb1c7369135cbe42484b741c5b3 100644
--- a/apps/files_external/lib/streamwrapper.php
+++ b/apps/files_external/lib/streamwrapper.php
@@ -71,39 +71,39 @@ abstract class StreamWrapper extends \OC\Files\Storage\Common{
 		return $succes;
 	}
 
-	public function fopen($path,$mode) {
+	public function fopen($path, $mode) {
 		$this->init();
-		return fopen($this->constructUrl($path),$mode);
+		return fopen($this->constructUrl($path), $mode);
 	}
 
 	public function free_space($path) {
 		return 0;
 	}
 
-	public function touch($path,$mtime=null) {
+	public function touch($path, $mtime=null) {
 		$this->init();
 		if(is_null($mtime)) {
-			$fh = $this->fopen($path,'a');
-			fwrite($fh,'');
+			$fh = $this->fopen($path, 'a');
+			fwrite($fh, '');
 			fclose($fh);
 		} else {
 			return false;//not supported
 		}
 	}
 
-	public function getFile($path,$target) {
+	public function getFile($path, $target) {
 		$this->init();
-		return copy($this->constructUrl($path),$target);
+		return copy($this->constructUrl($path), $target);
 	}
 
-	public function uploadFile($path,$target) {
+	public function uploadFile($path, $target) {
 		$this->init();
-		return copy($path,$this->constructUrl($target));
+		return copy($path, $this->constructUrl($target));
 	}
 
-	public function rename($path1,$path2) {
+	public function rename($path1, $path2) {
 		$this->init();
-		return rename($this->constructUrl($path1),$this->constructUrl($path2));
+		return rename($this->constructUrl($path1), $this->constructUrl($path2));
 	}
 
 	public function stat($path) {
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index 8ffa9d8552d24addfeb6601cdc69dc24074b0a06..0fd6fa143b816dff602231767ae57fe7b2e51cd1 100644
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -210,7 +210,7 @@ class SWIFT extends \OC\Files\Storage\Common{
 				return false;
 			} else {
 				$fh=fopen($tmpFile, 'a');
-				fwrite($fh,$name . "\n");
+				fwrite($fh, $name . "\n");
 			}
 		} catch(\Exception $e) {
 			file_put_contents($tmpFile, $name . "\n");
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index f54cdc062287615a1214b55869f776c6e3cb2a0d..039a07b1ef2a9b4a9229ddc59fb9c61a12e1cd9a 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -153,10 +153,10 @@ class DAV extends \OC\Files\Storage\Common{
 
 	public function unlink($path) {
 		$this->init();
-		return $this->simpleResponse('DELETE', $path, null ,204);
+		return $this->simpleResponse('DELETE', $path, null, 204);
 	}
 
-	public function fopen($path,$mode) {
+	public function fopen($path, $mode) {
 		$this->init();
 		$path=$this->cleanPath($path);
 		switch($mode) {
@@ -235,13 +235,13 @@ class DAV extends \OC\Files\Storage\Common{
 		$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
 	}
 
-	public function getFile($path,$target) {
+	public function getFile($path, $target) {
 		$this->init();
-		$source=$this->fopen($path,'r');
-		file_put_contents($target,$source);
+		$source=$this->fopen($path, 'r');
+		file_put_contents($target, $source);
 	}
 
-	public function uploadFile($path,$target) {
+	public function uploadFile($path, $target) {
 		$this->init();
 		$source=fopen($path, 'r');
 
@@ -256,7 +256,7 @@ class DAV extends \OC\Files\Storage\Common{
 		curl_close ($curl);
 	}
 
-	public function rename($path1,$path2) {
+	public function rename($path1, $path2) {
 		$this->init();
 		$path1=$this->cleanPath($path1);
 		$path2=$this->root.$this->cleanPath($path2);
@@ -268,7 +268,7 @@ class DAV extends \OC\Files\Storage\Common{
 		}
 	}
 
-	public function copy($path1,$path2) {
+	public function copy($path1, $path2) {
 		$this->init();
 		$path1=$this->cleanPath($path1);
 		$path2=$this->root.$this->cleanPath($path2);
@@ -321,7 +321,7 @@ class DAV extends \OC\Files\Storage\Common{
 		}
 	}
 
-	private function simpleResponse($method,$path,$body,$expected) {
+	private function simpleResponse($method, $path, $body, $expected) {
 		$path=$this->cleanPath($path);
 		try {
 			$response=$this->client->request($method, $path, $body);
diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php
index cc010979c51e28d655639c6c00f640bae69d27da..6320c1d08273fa0b719f90e6d6ee95c4a256a8f4 100644
--- a/apps/files_trashbin/ajax/undelete.php
+++ b/apps/files_trashbin/ajax/undelete.php
@@ -38,7 +38,7 @@ if ( $error ) {
 		$filelist .= $e.', ';
 	}
 	$l = OC_L10N::get('files_trashbin');
-	$message = $l->t("Couldn't restore %s", array(rtrim($filelist,', ')));
+	$message = $l->t("Couldn't restore %s", array(rtrim($filelist, ', ')));
 	OCP\JSON::error(array("data" => array("message" => $message,
 										  "success" => $success, "error" => $error)));
 } else {
diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php
index 1aceb8ffefddf48976038ab74d2c0d7d8755fa7a..a2d4cc0a44df9cb2a221750af922b2da3ae64ec8 100644
--- a/apps/files_trashbin/index.php
+++ b/apps/files_trashbin/index.php
@@ -27,7 +27,7 @@ if ($dir) {
 			$pos = strpos($dir.'/', '/', 1);
 			$tmp = substr($dir, 0, $pos);
 			$pos = strrpos($tmp, '.d');
-			$timestamp = substr($tmp,$pos+2);
+			$timestamp = substr($tmp, $pos+2);
 			$result[] = array(
 					'id' => $entryName,
 					'timestamp' => $timestamp,
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 8016040f1e959f47a481d849d43b2db7d218592d..76844ca92e983b09707186d0c8e6a7dc5b0c6622 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -80,7 +80,7 @@ class Trashbin {
 				}
 			}
 		} else {
-			\OC_Log::write('files_trashbin', 'Couldn\'t move '.$file_path.' to the trash bin' , \OC_log::ERROR);
+			\OC_Log::write('files_trashbin', 'Couldn\'t move '.$file_path.' to the trash bin', \OC_log::ERROR);
 		}
 		
 		// get available disk space for user
@@ -188,7 +188,7 @@ class Trashbin {
 			\OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize);
 			return true;
 		} else {
-			\OC_Log::write('files_trashbin', 'Couldn\'t restore file from trash bin, '.$filename , \OC_log::ERROR);
+			\OC_Log::write('files_trashbin', 'Couldn\'t restore file from trash bin, '.$filename, \OC_log::ERROR);
 		}
 
 		return false;
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index 9a37920e35dde2f07e8d2e26a6be96c695f525e5..0bf2efe35afc387cc6437ea872c58c3e5f9521b3 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -235,7 +235,7 @@ class Connection {
 			$this->config['turnOffCertCheck']
 				= $this->$v('ldap_turn_off_cert_check');
 			$this->config['ldapUserDisplayName']
-				= mb_strtolower($this->$v('ldap_display_name'),'UTF-8');
+				= mb_strtolower($this->$v('ldap_display_name'), 'UTF-8');
 			$this->config['ldapUserFilter']
 				= $this->$v('ldap_userlist_filter');
 			$this->config['ldapGroupFilter'] = $this->$v('ldap_group_filter');
diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php
index 61165d9956d47d3fdd5fcd0f1e27405d02ad0a98..c7375541e8679ce357a06d3947987888fbd65848 100644
--- a/lib/connector/sabre/file.php
+++ b/lib/connector/sabre/file.php
@@ -84,7 +84,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
 	 */
 	public function get() {
 
-		return \OC\Files\Filesystem::fopen($this->path,'rb');
+		return \OC\Files\Filesystem::fopen($this->path, 'rb');
 
 	}
 
diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php
index 52995630211fe2a9c012420ecbef320af8697397..57ce3710db8f3bc4e93800254f1f6d3d700edeeb 100644
--- a/lib/connector/sabre/node.php
+++ b/lib/connector/sabre/node.php
@@ -84,12 +84,12 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
 		$newPath = $parentPath . '/' . $newName;
 		$oldPath = $this->path;
 
-		\OC\Files\Filesystem::rename($this->path,$newPath);
+		\OC\Files\Filesystem::rename($this->path, $newPath);
 
 		$this->path = $newPath;
 
 		$query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ? WHERE `userid` = ? AND `propertypath` = ?' );
-		$query->execute( array( $newPath,OC_User::getUser(), $oldPath ));
+		$query->execute( array( $newPath, OC_User::getUser(), $oldPath ));
 
 	}
 
diff --git a/lib/files/mapper.php b/lib/files/mapper.php
index 2d29a8532b6833995539119793dff1198b392c79..cd163dcbfcd90732d6f1c3e4e13489d229cf6bd4 100644
--- a/lib/files/mapper.php
+++ b/lib/files/mapper.php
@@ -107,7 +107,7 @@ class Mapper
 
 	private function stripLast($path) {
 		if (substr($path, -1) == '/') {
-			$path = substr_replace($path ,'',-1);
+			$path = substr_replace($path, '', -1);
 		}
 		return $path;
 	}
diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php
index bff5c5d57d994390028083ada78ec311df0b7d71..b4c33c69f6ba4d6f47335e49ec6d8f222df14104 100644
--- a/lib/files/storage/common.php
+++ b/lib/files/storage/common.php
@@ -83,21 +83,21 @@ abstract class Common implements \OC\Files\Storage\Storage {
 		}
 		return fread($handle, $size);
 	}
-	public function file_put_contents($path,$data) {
+	public function file_put_contents($path, $data) {
 		$handle = $this->fopen($path, "w");
 		return fwrite($handle, $data);
 	}
-	public function rename($path1,$path2) {
-		if($this->copy($path1,$path2)) {
+	public function rename($path1, $path2) {
+		if($this->copy($path1, $path2)) {
 			return $this->unlink($path1);
 		}else{
 			return false;
 		}
 	}
-	public function copy($path1,$path2) {
-		$source=$this->fopen($path1,'r');
-		$target=$this->fopen($path2,'w');
-		$count=\OC_Helper::streamCopy($source,$target);
+	public function copy($path1, $path2) {
+		$source=$this->fopen($path1, 'r');
+		$target=$this->fopen($path2, 'w');
+		$count=\OC_Helper::streamCopy($source, $target);
 		return $count>0;
 	}
 
@@ -111,7 +111,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
 	 * deleted together with its contents. To avoid this set $empty to true
 	 */
 	public function deleteAll( $directory, $empty = false ) {
-		$directory = trim($directory,'/');
+		$directory = trim($directory, '/');
 
 		if ( !$this->file_exists( \OCP\USER::getUser() . '/' . $directory ) || !$this->is_dir( \OCP\USER::getUser() . '/' . $directory ) ) {
 			return false;
@@ -146,25 +146,25 @@ abstract class Common implements \OC\Files\Storage\Storage {
 		if($this->is_dir($path)) {
 			return 'httpd/unix-directory';
 		}
-		$source=$this->fopen($path,'r');
+		$source=$this->fopen($path, 'r');
 		if(!$source) {
 			return false;
 		}
-		$head=fread($source,8192);//8kb should suffice to determine a mimetype
-		if($pos=strrpos($path,'.')) {
-			$extension=substr($path,$pos);
+		$head=fread($source, 8192);//8kb should suffice to determine a mimetype
+		if($pos=strrpos($path, '.')) {
+			$extension=substr($path, $pos);
 		}else{
 			$extension='';
 		}
 		$tmpFile=\OC_Helper::tmpFile($extension);
-		file_put_contents($tmpFile,$head);
+		file_put_contents($tmpFile, $head);
 		$mime=\OC_Helper::getMimeType($tmpFile);
 		unlink($tmpFile);
 		return $mime;
 	}
-	public function hash($type,$path,$raw = false) {
+	public function hash($type, $path, $raw = false) {
 		$tmpFile=$this->getLocalFile($path);
-		$hash=hash($type,$tmpFile,$raw);
+		$hash=hash($type, $tmpFile, $raw);
 		unlink($tmpFile);
 		return $hash;
 	}
@@ -175,42 +175,42 @@ abstract class Common implements \OC\Files\Storage\Storage {
 		return $this->toTmpFile($path);
 	}
 	private function toTmpFile($path) {//no longer in the storage api, still useful here
-		$source=$this->fopen($path,'r');
+		$source=$this->fopen($path, 'r');
 		if(!$source) {
 			return false;
 		}
-		if($pos=strrpos($path,'.')) {
-			$extension=substr($path,$pos);
+		if($pos=strrpos($path, '.')) {
+			$extension=substr($path, $pos);
 		}else{
 			$extension='';
 		}
 		$tmpFile=\OC_Helper::tmpFile($extension);
-		$target=fopen($tmpFile,'w');
-		\OC_Helper::streamCopy($source,$target);
+		$target=fopen($tmpFile, 'w');
+		\OC_Helper::streamCopy($source, $target);
 		return $tmpFile;
 	}
 	public function getLocalFolder($path) {
 		$baseDir=\OC_Helper::tmpFolder();
-		$this->addLocalFolder($path,$baseDir);
+		$this->addLocalFolder($path, $baseDir);
 		return $baseDir;
 	}
-	private function addLocalFolder($path,$target) {
+	private function addLocalFolder($path, $target) {
 		if($dh=$this->opendir($path)) {
 			while($file=readdir($dh)) {
 				if($file!=='.' and $file!=='..') {
 					if($this->is_dir($path.'/'.$file)) {
 						mkdir($target.'/'.$file);
-						$this->addLocalFolder($path.'/'.$file,$target.'/'.$file);
+						$this->addLocalFolder($path.'/'.$file, $target.'/'.$file);
 					}else{
 						$tmp=$this->toTmpFile($path.'/'.$file);
-						rename($tmp,$target.'/'.$file);
+						rename($tmp, $target.'/'.$file);
 					}
 				}
 			}
 		}
 	}
 
-	protected function searchInDir($query,$dir='') {
+	protected function searchInDir($query, $dir='') {
 		$files=array();
 		$dh=$this->opendir($dir);
 		if($dh) {
@@ -220,7 +220,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
 					$files[]=$dir.'/'.$item;
 				}
 				if($this->is_dir($dir.'/'.$item)) {
-					$files=array_merge($files,$this->searchInDir($query,$dir.'/'.$item));
+					$files=array_merge($files, $this->searchInDir($query, $dir.'/'.$item));
 				}
 			}
 		}
@@ -233,7 +233,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
 	 * @param int $time
 	 * @return bool
 	 */
-	public function hasUpdated($path,$time) {
+	public function hasUpdated($path, $time) {
 		return $this->filemtime($path)>$time;
 	}
 
diff --git a/lib/files/storage/local.php b/lib/files/storage/local.php
index aaa3c0fab497bd611b59e48281dcc0624d11814b..4099f860d7b684ecb5f01cf8c9e4924e4f64bfc4 100644
--- a/lib/files/storage/local.php
+++ b/lib/files/storage/local.php
@@ -40,7 +40,7 @@ class Local extends \OC\Files\Storage\Common{
 		return opendir($this->datadir.$path);
 	}
 	public function is_dir($path) {
-		if(substr($path,-1)=='/') {
+		if(substr($path, -1)=='/') {
 			$path=substr($path, 0, -1);
 		}
 		return is_dir($this->datadir.$path);
@@ -117,11 +117,11 @@ class Local extends \OC\Files\Storage\Common{
 	}
 	public function rename($path1, $path2) {
 		if (!$this->isUpdatable($path1)) {
-			\OC_Log::write('core','unable to rename, file is not writable : '.$path1,\OC_Log::ERROR);
+			\OC_Log::write('core', 'unable to rename, file is not writable : '.$path1, \OC_Log::ERROR);
 			return false;
 		}
 		if(! $this->file_exists($path1)) {
-			\OC_Log::write('core','unable to rename, file does not exists : '.$path1,\OC_Log::ERROR);
+			\OC_Log::write('core', 'unable to rename, file does not exists : '.$path1, \OC_Log::ERROR);
 			return false;
 		}
 
diff --git a/lib/files/storage/mappedlocal.php b/lib/files/storage/mappedlocal.php
index 218465d8eef4e44a78506bc9179c29a10b302b19..f2af5bfe3571515493229a92f0c2c09c0732e5f2 100644
--- a/lib/files/storage/mappedlocal.php
+++ b/lib/files/storage/mappedlocal.php
@@ -61,7 +61,7 @@ class MappedLocal extends \OC\Files\Storage\Common{
 		return opendir('fakedir://local-win32'.$path);
 	}
 	public function is_dir($path) {
-		if(substr($path,-1)=='/') {
+		if(substr($path, -1)=='/') {
 			$path=substr($path, 0, -1);
 		}
 		return is_dir($this->buildPath($path));
@@ -138,11 +138,11 @@ class MappedLocal extends \OC\Files\Storage\Common{
 	}
 	public function rename($path1, $path2) {
 		if (!$this->isUpdatable($path1)) {
-			\OC_Log::write('core','unable to rename, file is not writable : '.$path1,\OC_Log::ERROR);
+			\OC_Log::write('core', 'unable to rename, file is not writable : '.$path1, \OC_Log::ERROR);
 			return false;
 		}
 		if(! $this->file_exists($path1)) {
-			\OC_Log::write('core','unable to rename, file does not exists : '.$path1,\OC_Log::ERROR);
+			\OC_Log::write('core', 'unable to rename, file does not exists : '.$path1, \OC_Log::ERROR);
 			return false;
 		}
 
diff --git a/lib/ocs.php b/lib/ocs.php
index 1657f1f9d7bcecd81e9166036cbfbe10822639c9..e08f0846f81e95f036188afcff91a6be4cd476bd 100644
--- a/lib/ocs.php
+++ b/lib/ocs.php
@@ -89,7 +89,7 @@ class OC_OCS {
 		$format = self::readData($method, 'format', 'text', '');
 		$txt='Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. DEBUG OUTPUT:'."\n";
 		$txt.=OC_OCS::getDebugOutput();
-		echo(OC_OCS::generateXml($format,'failed',999,$txt));
+		echo(OC_OCS::generateXml($format, 'failed', 999, $txt));
 
 	}
 
diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php
index 820d24a8e0c6865d240536e0755e660ace7091c0..5553ae382151d50b936a4b8ab32ca58323b21a2b 100644
--- a/lib/ocs/cloud.php
+++ b/lib/ocs/cloud.php
@@ -31,7 +31,7 @@ class OC_OCS_Cloud {
 		foreach($apps as $app) {
 			$info = OC_App::getAppInfo($app);
 			if(isset($info['standalone'])) {
-				$newValue = array('name'=>$info['name'],'url'=>OC_Helper::linkToAbsolute($app,''),'icon'=>'');
+				$newValue = array('name'=>$info['name'], 'url'=>OC_Helper::linkToAbsolute($app, ''), 'icon'=>'');
 				$values[] = $newValue;
 			}
 		}
diff --git a/lib/ocs/privatedata.php b/lib/ocs/privatedata.php
index 971a5c2ad31053fe82f9f9592a300b4e1275100c..4dfd0a6e66e3482edc454319471f644426a41b5b 100644
--- a/lib/ocs/privatedata.php
+++ b/lib/ocs/privatedata.php
@@ -29,7 +29,7 @@ class OC_OCS_Privatedata {
 		$user = OC_User::getUser();
 		$app = addslashes(strip_tags($parameters['app']));
 		$key = addslashes(strip_tags($parameters['key']));
-		$result = OC_OCS::getData($user,$app,$key);
+		$result = OC_OCS::getData($user, $app, $key);
 		$xml = array();
 		foreach($result as $i=>$log) {
 			$xml[$i]['key']=$log['key'];
diff --git a/lib/public/share.php b/lib/public/share.php
index af2a538e252d034aa837cba6b8c5ddbd09a7a58f..6dc30f6ae42f050077a1a4085ee8fb276d439cae 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -142,7 +142,7 @@ class Share {
 	 * @return Item
 	 */
 	public static function getShareByToken($token) {
-		$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `token` = ?',1);
+		$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `token` = ?', 1);
 		$result = $query->execute(array($token));
 		if (\OC_DB::isError($result)) {
 			\OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result) . ', token=' . $token, \OC_Log::ERROR);
diff --git a/lib/user.php b/lib/user.php
index 16680be4aa02d79ce000d1ee6c614da738d5749a..48f4e5c7006202d2e70008273d8843afbe7e50a4 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -541,7 +541,7 @@ class OC_User {
 	 */
 	public static function userExists($uid, $excludingBackend=null) {
 		foreach(self::$_usedBackends as $backend) {
-			if (!is_null($excludingBackend) && !strcmp(get_class($backend),$excludingBackend)) {
+			if (!is_null($excludingBackend) && !strcmp(get_class($backend), $excludingBackend)) {
 			    OC_Log::write('OC_User', $excludingBackend . 'excluded from user existance check.', OC_Log::DEBUG);
 			    continue;
 			}
diff --git a/lib/util.php b/lib/util.php
index 59e67f2a5f1a6beaaeb8d4c6941f91c5c06dec8c..b9ac8ed75d869e56ff65fc3f877ce43879761cd1 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -691,10 +691,10 @@ class OC_Util {
 			curl_setopt($curl, CURLOPT_MAXREDIRS, 10);
 
 			curl_setopt($curl, CURLOPT_USERAGENT, "ownCloud Server Crawler");
-			if(OC_Config::getValue('proxy','')<>'') {
+			if(OC_Config::getValue('proxy', '')<>'') {
 				curl_setopt($curl, CURLOPT_PROXY, OC_Config::getValue('proxy'));
 			}
-			if(OC_Config::getValue('proxyuserpwd','')<>'') {
+			if(OC_Config::getValue('proxyuserpwd', '')<>'') {
 				curl_setopt($curl, CURLOPT_PROXYUSERPWD, OC_Config::getValue('proxyuserpwd'));
 			}
 			$data = curl_exec($curl);
@@ -703,7 +703,7 @@ class OC_Util {
 		} else {
 			$contextArray = null;
 
-			if(OC_Config::getValue('proxy','')<>'') {
+			if(OC_Config::getValue('proxy', '')<>'') {
 				$contextArray = array(
 					'http' => array(
 						'timeout' => 10,