Completed
Push — master ( 94717f...b0ff97 )
by Jonathan
06:05
created
src/Webtrees/Mvc/View/AbstractView.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,9 @@
 block discarded – undo
45 45
     public function render() {
46 46
         global $controller;        
47 47
         
48
-        if(!$this->ctrl) throw new \Exception('Controller not initialised');
48
+        if(!$this->ctrl) {
49
+        	throw new \Exception('Controller not initialised');
50
+        }
49 51
         
50 52
 		$controller = $this->ctrl;
51 53
         $this->ctrl->pageHeader();
Please login to merge, or discard this patch.
src/Webtrees/GedcomRecord.php 1 patch
Braces   +13 added lines, -7 removed lines patch added patch discarded remove patch
@@ -86,9 +86,12 @@  discard block
 block discarded – undo
86 86
 	 * @return boolean
87 87
 	 */
88 88
 	public function canDisplayIsSourced($access_level = null){
89
-		if(!$this->gedcomrecord->canShow($access_level)) return false;
90
-		if($access_level === null )
91
-		    $access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree());
89
+		if(!$this->gedcomrecord->canShow($access_level)) {
90
+			return false;
91
+		}
92
+		if($access_level === null ) {
93
+				    $access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree());
94
+		}
92 95
 
93 96
 		$global_facts = Globals::getGlobalFacts();
94 97
 		if (isset($global_facts['SOUR'])) {
@@ -108,7 +111,9 @@  discard block
 block discarded – undo
108 111
 	 * @return int Level of sources
109 112
 	 */
110 113
 	public function isSourced(){
111
-		if($this->_issourced !== null) return $this->_issourced;
114
+		if($this->_issourced !== null) {
115
+			return $this->_issourced;
116
+		}
112 117
 		$this->_issourced=-1;
113 118
 		$sourcesfacts = $this->gedcomrecord->getFacts('SOUR');
114 119
 		foreach($sourcesfacts as $sourcefact){
@@ -127,7 +132,9 @@  discard block
 block discarded – undo
127 132
 	 * @return int Level of sources
128 133
 	 */
129 134
 	public function isFactSourced($eventslist){
130
-	    if(empty($eventslist)) return 0;
135
+	    if(empty($eventslist)) {
136
+	    	return 0;
137
+	    }
131 138
 		$isSourced=0;
132 139
 		$facts = $this->gedcomrecord->getFacts($eventslist);
133 140
 		foreach($facts as $fact){
@@ -137,8 +144,7 @@  discard block
 block discarded – undo
137 144
 				if($tmpIsSourced != 0) {
138 145
 					if($isSourced==0) {
139 146
 						$isSourced =  $tmpIsSourced;
140
-					}
141
-					else{
147
+					} else{
142 148
 						$isSourced = max($isSourced, $tmpIsSourced);
143 149
 					}
144 150
 				}
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/AdminConfigController.php 1 patch
Braces   +13 added lines, -11 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');
@@ -330,8 +334,7 @@  discard block
 block discarded – undo
330 334
                     if($use_map) {
331 335
                         $options->setMap(new OutlineMap($map_file));
332 336
                         $options->setMapLevel($map_top_level + 1);
333
-                    }
334
-                    else {
337
+                    } else {
335 338
                         $options->setMap(null);
336 339
                     }
337 340
                 }
@@ -342,8 +345,7 @@  discard block
 block discarded – undo
342 345
 					Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$res->getId().'” has been updated.');
343 346
 					$ga = $res;
344 347
 					$success = true;
345
-				}
346
-				else {
348
+				} else {
347 349
 					FlashMessages::addMessage(I18N::translate('An error occured while updating the geographical dispersion analysis “%s”', $ga->getTitle()), 'danger');
348 350
 					Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'. $ga->getId() .'” could not be updated. See error log.');
349 351
 				}
@@ -361,8 +363,7 @@  discard block
 block discarded – undo
361 363
 				FlashMessages::addMessage(I18N::translate('The geographical dispersion analysis “%s” has been successfully added.', $ga->getTitle()), 'success');
362 364
 				Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$ga->getId().'” has been added.');
363 365
 				$success = true;
364
-			}
365
-			else {
366
+			} else {
366 367
 				FlashMessages::addMessage(I18N::translate('An error occured while adding the geographical dispersion analysis “%s”', $description), 'danger');
367 368
 				Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis “'.$description.'” could not be added. See error log.');
368 369
 			}
