Passed
Push — master ( e8097c...9fd6b6 )
by Jonathan
05:26
created
src/Webtrees/Module/GeoDispersion/AdminConfigController.php 1 patch
Braces   +14 added lines, -13 removed lines patch added patch discarded remove patch
@@ -78,7 +78,9 @@  discard block
 block discarded – undo
78 78
         
79 79
         $other_trees = array();
80 80
         foreach (Tree::getAll() as $tree) {
81
-            if($tree->getTreeId() != $wt_tree->getTreeId()) $other_trees[] = $tree;
81
+            if($tree->getTreeId() != $wt_tree->getTreeId()) {
82
+            	$other_trees[] = $tree;
83
+            }
82 84
         }      
83 85
         $data->set('other_trees', $other_trees);
84 86
         
@@ -177,7 +179,9 @@  discard block
 block discarded – undo
177 179
         
178 180
         // Generate an AJAX/JSON response for datatables to load a block of rows
179 181
         $search = Filter::postArray('search');
180
-        if($search) $search = $search['value'];
182
+        if($search) {
183
+        	$search = $search['value'];
184
+        }
181 185
         $start  = Filter::postInteger('start');
182 186
         $length = Filter::postInteger('length');
183 187
         $order  = Filter::postArray('order');
@@ -259,8 +263,7 @@  discard block
 block discarded – undo
259 263
     		            $datum[7] .= $top_level . '(' . $place_hierarchy['hierarchy'][$top_level - 1] . ')';
260 264
     		        }
261 265
     		        $datum[7] .= '</span>';
262
-		        }
263
-		        else {
266
+		        } else {
264 267
 		            $datum[6] = I18N::translate('Error when loading map.');
265 268
 		        }
266 269
 		    }
@@ -335,8 +338,7 @@  discard block
 block discarded – undo
335 338
                     if($use_map) {
336 339
                         $options->setMap(new OutlineMap($map_file));
337 340
                         $options->setMapLevel($map_top_level + 1);
338
-                    }
339
-                    else {
341
+                    } else {
340 342
                         $options->setMap(null);
341 343
                     }
342 344
                 }
@@ -347,8 +349,7 @@  discard block
 block discarded – undo
347 349
 					Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$res->getId().'” has been updated.');
348 350
 					$ga = $res;
349 351
 					$success = true;
350
-				}
351
-				else {
352
+				} else {
352 353
 					FlashMessages::addMessage(I18N::translate('An error occured while updating the geographical dispersion analysis “%s”', $ga->getTitle()), 'danger');
353 354
 					Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'. $ga->getId() .'” could not be updated. See error log.');
354 355
 				}
@@ -366,8 +367,7 @@  discard block
 block discarded – undo
366 367
 				FlashMessages::addMessage(I18N::translate('The geographical dispersion analysis “%s” has been successfully added.', $ga->getTitle()), 'success');
367 368
 				Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$ga->getId().'” has been added.');
368 369
 				$success = true;
369
-			}
370
-			else {
370
+			} else {
371 371
 				FlashMessages::addMessage(I18N::translate('An error occured while adding the geographical dispersion analysis “%s”', $description), 'danger');
372 372
 				Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis “'.$description.'” could not be added. See error log.');
373 373
 			}
@@ -377,8 +377,7 @@  discard block
 block discarded – undo
377 377
         if(!$success) {			
378 378
             if($ga) {
379 379
                 $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@edit&ga_id='. $ga->getId() .'&ged=' . $wt_tree->getNameUrl();
380
-            }
381
-            else {
380
+            } else {
382 381
                 $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@add&ged=' . $wt_tree->getNameUrl();
383 382
             }
384 383
         }        
@@ -435,7 +434,9 @@  discard block
 block discarded – undo
435 434
         $data->set('map_list', $map_list);
436 435
     
437 436
         $gen_details = array(0 => I18N::translate('All'));
438
-        for($i = 1; $i <= 10 ; $i++) $gen_details[$i] = $i;
437
+        for($i = 1; $i <= 10 ; $i++) {
438
+        	$gen_details[$i] = $i;
439
+        }
439 440
         $data->set('generation_details', $gen_details);
440 441
     
441 442
         ViewFactory::make('GeoAnalysisEdit', $this, $controller, $data)->render();
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Model/OutlineMap.php 1 patch
Braces   +25 added lines, -10 removed lines patch added patch discarded remove patch
@@ -71,7 +71,9 @@  discard block
 block discarded – undo
