@@ -115,7 +115,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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>'; |
@@ -104,7 +104,9 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -47,7 +47,9 @@ discard block |
||
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 |
||
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(); |
@@ -160,7 +160,9 @@ discard block |
||
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 |
||
174 | 176 | $html .= ' <span><small><em>'.$dindi->formatFirstMajorFact(WT_EVENTS_BIRT, 10).'</em></small></span>'; |
175 | 177 | $html .= ' <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 |
||
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 |
||
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 |
||
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; |
@@ -108,16 +108,18 @@ discard block |
||
108 | 108 | $len_chars = count($chars); |
109 | 109 | $token = ''; |
110 | 110 | |
111 | - for ($i = 0; $i < $length; $i++) |
|
112 | - $token .= $chars[ mt_rand(0, $len_chars - 1) ]; |
|
111 | + for ($i = 0; $i < $length; $i++) { |
|
112 | + $token .= $chars[ mt_rand(0, $len_chars - 1) ]; |
|
113 | + } |
|
113 | 114 | |
114 | 115 | # Number of 32 char chunks |
115 | 116 | $chunks = ceil( strlen($token) / 32 ); |
116 | 117 | $md5token = ''; |
117 | 118 | |
118 | 119 | # Run each chunk through md5 |
119 | - for ( $i=1; $i<=$chunks; $i++ ) |
|
120 | - $md5token .= md5( substr($token, $i * 32 - 32, 32) ); |
|
120 | + for ( $i=1; $i<=$chunks; $i++ ) { |
|
121 | + $md5token .= md5( substr($token, $i * 32 - 32, 32) ); |
|
122 | + } |
|
121 | 123 | |
122 | 124 | # Trim the token |
123 | 125 | return substr($md5token, 0, $length); |
@@ -130,8 +132,9 @@ discard block |
||
130 | 132 | */ |
131 | 133 | protected static function getBase64EncryptionKey() { |
132 | 134 | $key = 'STANDARDKEYIFNOSERVER'; |
133 | - if(!empty(Filter::server('SERVER_NAME')) && !empty(Filter::server('SERVER_SOFTWARE'))) |
|
134 | - $key = md5(Filter::server('SERVER_NAME').Filter::server('SERVER_SOFTWARE')); |
|
135 | + if(!empty(Filter::server('SERVER_NAME')) && !empty(Filter::server('SERVER_SOFTWARE'))) { |
|
136 | + $key = md5(Filter::server('SERVER_NAME').Filter::server('SERVER_SOFTWARE')); |
|
137 | + } |
|
135 | 138 | |
136 | 139 | return $key; |
137 | 140 | } |
@@ -168,11 +171,13 @@ discard block |
||
168 | 171 | $encrypted = str_replace('_', '/', $encrypted); |
169 | 172 | $encrypted = str_replace('*', '=', $encrypted); |
170 | 173 | $encrypted = base64_decode($encrypted); |
171 | - if($encrypted === false) |
|
172 | - throw new \InvalidArgumentException('The encrypted value is not in correct base64 format.'); |
|
174 | + if($encrypted === false) { |
|
175 | + throw new \InvalidArgumentException('The encrypted value is not in correct base64 format.'); |
|
176 | + } |
|
173 | 177 | |
174 | - if (mb_strlen($encrypted, '8bit') < (SODIUM_CRYPTO_SECRETBOX_NONCEBYTES + SODIUM_CRYPTO_SECRETBOX_MACBYTES)) |
|
175 | - throw new \InvalidArgumentException('The encrypted value does not contain enough characters for the key.'); |
|
178 | + if (mb_strlen($encrypted, '8bit') < (SODIUM_CRYPTO_SECRETBOX_NONCEBYTES + SODIUM_CRYPTO_SECRETBOX_MACBYTES)) { |
|
179 | + throw new \InvalidArgumentException('The encrypted value does not contain enough characters for the key.'); |
|
180 | + } |
|
176 | 181 | |
177 | 182 | $nonce = mb_substr($encrypted, 0, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, '8bit'); |
178 | 183 | $ciphertext = mb_substr($encrypted, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit'); |
@@ -222,7 +227,9 @@ discard block |
||
222 | 227 | * @return boolean True if path valid |
223 | 228 | */ |
224 | 229 | public static function isValidPath($filename, $acceptfolder = FALSE) { |
225 | - if(strpbrk($filename, $acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>') === FALSE) return true; |
|
230 | + if(strpbrk($filename, $acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>') === FALSE) { |
|
231 | + return true; |
|
232 | + } |
|
226 | 233 | return false; |
227 | 234 | } |
228 | 235 |
@@ -71,7 +71,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -144,14 +144,15 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -95,7 +95,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -93,8 +93,12 @@ discard block |
||
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 | $missing=2*$prev_known - $tab['sosaCount']; |
@@ -169,7 +173,9 @@ discard block |
||
169 | 173 | private function htmlAncestorDispersionG2() |
170 | 174 | { |
171 | 175 | $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2); |
172 | - if(count($ancestorsDispGen2) == 0) return; |
|
176 | + if(count($ancestorsDispGen2) == 0) { |
|
177 | + return; |
|
178 | + } |
|
173 | 179 | |
174 | 180 | $size = '600x300'; |
175 | 181 | |
@@ -251,7 +257,9 @@ discard block |
||
251 | 257 | */ |
252 | 258 | private function htmlAncestorGenDepthG3() { |
253 | 259 | $ancestorsGenDepth3 = $this->sosa_provider->getGenerationDepthStatsAtGen(3); |
254 | - if(count($ancestorsGenDepth3) == 0) return; |
|
260 | + if(count($ancestorsGenDepth3) == 0) { |
|
261 | + return; |
|
262 | + } |
|
255 | 263 | |
256 | 264 | $ancestors = array(); |
257 | 265 | $chd_mean = array(); |
@@ -262,8 +270,7 @@ discard block |
||
262 | 270 | if($ancestor !== null && $ancestor->canShowName()) { |
263 | 271 | $tmp = $ancestor->getAllNames(); |
264 | 272 | $ancestors[] = Filter::escapeUrl($tmp[$ancestor->getPrimaryName()]['fullNN']); |
265 | - } |
|
266 | - else { |
|
273 | + } else { |
|
267 | 274 | $ancestors[] = I18N::translate('Sosa %s', I18N::number($sosa)); |
268 | 275 | } |
269 | 276 | $chd_mean[] = $genDepthStat['mean_gen_depth']; |