@@ -372,8 +373,7 @@  discard block
 block discarded – undo
372 373
         if(!$success) {			
373 374
             if($ga) {
374 375
                 $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@edit&ga_id='. $ga->getId() .'&ged=' . $wt_tree->getNameUrl();
375
-            }
376
-            else {
376
+            } else {
377 377
                 $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@add&ged=' . $wt_tree->getNameUrl();
378 378
             }
379 379
         }        
@@ -430,7 +430,9 @@  discard block
 block discarded – undo
430 430
         $data->set('map_list', $map_list);
431 431
     
432 432
         $gen_details = array(0 => I18N::translate('All'));
433
-        for($i = 1; $i <= 10 ; $i++) $gen_details[$i] = $i;
433
+        for($i = 1; $i <= 10 ; $i++) {
434
+        	$gen_details[$i] = $i;
435
+        }
434 436
         $data->set('generation_details', $gen_details);
435 437
     
436 438
         ViewFactory::make('GeoAnalysisEdit', $this, $controller, $data)->render();
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/CertificateController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,9 @@
 block discarded – undo
123 123
         $tree = Globals::getTree();
124 124
         $cid   = Filter::get('cid');
125 125
         $certificate = null;
126
-        if(!empty($cid)) $certificate =  Certificate::getInstance($cid, $tree, null, $this->provider);
126
+        if(!empty($cid)) {
127
+        	$certificate =  Certificate::getInstance($cid, $tree, null, $this->provider);
128
+        }
127 129
         
128 130
         $imageBuilder = new ImageBuilder($certificate);
129 131
         
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/AdminConfigController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,9 @@
 block discarded – undo
85 85
      */
86 86
     public function index() {        
87 87
         $action = Filter::post('action');        
88
-        if($action == 'update' && Filter::checkCsrf()) $this->update();
88
+        if($action == 'update' && Filter::checkCsrf()) {
89
+        	$this->update();
90
+        }
89 91
         
90 92
         Theme::theme(new AdministrationTheme)->init(Globals::getTree());        
91 93
         $ctrl = new PageController();
Please login to merge, or discard this patch.
src/Webtrees/Module/MiscExtensions/AdminConfigController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,9 @@
 block discarded – undo
61 61
      */
62 62
     public function index() {
63 63
         $action = Filter::post('action');        
64
-        if($action == 'update' && Filter::checkCsrf()) $this->update();
64
+        if($action == 'update' && Filter::checkCsrf()) {
65
+        	$this->update();
66
+        }
65 67
         
66 68
         Theme::theme(new AdministrationTheme)->init(Globals::getTree());        
67 69
         $ctrl = new PageController();
Please login to merge, or discard this patch.
src/Webtrees/Module/CertificatesModule.php 1 patch
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -115,7 +115,9 @@  discard block
 block discarded – undo
115 115
         $sid=null;
116 116
         
117 117
         if($this->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($wt_tree)){
118
-            if (!$srec || strlen($srec) == 0) return $html;
118
+            if (!$srec || strlen($srec) == 0) {
119
+            	return $html;
120
+            }
119 121
             	
120 122
             $certificate = null;
121 123
             $subrecords = explode("\n", $srec);
@@ -129,11 +131,14 @@  discard block
 block discarded – undo
129 131
                 $subrecords[$i] = trim($subrecords[$i]);
130 132
                 $tag = substr($subrecords[$i], 2, 4);
131 133
                 $text = substr($subrecords[$i], 7);
132
-                if($tag == '_ACT') $certificate= new Certificate($text, $wt_tree, $this->getProvider());
134
+                if($tag == '_ACT') {
135
+                	$certificate= new Certificate($text, $wt_tree, $this->getProvider());
136
+                }
133 137
             }
134 138
             	
135
-            if($certificate && $certificate->canShow())
136
-                $html = $this->getDisplay_ACT($certificate, $sid);
139
+            if($certificate && $certificate->canShow()) {
140
+                            $html = $this->getDisplay_ACT($certificate, $sid);
141
+            }
137 142
                 	
138 143
         }
139 144
         return $html;
@@ -161,7 +166,9 @@  discard block
 block discarded – undo
161 166
         $html = '';
162 167
         switch($tag){
163 168
             case '_ACT':
164
-                if($context == 'SOUR') $html = $this->getDisplay_ACT($value, $contextid);
169
+                if($context == 'SOUR') {
170
+                	$html = $this->getDisplay_ACT($value, $contextid);
171
+                }
165 172
                 break;
166 173
         }
167 174
         return $html;
@@ -189,7 +196,9 @@  discard block
 block discarded – undo
189 196
 				$html .= '<select id="certifCity'.$element_id.'" class="_CITY">';
190 197
 				foreach ($tabCities as $cities){
191 198
 					$selectedCity='';
192
-					if($certificate && $cities== $certificate->getCity()) $selectedCity='selected="true"';
199
+					if($certificate && $cities== $certificate->getCity()) {
200
+						$selectedCity='selected="true"';
201
+					}
193 202
 					$html .= '<option value="'.$cities.'" '.$selectedCity.' />'.$cities.'</option>';
194 203
 				}
195 204
 				$html .= '</select>';
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
@@ -104,7 +104,9 @@  discard block
 block discarded – undo
104 104
             }');