71 71
         $this->is_loaded = false;
72 72
         $this->subdivisions = array();
73 73
         $this->mappings = array();
74
-        if($load) $this->load();
74
+        if($load) {
75
+        	$this->load();
76
+        }
75 77
     }
76 78
     
77 79
     /**
@@ -118,7 +120,9 @@  discard block
 block discarded – undo
118 120
                 foreach($xml->subdivisions->children() as $subdivision){
119 121
                     $attributes = $subdivision->attributes();
120 122
                     $key = I18N::strtolower(trim($attributes['name']));
121
-                    if(isset($attributes['parent'])) $key .= '@'. I18N::strtolower(trim($attributes['parent']));
123
+                    if(isset($attributes['parent'])) {
124
+                    	$key .= '@'. I18N::strtolower(trim($attributes['parent']));
125
+                    }
122 126
                     $this->subdivisions[$key] = array(
123 127
                         'id' => trim($attributes['id']),
124 128
                         'displayname' => trim($attributes['name']),
@@ -145,9 +149,10 @@  discard block
 block discarded – undo
145 149
      */
146 150
     public function isLoaded() {
147 151
         try{
148
-            if(!$this->is_loaded) $this->load();
149
-        }
150
-        catch (\Exception $ex) { }
152
+            if(!$this->is_loaded) {
153
+            	$this->load();
154
+            }
155
+        } catch (\Exception $ex) { }
151 156
         return $this->is_loaded;
152 157
     }
153 158
     
@@ -164,7 +169,9 @@  discard block
 block discarded – undo
164 169
 	 * @return string
165 170
 	 */
166 171
     public function getDescription() {
167
-        if(!$this->is_loaded) $this->load();
172
+        if(!$this->is_loaded) {
173
+        	$this->load();
174
+        }
168 175
         return $this->description;
169 176
     }
170 177
     
@@ -173,7 +180,9 @@  discard block
 block discarded – undo
173 180
 	 * @return string
174 181
 	 */
175 182
     public function getTopLevelName() {
176
-        if(!$this->is_loaded) $this->load();
183
+        if(!$this->is_loaded) {
184
+        	$this->load();
185
+        }
177 186
         return $this->top_level_name;
178 187
     }    
179 188
     
@@ -182,7 +191,9 @@  discard block
 block discarded – undo
182 191
      * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\OutlineMapCanvas
183 192
      */
184 193
     public function getCanvas() {
185
-        if(!$this->is_loaded) $this->load();
194
+        if(!$this->is_loaded) {
195
+        	$this->load();
196
+        }
186 197
         return $this->canvas;
187 198
     }
188 199
     
@@ -191,7 +202,9 @@  discard block
 block discarded – undo
191 202
      * @return array
192 203
      */
193 204
     public function getSubdivisions() {
194
-        if(!$this->is_loaded) $this->load();
205
+        if(!$this->is_loaded) {
206
+        	$this->load();
207
+        }
195 208
         return $this->subdivisions;
196 209
     }
197 210
     
@@ -200,7 +213,9 @@  discard block
 block discarded – undo
200 213
      * @return array
201 214
      */
202 215
     public function getPlacesMappings() {
203
-        if(!$this->is_loaded) $this->load();
216
+        if(!$this->is_loaded) {
217
+        	$this->load();
218
+        }
204 219
         return $this->mappings;
205 220
     }
206 221
     
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/GeoAnalysisController.php 1 patch
Braces   +28 added lines, -21 removed lines patch added patch discarded remove patch
@@ -144,14 +144,15 @@  discard block
 block discarded – undo
144 144
             $this->provider->setGeoAnalysisStatus($ga, $status);
145 145
             $res['status'] = $status;
146 146
 			Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" has been '. ($status ? 'enabled' : 'disabled') .'.');
147
-        }
148
-        catch (\Exception $ex) {
147
+        } catch (\Exception $ex) {
149 148
             $res['error'] = $ex->getMessage();
150 149
 			Log::addErrorLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" could not be ' . ($status ? 'enabled' : 'disabled') .'. Error: '. $ex->getMessage());
151 150
         }
152 151
         
153 152
         $controller->pageHeader();
