@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | // Construct from an array (of three gedcom-style strings: "1900", "FEB", "4") |
109 | 109 | if (is_array($date)) { |
110 | - $this->d = (int)$date[2]; |
|
110 | + $this->d = (int) $date[2]; |
|
111 | 111 | if (array_key_exists($date[1], static::$MONTH_ABBREV)) { |
112 | 112 | $this->m = static::$MONTH_ABBREV[$date[1]]; |
113 | 113 | } else { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $jd = $date->calendar->ymdToJd($today[0], $date->m, $date->d == 0 ? $today[2] : $date->d); |
155 | 155 | } else { |
156 | 156 | // Complete date |
157 | - $jd = (int)(($date->maxJD + $date->minJD) / 2); |
|
157 | + $jd = (int) (($date->maxJD + $date->minJD) / 2); |
|
158 | 158 | } |
159 | 159 | list($this->y, $this->m, $this->d) = $this->calendar->jdToYmd($jd); |
160 | 160 | // New date has same precision as original date |
@@ -961,7 +961,7 @@ discard block |
||
961 | 961 | { |
962 | 962 | if ($number < 1) { |
963 | 963 | // Cannot convert zero/negative numbers |
964 | - return (string)$number; |
|
964 | + return (string) $number; |
|
965 | 965 | } |
966 | 966 | $roman = ''; |
967 | 967 | foreach (self::$roman_numerals as $key => $value) { |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | $num = 0; |
987 | 987 | foreach (self::$roman_numerals as $key => $value) { |
988 | 988 | if (strpos($roman, $value) === 0) { |
989 | - $num += $key; |
|
989 | + $num += $key; |
|
990 | 990 | $roman = substr($roman, strlen($value)); |
991 | 991 | } |
992 | 992 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | $calendar_service = new CalendarService(); |
70 | 70 | |
71 | - $days = (int)$this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
|
71 | + $days = (int) $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
|
72 | 72 | $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE); |
73 | 73 | $calendar = $this->getBlockSetting($block_id, 'calendar', self::DEFAULT_CALENDAR); |
74 | 74 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | $yahrzeit_date = new Date($yahrzeit_date->format('%@ %A %O %E')); |
124 | 124 | |
125 | - $yahrzeits[] = (object)[ |
|
125 | + $yahrzeits[] = (object) [ |
|
126 | 126 | 'individual' => $fact->getParent(), |
127 | 127 | 'fact_date' => $fact->getDate(), |
128 | 128 | 'fact' => $fact, |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $default_events = implode(',', self::DEFAULT_EVENTS); |
119 | 119 | |
120 | 120 | $days = $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
121 | - $filter = (bool)$this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER); |
|
121 | + $filter = (bool) $this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER); |
|
122 | 122 | $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE); |
123 | 123 | $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', self::DEFAULT_SORT); |
124 | 124 | $events = $this->getBlockSetting($block_id, 'events', $default_events); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $events_filter = implode('|', $event_array); |
137 | 137 | |
138 | 138 | $startjd = WT_CLIENT_JD + 1; |
139 | - $endjd = WT_CLIENT_JD + (int)$days; |
|
139 | + $endjd = WT_CLIENT_JD + (int) $days; |
|
140 | 140 | |
141 | 141 | $facts = $calendar_service->getEventsList($startjd, $endjd, $events_filter, $filter, $sortStyle, $tree); |
142 | 142 |
@@ -294,7 +294,7 @@ |
||
294 | 294 | public static function getAll(): array |
295 | 295 | { |
296 | 296 | if (empty(self::$trees)) { |
297 | - $rows = Database::prepare( |
|
297 | + $rows = Database::prepare( |
|
298 | 298 | "SELECT g.gedcom_id AS tree_id, g.gedcom_name AS tree_name, gs1.setting_value AS tree_title" . |
299 | 299 | " FROM `##gedcom` g" . |
300 | 300 | " LEFT JOIN `##gedcom_setting` gs1 ON (g.gedcom_id=gs1.gedcom_id AND gs1.setting_name='title')" . |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | "SELECT DISTINCT f_id AS xref, f_gedcom AS gedcom, d_type, d_day, d_month, d_year, d_fact" . |
184 | 184 | " FROM `##dates` JOIN `##families` ON d_gid = f_id AND d_file = f_file" . |
185 | 185 | " WHERE d_type = :type AND d_file = :tree_id"; |
186 | - $args = [ |
|
186 | + $args = [ |
|
187 | 187 | 'type' => $anniv->format('%@'), |
188 | 188 | 'tree_id' => $tree->getTreeId(), |
189 | 189 | ]; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $where .= " AND d_day = :day"; |
214 | 214 | $args['day'] = $anniv->d; |
215 | 215 | } |
216 | - $where .= " AND d_mon = :month"; |
|
216 | + $where .= " AND d_mon = :month"; |
|
217 | 217 | $args['month'] = $anniv->m; |
218 | 218 | } else { |
219 | 219 | // SPECIAL CASES: |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) { |
228 | 228 | $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2"; |
229 | 229 | } else { |
230 | - $where .= " AND d_day = :day AND d_mon = 2"; |
|
230 | + $where .= " AND d_day = :day AND d_mon = 2"; |
|
231 | 231 | $args['day'] = $anniv->d; |
232 | 232 | } |
233 | 233 | break; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) { |
251 | 251 | $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3"; |
252 | 252 | } else { |
253 | - $where .= " AND d_day = :day AND d_mon = 3"; |
|
253 | + $where .= " AND d_day = :day AND d_mon = 3"; |
|
254 | 254 | $args['day'] = $anniv->d; |
255 | 255 | } |
256 | 256 | break; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | } |
307 | 307 | // Only events in the past (includes dates without a year) |
308 | - $where .= " AND d_year <= :year"; |
|
308 | + $where .= " AND d_year <= :year"; |
|
309 | 309 | $args['year'] = $anniv->y; |
310 | 310 | |
311 | 311 | if ($facts) { |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | // Fixing the width for td to the box initial width when the person is the root person fix a rare bug that happen when a person without child and without known parents is the root person : an unwanted white rectangle appear at the right of the person’s boxes, otherwise. |
255 | 255 | $html .= '<td' . ($isRoot ? ' style="width:1px"' : '') . '><div class="tv_box' . ($isRoot ? ' rootPerson' : '') . '" dir="' . I18N::direction() . '" style="text-align: ' . (I18N::direction() === 'rtl' ? 'right' : 'left') . '; direction: ' . I18N::direction() . '" abbr="' . $person->getXref() . '" onclick="' . $this->name . 'Handler.expandBox(this, event);">'; |
256 | 256 | $html .= $this->drawPersonName($person); |
257 | - $fop = []; // $fop is fathers of partners |
|
257 | + $fop = []; // $fop is fathers of partners |
|
258 | 258 | if ($partner !== null) { |
259 | 259 | $dashed = ''; |
260 | 260 | foreach ($person->getSpouseFamilies() as $family) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $spouse_parents, |
273 | 273 | ]; |
274 | 274 | } |
275 | - $html .= $this->drawPersonName($spouse, $dashed); |
|
275 | + $html .= $this->drawPersonName($spouse, $dashed); |
|
276 | 276 | $dashed = 'dashed'; |
277 | 277 | } |
278 | 278 | } |
@@ -292,9 +292,9 @@ discard block |
||
292 | 292 | /* draw the parents */ |
293 | 293 | if ($state >= 0 && (!empty($parent) || count($fop))) { |
294 | 294 | $unique = (empty($parent) || count($fop) == 0); |
295 | - $html .= '<td align="left"><table class="tv_tree"><tbody>'; |
|
295 | + $html .= '<td align="left"><table class="tv_tree"><tbody>'; |
|
296 | 296 | if (!empty($parent)) { |
297 | - $u = $unique ? 'c' : 't'; |
|
297 | + $u = $unique ? 'c' : 't'; |
|
298 | 298 | $html .= '<tr><td ' . ($gen == 0 ? ' abbr="p' . $primaryChildFamily->getXref() . '@' . $u . '"' : '') . '>'; |
299 | 299 | $html .= $this->drawPerson($parent, $gen - 1, 1, $primaryChildFamily, $u); |
300 | 300 | $html .= '</td></tr>'; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $nb = count($fop); |
305 | 305 | foreach ($fop as $p) { |
306 | 306 | $n++; |
307 | - $u = $unique ? 'c' : ($n == $nb || empty($p[1]) ? 'b' : 'h'); |
|
307 | + $u = $unique ? 'c' : ($n == $nb || empty($p[1]) ? 'b' : 'h'); |
|
308 | 308 | $html .= '<tr><td ' . ($gen == 0 ? ' abbr="p' . $p[1]->getXref() . '@' . $u . '"' : '') . '>' . $this->drawPerson($p[0], $gen - 1, 1, $p[1], $u) . '</td></tr>'; |
309 | 309 | } |
310 | 310 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | if ($changes === '1' && $sendmail === '1') { |
75 | 75 | // There are pending changes - tell moderators/managers/administrators about them. |
76 | - if (WT_TIMESTAMP - (int)Site::getPreference('LAST_CHANGE_EMAIL') > (60 * 60 * 24 * $days)) { |
|
76 | + if (WT_TIMESTAMP - (int) Site::getPreference('LAST_CHANGE_EMAIL') > (60 * 60 * 24 * $days)) { |
|
77 | 77 | // Which users have pending changes? |
78 | 78 | foreach (User::all() as $user) { |
79 | 79 | if ($user->getPreference('contactmethod') !== 'none') { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | I18N::init($user->getPreference('language')); |
83 | 83 | |
84 | 84 | $sender = new User( |
85 | - (object)[ |
|
85 | + (object) [ |
|
86 | 86 | 'user_id' => null, |
87 | 87 | 'user_name' => '', |
88 | 88 | 'real_name' => $tmp_tree->getTitle(), |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | if ($sendmail === '1') { |
121 | 121 | $content .= I18N::translate('Last email reminder was sent ') . FunctionsDate::formatTimestamp(Site::getPreference('LAST_CHANGE_EMAIL')) . '<br>'; |
122 | - $content .= I18N::translate('Next email reminder will be sent after ') . FunctionsDate::formatTimestamp((int)Site::getPreference('LAST_CHANGE_EMAIL') + (60 * 60 * 24 * $days)) . '<br><br>'; |
|
122 | + $content .= I18N::translate('Next email reminder will be sent after ') . FunctionsDate::formatTimestamp((int) Site::getPreference('LAST_CHANGE_EMAIL') + (60 * 60 * 24 * $days)) . '<br><br>'; |
|
123 | 123 | } |
124 | 124 | $content .= '<ul>'; |
125 | 125 | $changes = Database::prepare( |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | public function page(Request $request): Response |
44 | 44 | { |
45 | 45 | $surname = $request->get('surname', ''); |
46 | - $soundex_std = (bool)$request->get('soundex_std'); |
|
47 | - $soundex_dm = (bool)$request->get('soundex_dm'); |
|
46 | + $soundex_std = (bool) $request->get('soundex_std'); |
|
47 | + $soundex_dm = (bool) $request->get('soundex_dm'); |
|
48 | 48 | |
49 | 49 | if ($surname !== '') { |
50 | 50 | /* I18N: %s is a surname */ |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function list(Request $request, Tree $tree, User $user): Response |
73 | 73 | { |
74 | - $soundex_dm = (bool)$request->get('soundex_dm'); |
|
75 | - $soundex_std = (bool)$request->get('soundex_std'); |
|
74 | + $soundex_dm = (bool) $request->get('soundex_dm'); |
|
75 | + $soundex_std = (bool) $request->get('soundex_std'); |
|
76 | 76 | $surname = $request->get('surname', ''); |
77 | 77 | |
78 | 78 | // Highlight direct-line ancestors of this individual. |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $sdx = Soundex::russell($surname); |
161 | 161 | if ($sdx !== '') { |
162 | 162 | foreach (explode(':', $sdx) as $value) { |
163 | - $sql .= " OR n_soundex_surn_std LIKE CONCAT('%', ?, '%')"; |
|
163 | + $sql .= " OR n_soundex_surn_std LIKE CONCAT('%', ?, '%')"; |
|
164 | 164 | $args[] = $value; |
165 | 165 | } |
166 | 166 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $sdx = Soundex::daitchMokotoff($surname); |
171 | 171 | if ($sdx !== '') { |
172 | 172 | foreach (explode(':', $sdx) as $value) { |
173 | - $sql .= " OR n_soundex_surn_dm LIKE CONCAT('%', ?, '%')"; |
|
173 | + $sql .= " OR n_soundex_surn_dm LIKE CONCAT('%', ?, '%')"; |
|
174 | 174 | $args[] = $value; |
175 | 175 | } |
176 | 176 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | private static function sosaGeneration($sosa): string |
342 | 342 | { |
343 | - $generation = (int)log($sosa, 2) + 1; |
|
343 | + $generation = (int) log($sosa, 2) + 1; |
|
344 | 344 | |
345 | 345 | return '<sup title="' . I18N::translate('Generation') . '">' . $generation . '</sup>'; |
346 | 346 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | private function significant(Family $family): stdClass |
64 | 64 | { |
65 | - $significant = (object)[ |
|
65 | + $significant = (object) [ |
|
66 | 66 | 'family' => $family, |
67 | 67 | 'individual' => null, |
68 | 68 | 'surname' => '', |