Passed
Push — dev ( d62152...d10d14 )
by Salim
03:23
created
src/models/Documentation.php 1 patch
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,12 +60,19 @@
 block discarded – undo
60 60
      */
61 61
     
62 62
     public function isDocumentationAllowedForRole(String $role){
63
-        if($role==User::INVESTIGATOR) return $this->accessInvestigator;
64
-        else if($role==User::CONTROLLER) return $this->accessController;
65
-        else if($role==User::MONITOR) return $this->accessMonitor;
66
-        else if($role==User::REVIEWER) return $this->accessReviewer;
67
-        else if($role==User::SUPERVISOR) return true;
68
-        else return false;
63
+        if($role==User::INVESTIGATOR) {
64
+        	return $this->accessInvestigator;
65
+        } else if($role==User::CONTROLLER) {
66
+        	return $this->accessController;
67
+        } else if($role==User::MONITOR) {
68
+        	return $this->accessMonitor;
69
+        } else if($role==User::REVIEWER) {
70
+        	return $this->accessReviewer;
71
+        } else if($role==User::SUPERVISOR) {
72
+        	return true;
73
+        } else {
74
+        	return false;
75
+        }
69 76
     }
70 77
     
71 78
     /**
Please login to merge, or discard this patch.
src/models/Patient.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             require_once($specificObjectFile);
149 149
             $objectName=$this->patientStudy."_Patient_Visit_Manager";
150 150
             return new $objectName($this, $visitGroupObject, $this->linkpdo);
151
-        }else{
151
+        } else{
152 152
             return new Patient_Visit_Manager($this, $visitGroupObject, $this->linkpdo);
153 153
         }
154 154
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         foreach($possiblevisitsGroups as $visitGroup){
208 208
             try{
209 209
                 $availableVisits=$this->getPatientVisitManager($visitGroup)->getAvailableVisitsToCreate();
210
-            }catch (Exception $e){
210
+            } catch (Exception $e){
211 211
                 $availableVisits=array($e->getMessage());
212 212
             }
213 213
 
Please login to merge, or discard this patch.
src/models/Group_Visit_Manager.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,9 @@
 block discarded – undo
124 124
             $visitObject = new Visit($visitId, $this->linkpdo);
125 125
 
126 126
             if (!empty($username)) {
127
-                if ($visitObject->isAwaitingReviewForReviewerUser($username)) $visitObjectArray[] = $visitObject;
127
+                if ($visitObject->isAwaitingReviewForReviewerUser($username)) {
128
+                	$visitObjectArray[] = $visitObject;
129
+                }
128 130
             } else {
129 131
                 $visitObjectArray[] = $visitObject;
130 132
             }
Please login to merge, or discard this patch.
src/models/Orthanc_Serie.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
 		
144 144
 		if(in_array($this->sopClassUid, $scUids)){
145 145
 			return true;
146
-		}else {
146
+		} else {
147 147
 			return false;
148 148
 		}
149 149
 		
Please login to merge, or discard this patch.
src/models/Session.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
             session_unset();     // unset $_SESSION variable for the run-time
48 48
             session_destroy();   // destroy session data in storage
49 49
             self::redirectAndEndScript();
50
-        }else if(empty($_SESSION)){
50
+        } else if(empty($_SESSION)){
51 51
             //if session already empty
52 52
             self::redirectAndEndScript();
53
-        }else{
53
+        } else{
54 54
             $_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
55 55
         }
56 56
         
@@ -84,14 +84,16 @@  discard block
 block discarded – undo
84 84
         //Instanciate PDO connexion with SSL or not
85 85
         if(DATABASE_SSL){
86 86
             $linkpdo= new PDO('mysql:host='.DATABASE_HOST.';dbname='.DATABASE_NAME.';charset=UTF8', ''.DATABASE_USERNAME.'', ''.DATABASE_PASSWORD.'', self::getSSLPDOArrayOptions() );    
87
-        }else{
87
+        } else{
88 88
             $linkpdo= new PDO('mysql:host='.DATABASE_HOST.';dbname='.DATABASE_NAME.';charset=UTF8', ''.DATABASE_USERNAME.'', ''.DATABASE_PASSWORD.'');   
89 89
         }
90 90
 
91 91
         $linkpdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
92 92
         
93 93
         //Load preferences from the database
94
-        if(! defined('GAELO_PATIENT_CODE_LENGHT') ) Session::loadPreferencesInConstants($linkpdo);
94
+        if(! defined('GAELO_PATIENT_CODE_LENGHT') ) {
95
+        	Session::loadPreferencesInConstants($linkpdo);
96
+        }
95 97
         
96 98
         return $linkpdo;
97 99
     }
@@ -121,7 +123,7 @@  discard block
 block discarded – undo
121 123
             $log->pushHandler(new RotatingFileHandler($_SERVER["DOCUMENT_ROOT"].'/data/logs/gaelO.log', Logger::INFO));
122 124
             $log->pushProcessor(new WebProcessor());
123 125
             $log->info($stringInfo);
124
-        }else{
126
+        } else{
125 127
             error_log("Can't write logs folder");
126 128
         }
127 129
     }
Please login to merge, or discard this patch.
src/models/Tracker.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
                 'role' => $role
35 35
             ));
36 36
            
37
-        }else{
37
+        } else{
38 38
             $queryTracker = $linkpdo->prepare('SELECT * FROM tracker WHERE study = :study AND role=:role');
39 39
             $queryTracker->execute(array('study' => $study,
40 40
                 'role' => $role,
Please login to merge, or discard this patch.
src/models/Import_Patient.php 1 patch
Braces   +15 added lines, -14 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
 			    if(GAELO_DATE_FORMAT=='m.d.Y'){
59 59
 			    	$birthDay=intval($birthDateArray[1]);
60 60
 			    	$birthMonth=intval($birthDateArray[0]);
61
-			    }
62
-			    else if(GAELO_DATE_FORMAT=='d.m.Y'){
61
+			    } else if(GAELO_DATE_FORMAT=='d.m.Y'){
63 62
 			    	$birthDay=intval($birthDateArray[0]);
64 63
 			    	$birthMonth=intval($birthDateArray[1]);
65 64
 			    }
@@ -71,8 +70,7 @@  discard block
 block discarded – undo
71 70
 				//Store the patient result import process in this object
72 71
 				if ($insertddb){
73 72
 						$this->sucessList[] = $patientNumber;
74
-				}
75
-				else{
73
+				} else{
76 74
 					$patientFailed['PatientNumber']=$patientNumber;
77 75
 					$patientFailed['Reason']="Can't write to DB, wrong date or other wrong input";
78 76
 					$this->failList[]=$patientFailed;
@@ -84,8 +82,7 @@  discard block
 block discarded – undo
84 82
 				if(!$isExistingCenter) {
85 83
 				    if( empty($patientInvestigatorNumCenter) ){
86 84
 				        $this->failList['Missing Num Center'][]=$patientNumber;
87
-				    }
88
-				    else {
85
+				    } else {
89 86
 				        $this->failList['Unknown Center'][]=$patientNumber;
90 87
 				    }
91 88
 
@@ -117,8 +114,7 @@  discard block
 block discarded – undo
117 114
 	    if(GAELO_DATE_FORMAT=='m.d.Y'){
118 115
 	        $registrationDay=intval($dateNbArray[1]);
119 116
 	        $registrationMonth=intval($dateNbArray[0]);
120
-	    }
121
-	    else if(GAELO_DATE_FORMAT=='d.m.Y'){
117
+	    } else if(GAELO_DATE_FORMAT=='d.m.Y'){
122 118
 	        $registrationDay=intval($dateNbArray[0]);
123 119
 	        $registrationMonth=intval($dateNbArray[1]);
124 120
 	    }
@@ -148,7 +144,7 @@  discard block
 block discarded – undo
148 144
 	private function isNewPatient($patientCode){
149 145
 	    try{
150 146
 	        new Patient($patientCode, $this->linkpdo);
151
-	    }catch(Exception $e1){
147
+	    } catch(Exception $e1){
152 148
 	        return true;
153 149
 	    }
154 150
 	    
@@ -176,11 +172,13 @@  discard block
 block discarded – undo
176 172
      * @return boolean
177 173
      */