154
-        if($res['error']) http_response_code(500);
153
+        if($res['error']) {
154
+        	http_response_code(500);
155
+        }
155 156
         
156 157
         $controller->encode($res);
157 158
     }
@@ -175,14 +176,15 @@  discard block
 block discarded – undo
175 176
         try{
176 177
             $this->provider->deleteGeoAnalysis($ga);
177 178
 			Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" has been deleted.');
178
-        }
179
-        catch (\Exception $ex) {
179
+        } catch (\Exception $ex) {
180 180
             $res['error'] = $ex->getMessage();
181 181
 			Log::addErrorLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" could not be deleted. Error: '. $ex->getMessage());
182 182
         }
183 183
     
184 184
         $controller->pageHeader();
185
-        if($res['error']) http_response_code(500);
185
+        if($res['error']) {
186
+        	http_response_code(500);
187
+        }
186 188
 
187 189
         $controller->encode($res);
188 190
     }
@@ -234,7 +236,9 @@  discard block
 block discarded – undo
234 236
             
235 237
             $nb_found = $placesGeneralResults['knownsum'];
236 238
             $nb_other = 0;
237
-            if(isset($placesGeneralResults['other'])) $nb_other =$placesGeneralResults['other'];
239
+            if(isset($placesGeneralResults['other'])) {
240
+            	$nb_other =$placesGeneralResults['other'];
241
+            }
238 242
             $nb_unknown = $placesGeneralResults['unknown'];
239 243
             
240 244
             $data->set('stats_gen_nb_found', $nb_found);
@@ -255,12 +259,13 @@  discard block
 block discarded – undo
255 259
                         if($level_map >= 0 && $level_map < count($levelvalues)) {
256 260
                             $levelref = I18N::strtolower($levelvalues[0] . '@' . $levelvalues[$level_map]);
257 261
                             if(!isset($results_by_subdivs[$levelref])) { $levelref = $levelvalues[0]; }
258
-                        }
259
-                        else {
262
+                        } else {
260 263
                             $levelref = $levelvalues[0];
261 264
                         }
262 265
                         $levelref = I18N::strtolower($levelref);
263
-                        if(isset($places_mappings[$levelref])) $levelref = $places_mappings[$levelref];
266
+                        if(isset($places_mappings[$levelref])) {
267
+                        	$levelref = $places_mappings[$levelref];
268
+                        }
264 269
                         if(isset($results_by_subdivs[$levelref])) {
265 270
                             $count_subd = isset($results_by_subdivs[$levelref]['count']) ? $results_by_subdivs[$levelref]['count'] : 0;
266 271
                             $count_subd  += $count;
@@ -278,8 +283,7 @@  discard block
 block discarded – undo
278 283
                 }
279 284
                 
280 285
                 $html = ViewFactory::make('GeoAnalysisTabGeneralMap', $this, new BaseController(), $data)->getHtmlPartial();
281
-            }
282
-            else {
286
+            } else {
283 287
                 $results = $placesGeneralResults['places'];
284 288
                 arsort($results);
285 289
                 $data->set('results', $results);
@@ -287,8 +291,7 @@  discard block
 block discarded – undo
287 291
                 
288 292
                 $html = ViewFactory::make('GeoAnalysisTabGeneralTable', $this, new BaseController(), $data)->getHtmlPartial();
289 293
             }
290
-        }
291
-        else {
294
+        } else {
292 295
             $html = '<p class="warning">' . I18N::translate('No data is available for the general analysis.') . '</p>';
293 296
         }
294 297
         return $html;
@@ -320,9 +323,15 @@  discard block
 block discarded – undo
320 323
                 $sum = 0;
321 324
                 $other = 0;
322 325
                 $unknown = 0;
323
-                if(isset($genData['sum'])) $sum = $genData['sum'];
324
-                if(isset($genData['other'])) $other = $genData['other'];
325
-                if(isset($genData['unknown'])) $unknown = $genData['unknown'];
326
+                if(isset($genData['sum'])) {
327
+                	$sum = $genData['sum'];
328
+                }
329
+                if(isset($genData['other'])) {
330
+                	$other = $genData['other'];
331
+                }
332
+                if(isset($genData['unknown'])) {
333
+                	$unknown = $genData['unknown'];
334
+                }
326 335
                 
