Completed
Push — master ( b40ea8...2ebfe4 )
by Jonathan
05:27
created
src/Webtrees/Module/IsSourcedModule.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,8 +63,9 @@  discard block
 block discarded – undo
63 63
 	public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) {
64 64
 	    if($ctrlIndi){
65 65
 	        $dindi = new Individual($ctrlIndi->getSignificantIndividual());
66
-	        if ($dindi->canDisplayIsSourced()) 
67
-	            return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
66
+	        if ($dindi->canDisplayIsSourced()) {
67
+	        	            return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
68
+	        }
68 69
 	    }
69 70
 	    return '';
70 71
 	}
@@ -97,8 +98,9 @@  discard block
 block discarded – undo
97 98
 	        $dindi = new Individual($grec);
98 99
 	        $html .= FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'small');
99 100
 	        $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1, 'small');
100
-	        if($grec->isDead())
101
-	            $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, 'small');
101
+	        if($grec->isDead()) {
102
+	        	            $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, 'small');
103
+	        }
102 104
 	    }
103 105
 	    return $html;
104 106
 	}
@@ -171,12 +173,13 @@  discard block
 block discarded – undo
171 173
 	                   </tr>';
172 174
 	            }
173 175
 	            
174
-	            if( $root->isDead() )
175
-	                echo '
176
+	            if( $root->isDead() ) {
177
+	            	                echo '
176 178
 	                    <tr>
177 179
 	                       <td class="slabel">' . GedcomTag::getLabel('DEAT') . '</td>
178 180
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1).'</td>
179 181
 	                   </tr>';
182
+	            }
180 183
 	            
181 184
 	            echo '</table>';
182 185
 	        }
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/Model/TaskProvider.php 1 patch
Braces   +9 added lines, -13 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@  discard block
 block discarded – undo
49 49
 					return $task;
50 50
 				}
51 51
 			}
52
-		}
53
-		catch(\Exception $ex) { }
52
+		} catch(\Exception $ex) { }
54 53
 		
55 54
 		return null;
56 55
 	}
@@ -83,8 +82,7 @@  discard block
 block discarded – undo
83 82
 				);
84 83
         
85 84
 			return $task;
86
-		}
87
-		else {
85
+		} else {
88 86
 		    $this->deleteTask($row['majat_name']);
89 87
 		}
90 88
 		return null;
@@ -156,8 +154,7 @@  discard block
 block discarded – undo
156 154
                     'is_running' => $task->isRunning() ? 1 : 0
157 155
                 ));
158 156
             return true;
159
-        }
160
-        catch (\Exception $ex) {
157
+        } catch (\Exception $ex) {
161 158
             Log::addErrorLog(sprintf('Error while updating the Admin Task %s. Exception: %s', $task->getName(), $ex->getMessage()));
162 159
             return false;
163 160
         }        
@@ -279,7 +276,9 @@  discard block
 block discarded – undo
279 276
 		$dir=opendir($this->root_path);
280 277
 		while (($file=readdir($dir))!==false){ 
281 278
 			try {
282
-			    if($file == '.' || $file == '..') continue;
279
+			    if($file == '.' || $file == '..') {
280
+			    	continue;
281
+			    }
283 282
 				$task = include $this->root_path . $file;
284 283
 				if($task ) {
285 284
 				    $task->setProvider($this);
@@ -294,12 +293,10 @@  discard block
 block discarded – undo
294 293
 					));
295 294
 					
296 295
 					$tasks[] = $task;
297
-				}
298
-				else {
296
+				} else {
299 297
 					throw new \Exception;
300 298
 				}
301
-			}
302
-			catch (\Exception $ex) {
299
+			} catch (\Exception $ex) {
303 300
 				Log::addErrorLog('An error occured while trying to load the task in file ' . $file . '. Exception: ' . $ex->getMessage());
304 301
 			}
305 302
 		}
@@ -325,8 +322,7 @@  discard block
 block discarded – undo
325 322
 			Log::addConfigurationLog('Admin Task '.$task_name.' has been deleted from disk - deleting it from DB');
326 323
 			
327 324
 			return true;