178 174
 	private function isExistingCenter($patientNumCenter){
179
-	    if(is_null($patientNumCenter) || strlen($patientNumCenter)==0) return false;
175
+	    if(is_null($patientNumCenter) || strlen($patientNumCenter)==0) {
176
+	    	return false;
177
+	    }
180 178
 	    
181 179
 	    try{
182 180
 	        new Center($this->linkpdo, $patientNumCenter);
183
-	    }catch(Exception $e1){
181
+	    } catch(Exception $e1){
184 182
 	        return false;
185 183
 	    }
186 184
 	    
@@ -250,11 +248,14 @@  discard block
 block discarded – undo
250 248
 	        foreach ($this->failList as $key=>$value){
251 249
 	            if(! empty($value)){
252 250
 	                $failReport=$failReport.$key.':<br>';
253
-	                if(is_array($value)) $failReport=$failReport.implode('<br>',$value).'<br>';
254
-	                else $failReport=$failReport.$value.'<br>';
251
+	                if(is_array($value)) {
252
+	                	$failReport=$failReport.implode('<br>',$value).'<br>';
253
+	                } else {
254
+	                	$failReport=$failReport.$value.'<br>';
255
+	                }
255 256
 	            }
256 257
 	        }
257
-	    }else{
258
+	    } else{
258 259
 	        $failReport=$failReport.' None <br>' ;
259 260
 	    }
260 261
 	    
Please login to merge, or discard this patch.
src/models/Fill_Orthanc_Table.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
                 }
65 65
                 $this->visitObject->changeUploadStatus(Visit::DONE, $this->username);
66 66
                 
67
-            }catch(Exception $e1){
67
+            } catch(Exception $e1){
68 68
                 throw new Exception("Error during import ".$e1->getMessage());
69 69
             }
70
-        }else{
70
+        } else{
71 71
             throw new Exception("Error during import Study Already Known");
72 72
         }
73 73
     }
@@ -267,12 +267,12 @@  discard block
 block discarded – undo
267 267
             if($dateObject!==false){
268 268
                 $parsedDateTime=$dateObject->format('H:i:s');
269 269
             }
270
-        }else if($type==1){
270
+        } else if($type==1){
271 271
             $dateObject=DateTime::createFromFormat('Ymd', $string);
272 272
             if($dateObject!==false){
273 273
                 $parsedDateTime=$dateObject->format('Y-m-d');
274 274
             }
275
-        }else if($type==0){
275
+        } else if($type==0){
276 276
             $dateObject=DateTime::createFromFormat('YmdHis', $string);
277 277
             if($dateObject!==false){
278 278
                 $parsedDateTime=$dateObject->format('Y-m-d H:i:s');
Please login to merge, or discard this patch.
src/models/Orthanc_Study.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 	    			)
56 56
 	    	);
57 57
 	    	
58
-	    }else{
58
+	    } else{
59 59
 	    	$this->url=$url;
60 60
 	    	$this->context = $context;	
61 61
 	    }
Please login to merge, or discard this patch.