327 336
                 if($sum > 0) {                
328 337
                     $results_by_gen[$gen]['sum'] = $sum;
@@ -340,8 +349,7 @@  discard block
 block discarded – undo
340 349
                                 $results_by_gen[$gen]['places'][$placename]['flag'] = $flag;
341 350
                             }
342 351
                         }
343
-                    }
344
-                    else {
352
+                    } else {
345 353
                         $tmp = $genData['places'];
346 354
                         if($other > 0) {
347 355
                             $tmp = array_slice($tmp, 0, 5, true);
@@ -357,8 +365,7 @@  discard block
 block discarded – undo
357 365
             
358 366
             $html = ViewFactory::make('GeoAnalysisTabGenerations', $this, new BaseController(), $data)->getHtmlPartial();
359 367
             
360
-        }
361
-        else {
368
+        } else {
362 369
             $html = '<p class="warning">' . I18N::translate('No data is available for the generations analysis.') . '</p>';
363 370
         }
364 371
         return $html;
Please login to merge, or discard this patch.
src/Webtrees/ImageBuilder.php 1 patch
Braces   +16 added lines, -7 removed lines patch added patch discarded remove patch
@@ -95,7 +95,9 @@  discard block
 block discarded – undo
95 95
 	 * @return ImageBuilder
96 96
 	 */
97 97
 	public function setExpireOffset($expireOffset) {
98
-	    if($expireOffset) $this->expire_offset = $expireOffset;
98
+	    if($expireOffset) {
99
+	    	$this->expire_offset = $expireOffset;
100
+	    }
99 101
 	    return $this;
100 102
 	}
101 103
 	
@@ -115,7 +117,9 @@  discard block
 block discarded – undo
115 117
 	 * @return ImageBuilder
116 118
 	 */
117 119
 	public function setShowWatermark($show_watermark) {
118
-	    if(!is_null($show_watermark)) $this->show_watermark = $show_watermark;
120
+	    if(!is_null($show_watermark)) {
121
+	    	$this->show_watermark = $show_watermark;
122
+	    }
119 123
 	    return $this;
120 124
 	}
121 125
 	
@@ -126,7 +130,9 @@  discard block
 block discarded – undo
126 130
 	 * @return ImageBuilder
127 131
 	 */
128 132
 	public function setFontMaxSize($font_max_size) {
129
-	    if($font_max_size) $this->font_max_size = $font_max_size;
133
+	    if($font_max_size) {
134
+	    	$this->font_max_size = $font_max_size;
135
+	    }
130 136
 	    return $this;
131 137
 	}
132 138
 	
@@ -137,7 +143,9 @@  discard block
 block discarded – undo
137 143
 	 * @return ImageBuilder
138 144
 	 */
139 145
 	public function setFontColor($font_color) {
140
-	    if($font_color) $this->font_color = $font_color;
146
+	    if($font_color) {
147
+	    	$this->font_color = $font_color;
148
+	    }
141 149
 	    return $this;
142 150
 	}
143 151
 	
@@ -148,7 +156,9 @@  discard block
 block discarded – undo
148 156
 	 * @return ImageBuilder
149 157
 	 */
150 158
 	public function setAsAttachment($is_attachement) {
151
-	    if(is_bool($is_attachement)) $this->as_attachment = $is_attachement;
159
+	    if(is_bool($is_attachement)) {
160
+	    	$this->as_attachment = $is_attachement;
161
+	    }
152 162
 	    return $this;
153 163
 	}
154 164
 	
@@ -300,8 +310,7 @@  discard block
 block discarded – undo
300 310
 	    // text to watermark with	    
301 311
 	    if(method_exists($this->media, 'getWatermarkText')) {
302 312
 	       $word1_text = $this->media->getWatermarkText();
303
-	    }
304
-	    else {
313
+	    } else {
305 314
 	        $word1_text = $this->media->getTitle();
306 315
 	    }
307 316
 	
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/SosaStatsController.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,8 +93,12 @@  discard block
 block discarded – undo
93 93
             foreach($stats_gen as $gen => $tab){
94 94
                 $genY1= I18N::translate('-');
95 95
                 $genY2= I18N::translate('-');
96
-                if($tab['firstBirth']>0) $genY1=$tab['firstEstimatedBirth'];
97
-                if($tab['lastBirth']>0) $genY2=$tab['lastEstimatedBirth'];
96
+                if($tab['firstBirth']>0) {
97
+                	$genY1=$tab['firstEstimatedBirth'];
98
+                }
99
+                if($tab['lastBirth']>0) {
100
+                	$genY2=$tab['lastEstimatedBirth'];
101
+                }
98 102
                 $total_theoretical += $gen_theoretical;
99 103
                 $perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical);
100 104
                 $gen_equiv += $perc_sosa_count_theor;
@@ -154,7 +158,9 @@  discard block
 block discarded – undo
154 158
      private function htmlAncestorDispersionG2()
155 159
     {
156 160
         $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2);
157
-        if(count($ancestorsDispGen2) == 0) return;
161
+        if(count($ancestorsDispGen2) == 0) {
162
+        	return;
163
+        }
158 164
         
159 165
         $size = '600x300';
160 166
         
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/Model/SosaProvider.php 1 patch
Braces   +77 added lines, -30 removed lines patch added patch discarded remove patch
@@ -84,21 +84,25 @@  discard block
 block discarded – undo
84 84
      * @param User $user
85 85
      */
86 86
     public function __construct(Tree $tree, User $user = null) {
87
-        if(self::$default_user === null) 
88
-            self::$default_user = User::find(-1);
87
+        if(self::$default_user === null) {
88
+                    self::$default_user = User::find(-1);
89
+        }
89 90
         
90 91
         $this->tree = $tree;
91 92
         $this->user = $user;
92 93
         $this->is_setup = true;
93
-        if($this->user === null) $this->user = Auth::user();
94
-        if(strlen($this->user->getUserId()) == 0) $this->user = self::$default_user;
94
+        if($this->user === null) {
95
+        	$this->user = Auth::user();
96
+        }
97
+        if(strlen($this->user->getUserId()) == 0) {
98
+        	$this->user = self::$default_user;
99
+        }
95 100
         
96 101
         // Check if the user, or the default user, has a root already setup;
97 102
         if(empty($this->getRootIndiId())) {
98 103
             if($this->user == self::$default_user) {  // If the default user is not setup
99 104
                 $this->is_setup = false;
100
-            }
101
-            else {
105
+            } else {
102 106
                 $this->user = self::$default_user;
103 107
                 $this->is_setup = $this->getRootIndiId() === null;
104 108
             }            
@@ -141,7 +145,9 @@  discard block
 block discarded – undo
141 145
      * Remove all Sosa entries related to the gedcom file and user
142 146
      */
143 147
     public function deleteAll() {
144
-        if(!$this->is_setup) return;
148
+        if(!$this->is_setup) {
149
+        	return;
150
+        }
145 151
         Database::prepare(
146 152
             'DELETE FROM `##maj_sosa`'.
147 153
             ' WHERE majs_gedcom_id= :tree_id and majs_user_id = :user_id ')
@@ -157,7 +163,9 @@  discard block
 block discarded – undo
157 163
      * @param int $sosa
158 164
      */
159 165
     public function deleteAncestors($sosa) {
160
-        if(!$this->is_setup) return;
166
+        if(!$this->is_setup) {
167
+        	return;
168
+        }
161 169
         $gen = Functions::getGeneration($sosa);
162 170
         Database::prepare(
163 171
             'DELETE FROM `##maj_sosa`'.
@@ -177,7 +185,9 @@  discard block
 block discarded – undo
177 185
      * @param array $sosa_records
178 186
      */
179 187
     public function insertOrUpdate($sosa_records) {
180
-        if(!$this->is_setup) return;
188
+        if(!$this->is_setup) {
189
+        	return;
190
+        }
181 191
         
182 192
         $treeid = $this->tree->getTreeId();
183 193
         $userid = $this->user->getUserId();
@@ -226,7 +236,9 @@  discard block
 block discarded – undo
226 236
      * @return array Array of sosa numbers
227 237
      */
228 238
     public function getSosaNumbers(Individual $indi) {
229
-        if(!$this->is_setup) return array();
239
+        if(!$this->is_setup) {
240
+        	return array();
241
+        }
230 242
         return Database::prepare(
231 243
                 'SELECT majs_sosa, majs_gen FROM `##maj_sosa`'.
232 244
                 ' WHERE majs_i_id=:indi_id AND majs_gedcom_id=:tree_id AND majs_user_id=:user_id'
@@ -243,7 +255,9 @@  discard block
 block discarded – undo
243 255
      * @return number Last generation if found, 1 otherwise
244 256
      */
245 257
     public function getLastGeneration() {
246
-        if(!$this->is_setup) return;
258
+        if(!$this->is_setup) {
259
+        	return;
260
+        }
247 261
         return Database::prepare(
248 262
                 'SELECT MAX(majs_gen) FROM `##maj_sosa`'.
249 263
                 ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'
@@ -263,7 +277,9 @@  discard block
 block discarded – undo
263 277
      * @return array Associative array of Sosa ancestors, with their generation, comma separated
264 278
      */
265 279
     public function getAllSosaWithGenerations(){
266
-        if(!$this->is_setup) return array();
280
+        if(!$this->is_setup) {
281
+        	return array();
282
+        }
267 283
         return Database::prepare(
268 284
             'SELECT majs_i_id AS indi,' .
269 285
             ' GROUP_CONCAT(DISTINCT majs_gen ORDER BY majs_gen ASC SEPARATOR ",") AS generations' .
@@ -283,9 +299,12 @@  discard block
 block discarded – undo
283 299
      * @return array Array of Sosa individuals
284 300
      */
285 301
     public function getSosaListAtGeneration($gen){
286
-        if(!$this->is_setup) return array();
287
-        if(!$this->sosa_list_by_gen)
288
-            $this->sosa_list_by_gen = array();
302
+        if(!$this->is_setup) {
303
+        	return array();
304
+        }
305
+        if(!$this->sosa_list_by_gen) {
306
+                    $this->sosa_list_by_gen = array();
307
+        }
289 308
         
290 309
         if($gen){
291 310
             if(!isset($this->sosa_list_by_gen[$gen])){
@@ -314,9 +333,12 @@  discard block
 block discarded – undo
314 333
      * @return array Array of Sosa families
315 334
      */
316 335
     public function getFamilySosaListAtGeneration($gen){
317
-        if(!$this->is_setup) return array();
318
-        if(!$this->sosa_fam_list_by_gen)
319
-            $this->sosa_fam_list_by_gen = array();
336
+        if(!$this->is_setup) {
337
+        	return array();
338
+        }
339
+        if(!$this->sosa_fam_list_by_gen) {
340
+                    $this->sosa_fam_list_by_gen = array();
341
+        }
320 342
         
321 343
         if($gen){
322 344
             if(!isset($this->sosa_fam_list_by_gen[$gen])){
@@ -350,7 +372,9 @@  discard block
 block discarded – undo
350 372
      * @return array Array of Sosa individuals
351 373
      */
352 374
     public function getMissingSosaListAtGeneration($gen){
353
-        if(!$this->is_setup) return array();    
375
+        if(!$this->is_setup) {
376
+        	return array();
377
+        }
354 378
         if($gen){
355 379
             return $this->sosa_list_by_gen[$gen] = Database::prepare(
356 380
                 'SELECT schild.majs_sosa sosa, schild.majs_i_id indi, sfat.majs_sosa IS NOT NULL has_father, smot.majs_sosa IS NOT NULL has_mother'.
@@ -390,7 +414,9 @@  discard block
 block discarded – undo
390 414
      * @return array Statistics array
391 415
      */
392 416
     public function getStatisticsByGeneration() {
393
-        if(!$this->is_setup) return array();
417
+        if(!$this->is_setup) {
418
+        	return array();
419
+        }
394 420
         if(!$this->statistics_tab) {
395 421
             $this->statistics_tab = array();
396 422
             if($maxGeneration = $this->getLastGeneration()) {
@@ -418,7 +444,9 @@  discard block
 block discarded – undo
418 444
 	 * @return int
419 445
 	 */
420 446
 	public function getTotalIndividuals() {
421
-	    if(!$this->is_setup) return 0;
447
+	    if(!$this->is_setup) {
448
+	    	return 0;
449
+	    }
422 450
 	    return Database::prepare(
423 451
 	        'SELECT COUNT(*) FROM `##individuals`' .
424 452
 	        ' WHERE i_file = :tree_id')
@@ -432,7 +460,9 @@  discard block
 block discarded – undo
432 460
      * @return number Number of Sosas
433 461
      */
434 462
     public function getSosaCount(){
435
-        if(!$this->is_setup) return 0;
463
+        if(!$this->is_setup) {
464
+        	return 0;
465
+        }
436 466
         return Database::prepare(
437 467
             'SELECT COUNT(majs_sosa) FROM `##maj_sosa`' .
438 468
             ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id')
@@ -449,7 +479,9 @@  discard block
 block discarded – undo
449 479
      * @return number Number of Sosas in generation
450 480
      */
451 481
     public function getSosaCountAtGeneration($gen){
452
-        if(!$this->is_setup) return 0;
482
+        if(!$this->is_setup) {
483
+        	return 0;
484
+        }
453 485
         return Database::prepare(
454 486
             'SELECT COUNT(majs_sosa) FROM `##maj_sosa`' .
455 487
             ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'.
@@ -468,7 +500,9 @@  discard block
 block discarded – undo
468 500
      * @return number Total number of Sosas up to generation
469 501
      */
470 502
     public function getSosaCountUpToGeneration($gen){
471
-        if(!$this->is_setup) return 0;
503
+        if(!$this->is_setup) {
504
+        	return 0;
505
+        }
472 506
         return Database::prepare(
473 507
             'SELECT COUNT(majs_sosa) FROM `##maj_sosa`' .
474 508
             ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'.
@@ -486,7 +520,9 @@  discard block
 block discarded – undo
486 520
      * @return number Total number of distinct individual
487 521
      */
488 522
     public function getDifferentSosaCount(){
489
-        if(!$this->is_setup) return 0;
523
+        if(!$this->is_setup) {
524
+        	return 0;
525
+        }
490 526
         return Database::prepare(
491 527
             'SELECT COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`' .
492 528
             ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id')
@@ -503,7 +539,9 @@  discard block
 block discarded – undo
503 539
      * @return number Number of distinct Sosa individuals up to generation
504 540
      */
505 541
     public function getDifferentSosaCountUpToGeneration($gen){
506
-        if(!$this->is_setup) return 0;
542
+        if(!$this->is_setup) {
543
+        	return 0;
544
+        }
507 545
         return Database::prepare(
508 546
             'SELECT COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`' .
509 547
             ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'.
@@ -528,7 +566,9 @@  discard block
 block discarded – undo
528 566
      * @return array Birth statistics array
529 567
      */
530 568
     public function getStatsBirthYearInGeneration($gen){
531
-        if(!$this->is_setup) return array('first' => 0, 'first_est' => 0, 'avg' => 0, 'last' => 0, 'last_est' => 0);
569
+        if(!$this->is_setup) {
570
+        	return array('first' => 0, 'first_est' => 0, 'avg' => 0, 'last' => 0, 'last_est' => 0);
571
+        }
532 572
         return Database::prepare(
533 573
             'SELECT'.
534 574
             ' MIN(majs_birth_year) AS first, MIN(majs_birth_year_est) AS first_est,'.
@@ -550,7 +590,9 @@  discard block
 block discarded – undo
550 590
      * @return number|NULL Mean generation time
551 591
      */
552 592
     public function getMeanGenerationTime(){
553
-        if(!$this->is_setup) return;
593
+        if(!$this->is_setup) {
594
+        	return;
595
+        }
554 596
         if(!$this->statistics_tab){
555 597
             $this->getStatisticsByGeneration();
556 598
         }
@@ -596,7 +638,10 @@  discard block
 block discarded – undo
596 638
      * @return array
597 639
      */
598 640
     public function getAncestorDispersionForGen($gen) {
599
-        if(!$this->is_setup || $gen > 11) return array();  // Going further than 11 gen will be out of range in the query
641
+        if(!$this->is_setup || $gen > 11) {
642
+        	return array();
643
+        }
644
+        // Going further than 11 gen will be out of range in the query
600 645
         return Database::prepare(
601 646
             'SELECT branches, count(i_id)'.
602 647
             ' FROM ('.
@@ -636,7 +681,9 @@  discard block
 block discarded – undo
636 681
      * @return array 
637 682
      */
638 683
     public function getTopMultiSosaAncestorsNoTies($limit) {
639
-        if(!$this->is_setup) return array();
684
+        if(!$this->is_setup) {
685
+        	return array();
686
+        }
640 687
         return Database::prepare(
641 688
             'SELECT sosa_i_id, sosa_count FROM ('.
642 689
             '   SELECT'.
Please login to merge, or discard this patch.