Passed
Push — dev ( 245ae2...b33a8e )
by Salim
32:28 queued 10:37
created
src/scripts/validate_dicom_upload_tus.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -146,13 +146,13 @@  discard block
 block discarded – undo
146 146
 		//Log import
147 147
 		Tracker::logActivity($username, $role, $study, $visitObject->id_visit, "Upload Series", $logDetails);
148 148
 	
149
-	}catch (Throwable $e1) {
149
+	} catch (Throwable $e1) {
150 150
 		error_log($e1->getMessage());
151 151
 		handleException($e1);
152 152
 	}
153 153
 		
154 154
 
155
-}else {
155
+} else {
156 156
 	header('HTTP/1.0 403 Forbidden');
157 157
 	die('You are not allowed to access this file.');
158 158
 }
@@ -207,11 +207,11 @@  discard block
 block discarded – undo
207 207
 	
208 208
 	if (count($importedMap) == 1 && $importedInstances == $nbOfInstances) {
209 209
 		return $importedMap;
210
-	}else {
210
+	} else {
211 211
 		//These error shall never occur
212 212
 		if (count($importedMap) > 1) {
213 213
 			throw new Exception("More than one study in Zip");
214
-		}else if ($importedInstances != $nbOfInstances) {
214
+		} else if ($importedInstances != $nbOfInstances) {
215 215
 			throw new Exception("Imported DICOM not matching announced number of Instances");
216 216
 			
217 217
 		}
@@ -227,8 +227,11 @@  discard block
 block discarded – undo
227 227
 	$it=new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS);
228 228
 	$it=new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
229 229
 	foreach ($it as $file) {
230
-		if ($file->isDir()) rmdir($file->getPathname());
231
-		else unlink($file->getPathname());
230
+		if ($file->isDir()) {
231
+			rmdir($file->getPathname());
232
+		} else {
233
+			unlink($file->getPathname());
234
+		}
232 235
 	}
233 236
 	rmdir($directory);
234 237
 }
Please login to merge, or discard this patch.