105 105
         
106 106
         $action = Filter::post('action');
107
-        if($action === 'update') $this->update($controller);
107
+        if($action === 'update') {
108
+        	$this->update($controller);
109
+        }
108 110
         
109 111
         $view_bag = new ViewBag();
110 112
         $view_bag->set('title', $controller->getPageTitle());
@@ -149,7 +151,9 @@  discard block
 block discarded – undo
149 151
         $user = User::find(Filter::getInteger('userid', -1));
150 152
         if($user) {
151 153
             $calculator = new SosaCalculator(Globals::getTree(), $user);
152
-            if($calculator->computeAll()) $view_bag->set('is_success', true);
154
+            if($calculator->computeAll()) {
155
+            	$view_bag->set('is_success', true);
156
+            }
153 157
         }
154 158
         ViewFactory::make('SosaComputeResult', $this, $controller, $view_bag)->render();
155 159
     }
@@ -170,9 +174,10 @@  discard block
 block discarded – undo
170 174
         
171 175
         if($user && $indi) {
172 176
             $calculator = new SosaCalculator($wt_tree, $user);
173
-            if($calculator->computeFromIndividual($indi)) $view_bag->set('is_success', true);
174
-        }
175
-        else {
177
+            if($calculator->computeFromIndividual($indi)) {
178
+            	$view_bag->set('is_success', true);
179
+            }
180
+        } else {
176 181
             $view_bag->set('error', I18N::translate('Non existing individual'));
177 182
         }
178 183
             
Please login to merge, or discard this patch.
src/Webtrees/Module/Hooks/AdminConfigController.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,9 @@  discard block
 block discarded – undo
47 47
                         $array_hook = explode('#', $ihook);
48 48
                         //Update status
49 49
                         $new_status= Filter::postBool('status-' . $params['id']);
50
-                        if(in_array($array_hook[0], $module_names)) $new_status = false;
50
+                        if(in_array($array_hook[0], $module_names)) {
51
+                        	$new_status = false;
52
+                        }
51 53
                         $previous_status = $params['status'];
52 54
                         if ($new_status !== null) {
53 55
                             $new_status= $new_status ? 'enabled' : 'disabled';
@@ -92,7 +94,9 @@  discard block
 block discarded – undo
92 94
         HookProvider::getInstance()->updateHooks();
93 95
         
94 96
         $action = Filter::post('action');        
95
-        if($action == 'update' && Filter::checkCsrf()) $this->update();
97
+        if($action == 'update' && Filter::checkCsrf()) {
98
+        	$this->update();
99
+        }
96 100
         
97 101
         Theme::theme(new AdministrationTheme)->init(Globals::getTree());        
98 102
         $ctrl = new PageController();
Please login to merge, or discard this patch.