@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | $files = $request->get('files'); // local|external|unused |
120 | 120 | $search = $request->get('search'); |
121 | 121 | $search = $search['value']; |
122 | - $start = (int)$request->get('start'); |
|
123 | - $length = (int)$request->get('length'); |
|
122 | + $start = (int) $request->get('start'); |
|
123 | + $length = (int) $request->get('length'); |
|
124 | 124 | |
125 | 125 | // family tree setting MEDIA_DIRECTORY |
126 | 126 | $media_folders = $this->allMediaFolders(); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | " OR descriptive_title LIKE CONCAT('%', :search_2, '%'))" . |
157 | 157 | " AND multimedia_file_refn NOT LIKE 'http://%'" . |
158 | 158 | " AND multimedia_file_refn NOT LIKE 'https://%'"; |
159 | - $ARGS1 = [ |
|
159 | + $ARGS1 = [ |
|
160 | 160 | 'media_path_1' => $media_path, |
161 | 161 | 'media_folder' => $media_folder, |
162 | 162 | 'media_path_2' => Database::escapeLike($media_path), |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | " AND multimedia_file_refn LIKE CONCAT(:media_path_3, '%')" . |
174 | 174 | " AND multimedia_file_refn NOT LIKE 'http://%'" . |
175 | 175 | " AND multimedia_file_refn NOT LIKE 'https://%'"; |
176 | - $ARGS2 = [ |
|
176 | + $ARGS2 = [ |
|
177 | 177 | 'media_folder' => $media_folder, |
178 | 178 | 'media_path_3' => $media_path, |
179 | 179 | ]; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $ARGS2['media_path_4'] = Database::escapeLike($media_path); |
186 | 186 | } |
187 | 187 | |
188 | - $order = $request->get('order', []); |
|
188 | + $order = $request->get('order', []); |
|
189 | 189 | $SELECT1 .= " ORDER BY "; |
190 | 190 | if ($order) { |
191 | 191 | foreach ($order as $key => $value) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | if ($length > 0) { |
212 | - $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
212 | + $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
213 | 213 | $ARGS1['length'] = $length; |
214 | 214 | $ARGS1['start'] = $start; |
215 | 215 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | " JOIN `##media_file` USING (m_id, m_file)" . |
243 | 243 | " WHERE (multimedia_file_refn LIKE 'http://%' OR multimedia_file_refn LIKE 'https://%')" . |
244 | 244 | " AND (multimedia_file_refn LIKE CONCAT('%', :search_1, '%') OR descriptive_title LIKE CONCAT('%', :search_2, '%'))"; |
245 | - $ARGS1 = [ |
|
245 | + $ARGS1 = [ |
|
246 | 246 | 'search_1' => Database::escapeLike($search), |
247 | 247 | 'search_2' => Database::escapeLike($search), |
248 | 248 | ]; |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | |
280 | 280 | if ($length > 0) { |
281 | - $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
281 | + $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
282 | 282 | $ARGS1['length'] = $length; |
283 | 283 | $ARGS1['start'] = $start; |
284 | 284 | } |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | |
579 | 579 | // $dir comes from the database. The actual folder may not exist. |
580 | 580 | if (is_dir($dir)) { |
581 | - foreach (scandir($dir,SCANDIR_SORT_NONE) as $path) { |
|
581 | + foreach (scandir($dir, SCANDIR_SORT_NONE) as $path) { |
|
582 | 582 | if (is_dir($dir . $path)) { |
583 | 583 | // What if there are user-defined subfolders “thumbs” or “watermarks”? |
584 | 584 | if ($path != '.' && $path != '..' && $path != 'thumbs' && $path != 'watermark' && $recursive) { |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | $full_path = WT_DATA_DIR . $media_folder . $media_path . $file; |
661 | 661 | try { |
662 | 662 | $size = filesize($full_path); |
663 | - $size = (int)(($size + 1023) / 1024); // Round up to next KB |
|
663 | + $size = (int) (($size + 1023) / 1024); // Round up to next KB |
|
664 | 664 | /* I18N: size of file in KB */ |
665 | 665 | $size = I18N::translate('%s KB', I18N::number($size)); |
666 | 666 | $html .= '<dt>' . I18N::translate('File size') . '</dt>'; |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | |
93 | 93 | $this->checkIndividualAccess($individual); |
94 | 94 | |
95 | - $orientation = (int)$request->get('orientation', self::LANDSCAPE); |
|
96 | - $generations = (int)$request->get('generations', self::DEFAULT_GENERATIONS); |
|
95 | + $orientation = (int) $request->get('orientation', self::LANDSCAPE); |
|
96 | + $generations = (int) $request->get('generations', self::DEFAULT_GENERATIONS); |
|
97 | 97 | |
98 | 98 | $generations = min(self::MAX_GENERATIONS, $generations); |
99 | 99 | $generations = max(self::MIN_GENERATIONS, $generations); |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | |
130 | 130 | $this->checkIndividualAccess($individual); |
131 | 131 | |
132 | - $this->orientation = (int)$request->get('orientation'); |
|
133 | - $this->generations = (int)$request->get('generations'); |
|
132 | + $this->orientation = (int) $request->get('orientation'); |
|
133 | + $this->generations = (int) $request->get('generations'); |
|
134 | 134 | $bxspacing = Theme::theme()->parameter('chart-spacing-x'); |
135 | 135 | $byspacing = Theme::theme()->parameter('chart-spacing-y'); |
136 | 136 | $curgen = 1; // -- track which generation the algorithm is currently working on |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | }, array_values($this->sosaStradonitzAncestors($individual, $this->generations))); |
156 | 156 | |
157 | 157 | //check earliest generation for any ancestors |
158 | - for ($i = (int)($this->treesize / 2); $i < $this->treesize; $i++) { |
|
158 | + for ($i = (int) ($this->treesize / 2); $i < $this->treesize; $i++) { |
|
159 | 159 | $this->chartHasAncestors = $this->chartHasAncestors || ($this->nodes[$i]['indi'] && $this->nodes[$i]['indi']->getChildFamilies()); |
160 | 160 | } |
161 | 161 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | for ($i = ($this->treesize - 1); $i >= 0; $i--) { |
191 | 191 | // -- check to see if we have moved to the next generation |
192 | - if ($i < (int)($this->treesize / (2 ** $curgen))) { |
|
192 | + if ($i < (int) ($this->treesize / (2 ** $curgen))) { |
|
193 | 193 | $curgen++; |
194 | 194 | } |
195 | 195 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | } else { |
221 | 221 | $yoffset = $yoffset + (($boxspacing / 2) * ($curgen - 1)); |
222 | 222 | } |
223 | - $parent = (int)(($i - 1) / 2); |
|
223 | + $parent = (int) (($i - 1) / 2); |
|
224 | 224 | $pgen = $curgen; |
225 | 225 | while ($parent > 0) { |
226 | 226 | if ($parent % 2 == 0) { |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $yoffset = $yoffset + (($boxspacing / 2) * $temp); |
241 | 241 | } |
242 | 242 | } |
243 | - $parent = (int)(($parent - 1) / 2); |
|
243 | + $parent = (int) (($parent - 1) / 2); |
|
244 | 244 | } |
245 | 245 | if ($curgen > 3) { |
246 | 246 | $temp = 0; |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | } |
277 | 277 | break; |
278 | 278 | } |
279 | - $this->nodes[$i]['x'] = (int)$xoffset; |
|
280 | - $this->nodes[$i]['y'] = (int)$yoffset; |
|
279 | + $this->nodes[$i]['x'] = (int) $xoffset; |
|
280 | + $this->nodes[$i]['y'] = (int) $yoffset; |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | // find the minimum x & y offsets and deduct that number from |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $canvas_width = $max_xoffset + $bxspacing + Theme::theme()->parameter('chart-box-x') + $addoffset['x']; |
307 | 307 | $canvas_height = $max_yoffset + $byspacing + Theme::theme()->parameter('chart-box-y') + $addoffset['y']; |
308 | 308 | $posn = I18N::direction() === 'rtl' ? 'right' : 'left'; |
309 | - $last_gen_start = (int)floor($this->treesize / 2); |
|
309 | + $last_gen_start = (int) floor($this->treesize / 2); |
|
310 | 310 | if ($this->orientation === self::OLDEST_AT_TOP || $this->orientation === self::OLDEST_AT_BOTTOM) { |
311 | 311 | $flex_direction = ' flex-column'; |
312 | 312 | } else { |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $html = sprintf('<div id="childarrow"><a href="#" class="menuselect %s"></a><div id="childbox-pedigree">', $this->arrows->menu); |
356 | 356 | |
357 | 357 | foreach ($families as $family) { |
358 | - $html .= '<span class="name1">' . I18N::translate('Family') . '</span>'; |
|
358 | + $html .= '<span class="name1">' . I18N::translate('Family') . '</span>'; |
|
359 | 359 | $spouse = $family->getSpouse($this->root); |
360 | 360 | if ($spouse) { |
361 | 361 | $html .= '<a class="name1" href="' . e(route('pedigree', [ |
@@ -416,9 +416,9 @@ discard block |
||
416 | 416 | $html = ''; |
417 | 417 | if ($this->chartHasAncestors) { |
418 | 418 | if ($this->nodes[$index]['indi'] && $this->nodes[$index]['indi']->getChildFamilies()) { |
419 | - $html .= '<div class="ancestorarrow">'; |
|
419 | + $html .= '<div class="ancestorarrow">'; |
|
420 | 420 | $rootParentId = 1; |
421 | - if ($index > (int)($this->treesize / 2) + (int)($this->treesize / 4)) { |
|
421 | + if ($index > (int) ($this->treesize / 2) + (int) ($this->treesize / 4)) { |
|
422 | 422 | $rootParentId++; |
423 | 423 | } |
424 | 424 | $html .= '<a class="' . $this->arrows->prevGen . '" href="' . e(route('pedigree', [ |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | private function generationOptions(Tree $tree): array |
446 | 446 | { |
447 | 447 | // @TODO - do we need this config setting, given that we cannot show more than 8 generations? |
448 | - $max_generations = min(self::MAX_GENERATIONS, (int)$tree->getPreference('MAX_PEDIGREE_GENERATIONS')); |
|
448 | + $max_generations = min(self::MAX_GENERATIONS, (int) $tree->getPreference('MAX_PEDIGREE_GENERATIONS')); |
|
449 | 449 | |
450 | 450 | return FunctionsEdit::numericOptions(range(self::MIN_GENERATIONS, $max_generations)); |
451 | 451 | } |