Passed
Branch feature/2.0 (be78a0)
by Jonathan
11:57
created
src/Webtrees/Module/IsSourcedModule.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,8 +65,9 @@  discard block
 block discarded – undo
65 65
 	public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) {
66 66
 	    if($ctrlIndi){
67 67
 	        $dindi = new Individual($ctrlIndi->getSignificantIndividual());
68
-	        if ($dindi->canDisplayIsSourced()) 
69
-	            return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
68
+	        if ($dindi->canDisplayIsSourced()) {
69
+	        	            return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
70
+	        }
70 71
 	    }
71 72
 	    return '';
72 73
 	}
@@ -99,8 +100,9 @@  discard block
 block discarded – undo
99 100
 	        $dindi = new Individual($grec);
100 101
 	        $html .= FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, $size);
101 102
 	        $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1, $size);
102
-	        if($grec->isDead())
103
-	            $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size);
103
+	        if($grec->isDead()) {
104
+	        	            $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size);
105
+	        }
104 106
 	    }
105 107
 	    return $html;
106 108
 	}
@@ -173,12 +175,13 @@  discard block
 block discarded – undo
173 175
 	                   </tr>';
174 176
 	            }
175 177
 	            
176
-	            if( $root->isDead() )
177
-	                echo '
178
+	            if( $root->isDead() ) {
179
+	            	                echo '
178 180
 	                    <tr>
179 181
 	                       <td class="slabel">' . GedcomTag::getLabel('DEAT') . '</td>
180 182
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1).'</td>
181 183
 	                   </tr>';
184
+	            }
182 185
 	            
183 186
 	            echo '</table>';
184 187
 	        }
Please login to merge, or discard this patch.
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/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/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.
src/Webtrees/Functions/FunctionsPrint.php 1 patch
Braces   +11 added lines, -7 removed lines patch added patch discarded remove patch
@@ -160,7 +160,9 @@  discard block
 block discarded – undo
160 160
 	public static function htmlIndividualForList(\Fisharebest\Webtrees\Individual $individual, $isStrong = true){
161 161
 		$html = '';
162 162
 		$tag = 'em';
163
-		if($isStrong) $tag = 'strong';
163
+		if($isStrong) {
164
+			$tag = 'strong';
165
+		}
164 166
 		if($individual && $individual->canShow()){
165 167
 			$dindi = new Individual($individual);
166 168
 			$html = $individual->getSexImage();
@@ -174,8 +176,7 @@  discard block
 block discarded – undo
174 176
 			$html .= '&nbsp;<span><small><em>'.$dindi->formatFirstMajorFact(WT_EVENTS_BIRT, 10).'</em></small></span>';
175 177
 			$html .= '&nbsp;<span><small><em>'.$dindi->formatFirstMajorFact(WT_EVENTS_DEAT, 10).'</em></small></span>';
176 178
 			$html .= '</a>';
177
-		}
178
-		else {
179
+		} else {
179 180
 			$html .= '<span class=\"list_item\"><'.$tag.'>' . I18N::translate('Private') . '</'.$tag.'></span>';
180 181
 		}
181 182
 		return $html;
@@ -193,8 +194,7 @@  discard block
 block discarded – undo
193 194
 		$date = $fact->getDate();
194 195
 		if($date->isOK()){
195 196
 			$html.=' '.$date->Display($anchor && !Globals::isSearchSpider(), '%Y');
196
-		}
197
-		else{
197
+		} else{
198 198
 			// 1 DEAT Y with no DATE => print YES
199 199
 			// 1 BIRT 2 SOUR @S1@ => print YES
200 200
 			// 1 DEAT N is not allowed
@@ -218,7 +218,9 @@  discard block
 block discarded – undo
218 218
 	public static function formatFactPlaceShort(\Fisharebest\Webtrees\Fact $fact, $format, $anchor=false){
219 219
 		$html='';
220 220
 		
221
-		if ($fact === null) return $html;
221
+		if ($fact === null) {
222
+			return $html;
223
+		}
222 224
 		$place = $fact->getPlace();
223 225
 		if($place){
224 226
 			$dplace = new Place($place);
@@ -336,7 +338,9 @@  discard block
 block discarded – undo
336 338
 					default:
337 339
 						break;
338 340
 				}
339
-				if($image && $title) $html = '<i class="icon-maj-sourced-'.$size.'_'.$image.'" title="'.$title.'"></i>';
341
+				if($image && $title) {
342
+					$html = '<i class="icon-maj-sourced-'.$size.'_'.$image.'" title="'.$title.'"></i>';
343
+				}
340 344
 				break;
341 345
 			default:
342 346
 				break;
Please login to merge, or discard this patch.