328
-		}
329
-		catch(\Exception $ex) {
325
+		} catch(\Exception $ex) {
330 326
 			Database::rollback();
331 327
 		
332 328
 			Log::addErrorLog('An error occurred while deleting Admin Task '.$task_name.'. Exception: '. $ex->getMessage());
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/Tasks/HealthCheckEmailTask.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -185,8 +185,7 @@  discard block
 block discarded – undo
185 185
 						I18N::translate('Error').Mail::EOL.
186 186
 						str_repeat('-', $nb_char_count_title)."\t".str_repeat('-', $nb_char_type)."\t".str_repeat('-', 20)."\t".str_repeat('-', strlen(I18N::translate('Error'))).Mail::EOL.
187 187
 						$tmp_message.Mail::EOL;
188
-				}
189
-				else{
188
+				} else{
190 189
 					$message .= I18N::translate('No errors', $nb_errors).Mail::EOL.Mail::EOL;
191 190
 				}
192 191
 				
@@ -251,8 +250,7 @@  discard block
 block discarded – undo
251 250
 				}
252 251
 			}
253 252
 			return true;
254
-		}
255
-		catch (\Exception $ex) {
253
+		} catch (\Exception $ex) {
256 254
 			Log::addErrorLog(sprintf('Error while updating the Admin Task "%s". Exception: %s', $this->getName(), $ex->getMessage()));
257 255
 			return false;
258 256
 		}
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/AdminConfigController.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -187,7 +187,9 @@  discard block
 block discarded – undo
187 187
     
188 188
         // Generate an AJAX/JSON response for datatables to load a block of rows
189 189
         $search = Filter::postArray('search');
190
-        if($search) $search = $search['value'];
190
+        if($search) {
191
+        	$search = $search['value'];
192
+        }
191 193
         $start  = Filter::postInteger('start');
192 194
         $length = Filter::postInteger('length');
193 195
         $order  = Filter::postArray('order');
@@ -261,8 +263,7 @@  discard block
 block discarded – undo
261 263
     			    <button id="bt_runtask_'. $task->getName() .'" class="btn btn-primary" href="#" onclick="return run_admintask(\''. $task->getName() .'\')">
262 264
     			         <div id="bt_runtasktext_'. $task->getName() .'"><i class="fa fa-cog fa-fw" ></i>' . I18N::translate('Run') . '</div>
263 265
     			    </button>';
264
-			}
265
-			else {
266
+			} else {
266 267
 			    $datum[9] = '';
267 268
 			}			    
268 269
 						
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/SosaConfigController.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -106,7 +106,9 @@  discard block
 block discarded – undo
106 106
             }');
107 107
         
108 108
         $action = Filter::post('action');
109
-        if($action === 'update') $this->update($controller);
109
+        if($action === 'update') {
110
+        	$this->update($controller);
111
+        }
110 112
         
111 113
         $view_bag = new ViewBag();
112 114
         $view_bag->set('title', $controller->getPageTitle());
@@ -153,7 +155,9 @@  discard block
 block discarded – undo
153 155
         $user = User::find(Filter::getInteger('userid', -1));
154 156
         if($user) {
155 157
             $calculator = new SosaCalculator($WT_TREE, $user);
156
-            if($calculator->computeAll()) $view_bag->set('is_success', true);
158
+            if($calculator->computeAll()) {
159
+            	$view_bag->set('is_success', true);
160
+            }
157 161
         }
158 162
         ViewFactory::make('SosaComputeResult', $this, $controller, $view_bag)->render();
159 163
     }
@@ -175,9 +179,10 @@  discard block
 block discarded – undo
175 179
         
176 180
         if($user && $indi) {
177 181
             $calculator = new SosaCalculator($WT_TREE, $user);
178
-            if($calculator->computeFromIndividual($indi)) $view_bag->set('is_success', true);
179
-        }
180
-        else {
182
+            if($calculator->computeFromIndividual($indi)) {
183
+            	$view_bag->set('is_success', true);
184
+            }
185
+        } else {
181 186
             $view_bag->set('error', I18N::translate('Non existing individual'));
182 187
         }
183 188
             
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/Model/SosaCalculator.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,8 +114,12 @@
 block discarded – undo
114 114
         $this->flushTmpSosaTable();
115 115
         
