@@ -45,7 +45,9 @@ |
||
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(); |
@@ -61,7 +61,9 @@ |
||
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(); |
@@ -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; |
@@ -104,8 +104,7 @@ |
||
104 | 104 | |
105 | 105 | if(file_exists($css_file)) { |
106 | 106 | return $this->assetUrl('css/' . $theme->name() . '.min.css'); |
107 | - } |
|
108 | - else { |
|
107 | + } else { |
|
109 | 108 | return $this->assetUrl('css/default.min.css'); |
110 | 109 | } |
111 | 110 | } |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | $ct2 = preg_match_all($pattern, $titlefact->getValue(), $match2); |
58 | 58 | if($ct2>0){ |
59 | 59 | $this->titles[$match2[1][0]][]= trim($match2[2][0]); |
60 | - } |
|
61 | - else{ |
|
60 | + } else{ |
|
62 | 61 | $this->titles[$titlefact->getValue()][]=''; |
63 | 62 | } |
64 | 63 | } |
@@ -90,8 +89,7 @@ discard block |
||
90 | 89 | if($bplace = $this->gedcomrecord->getBirthPlace()){ |
91 | 90 | if($perc){ |
92 | 91 | return array ($bplace, 1); |
93 | - } |
|
94 | - else{ |
|
92 | + } else{ |
|
95 | 93 | return $bplace; |
96 | 94 | } |
97 | 95 | } |
@@ -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); |
@@ -157,7 +159,9 @@ discard block |
||
157 | 159 | * @return boolean True if path valid |
158 | 160 | */ |
159 | 161 | public static function isValidPath($filename, $acceptfolder = FALSE) { |
160 | - if(strpbrk($filename, $acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>') === FALSE) return true; |
|
162 | + if(strpbrk($filename, $acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>') === FALSE) { |
|
163 | + return true; |
|
164 | + } |
|
161 | 165 | return false; |
162 | 166 | } |
163 | 167 |
@@ -64,10 +64,16 @@ |
||
64 | 64 | */ |
65 | 65 | private function extractPlace(?Place $place, int $depth, bool $strict_depth): ?Place |
66 | 66 | { |
67 | - if($place === null) return null; |
|
68 | - if(mb_strlen($place->gedcomName()) === 0) return null; |
|
67 | + if($place === null) { |
|
68 | + return null; |
|
69 | + } |
|
70 | + if(mb_strlen($place->gedcomName()) === 0) { |
|
71 | + return null; |
|
72 | + } |
|
69 | 73 | $parts = $place->lastParts($depth); |
70 | - if($strict_depth && $parts->count() !== $depth) return new Place(self::INVALID_PLACE, $place->tree()); |
|
74 | + if($strict_depth && $parts->count() !== $depth) { |
|
75 | + return new Place(self::INVALID_PLACE, $place->tree()); |
|
76 | + } |
|
71 | 77 | return new Place($parts->implode(', '), $place->tree()); |
72 | 78 | } |
73 | 79 |
@@ -77,8 +77,7 @@ |
||
77 | 77 | if($feature_collection instanceof FeatureCollection) { |
78 | 78 | return $feature_collection->getFeatures(); |
79 | 79 | } |
80 | - } |
|
81 | - catch(Throwable $ex) { } |
|
80 | + } catch(Throwable $ex) { } |
|
82 | 81 | return []; |
83 | 82 | } |
84 | 83 |