Completed
Pull Request — master (#4890)
by Blizzz
14:37
created
lib/private/legacy/db.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * SQL query via Doctrine prepare(), needs to be execute()'d!
55 55
 	 */
56
-	static public function prepare( $query , $limit = null, $offset = null, $isManipulation = null) {
56
+	static public function prepare($query, $limit = null, $offset = null, $isManipulation = null) {
57 57
 		$connection = \OC::$server->getDatabaseConnection();
58 58
 
59 59
 		if ($isManipulation === null) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 		// return the result
65 65
 		try {
66
-			$result =$connection->prepare($query, $limit, $offset);
66
+			$result = $connection->prepare($query, $limit, $offset);
67 67
 		} catch (\Doctrine\DBAL\DBALException $e) {
68 68
 			throw new \OC\DatabaseException($e->getMessage(), $query);
69 69
 		}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @param string $sql
80 80
 	 * @return bool
81 81
 	 */
82
-	static public function isManipulation( $sql ) {
82
+	static public function isManipulation($sql) {
83 83
 		$selectOccurrence = stripos($sql, 'SELECT');
84 84
 		if ($selectOccurrence !== false && $selectOccurrence < 10) {
85 85
 			return false;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @return OC_DB_StatementWrapper
109 109
 	 * @throws \OC\DatabaseException
110 110
 	 */
111
-	static public function executeAudited( $stmt, array $parameters = null) {
111
+	static public function executeAudited($stmt, array $parameters = null) {
112 112
 		if (is_string($stmt)) {
113 113
 			// convert to an array with 'sql'
114 114
 			if (stripos($stmt, 'LIMIT') !== false) { //OFFSET requires LIMIT, so we only need to check for LIMIT
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
 		}
122 122
 		if (is_array($stmt)) {
123 123
 			// convert to prepared statement
124
-			if ( ! array_key_exists('sql', $stmt) ) {
124
+			if (!array_key_exists('sql', $stmt)) {
125 125
 				$message = 'statement array must at least contain key \'sql\'';
126 126
 				throw new \OC\DatabaseException($message);
127 127
 			}
128
-			if ( ! array_key_exists('limit', $stmt) ) {
128
+			if (!array_key_exists('limit', $stmt)) {
129 129
 				$stmt['limit'] = null;
130 130
 			}
131
-			if ( ! array_key_exists('limit', $stmt) ) {
131
+			if (!array_key_exists('limit', $stmt)) {
132 132
 				$stmt['offset'] = null;
133 133
 			}
134 134
 			$stmt = self::prepare($stmt['sql'], $stmt['limit'], $stmt['offset']);
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 			self::raiseExceptionOnError($result, 'Could not execute statement');
140 140
 		} else {
141 141
 			if (is_object($stmt)) {
142
-				$message = 'Expected a prepared statement or array got ' . get_class($stmt);
142
+				$message = 'Expected a prepared statement or array got '.get_class($stmt);
143 143
 			} else {
144
-				$message = 'Expected a prepared statement or array got ' . gettype($stmt);
144
+				$message = 'Expected a prepared statement or array got '.gettype($stmt);
145 145
 			}
146 146
 			throw new \OC\DatabaseException($message);
147 147
 		}
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 *
169 169
 	 * TODO: write more documentation
170 170
 	 */
171
-	public static function createDbFromStructure( $file ) {
171
+	public static function createDbFromStructure($file) {
172 172
 		$schemaManager = self::getMDB2SchemaManager();
173 173
 		$result = $schemaManager->createDbFromStructure($file);
174 174
 		return $result;
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
 	 * @throws \OC\DatabaseException
209 209
 	 */
210 210
 	public static function raiseExceptionOnError($result, $message = null) {
211
-		if($result === false) {
211
+		if ($result === false) {
212 212
 			if ($message === null) {
213 213
 				$message = self::getErrorMessage();
214 214
 			} else {
215
-				$message .= ', Root cause:' . self::getErrorMessage();
215
+				$message .= ', Root cause:'.self::getErrorMessage();
216 216
 			}
217 217
 			throw new \OC\DatabaseException($message, \OC::$server->getDatabaseConnection()->errorCode());
218 218
 		}
Please login to merge, or discard this patch.
lib/private/legacy/user/backend.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,27 +31,27 @@
 block discarded – undo
31 31
  * error code for functions not provided by the user backend
32 32
  * @deprecated Use \OC_User_Backend::NOT_IMPLEMENTED instead
33 33
  */
34
-define('OC_USER_BACKEND_NOT_IMPLEMENTED',   -501);
34
+define('OC_USER_BACKEND_NOT_IMPLEMENTED', -501);
35 35
 
36 36
 /**
37 37
  * actions that user backends can define
38 38
  */
39 39
 /** @deprecated Use \OC_User_Backend::CREATE_USER instead */
40
-define('OC_USER_BACKEND_CREATE_USER',       1 << 0);
40
+define('OC_USER_BACKEND_CREATE_USER', 1 << 0);
41 41
 /** @deprecated Use \OC_User_Backend::SET_PASSWORD instead */
42
-define('OC_USER_BACKEND_SET_PASSWORD',      1 << 4);
42
+define('OC_USER_BACKEND_SET_PASSWORD', 1 << 4);
43 43
 /** @deprecated Use \OC_User_Backend::CHECK_PASSWORD instead */
44
-define('OC_USER_BACKEND_CHECK_PASSWORD',    1 << 8);
44
+define('OC_USER_BACKEND_CHECK_PASSWORD', 1 << 8);
45 45
 /** @deprecated Use \OC_User_Backend::GET_HOME instead */
46
-define('OC_USER_BACKEND_GET_HOME',          1 << 12);
46
+define('OC_USER_BACKEND_GET_HOME', 1 << 12);
47 47
 /** @deprecated Use \OC_User_Backend::GET_DISPLAYNAME instead */
48
-define('OC_USER_BACKEND_GET_DISPLAYNAME',   1 << 16);
48
+define('OC_USER_BACKEND_GET_DISPLAYNAME', 1 << 16);
49 49
 /** @deprecated Use \OC_User_Backend::SET_DISPLAYNAME instead */
50
-define('OC_USER_BACKEND_SET_DISPLAYNAME',   1 << 20);
50
+define('OC_USER_BACKEND_SET_DISPLAYNAME', 1 << 20);
51 51
 /** @deprecated Use \OC_User_Backend::PROVIDE_AVATAR instead */
52
-define('OC_USER_BACKEND_PROVIDE_AVATAR',    1 << 24);
52
+define('OC_USER_BACKEND_PROVIDE_AVATAR', 1 << 24);
53 53
 /** @deprecated Use \OC_User_Backend::COUNT_USERS instead */
54
-define('OC_USER_BACKEND_COUNT_USERS',       1 << 28);
54
+define('OC_USER_BACKEND_COUNT_USERS', 1 << 28);
55 55
 
56 56
 /**
57 57
  * Abstract base class for user management. Provides methods for querying backend
Please login to merge, or discard this patch.
lib/private/legacy/hook.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  * along with this program.  If not, see <http://www.gnu.org/licenses/>
29 29
  *
30 30
  */
31
-class OC_Hook{
31
+class OC_Hook {
32 32
 	public static $thrownExceptions = [];
33 33
 
34 34
 	static private $registered = array();
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
 	 *
47 47
 	 * TODO: write example
48 48
 	 */
49
-	static public function connect($signalClass, $signalName, $slotClass, $slotName ) {
49
+	static public function connect($signalClass, $signalName, $slotClass, $slotName) {
50 50
 		// If we're trying to connect to an emitting class that isn't
51 51
 		// yet registered, register it
52
-		if( !array_key_exists($signalClass, self::$registered )) {
52
+		if (!array_key_exists($signalClass, self::$registered)) {
53 53
 			self::$registered[$signalClass] = array();
54 54
 		}
55 55
 		// If we're trying to connect to an emitting method that isn't
56 56
 		// yet registered, register it with the emitting class
57
-		if( !array_key_exists( $signalName, self::$registered[$signalClass] )) {
57
+		if (!array_key_exists($signalName, self::$registered[$signalClass])) {
58 58
 			self::$registered[$signalClass][$signalName] = array();
59 59
 		}
60 60
 
@@ -90,27 +90,27 @@  discard block
 block discarded – undo
90 90
 
91 91
 		// Return false if no hook handlers are listening to this
92 92
 		// emitting class
93
-		if( !array_key_exists($signalClass, self::$registered )) {
93
+		if (!array_key_exists($signalClass, self::$registered)) {
94 94
 			return false;
95 95
 		}
96 96
 
97 97
 		// Return false if no hook handlers are listening to this
98 98
 		// emitting method
99
-		if( !array_key_exists( $signalName, self::$registered[$signalClass] )) {
99
+		if (!array_key_exists($signalName, self::$registered[$signalClass])) {
100 100
 			return false;
101 101
 		}
102 102
 
103 103
 		// Call all slots
104
-		foreach( self::$registered[$signalClass][$signalName] as $i ) {
104
+		foreach (self::$registered[$signalClass][$signalName] as $i) {
105 105
 			try {
106
-				call_user_func( array( $i["class"], $i["name"] ), $params );
107
-			} catch (Exception $e){
106
+				call_user_func(array($i["class"], $i["name"]), $params);
107
+			} catch (Exception $e) {
108 108
 				self::$thrownExceptions[] = $e;
109 109
 				\OC::$server->getLogger()->logException($e);
110
-				if($e instanceof \OC\HintException) {
110
+				if ($e instanceof \OC\HintException) {
111 111
 					throw $e;
112 112
 				}
113
-				if($e instanceof \OC\ServerNotAvailableException) {
113
+				if ($e instanceof \OC\ServerNotAvailableException) {
114 114
 					throw $e;
115 115
 				}
116 116
 			}
@@ -124,15 +124,15 @@  discard block
 block discarded – undo
124 124
 	 * @param string $signalClass
125 125
 	 * @param string $signalName
126 126
 	 */
127
-	static public function clear($signalClass='', $signalName='') {
127
+	static public function clear($signalClass = '', $signalName = '') {
128 128
 		if ($signalClass) {
129 129
 			if ($signalName) {
130
-				self::$registered[$signalClass][$signalName]=array();
131
-			}else{
132
-				self::$registered[$signalClass]=array();
130
+				self::$registered[$signalClass][$signalName] = array();
131
+			} else {
132
+				self::$registered[$signalClass] = array();
133 133
 			}
134
-		}else{
135
-			self::$registered=array();
134
+		} else {
135
+			self::$registered = array();
136 136
 		}
137 137
 	}
138 138
 
Please login to merge, or discard this patch.
lib/private/legacy/helper.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		} else {
65 65
 			$url = OC::$server->getURLGenerator()->getAbsoluteURL(OC::$server->getURLGenerator()->linkTo('', 'public.php').'?service='.$service);
66 66
 		}
67
-		return $url . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
67
+		return $url.(($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
68 68
 	}
69 69
 
70 70
 	/**
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 			return "?";
115 115
 		}
116 116
 		if ($bytes < 1024) {
117
-			return $bytes . "B";
117
+			return $bytes."B";
118 118
 		}
119 119
 		$bytes = round($bytes / 1024, 1);
120 120
 		if ($bytes < 1024) {
121
-			return $bytes . "K";
121
+			return $bytes."K";
122 122
 		}
123 123
 		$bytes = round($bytes / 1024, 1);
124 124
 		if ($bytes < 1024) {
125
-			return $bytes . "M";
125
+			return $bytes."M";
126 126
 		}
127 127
 		$bytes = round($bytes / 1024, 1);
128
-		return $bytes . "G";
128
+		return $bytes."G";
129 129
 	}
130 130
 
131 131
 	/**
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 		}
272 272
 		foreach ($dirs as $dir) {
273 273
 			foreach ($exts as $ext) {
274
-				if ($check_fn("$dir/$name" . $ext))
274
+				if ($check_fn("$dir/$name".$ext))
275 275
 					return true;
276 276
 			}
277 277
 		}
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 			$ext = '';
343 343
 		}
344 344
 
345
-		$newpath = $path . '/' . $filename;
345
+		$newpath = $path.'/'.$filename;
346 346
 		if ($view->file_exists($newpath)) {
347 347
 			if (preg_match_all('/\((\d+)\)/', $name, $matches, PREG_OFFSET_CAPTURE)) {
348 348
 				//Replace the last "(number)" with "(number+1)"
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
 			do {
359 359
 				if ($offset) {
360 360
 					//Replace the last "(number)" with "(number+1)"
361
-					$newname = substr_replace($name, '(' . $counter . ')', $offset, $match_length);
361
+					$newname = substr_replace($name, '('.$counter.')', $offset, $match_length);
362 362
 				} else {
363
-					$newname = $name . ' (' . $counter . ')';
363
+					$newname = $name.' ('.$counter.')';
364 364
 				}
365
-				$newpath = $path . '/' . $newname . $ext;
365
+				$newpath = $path.'/'.$newname.$ext;
366 366
 				$counter++;
367 367
 			} while ($view->file_exists($newpath));
368 368
 		}
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	 * @return int number of bytes representing
426 426
 	 */
427 427
 	public static function maxUploadFilesize($dir, $freeSpace = null) {
428
-		if (is_null($freeSpace) || $freeSpace < 0){
428
+		if (is_null($freeSpace) || $freeSpace < 0) {
429 429
 			$freeSpace = self::freeSpace($dir);
430 430
 		}
431 431
 		return min($freeSpace, self::uploadLimit());
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 			$freeSpace = max($freeSpace, 0);
444 444
 			return $freeSpace;
445 445
 		} else {
446
-			return (INF > 0)? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
446
+			return (INF > 0) ? INF : PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
447 447
 		}
448 448
 	}
449 449
 
@@ -456,9 +456,9 @@  discard block
 block discarded – undo
456 456
 		$ini = \OC::$server->getIniWrapper();
457 457
 		$upload_max_filesize = OCP\Util::computerFileSize($ini->get('upload_max_filesize'));
458 458
 		$post_max_size = OCP\Util::computerFileSize($ini->get('post_max_size'));
459
-		if ((int)$upload_max_filesize === 0 and (int)$post_max_size === 0) {
459
+		if ((int) $upload_max_filesize === 0 and (int) $post_max_size === 0) {
460 460
 			return INF;
461
-		} elseif ((int)$upload_max_filesize === 0 or (int)$post_max_size === 0) {
461
+		} elseif ((int) $upload_max_filesize === 0 or (int) $post_max_size === 0) {
462 462
 			return max($upload_max_filesize, $post_max_size); //only the non 0 value counts
463 463
 		} else {
464 464
 			return min($upload_max_filesize, $post_max_size);
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
 				if (empty($paths)) {
511 511
 					$paths = '/usr/local/bin /usr/bin /opt/bin /bin';
512 512
 				} else {
513
-					$paths = str_replace(':',' ',getenv('PATH'));
513
+					$paths = str_replace(':', ' ', getenv('PATH'));
514 514
 				}
515
-				$command = 'find ' . $paths . ' -name ' . escapeshellarg($program) . ' 2> /dev/null';
515
+				$command = 'find '.$paths.' -name '.escapeshellarg($program).' 2> /dev/null';
516 516
 				exec($command, $output, $returnCode);
517 517
 				if (count($output) > 0) {
518 518
 					$result = escapeshellcmd($output[0]);
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 		$ownerId = $storage->getOwner($path);
598 598
 		$ownerDisplayName = '';
599 599
 		$owner = \OC::$server->getUserManager()->get($ownerId);
600
-		if($owner) {
600
+		if ($owner) {
601 601
 			$ownerDisplayName = $owner->getDisplayName();
602 602
 		}
603 603
 
Please login to merge, or discard this patch.
lib/private/Settings/RemoveOrphaned.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	private $manager;
47 47
 
48 48
 	public function __construct(Manager $manager = null) {
49
-		if($manager !== null) {
49
+		if ($manager !== null) {
50 50
 			$this->manager = $manager;
51 51
 		} else {
52 52
 			// fix DI for Jobs
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function execute($jobList, ILogger $logger = null) {
64 64
 		// add an interval of 15 mins
65
-		$this->setInterval(15*60);
65
+		$this->setInterval(15 * 60);
66 66
 
67 67
 		$this->jobList = $jobList;
68 68
 		$this->logger = $logger;
Please login to merge, or discard this patch.
lib/private/Streamer.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 
30 30
 class Streamer {
31 31
 	// array of regexp. Matching user agents will get tar instead of zip
32
-	private $preferTarFor = [ '/macintosh|mac os x/i' ];
32
+	private $preferTarFor = ['/macintosh|mac os x/i'];
33 33
 
34 34
 	// streamer instance
35 35
 	private $streamerInstance;
36 36
 	
37
-	public function __construct(){
37
+	public function __construct() {
38 38
 		/** @var \OCP\IRequest */
39 39
 		$request = \OC::$server->getRequest();
40 40
 		
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 	 * Send HTTP headers
50 50
 	 * @param string $name 
51 51
 	 */
52
-	public function sendHeaders($name){
52
+	public function sendHeaders($name) {
53 53
 		$extension = $this->streamerInstance instanceof ZipStreamer ? '.zip' : '.tar';
54
-		$fullName = $name . $extension;
54
+		$fullName = $name.$extension;
55 55
 		$this->streamerInstance->sendHeaders($fullName);
56 56
 	}
57 57
 	
@@ -60,27 +60,27 @@  discard block
 block discarded – undo
60 60
 	 * @param string $dir
61 61
 	 * @param string $internalDir
62 62
 	 */
63
-	public function addDirRecursive($dir, $internalDir='') {
63
+	public function addDirRecursive($dir, $internalDir = '') {
64 64
 		$dirname = basename($dir);
65
-		$rootDir = $internalDir . $dirname;
65
+		$rootDir = $internalDir.$dirname;
66 66
 		if (!empty($rootDir)) {
67 67
 			$this->streamerInstance->addEmptyDir($rootDir);
68 68
 		}
69
-		$internalDir .= $dirname . '/';
69
+		$internalDir .= $dirname.'/';
70 70
 		// prevent absolute dirs
71 71
 		$internalDir = ltrim($internalDir, '/');
72 72
 
73
-		$files= \OC\Files\Filesystem::getDirectoryContent($dir);
74
-		foreach($files as $file) {
73
+		$files = \OC\Files\Filesystem::getDirectoryContent($dir);
74
+		foreach ($files as $file) {
75 75
 			$filename = $file['name'];
76
-			$file = $dir . '/' . $filename;
77
-			if(\OC\Files\Filesystem::is_file($file)) {
76
+			$file = $dir.'/'.$filename;
77
+			if (\OC\Files\Filesystem::is_file($file)) {
78 78
 				$filesize = \OC\Files\Filesystem::filesize($file);
79 79
 				$fileTime = \OC\Files\Filesystem::filemtime($file);
80 80
 				$fh = \OC\Files\Filesystem::fopen($file, 'r');
81
-				$this->addFileFromStream($fh, $internalDir . $filename, $filesize, $fileTime);
81
+				$this->addFileFromStream($fh, $internalDir.$filename, $filesize, $fileTime);
82 82
 				fclose($fh);
83
-			}elseif(\OC\Files\Filesystem::is_dir($file)) {
83
+			}elseif (\OC\Files\Filesystem::is_dir($file)) {
84 84
 				$this->addDirRecursive($file, $internalDir);
85 85
 			}
86 86
 		}
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * @param string $dirName Directory Path and name to be added to the archive.
117 117
 	 * @return bool $success
118 118
 	 */
119
-	public function addEmptyDir($dirName){
119
+	public function addEmptyDir($dirName) {
120 120
 		return $this->streamerInstance->addEmptyDir($dirName);
121 121
 	}
122 122
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * closing, the file is completely written to the output stream.
127 127
 	 * @return bool $success
128 128
 	 */
129
-	public function finalize(){
129
+	public function finalize() {
130 130
 		return $this->streamerInstance->finalize();
131 131
 	}
132 132
 }
Please login to merge, or discard this patch.
lib/private/Memcache/Factory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @return \OCP\IMemcache
131 131
 	 */
132 132
 	public function createLocking($prefix = '') {
133
-		return new $this->lockingCacheClass($this->globalPrefix . '/' . $prefix);
133
+		return new $this->lockingCacheClass($this->globalPrefix.'/'.$prefix);
134 134
 	}
135 135
 
136 136
 	/**
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * @return \OC\Memcache\Cache
141 141
 	 */
142 142
 	public function createDistributed($prefix = '') {
143
-		return new $this->distributedCacheClass($this->globalPrefix . '/' . $prefix);
143
+		return new $this->distributedCacheClass($this->globalPrefix.'/'.$prefix);
144 144
 	}
145 145
 
146 146
 	/**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	 * @return \OC\Memcache\Cache
151 151
 	 */
152 152
 	public function createLocal($prefix = '') {
153
-		return new $this->localCacheClass($this->globalPrefix . '/' . $prefix);
153
+		return new $this->localCacheClass($this->globalPrefix.'/'.$prefix);
154 154
 	}
155 155
 
156 156
 	/**
Please login to merge, or discard this patch.
lib/private/Memcache/CASTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,13 +41,13 @@
 block discarded – undo
41 41
 	 */
42 42
 	public function cas($key, $old, $new) {
43 43
 		//no native cas, emulate with locking
44
-		if ($this->add($key . '_lock', true)) {
44
+		if ($this->add($key.'_lock', true)) {
45 45
 			if ($this->get($key) === $old) {
46 46
 				$this->set($key, $new);
47
-				$this->remove($key . '_lock');
47
+				$this->remove($key.'_lock');
48 48
 				return true;
49 49
 			} else {
50
-				$this->remove($key . '_lock');
50
+				$this->remove($key.'_lock');
51 51
 				return false;
52 52
 			}
53 53
 		} else {
Please login to merge, or discard this patch.
lib/private/Memcache/APCu.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	use CADTrait;
38 38
 
39 39
 	public function get($key) {
40
-		$result = apcu_fetch($this->getPrefix() . $key, $success);
40
+		$result = apcu_fetch($this->getPrefix().$key, $success);
41 41
 		if (!$success) {
42 42
 			return null;
43 43
 		}
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	public function set($key, $value, $ttl = 0) {
48
-		return apcu_store($this->getPrefix() . $key, $value, $ttl);
48
+		return apcu_store($this->getPrefix().$key, $value, $ttl);
49 49
 	}
50 50
 
51 51
 	public function hasKey($key) {
52
-		return apcu_exists($this->getPrefix() . $key);
52
+		return apcu_exists($this->getPrefix().$key);
53 53
 	}
54 54
 
55 55
 	public function remove($key) {
56
-		return apcu_delete($this->getPrefix() . $key);
56
+		return apcu_delete($this->getPrefix().$key);
57 57
 	}
58 58
 
59 59
 	public function clear($prefix = '') {
60
-		$ns = $this->getPrefix() . $prefix;
60
+		$ns = $this->getPrefix().$prefix;
61 61
 		$ns = preg_quote($ns, '/');
62
-		if(class_exists('\APCIterator')) {
63
-			$iter = new \APCIterator('user', '/^' . $ns . '/', APC_ITER_KEY);
62
+		if (class_exists('\APCIterator')) {
63
+			$iter = new \APCIterator('user', '/^'.$ns.'/', APC_ITER_KEY);
64 64
 		} else {
65
-			$iter = new \APCUIterator('/^' . $ns . '/', APC_ITER_KEY);
65
+			$iter = new \APCUIterator('/^'.$ns.'/', APC_ITER_KEY);
66 66
 		}
67 67
 		return apcu_delete($iter);
68 68
 	}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 * @return bool
77 77
 	 */
78 78
 	public function add($key, $value, $ttl = 0) {
79
-		return apcu_add($this->getPrefix() . $key, $value, $ttl);
79
+		return apcu_add($this->getPrefix().$key, $value, $ttl);
80 80
 	}
81 81
 
82 82
 	/**
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 		 * see https://github.com/krakjoe/apcu/issues/183#issuecomment-244038221
101 101
 		 * for details
102 102
 		 */
103
-		return apcu_exists($this->getPrefix() . $key)
104
-			? apcu_inc($this->getPrefix() . $key, $step)
103
+		return apcu_exists($this->getPrefix().$key)
104
+			? apcu_inc($this->getPrefix().$key, $step)
105 105
 			: false;
106 106
 	}
107 107
 
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 		 * see https://github.com/krakjoe/apcu/issues/183#issuecomment-244038221
126 126
 		 * for details
127 127
 		 */
128
-		return apcu_exists($this->getPrefix() . $key)
129
-			? apcu_dec($this->getPrefix() . $key, $step)
128
+		return apcu_exists($this->getPrefix().$key)
129
+			? apcu_dec($this->getPrefix().$key, $step)
130 130
 			: false;
131 131
 	}
132 132
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	public function cas($key, $old, $new) {
142 142
 		// apc only does cas for ints
143 143
 		if (is_int($old) and is_int($new)) {
144
-			return apcu_cas($this->getPrefix() . $key, $old, $new);
144
+			return apcu_cas($this->getPrefix().$key, $old, $new);
145 145
 		} else {
146 146
 			return $this->casEmulated($key, $old, $new);
147 147
 		}
Please login to merge, or discard this patch.