@@ -175,7 +175,7 @@ |
||
175 | 175 | 'words' => I18N::translate('Match the exact text, unless it occurs in the middle of a word.'), |
176 | 176 | 'wildcards' => I18N::translate('Use a “?” to match a single character, use “*” to match zero or more characters.'), |
177 | 177 | /* I18N: http://en.wikipedia.org/wiki/Regular_expression */ |
178 | - 'regex' => I18N::translate('Regular expressions are an advanced pattern matching technique.') . '<br>' . I18N::translate('See %s for more information.', '<a href="http://php.net/manual/regexp.reference.php">php.net/manual/regexp.reference.php</a>'), |
|
178 | + 'regex' => I18N::translate('Regular expressions are an advanced pattern matching technique.') . '<br>' . I18N::translate('See %s for more information.', '<a href="http://php.net/manual/regexp.reference.php">php.net/manual/regexp.reference.php</a>'), |
|
179 | 179 | ]; |
180 | 180 | |
181 | 181 | return |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | { |
53 | 53 | $this->checkModuleIsActive($tree, 'lifespans_chart'); |
54 | 54 | |
55 | - $xrefs = (array)$request->get('xrefs', []); |
|
55 | + $xrefs = (array) $request->get('xrefs', []); |
|
56 | 56 | $addxref = $request->get('addxref', ''); |
57 | - $addfam = (bool)$request->get('addfam', false); |
|
57 | + $addfam = (bool) $request->get('addfam', false); |
|
58 | 58 | $placename = $request->get('placename', ''); |
59 | 59 | $start = $request->get('start', ''); |
60 | 60 | $end = $request->get('end', ''); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $this->checkModuleIsActive($tree, 'lifespans_chart'); |
113 | 113 | |
114 | - $xrefs = (array)$request->get('xrefs', []); |
|
114 | + $xrefs = (array) $request->get('xrefs', []); |
|
115 | 115 | $xrefs = array_unique($xrefs); |
116 | 116 | |
117 | 117 | /** @var Individual[] $individuals */ |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $subtitle = $request->get('subtitle'); |
132 | 132 | |
133 | 133 | // Round to whole decades |
134 | - $start_year = (int)floor($this->minYear($individuals) / 10) * 10; |
|
135 | - $end_year = (int)ceil($this->maxYear($individuals) / 10) * 10; |
|
134 | + $start_year = (int) floor($this->minYear($individuals) / 10) * 10; |
|
135 | + $end_year = (int) ceil($this->maxYear($individuals) / 10) * 10; |
|
136 | 136 | |
137 | 137 | $lifespans = $this->layoutIndividuals($individuals); |
138 | 138 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | 'U' => new ColorGenerator(120, self::SATURATION, self::LIGHTNESS, self::ALPHA, self::RANGE), |
168 | 168 | ]; |
169 | 169 | |
170 | - $current_year = (int)date('Y'); |
|
170 | + $current_year = (int) date('Y'); |
|
171 | 171 | |
172 | 172 | // Latest year used in each row |
173 | 173 | $rows = []; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | // Fill the row up to the year (leaving a small gap) |
197 | 197 | $rows[$next_row] = $death_year; |
198 | 198 | |
199 | - $lifespans[] = (object)[ |
|
199 | + $lifespans[] = (object) [ |
|
200 | 200 | 'background' => $colors[$individual->getSex()]->getNextColor(), |
201 | 201 | 'birth_year' => $birth_year, |
202 | 202 | 'death_year' => $death_year, |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $year = $this->jdToYear($jd); |
226 | 226 | |
227 | 227 | // Don't show future dates |
228 | - return min($year, (int)date('Y')); |
|
228 | + return min($year, (int) date('Y')); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | ->setPreference('sessiontime', '0'); |
119 | 119 | |
120 | 120 | // Create a dummy user, so we can send messages from the tree. |
121 | - $sender = new User((object)[ |
|
121 | + $sender = new User((object) [ |
|
122 | 122 | 'user_id' => null, |
123 | 123 | 'user_name' => '', |
124 | 124 | 'real_name' => $tree->getTitle(), |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | ); |
138 | 138 | |
139 | 139 | // Tell the genealogy contact about the registration. |
140 | - $webmaster = User::find((int)$tree->getPreference('WEBMASTER_USER_ID')); |
|
140 | + $webmaster = User::find((int) $tree->getPreference('WEBMASTER_USER_ID')); |
|
141 | 141 | |
142 | 142 | if ($webmaster !== null) { |
143 | 143 | I18N::init($webmaster->getPreference('language')); |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | |
63 | 63 | $this->checkIndividualAccess($individual); |
64 | 64 | |
65 | - $chart_style = (int)$request->get('chart_style', self::DEFAULT_STYLE); |
|
66 | - $fan_width = (int)$request->get('fan_width', self::DEFAULT_WIDTH); |
|
67 | - $generations = (int)$request->get('generations', self::DEFAULT_GENERATIONS); |
|
65 | + $chart_style = (int) $request->get('chart_style', self::DEFAULT_STYLE); |
|
66 | + $fan_width = (int) $request->get('fan_width', self::DEFAULT_WIDTH); |
|
67 | + $generations = (int) $request->get('generations', self::DEFAULT_GENERATIONS); |
|
68 | 68 | |
69 | 69 | $fan_width = min($fan_width, self::MAXIMUM_WIDTH); |
70 | 70 | $fan_width = max($fan_width, self::MINIMUM_WIDTH); |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->checkIndividualAccess($individual); |
108 | 108 | |
109 | - $chart_style = (int)$request->get('chart_style', self::DEFAULT_STYLE); |
|
110 | - $fan_width = (int)$request->get('fan_width', self::DEFAULT_WIDTH); |
|
111 | - $generations = (int)$request->get('generations', self::DEFAULT_GENERATIONS); |
|
109 | + $chart_style = (int) $request->get('chart_style', self::DEFAULT_STYLE); |
|
110 | + $fan_width = (int) $request->get('fan_width', self::DEFAULT_WIDTH); |
|
111 | + $generations = (int) $request->get('generations', self::DEFAULT_GENERATIONS); |
|
112 | 112 | |
113 | 113 | $fan_width = min($fan_width, self::MAXIMUM_WIDTH); |
114 | 114 | $fan_width = max($fan_width, self::MINIMUM_WIDTH); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $scale = $fanw / 640; |
138 | 138 | |
139 | 139 | // Create the image |
140 | - $image = imagecreate((int)$fanw, (int)$fanh); |
|
140 | + $image = imagecreate((int) $fanw, (int) $fanh); |
|
141 | 141 | |
142 | 142 | // Create colors |
143 | 143 | $transparent = imagecolorallocate($image, 0, 0, 0); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | ]; |
155 | 155 | |
156 | 156 | |
157 | - imagefilledrectangle($image, 0, 0, (int)$fanw, (int)$fanh, $transparent); |
|
157 | + imagefilledrectangle($image, 0, 0, (int) $fanw, (int) $fanh, $transparent); |
|
158 | 158 | |
159 | 159 | $fandeg = 90 * $chart_style; |
160 | 160 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | // clean current generation area |
170 | 170 | $deg2 = 360 + ($fandeg - 180) / 2; |
171 | 171 | $deg1 = $deg2 - $fandeg; |
172 | - imagefilledarc($image, (int)$cx, (int)$cy, (int)$rx, (int)$rx, (int)$deg1, (int)$deg2, $backgrounds['U'], IMG_ARC_PIE); |
|
172 | + imagefilledarc($image, (int) $cx, (int) $cy, (int) $rx, (int) $rx, (int) $deg1, (int) $deg2, $backgrounds['U'], IMG_ARC_PIE); |
|
173 | 173 | $rx -= 3; |
174 | 174 | |
175 | 175 | // calculate new angle |
@@ -199,15 +199,15 @@ discard block |
||
199 | 199 | |
200 | 200 | $background = $backgrounds[$person->getSex()]; |
201 | 201 | |
202 | - imagefilledarc($image, (int)$cx, (int)$cy, (int)$rx, (int)$rx, (int)$deg1, (int)$deg2, $background, IMG_ARC_PIE); |
|
202 | + imagefilledarc($image, (int) $cx, (int) $cy, (int) $rx, (int) $rx, (int) $deg1, (int) $deg2, $background, IMG_ARC_PIE); |
|
203 | 203 | |
204 | 204 | // split and center text by lines |
205 | - $wmax = (int)($angle * 7 / 7 * $scale); |
|
205 | + $wmax = (int) ($angle * 7 / 7 * $scale); |
|
206 | 206 | $wmax = min($wmax, 35 * $scale); |
207 | 207 | if ($gen == 0) { |
208 | 208 | $wmax = min($wmax, 17 * $scale); |
209 | 209 | } |
210 | - $text = $this->splitAlignText($text, (int)$wmax); |
|
210 | + $text = $this->splitAlignText($text, (int) $wmax); |
|
211 | 211 | |
212 | 212 | // text angle |
213 | 213 | $tangle = 270 - ($deg1 + $angle / 2); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | } |
377 | 377 | $line .= "$word"; |
378 | 378 | } else { |
379 | - $p = max(0, (int)(($maxlen - $len) / 2)); |
|
379 | + $p = max(0, (int) (($maxlen - $len) / 2)); |
|
380 | 380 | if (!empty($line)) { |
381 | 381 | $line = str_repeat(' ', $p) . $line; // center alignment using spaces |
382 | 382 | $text .= $line . "\n"; |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | if (in_array(ord($line{0}), $RTLOrd)) { |
392 | 392 | $len /= 2; |
393 | 393 | } |
394 | - $p = max(0, (int)(($maxlen - $len) / 2)); |
|
394 | + $p = max(0, (int) (($maxlen - $len) / 2)); |
|
395 | 395 | $line = str_repeat(' ', $p) . $line; // center alignment using spaces |
396 | 396 | $text .= $line; |
397 | 397 | } |
@@ -411,9 +411,9 @@ discard block |
||
411 | 411 | { |
412 | 412 | return imagecolorallocate( |
413 | 413 | $image, |
414 | - (int)hexdec(substr($css_color, 0, 2)), |
|
415 | - (int)hexdec(substr($css_color, 2, 2)), |
|
416 | - (int)hexdec(substr($css_color, 4, 2)) |
|
414 | + (int) hexdec(substr($css_color, 0, 2)), |
|
415 | + (int) hexdec(substr($css_color, 2, 2)), |
|
416 | + (int) hexdec(substr($css_color, 4, 2)) |
|
417 | 417 | ); |
418 | 418 | } |
419 | 419 |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | $z_axis = $this->axisAll(); |
577 | 577 | // The stats query doesn't have an "all" function, so query M/F/U separately |
578 | 578 | foreach (['M', 'F', 'U'] as $sex) { |
579 | - $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
579 | + $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
580 | 580 | $indi = []; |
581 | 581 | foreach ($rows as $row) { |
582 | 582 | if (!in_array($row->d_gid, $indi)) { |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | case self::Z_AXIS_SEX: |
590 | 590 | $z_axis = $this->axisSexes(); |
591 | 591 | foreach (array_keys($z_axis) as $sex) { |
592 | - $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
592 | + $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
593 | 593 | $indi = []; |
594 | 594 | foreach ($rows as $row) { |
595 | 595 | if (!in_array($row->d_gid, $indi)) { |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | // The stats query doesn't have an "all" function, so query M/F/U separately |
606 | 606 | foreach (['M', 'F', 'U'] as $sex) { |
607 | 607 | $prev_boundary = 0; |
608 | - $indi = []; |
|
608 | + $indi = []; |
|
609 | 609 | foreach (array_keys($z_axis) as $boundary) { |
610 | 610 | $rows = $stats->statsMarrAgeQuery(false, $sex, $prev_boundary, $boundary); |
611 | 611 | foreach ($rows as $row) { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $breadcrumbs[] = I18N::translate('Add'); |
107 | 107 | } else { |
108 | 108 | $breadcrumbs[] = I18N::translate('Edit'); |
109 | - $title .= ' — ' . I18N::translate('Edit'); |
|
109 | + $title .= ' — ' . I18N::translate('Edit'); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return $this->viewResponse('admin/location-edit', [ |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function exportLocations(Request $request): Response |
242 | 242 | { |
243 | - $parent_id = (int)$request->get('parent_id'); |
|
243 | + $parent_id = (int) $request->get('parent_id'); |
|
244 | 244 | $format = $request->get('format'); |
245 | 245 | $maxlevel = (int) Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne(); |
246 | 246 | $startfqpn = []; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | */ |
299 | 299 | public function importLocations(Request $request): Response |
300 | 300 | { |
301 | - $parent_id = (int) $request->get('parent_id'); |
|
301 | + $parent_id = (int) $request->get('parent_id'); |
|
302 | 302 | |
303 | 303 | $files = array_merge( |
304 | 304 | glob(WT_DATA_DIR . 'places/*.csv'), |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | } |
352 | 352 | |
353 | 353 | if (is_file($filename)) { |
354 | - $string = file_get_contents($filename); |
|
354 | + $string = file_get_contents($filename); |
|
355 | 355 | |
356 | 356 | // Check the filetype |
357 | 357 | if (stripos($string, 'FeatureCollection') !== false) { |
@@ -401,10 +401,10 @@ discard block |
||
401 | 401 | usort( |
402 | 402 | $places, |
403 | 403 | function (array $a, array $b) { |
404 | - if ((int)$a['pl_level'] === (int)$b['pl_level']) { |
|
404 | + if ((int) $a['pl_level'] === (int) $b['pl_level']) { |
|
405 | 405 | return I18N::strcasecmp($a['fqpn'], $b['fqpn']); |
406 | 406 | } else { |
407 | - return (int)$a['pl_level'] - (int)$b['pl_level']; |
|
407 | + return (int) $a['pl_level'] - (int) $b['pl_level']; |
|
408 | 408 | } |
409 | 409 | } |
410 | 410 | ); |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | "INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place)" . |
522 | 522 | " VALUES (:id, :parent, :level, :place)" |
523 | 523 | ); |
524 | - $checkRecordQry = Database::prepare( |
|
524 | + $checkRecordQry = Database::prepare( |
|
525 | 525 | "SELECT pl1.pl_id" . |
526 | 526 | " FROM `##placelocation` AS pl1" . |
527 | 527 | " LEFT JOIN `##placelocation` AS pl2 ON (pl1.pl_parent_id = pl2.pl_id)" . |
@@ -34,6 +34,6 @@ |
||
34 | 34 | */ |
35 | 35 | public function generate(Individual $individual, Individual $head) |
36 | 36 | { |
37 | - return (string)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
37 | + return (string) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
38 | 38 | } |
39 | 39 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | { |
215 | 215 | if ($analytics_id) { |
216 | 216 | // Add extra dimensions (i.e. filtering categories) |
217 | - $dimensions = (object)[ |
|
217 | + $dimensions = (object) [ |
|
218 | 218 | 'dimension1' => $this->tree ? $this->tree->getName() : '-', |
219 | 219 | 'dimension2' => $this->tree ? Auth::accessLevel($this->tree) : '-', |
220 | 220 | ]; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | if ($project_id && $security_id) { |
277 | 277 | return |
278 | 278 | '<script>' . |
279 | - 'var sc_project=' . (int)$project_id . ',sc_invisible=1,sc_security="' . $security_id . |
|
279 | + 'var sc_project=' . (int) $project_id . ',sc_invisible=1,sc_security="' . $security_id . |
|
280 | 280 | '",scJsHost = (("https:"===document.location.protocol)?"https://secure.":"http://www.");' . |
281 | 281 | 'document.write("<sc"+"ript src=\'"+scJsHost+"statcounter.com/counter/counter.js\'></"+"script>");' . |
282 | 282 | '</script>'; |
@@ -1803,7 +1803,7 @@ discard block |
||
1803 | 1803 | public function menuSearchPhonetic() |
1804 | 1804 | { |
1805 | 1805 | /* I18N: search using “sounds like”, rather than exact spelling */ |
1806 | - return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged' => $this->tree->getName(), 'action' => 'soundex',]), 'menu-search-soundex', ['rel' => 'nofollow']); |
|
1806 | + return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged' => $this->tree->getName(), 'action' => 'soundex', ]), 'menu-search-soundex', ['rel' => 'nofollow']); |
|
1807 | 1807 | } |
1808 | 1808 | |
1809 | 1809 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $user_list[$tmp_user->getUserName()] = $tmp_user->getUserName(); |
166 | 166 | } |
167 | 167 | |
168 | - $action = $request->get('action'); |
|
168 | + $action = $request->get('action'); |
|
169 | 169 | |
170 | 170 | // @TODO This ought to be a POST action |
171 | 171 | if ($action === 'delete') { |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function changesLogData(Request $request): Response |
233 | 233 | { |
234 | - list($select, , $where, $args1) = $this->changesQuery($request); |
|
234 | + list($select,, $where, $args1) = $this->changesQuery($request); |
|
235 | 235 | list($order_by, $limit, $args2) = $this->dataTablesPagination($request); |
236 | 236 | |
237 | 237 | $rows = Database::prepare( |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | )->execute(array_merge($args1, $args2))->fetchAll(); |
240 | 240 | |
241 | 241 | // Total filtered/unfiltered rows |
242 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
243 | - $recordsTotal = (int)Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne(); |
|
242 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
243 | + $recordsTotal = (int) Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne(); |
|
244 | 244 | |
245 | 245 | $data = []; |
246 | 246 | $algorithm = new MyersDiff(); |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | // See http://www.datatables.net/usage/server-side |
293 | 293 | return new JsonResponse([ |
294 | - 'draw' => (int)$request->get('draw'), |
|
294 | + 'draw' => (int) $request->get('draw'), |
|
295 | 295 | 'recordsTotal' => $recordsTotal, |
296 | 296 | 'recordsFiltered' => $recordsFiltered, |
297 | 297 | 'data' => $data, |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function changesLogDownload(Request $request): Response |
309 | 309 | { |
310 | - list($select, , $where, $args) = $this->changesQuery($request); |
|
310 | + list($select,, $where, $args) = $this->changesQuery($request); |
|
311 | 311 | |
312 | 312 | $rows = Database::prepare($select . $where)->execute($args)->fetchAll(); |
313 | 313 | |
@@ -449,8 +449,8 @@ discard block |
||
449 | 449 | 'RESN', |
450 | 450 | ]; |
451 | 451 | |
452 | - $start = (int)$request->get('start', 0); |
|
453 | - $length = (int)$request->get('length', 20); |
|
452 | + $start = (int) $request->get('start', 0); |
|
453 | + $length = (int) $request->get('length', 20); |
|
454 | 454 | $search = $request->get('search', []); |
455 | 455 | $search = $search['value'] ?? ''; |
456 | 456 | |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | $args = []; |
471 | 471 | |
472 | 472 | if ($search !== '') { |
473 | - $where .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))"; |
|
473 | + $where .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))"; |
|
474 | 474 | $args['search1'] = $search; |
475 | 475 | $args['search2'] = $search; |
476 | 476 | } |
@@ -489,8 +489,8 @@ discard block |
||
489 | 489 | )->fetchAll(); |
490 | 490 | |
491 | 491 | // Total filtered/unfiltered rows |
492 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
493 | - $recordsTotal = (int)Database::prepare($select2)->fetchOne(); |
|
492 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
493 | + $recordsTotal = (int) Database::prepare($select2)->fetchOne(); |
|
494 | 494 | |
495 | 495 | // Turn each row from the query into a row for the table |
496 | 496 | $data = array_map(function (stdClass $datum) use ($ignore_facts) { |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | }, $data); |
533 | 533 | |
534 | 534 | return new JsonResponse([ |
535 | - 'draw' => (int)$request->get('draw'), |
|
535 | + 'draw' => (int) $request->get('draw'), |
|
536 | 536 | 'recordsTotal' => $recordsTotal, |
537 | 537 | 'recordsFiltered' => $recordsFiltered, |
538 | 538 | 'data' => $data, |
@@ -621,8 +621,8 @@ discard block |
||
621 | 621 | */ |
622 | 622 | public function webtrees1ThumbnailsData(Request $request): JsonResponse |
623 | 623 | { |
624 | - $start = (int)$request->get('start', 0); |
|
625 | - $length = (int)$request->get('length', 20); |
|
624 | + $start = (int) $request->get('start', 0); |
|
625 | + $length = (int) $request->get('length', 20); |
|
626 | 626 | $search = $request->get('search', []); |
627 | 627 | $search = $search['value'] ?? ''; |
628 | 628 | |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | $data = array_map(function (string $thumbnail) { |
654 | 654 | $original = $this->findOriginalFileFromThumbnail($thumbnail); |
655 | 655 | |
656 | - $original_url = route('unused-media-thumbnail', [ |
|
656 | + $original_url = route('unused-media-thumbnail', [ |
|
657 | 657 | 'folder' => dirname($original), |
658 | 658 | 'file' => basename($original), |
659 | 659 | 'w' => 100, |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | }, $thumbnails); |
696 | 696 | |
697 | 697 | return new JsonResponse([ |
698 | - 'draw' => (int)$request->get('draw'), |
|
698 | + 'draw' => (int) $request->get('draw'), |
|
699 | 699 | 'recordsTotal' => $recordsTotal, |
700 | 700 | 'recordsFiltered' => $recordsFiltered, |
701 | 701 | 'data' => $data, |
@@ -1021,7 +1021,7 @@ discard block |
||
1021 | 1021 | */ |
1022 | 1022 | public function treePrivacyUpdate(Request $request, Tree $tree): RedirectResponse |
1023 | 1023 | { |
1024 | - foreach ((array)$request->get('delete') as $default_resn_id) { |
|
1024 | + foreach ((array) $request->get('delete') as $default_resn_id) { |
|
1025 | 1025 | Database::prepare( |
1026 | 1026 | "DELETE FROM `##default_resn` WHERE default_resn_id = :default_resn_id" |
1027 | 1027 | )->execute([ |
@@ -1029,13 +1029,13 @@ discard block |
||
1029 | 1029 | ]); |
1030 | 1030 | } |
1031 | 1031 | |
1032 | - $xrefs = (array)$request->get('xref'); |
|
1033 | - $tag_types = (array)$request->get('tag_type'); |
|
1034 | - $resns = (array)$request->get('resn'); |
|
1032 | + $xrefs = (array) $request->get('xref'); |
|
1033 | + $tag_types = (array) $request->get('tag_type'); |
|
1034 | + $resns = (array) $request->get('resn'); |
|
1035 | 1035 | |
1036 | 1036 | foreach ($xrefs as $n => $xref) { |
1037 | - $tag_type = (string)$tag_types[$n]; |
|
1038 | - $resn = (string)$resns[$n]; |
|
1037 | + $tag_type = (string) $tag_types[$n]; |
|
1038 | + $resn = (string) $resns[$n]; |
|
1039 | 1039 | |
1040 | 1040 | if ($tag_type !== '' || $xref !== '') { |
1041 | 1041 | // Delete any existing data |
@@ -1081,10 +1081,10 @@ discard block |
||
1081 | 1081 | FlashMessages::addMessage(I18N::translate('The preferences for the family tree “%s” have been updated.', e($tree->getTitle()), 'success')); |
1082 | 1082 | |
1083 | 1083 | // Coming soon... |
1084 | - if ((bool)$request->get('all_trees')) { |
|
1084 | + if ((bool) $request->get('all_trees')) { |
|
1085 | 1085 | FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.', e($tree->getTitle())), 'success'); |
1086 | 1086 | } |
1087 | - if ((bool)$request->get('new_trees')) { |
|
1087 | + if ((bool) $request->get('new_trees')) { |
|
1088 | 1088 | FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.', e($tree->getTitle())), 'success'); |
1089 | 1089 | } |
1090 | 1090 | |
@@ -1107,7 +1107,7 @@ discard block |
||
1107 | 1107 | foreach ($modules as $module) { |
1108 | 1108 | foreach (Tree::getAll() as $tree) { |
1109 | 1109 | $key = 'access-' . $module->getName() . '-' . $tree->getTreeId(); |
1110 | - $access_level = (int)$request->get($key, $module->defaultAccessLevel()); |
|
1110 | + $access_level = (int) $request->get($key, $module->defaultAccessLevel()); |
|
1111 | 1111 | |
1112 | 1112 | Database::prepare("REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (:module_name, :tree_id, :component, :access_level)")->execute([ |
1113 | 1113 | 'module_name' => $module->getName(), |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | $module_status = Database::prepare("SELECT module_name, status FROM `##module`")->fetchAssoc(); |
1135 | 1135 | |
1136 | 1136 | foreach ($modules as $module) { |
1137 | - $new_status = (bool)$request->get('status-' . $module->getName()) ? 'enabled' : 'disabled'; |
|
1137 | + $new_status = (bool) $request->get('status-' . $module->getName()) ? 'enabled' : 'disabled'; |
|
1138 | 1138 | $old_status = $module_status[$module->getName()]; |
1139 | 1139 | |
1140 | 1140 | if ($new_status !== $old_status) { |
@@ -1197,36 +1197,36 @@ discard block |
||
1197 | 1197 | $where = ' WHERE 1'; |
1198 | 1198 | $args = []; |
1199 | 1199 | if ($search !== '') { |
1200 | - $where .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))"; |
|
1200 | + $where .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))"; |
|
1201 | 1201 | $args['search_1'] = $search; |
1202 | 1202 | $args['search_2'] = $search; |
1203 | 1203 | } |
1204 | 1204 | if ($from !== '') { |
1205 | - $where .= " AND change_time >= :from"; |
|
1205 | + $where .= " AND change_time >= :from"; |
|
1206 | 1206 | $args['from'] = $from; |
1207 | 1207 | } |
1208 | 1208 | if ($to !== '') { |
1209 | - $where .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day |
|
1209 | + $where .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day |
|
1210 | 1210 | $args['to'] = $to; |
1211 | 1211 | } |
1212 | 1212 | if ($type !== '') { |
1213 | - $where .= ' AND status = :status'; |
|
1213 | + $where .= ' AND status = :status'; |
|
1214 | 1214 | $args['status'] = $type; |
1215 | 1215 | } |
1216 | 1216 | if ($oldged !== '') { |
1217 | - $where .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')"; |
|
1217 | + $where .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')"; |
|
1218 | 1218 | $args['old_ged'] = $oldged; |
1219 | 1219 | } |
1220 | 1220 | if ($newged !== '') { |
1221 | - $where .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')"; |
|
1221 | + $where .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')"; |
|
1222 | 1222 | $args['new_ged'] = $newged; |
1223 | 1223 | } |
1224 | 1224 | if ($xref !== '') { |
1225 | - $where .= " AND xref = :xref"; |
|
1225 | + $where .= " AND xref = :xref"; |
|
1226 | 1226 | $args['xref'] = $xref; |
1227 | 1227 | } |
1228 | 1228 | if ($username !== '') { |
1229 | - $where .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
1229 | + $where .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
1230 | 1230 | $args['user'] = $username; |
1231 | 1231 | } |
1232 | 1232 | if ($ged !== '') { |
@@ -1277,8 +1277,8 @@ discard block |
||
1277 | 1277 | */ |
1278 | 1278 | private function dataTablesPagination(Request $request): array |
1279 | 1279 | { |
1280 | - $start = (int)$request->get('start', '0'); |
|
1281 | - $length = (int)$request->get('length', '0'); |
|
1280 | + $start = (int) $request->get('start', '0'); |
|
1281 | + $length = (int) $request->get('length', '0'); |
|
1282 | 1282 | $order = $request->get('order', []); |
1283 | 1283 | $args = []; |
1284 | 1284 | |
@@ -1429,7 +1429,7 @@ discard block |
||
1429 | 1429 | } |
1430 | 1430 | |
1431 | 1431 | // The maximum difference is 255 (black versus white). |
1432 | - return 100 - (int)($max_difference * 100 / 255); |
|
1432 | + return 100 - (int) ($max_difference * 100 / 255); |
|
1433 | 1433 | } |
1434 | 1434 | |
1435 | 1435 | /** |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | $pixels[$x] = []; |
1461 | 1461 | for ($y = 0; $y < $size; ++$y) { |
1462 | 1462 | $pixel = $image->pickColor($x, $y); |
1463 | - $pixels[$x][$y] = (int)(($pixel[0] + $pixel[1] + $pixel[2]) / 3); |
|
1463 | + $pixels[$x][$y] = (int) (($pixel[0] + $pixel[1] + $pixel[2]) / 3); |
|
1464 | 1464 | } |
1465 | 1465 | } |
1466 | 1466 |