Passed
Push — master ( f0dd71...c56a27 )
by Christoph
11:49 queued 12s
created
apps/files_external/lib/Service/StoragesService.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
 	}
73 73
 
74 74
 	protected function getStorageConfigFromDBMount(array $mount) {
75
-		$applicableUsers = array_filter($mount['applicable'], function ($applicable) {
75
+		$applicableUsers = array_filter($mount['applicable'], function($applicable) {
76 76
 			return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_USER;
77 77
 		});
78
-		$applicableUsers = array_map(function ($applicable) {
78
+		$applicableUsers = array_map(function($applicable) {
79 79
 			return $applicable['value'];
80 80
 		}, $applicableUsers);
81 81
 
82
-		$applicableGroups = array_filter($mount['applicable'], function ($applicable) {
82
+		$applicableGroups = array_filter($mount['applicable'], function($applicable) {
83 83
 			return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_GROUP;
84 84
 		});
85
-		$applicableGroups = array_map(function ($applicable) {
85
+		$applicableGroups = array_map(function($applicable) {
86 86
 			return $applicable['value'];
87 87
 		}, $applicableGroups);
88 88
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 				$mount['priority']
99 99
 			);
100 100
 			$config->setType($mount['type']);
101
-			$config->setId((int)$mount['mount_id']);
101
+			$config->setId((int) $mount['mount_id']);
102 102
 			return $config;
103 103
 		} catch (\UnexpectedValueException $e) {
104 104
 			// don't die if a storage backend doesn't exist
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
 	protected function readConfig() {
127 127
 		$mounts = $this->readDBConfig();
128 128
 		$configs = array_map([$this, 'getStorageConfigFromDBMount'], $mounts);
129
-		$configs = array_filter($configs, function ($config) {
129
+		$configs = array_filter($configs, function($config) {
130 130
 			return $config instanceof StorageConfig;
131 131
 		});
132 132
 
133
-		$keys = array_map(function (StorageConfig $config) {
133
+		$keys = array_map(function(StorageConfig $config) {
134 134
 			return $config->getId();
135 135
 		}, $configs);
136 136
 
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 		$mount = $this->dbConfig->getMountById($id);
150 150
 
151 151
 		if (!is_array($mount)) {
152
-			throw new NotFoundException('Storage with ID "' . $id . '" not found');
152
+			throw new NotFoundException('Storage with ID "'.$id.'" not found');
153 153
 		}
154 154
 
155 155
 		$config = $this->getStorageConfigFromDBMount($mount);
156 156
 		if ($this->isApplicable($config)) {
157 157
 			return $config;
158 158
 		} else {
159
-			throw new NotFoundException('Storage with ID "' . $id . '" not found');
159
+			throw new NotFoundException('Storage with ID "'.$id.'" not found');
160 160
 		}
161 161
 	}
162 162
 
@@ -379,13 +379,13 @@  discard block
 block discarded – undo
379 379
 		$existingMount = $this->dbConfig->getMountById($id);
380 380
 
381 381
 		if (!is_array($existingMount)) {
382
-			throw new NotFoundException('Storage with ID "' . $id . '" not found while updating storage');
382
+			throw new NotFoundException('Storage with ID "'.$id.'" not found while updating storage');
383 383
 		}
384 384
 
385 385
 		$oldStorage = $this->getStorageConfigFromDBMount($existingMount);
386 386
 
387 387
 		if ($oldStorage->getBackend() instanceof InvalidBackend) {
388
-			throw new NotFoundException('Storage with id "' . $id . '" cannot be edited due to missing backend');
388
+			throw new NotFoundException('Storage with id "'.$id.'" cannot be edited due to missing backend');
389 389
 		}
390 390
 
391 391
 		$removedUsers = array_diff($oldStorage->getApplicableUsers(), $updatedStorage->getApplicableUsers());
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 		$existingMount = $this->dbConfig->getMountById($id);
463 463
 
464 464
 		if (!is_array($existingMount)) {
465
-			throw new NotFoundException('Storage with ID "' . $id . '" not found');
465
+			throw new NotFoundException('Storage with ID "'.$id.'" not found');
466 466
 		}
467 467
 
468 468
 		$this->dbConfig->removeMount($id);
Please login to merge, or discard this patch.
apps/workflowengine/lib/Controller/RequestTime.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 		$timezones = \DateTimeZone::listIdentifiers();
37 37
 
38 38
 		if ($search !== '') {
39
-			$timezones = array_filter($timezones, function ($timezone) use ($search) {
39
+			$timezones = array_filter($timezones, function($timezone) use ($search) {
40 40
 				return stripos($timezone, $search) !== false;
41 41
 			});
42 42
 		}
Please login to merge, or discard this patch.
core/Command/Integrity/CheckApp.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,10 +63,10 @@
 block discarded – undo
63 63
 	 */
64 64
 	protected function execute(InputInterface $input, OutputInterface $output) {
65 65
 		$appid = $input->getArgument('appid');
66
-		$path = (string)$input->getOption('path');
66
+		$path = (string) $input->getOption('path');
67 67
 		$result = $this->checker->verifyAppSignature($appid, $path);
68 68
 		$this->writeArrayInOutputFormat($input, $output, $result);
69
-		if (count($result)>0){
69
+		if (count($result) > 0) {
70 70
 			return 1;
71 71
 		}
72 72
 	}
Please login to merge, or discard this patch.
lib/public/Collaboration/Collaborators/SearchResultType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@
 block discarded – undo
58 58
 	 * @since 13.0.0
59 59
 	 */
60 60
 	protected function getValidatedType($type) {
61
-		$type = trim((string)$type);
61
+		$type = trim((string) $type);
62 62
 
63
-		if($type === '') {
63
+		if ($type === '') {
64 64
 			throw new \InvalidArgumentException('Type must not be empty');
65 65
 		}
66 66
 
67
-		if($type === 'exact') {
67
+		if ($type === 'exact') {
68 68
 			throw new \InvalidArgumentException('Provided type is a reserved word');
69 69
 		}
70 70
 
Please login to merge, or discard this patch.
apps/user_ldap/lib/Command/Search.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -90,16 +90,16 @@  discard block
 block discarded – undo
90 90
 	 * @throws \InvalidArgumentException
91 91
 	 */
92 92
 	protected function validateOffsetAndLimit($offset, $limit) {
93
-		if($limit < 0) {
93
+		if ($limit < 0) {
94 94
 			throw new \InvalidArgumentException('limit must be  0 or greater');
95 95
 		}
96
-		if($offset  < 0) {
96
+		if ($offset < 0) {
97 97
 			throw new \InvalidArgumentException('offset must be 0 or greater');
98 98
 		}
99
-		if($limit === 0 && $offset !== 0) {
99
+		if ($limit === 0 && $offset !== 0) {
100 100
 			throw new \InvalidArgumentException('offset must be 0 if limit is also set to 0');
101 101
 		}
102
-		if($offset > 0 && ($offset % $limit !== 0)) {
102
+		if ($offset > 0 && ($offset % $limit !== 0)) {
103 103
 			throw new \InvalidArgumentException('offset must be a multiple of limit');
104 104
 		}
105 105
 	}
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
 		$configPrefixes = $helper->getServerConfigurationPrefixes(true);
110 110
 		$ldapWrapper = new LDAP();
111 111
 
112
-		$offset = (int)$input->getOption('offset');
113
-		$limit = (int)$input->getOption('limit');
112
+		$offset = (int) $input->getOption('offset');
113
+		$limit = (int) $input->getOption('limit');
114 114
 		$this->validateOffsetAndLimit($offset, $limit);
115 115
 
116
-		if($input->getOption('group')) {
116
+		if ($input->getOption('group')) {
117 117
 			$proxy = new Group_Proxy($configPrefixes, $ldapWrapper, \OC::$server->query('LDAPGroupPluginManager'));
118 118
 			$getMethod = 'getGroups';
119 119
 			$printID = false;
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 		}
137 137
 
138 138
 		$result = $proxy->$getMethod($input->getArgument('search'), $limit, $offset);
139
-		foreach($result as $id => $name) {
140
-			$line = $name . ($printID ? ' ('.$id.')' : '');
139
+		foreach ($result as $id => $name) {
140
+			$line = $name.($printID ? ' ('.$id.')' : '');
141 141
 			$output->writeln($line);
142 142
 		}
143 143
 	}
Please login to merge, or discard this patch.
apps/user_ldap/lib/Migration/UUIDFixInsert.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function run(IOutput $output) {
73 73
 		$installedVersion = $this->config->getAppValue('user_ldap', 'installed_version', '1.2.1');
74
-		if(version_compare($installedVersion, '1.2.1') !== -1) {
74
+		if (version_compare($installedVersion, '1.2.1') !== -1) {
75 75
 			return;
76 76
 		}
77 77
 
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
 			do {
83 83
 				$retry = false;
84 84
 				$records = $mapper->getList($offset, $batchSize);
85
-				if(count($records) === 0){
85
+				if (count($records) === 0) {
86 86
 					continue;
87 87
 				}
88 88
 				try {
89 89
 					$this->jobList->add($jobClass, ['records' => $records]);
90 90
 					$offset += $batchSize;
91 91
 				} catch (\InvalidArgumentException $e) {
92
-					if(strpos($e->getMessage(), 'Background job arguments can\'t exceed 4000') !== false) {
93
-						$batchSize = (int)floor(count($records) * 0.8);
92
+					if (strpos($e->getMessage(), 'Background job arguments can\'t exceed 4000') !== false) {
93
+						$batchSize = (int) floor(count($records) * 0.8);
94 94
 						$retry = true;
95 95
 					}
96 96
 				}
Please login to merge, or discard this patch.
apps/files_sharing/lib/Updater.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,11 +90,11 @@
 block discarded – undo
90 90
 	 */
91 91
 	static private function renameChildren($oldPath, $newPath) {
92 92
 
93
-		$absNewPath =  \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $newPath);
94
-		$absOldPath =  \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $oldPath);
93
+		$absNewPath = \OC\Files\Filesystem::normalizePath('/'.\OCP\User::getUser().'/files/'.$newPath);
94
+		$absOldPath = \OC\Files\Filesystem::normalizePath('/'.\OCP\User::getUser().'/files/'.$oldPath);
95 95
 
96 96
 		$mountManager = \OC\Files\Filesystem::getMountManager();
97
-		$mountedShares = $mountManager->findIn('/' . \OCP\User::getUser() . '/files/' . $oldPath);
97
+		$mountedShares = $mountManager->findIn('/'.\OCP\User::getUser().'/files/'.$oldPath);
98 98
 		foreach ($mountedShares as $mount) {
99 99
 			if ($mount->getStorage()->instanceOfStorage(ISharedStorage::class)) {
100 100
 				$mountPoint = $mount->getMountPoint();
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/DavAclPlugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 
46 46
 	function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) {
47 47
 		$access = parent::checkPrivileges($uri, $privileges, $recursion, false);
48
-		if($access === false && $throwExceptions) {
48
+		if ($access === false && $throwExceptions) {
49 49
 			/** @var INode $node */
50 50
 			$node = $this->server->tree->getNodeForPath($uri);
51 51
 
52
-			switch(get_class($node)) {
52
+			switch (get_class($node)) {
53 53
 				case AddressBook::class:
54 54
 					$type = 'Addressbook';
55 55
 					break;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	public function propFind(PropFind $propFind, INode $node) {
73 73
 		// If the node is neither readable nor writable then fail unless its of
74 74
 		// the standard user-principal
75
-		if(!($node instanceof User)) {
75
+		if (!($node instanceof User)) {
76 76
 			$path = $propFind->getPath();
77 77
 			$readPermissions = $this->checkPrivileges($path, '{DAV:}read', self::R_PARENT, false);
78 78
 			$writePermissions = $this->checkPrivileges($path, '{DAV:}write', self::R_PARENT, false);
Please login to merge, or discard this patch.
lib/private/App/AppStore/Version/VersionParser.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @return bool
35 35
 	 */
36 36
 	private function isValidVersionString($versionString) {
37
-		return (bool)preg_match('/^[0-9.]+$/', $versionString);
37
+		return (bool) preg_match('/^[0-9.]+$/', $versionString);
38 38
 	}
39 39
 
40 40
 	/**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function getVersion($versionSpec) {
48 48
 		// * indicates that the version is compatible with all versions
49
-		if($versionSpec === '*') {
49
+		if ($versionSpec === '*') {
50 50
 			return new Version('', '');
51 51
 		}
52 52
 
@@ -58,17 +58,17 @@  discard block
 block discarded – undo
58 58
 		$secondVersion = isset($versionElements[1]) ? $versionElements[1] : '';
59 59
 		$secondVersionNumber = substr($secondVersion, 2);
60 60
 
61
-		switch(count($versionElements)) {
61
+		switch (count($versionElements)) {
62 62
 			case 1:
63
-				if(!$this->isValidVersionString($firstVersionNumber)) {
63
+				if (!$this->isValidVersionString($firstVersionNumber)) {
64 64
 					break;
65 65
 				}
66
-				if(strpos($firstVersion, '>') === 0) {
66
+				if (strpos($firstVersion, '>') === 0) {
67 67
 					return new Version($firstVersionNumber, '');
68 68
 				}
69 69
 				return new Version('', $firstVersionNumber);
70 70
 			case 2:
71
-				if(!$this->isValidVersionString($firstVersionNumber) || !$this->isValidVersionString($secondVersionNumber)) {
71
+				if (!$this->isValidVersionString($firstVersionNumber) || !$this->isValidVersionString($secondVersionNumber)) {
72 72
 					break;
73 73
 				}
74 74
 				return new Version($firstVersionNumber, $secondVersionNumber);
Please login to merge, or discard this patch.