116 116
         if($fam = $indi->getPrimaryChildFamily()) {
117
-            if($husb = $fam->getHusband()) $this->addNode($husb, 2 * $sosa);
118
-            if($wife = $fam->getWife()) $this->addNode($wife, 2 * $sosa + 1);
117
+            if($husb = $fam->getHusband()) {
118
+            	$this->addNode($husb, 2 * $sosa);
119
+            }
120
+            if($wife = $fam->getWife()) {
121
+            	$this->addNode($wife, 2 * $sosa + 1);
122
+            }
119 123
         }
120 124
     }
121 125
     
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/SosaListController.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -431,8 +431,7 @@  discard block
 block discarded – undo
431 431
                         ) {
432 432
                         $birt_by_decade[(int)($birth_dates[0]->gregorianYear()/10)*10] .= $person->getSex();
433 433
                     }
434
-                }
435
-                else {
434
+                } else {
436 435
                     $birth_dates[0]=new Date('');
437 436
                 }
438 437
                 if ($death_dates = $person->getAllDeathDates()) {
@@ -443,8 +442,7 @@  discard block
 block discarded – undo
443 442
                         ) {
444 443
                         $deat_by_decade[(int) ($death_dates[0]->gregorianYear() / 10) * 10] .= $person->getSex();
445 444
                     }
446
-                }
447
-                else {
445
+                } else {
448 446
                     $death_dates[0] = new Date('');
449 447
                 }
450 448
                 $age = Date::getAge($birth_dates[0], $death_dates[0], 0);
Please login to merge, or discard this patch.
src/Webtrees/Module/PatronymicLineage/Model/LineageRootNode.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 			$place_name = $place->getFullName();
42 42
 			if(isset($this->places[$place_name])){
43 43
 				$this->places[$place_name]+=1;
44
-			}
45
-			else{
44
+			} else{
46 45
 				$this->places[$place_name] = 1;
47 46
 			}
48 47
 		}
Please login to merge, or discard this patch.
src/Webtrees/Module/PatronymicLineage/Views/LineageView.php 1 patch
Braces   +8 added lines, -11 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
                     echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $tree, $extra_params);
56 56
                     break;
57 57
             }
58
-        }
59
-        else if ($this->data->get('islineages', false)) {
58
+        } else if ($this->data->get('islineages', false)) {
60 59
             //Link to indilist
61 60
             echo '<p class="center"><strong>'.
62 61
                 '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. 
@@ -81,7 +80,9 @@  discard block
 block discarded – undo
81 80
             	
82 81
             	foreach($lineages as $i => $lineage) {
83 82
             		$this->printRootLineage($lineage);
84
-            		if($i < $nb_lineages - 1) echo '<hr />';
83
+            		if($i < $nb_lineages - 1) {
84
+            			echo '<hr />';
85
+            		}
85 86
             	}
86 87
             	
87 88
             	echo '</div>';
@@ -156,8 +157,7 @@  discard block
 block discarded – undo
156 157
     				}
157 158
     			}
158 159
     		}
159
-    	}
160
-    	else {
160
+    	} else {
161 161
     		$this->printLineage($node);
162 162
     	}
163 163
     	echo '</div>';
@@ -185,8 +185,7 @@  discard block
 block discarded – undo
185 185
     			echo '<li>';
186 186
     			if($is_first_family){
187 187
     				echo FunctionsPrint::htmlIndividualForList($node_indi);
188
-    			}
189
-				else{
188
+    			} else{
190 189
 					echo FunctionsPrint::htmlIndividualForList($node_indi, false);
191 190
 				}
192 191
 				//Get individual's spouse
@@ -207,15 +206,13 @@  discard block
 block discarded – undo
207 206
     			foreach($fam_nodes[$fam] as $child_node) {
208 207
     				if($child_node) {
209 208
     					$this->printLineage($child_node);
210
-    				}
211
-    				else {
209
+    				} else {
212 210
     					echo '<ul><li><strong>&hellip;</strong></li></ul>';
213 211
     				}
214 212
     			}
215 213
     			$is_first_family = false;
216 214
     		}
217
-    	}
218
-    	else {
215
+    	} else {
219 216
     		echo '<li>';
220 217
     		echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual());
221 218
     		if($node->hasFollowUpSurname()) {
Please login to merge, or discard this patch.