Completed
Push — master ( 8c59e5...eb013e )
by Jonathan
09:17
created
src/Webtrees/Module/WelcomeBlock/PiwikController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,9 @@
 block discarded – undo
50 50
         
51 51
             if($fetched = File::fetchUrl($url)) {
52 52
                 $content = @unserialize($fetched);
53
-                if(is_numeric($content)) return $content;
53
+                if(is_numeric($content)) {
54
+                	return $content;
55
+                }
54 56
             }
55 57
         }
56 58
     
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Views/CertificatesListView.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@  discard block
 block discarded – undo
39 39
     			<input type="hidden" name="ged" value="<?= $this->data->get('url_ged') ?>">
40 40
     			<select name="city">
41 41
     			<?php foreach ($cities as $city) { ?>
42
-    				<option value="<?= Functions::encryptToSafeBase64($city) ?>" <?php if(trim($city) == trim($selected_city)) echo 'selected="selected"'?> ><?= $city ?></option>
42
+    				<option value="<?= Functions::encryptToSafeBase64($city) ?>" <?php if(trim($city) == trim($selected_city)) {
43
+	echo 'selected="selected"'?> ><?= $city ?></option>
43 44
     			<?php } ?>
44 45
     			</select>
45 46
     			<input type="submit" value="<?= I18N::translate('Show') ?>" />
@@ -72,9 +73,12 @@  discard block
 block discarded – undo
72 73
     						<!--  Certificate Name -->
73 74
     						<?php 
74 75
     						$name = $certificate->getCertificateDetails() ?: '';
76
+}
75 77
     						$sortname = "";
76 78
     						$ct_names=preg_match("/([A-Z]{2,})/", $name, $match);
77
-    						if($ct_names > 0) $sortname = $match[1].'_';
79
+    						if($ct_names > 0) {
80
+    							$sortname = $match[1].'_';
81
+    						}
78 82
     						$sortname .= $name;
79 83
     						?>
80 84
     						<td data-sort="<?= Filter::escapeHtml($sortname) ?>">
Please login to merge, or discard this patch.
src/Webtrees/Module/WelcomeBlockModule.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,9 +89,10 @@
 block discarded – undo
89 89
         $wb_controller = new WelcomeBlockController($this);
90 90
         try {
91 91
             return $wb_controller->config($block_id);
92
-        }
93
-        catch (MvcException $ex) {
94
-            if($ex->getHttpCode() != 200) throw $ex;
92
+        } catch (MvcException $ex) {
93
+            if($ex->getHttpCode() != 200) {
94
+            	throw $ex;
95
+            }
95 96
             return;
96 97
         }     
97 98
     }
Please login to merge, or discard this patch.
src/Webtrees/Module/WelcomeBlock/WelcomeBlockController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,9 @@
 block discarded – undo
98 98
      */
99 99
     public function config($block_id = null) {
100 100
         
101
-        if(empty($block_id)) throw new MvcException(404);
101
+        if(empty($block_id)) {
102
+        	throw new MvcException(404);
103
+        }
102 104
 
103 105
         if (Filter::postBool('save') && Filter::checkCsrf()) {
104 106
             $this->module->setBlockSetting($block_id, 'piwik_enabled', Filter::postBool('piwik_enabled'));
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/Views/SosaListFamView.php 1 patch
Braces   +3 added lines, -7 removed lines patch added patch discarded remove patch
@@ -293,10 +293,8 @@  discard block
 block discarded – undo
293 293
 						<?= I18N::number($family->getNumberOfChildren()) ?>
294 294
 					</td>
295 295
 					<td hidden><?php 
296
-					if (!$mdate->isOK()) { echo 'U'; }
297
-					else {
298
-					    if (Date::compare($mdate, new Date(date('Y') - 100)) > 0) { echo 'Y100'; }
299
-					    else { echo 'YES'; }
296
+					if (!$mdate->isOK()) { echo 'U'; } else {
297
+					    if (Date::compare($mdate, new Date(date('Y') - 100)) > 0) { echo 'Y100'; } else { echo 'YES'; }
300 298
 					}
301 299
 					if ($family->getFacts(WT_EVENTS_DIV)) { echo 'D'; }
302 300
 					if (count($husb->getSpouseFamilies()) > 1 || count($wife->getSpouseFamilies()) > 1) {
@@ -316,9 +314,7 @@  discard block
 block discarded – undo
316 314
         			if (!$husb->isDead() && !$wife->isDead()) { echo 'N'; } ?>
317 315
         			</td>
318 316
         			<td hidden><?php 
319
-			         if (!$husb->getChildFamilies() && !$wife->getChildFamilies()) { echo 'R'; }
320
-			         elseif (!$husb->isDead() && !$wife->isDead() && $family->getNumberOfChildren() < 1) { echo 'L'; }
321
-			         else { echo '&nbsp;'; } ?>
317
+			         if (!$husb->getChildFamilies() && !$wife->getChildFamilies()) { echo 'R'; } elseif (!$husb->isDead() && !$wife->isDead() && $family->getNumberOfChildren() < 1) { echo 'L'; } else { echo '&nbsp;'; } ?>
322 318
 			         </td>
323 319
 				</tr>
324 320
         	<?php } ?>
Please login to merge, or discard this patch.
src/Webtrees/Module/Sosa/Views/SosaListMissingView.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -184,7 +184,10 @@
 block discarded – undo
184 184
 							<td class="ui-state-default" colspan="11">
185 185
 								<div class="center">
186 186
 									<?= I18N::translate('Number of different missing ancestors: %s', I18N::number($this->data->get('missing_diff_count'))) ?>
187
-									<?php if($this->data->get('missing_hidden') > 0) echo ' ['. I18N::translate('%s hidden', I18N::number($this->data->get('missing_hidden'))).']'; ?>
187
+									<?php if($this->data->get('missing_hidden') > 0) {
188
+	echo ' ['. I18N::translate('%s hidden', I18N::number($this->data->get('missing_hidden'))).']';
189
+}
190
+?>
188 191
 									<?= ' - ' . I18N::translate('Generation complete at %s', I18N::percentage($this->data->get('perc_sosa'), 2)) ?>
189 192
 									<?= ' [' . I18N::translate('Potential %s', I18N::percentage($this->data->get('perc_sosa_potential'),2)).']' ?>
190 193
 								</div>
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
@@ -94,8 +94,12 @@  discard block
 block discarded – undo
94 94
             foreach($stats_gen as $gen => $tab){
95 95
                 $genY1= I18N::translate('-');
96 96
                 $genY2= I18N::translate('-');
97
-                if($tab['firstBirth']>0) $genY1=$tab['firstBirth'];
98
-                if($tab['lastBirth']>0) $genY2=$tab['lastBirth'];
97
+                if($tab['firstBirth']>0) {
98
+                	$genY1=$tab['firstBirth'];
99
+                }
100
+                if($tab['lastBirth']>0) {
101
+                	$genY2=$tab['lastBirth'];
102
+                }
99 103
                 $total_theoretical += $gen_theoretical;
100 104
                 $perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical);
101 105
                 $gen_equiv += $perc_sosa_count_theor;
@@ -141,7 +145,9 @@  discard block
 block discarded – undo
141 145
      private function htmlAncestorDispersionG2()
142 146
     {
143 147
         $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2);
144
-        if(count($ancestorsDispGen2) == 0) return;
148
+        if(count($ancestorsDispGen2) == 0) {
149
+        	return;
150
+        }
145 151
         
146 152
         $size = '600x300';
147 153
         
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/TaskController.php 1 patch
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -94,14 +94,15 @@  discard block
 block discarded – undo
94 94
             $this->provider->setTaskStatus($task, $status);
95 95
             $res['status'] = $status;
96 96
 			Log::addConfigurationLog('Module '.$this->module->getName().' : Admin Task "'.$task->getName().'" has been '. ($status ? 'enabled' : 'disabled') .'.');
97
-        }
98
-        catch (\Exception $ex) {
97
+        } catch (\Exception $ex) {
99 98
             $res['error'] = $ex->getMessage();
100 99
 			Log::addErrorLog('Module '.$this->module->getName().' : Admin Task "'.$task->getName().'" could not be ' . ($status ? 'enabled' : 'disabled') .'. Error: '. $ex->getMessage());
101 100
         }
102 101
         
103 102
         $controller->pageHeader();
104
-        if($res['error']) http_response_code(500);
103
+        if($res['error']) {
104
+        	http_response_code(500);
105
+        }
105 106
         
106 107
         $controller->encode($res);
107 108
     }
@@ -169,8 +170,7 @@  discard block
 block discarded – undo
169 170
 			$task->setFrequency($frequency);
170 171
 			if($is_limited == 1) {
171 172
 				$task->setRemainingOccurrences($nb_occur);
172
-			}
173
-			else {
173
+			} else {
174 174
 				$task->setRemainingOccurrences(0);
175 175
 			}
176 176
 			
@@ -191,8 +191,7 @@  discard block
 block discarded – undo
191 191
 					Log::addConfigurationLog('Module '.$this->module->getName().' : AdminTask “'.$task->getName() .'” has been updated.');
192 192
 					$success = true;
193 193
 				}
194
-			}
195
-			else {
194
+			} else {
196 195
 				FlashMessages::addMessage(I18N::translate('An error occured while updating the administrative task “%s”', $task->getTitle()), 'danger');
197 196
 				Log::addConfigurationLog('Module '.$this->module->getName().' : AdminTask “'. $task->getName() .'” could not be updated. See error log.');
198 197
 			}
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/Model/AbstractTask.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -235,7 +235,9 @@  discard block
 block discarded – undo
235 235
 	 * @return bool
236 236
 	 */
237 237
 	public function save() {
238
-	    if(!$this->provider) throw new \Exception('The task has not been initialised with a provider.');
238
+	    if(!$this->provider) {
239
+	    	throw new \Exception('The task has not been initialised with a provider.');
240
+	    }
239 241
 		return $this->provider->updateTask($this);
240 242
 	}
241 243
 	
@@ -245,8 +247,9 @@  discard block
 block discarded – undo
245 247
      */
246 248
     public function execute(){
247 249
     
248
-        if($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime())
249
-            $this->is_running = false;
250
+        if($this->last_updated->add(new \DateInterval('PT'.self::TASK_TIME_OUT.'S')) < new \DateTime()) {
251
+                    $this->is_running = false;
252
+        }
250 253
     
251 254
         if(!$this->is_running){
252 255
             $this->last_result = false;
@@ -259,7 +262,9 @@  discard block
 block discarded – undo
259 262
                 $this->last_updated = new \DateTime();
260 263
                 if($this->nb_occurrences > 0){
261 264
                     $this->nb_occurrences--;
262
-                    if($this->nb_occurrences == 0) $this->is_enabled = false;
265
+                    if($this->nb_occurrences == 0) {
266
+                    	$this->is_enabled = false;
267
+                    }
263 268
                 }
264 269
             }
265 270
             $this->is_running = false;
Please login to merge, or discard this patch.