@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * webtrees: online genealogy |
5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | '<u>', |
47 | 47 | '</u>', |
48 | 48 | ], $temptext); |
49 | - $match = []; |
|
49 | + $match = []; |
|
50 | 50 | // Indicates if the cell background must be painted (1) or transparent (0) |
51 | 51 | if ($this->fill == 1) { |
52 | 52 | if (!empty($this->bgcolor)) { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * webtrees: online genealogy |
5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $lines = explode("\n", $temptext); |
63 | 63 | foreach ($lines as $line) { |
64 | 64 | echo '<div style="position:absolute;top:', $startY, 'pt;', $renderer->alignRTL, ':', $startX, 'pt;width:', $width, 'pt;">'; |
65 | - $line = $renderer->textWrap($line, $width); |
|
65 | + $line = $renderer->textWrap($line, $width); |
|
66 | 66 | $startY += $renderer->getTextCellHeight($line); |
67 | 67 | $renderer->setY($startY); |
68 | 68 | $renderer->write($line, $this->color); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $newtext .= ' '; |
150 | 150 | } |
151 | 151 | } else { |
152 | - $lw = $html->getStringWidth($word . ' '); |
|
152 | + $lw = $html->getStringWidth($word . ' '); |
|
153 | 153 | $newtext .= "\n$word"; |
154 | 154 | if ($addspace != 0) { |
155 | 155 | $newtext .= ' '; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * webtrees: online genealogy |
5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -1848,7 +1848,7 @@ discard block |
||
1848 | 1848 | // Some filters/sorts can be applied using SQL, while others require PHP |
1849 | 1849 | switch ($listname) { |
1850 | 1850 | case 'pending': |
1851 | - $rows = Database::prepare( |
|
1851 | + $rows = Database::prepare( |
|
1852 | 1852 | "SELECT xref, CASE new_gedcom WHEN '' THEN old_gedcom ELSE new_gedcom END AS gedcom" . |
1853 | 1853 | " FROM `##change`" . " WHERE (xref, change_id) IN (" . |
1854 | 1854 | " SELECT xref, MAX(change_id)" . |
@@ -1887,7 +1887,7 @@ discard block |
||
1887 | 1887 | $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
1888 | 1888 | } |
1889 | 1889 | if ($sortby == $match[1]) { |
1890 | - $sortby = ""; |
|
1890 | + $sortby = ""; |
|
1891 | 1891 | $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1"; |
1892 | 1892 | } |
1893 | 1893 | unset($attrs[$attr]); // This filter has been fully processed |
@@ -1899,13 +1899,13 @@ discard block |
||
1899 | 1899 | if ($match[1] != '') { |
1900 | 1900 | $names = explode(' ', $match[1]); |
1901 | 1901 | foreach ($names as $n => $name) { |
1902 | - $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1902 | + $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1903 | 1903 | $sql_params[$attr . 'name' . $n] = $name; |
1904 | 1904 | } |
1905 | 1905 | } |
1906 | 1906 | // Let the DB do the name sorting even when no name was entered |
1907 | 1907 | if ($sortby == 'NAME') { |
1908 | - $sortby = ''; |
|
1908 | + $sortby = ''; |
|
1909 | 1909 | $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.n_sort"; |
1910 | 1910 | } |
1911 | 1911 | } |
@@ -1922,7 +1922,7 @@ discard block |
||
1922 | 1922 | $sql_params[$attr . 'place'] = $match[1]; |
1923 | 1923 | // Don't unset this filter. This is just initial filtering |
1924 | 1924 | } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
1925 | - $sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1925 | + $sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1926 | 1926 | $sql_params[$attr . 'contains1'] = $match[1]; |
1927 | 1927 | $sql_params[$attr . 'contains2'] = $match[2]; |
1928 | 1928 | $sql_params[$attr . 'contains3'] = $match[3]; |
@@ -1964,7 +1964,7 @@ discard block |
||
1964 | 1964 | $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
1965 | 1965 | } |
1966 | 1966 | if ($sortby == $match[1]) { |
1967 | - $sortby = ''; |
|
1967 | + $sortby = ''; |
|
1968 | 1968 | $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.d_julianday1"; |
1969 | 1969 | } |
1970 | 1970 | unset($attrs[$attr]); // This filter has been fully processed |
@@ -1981,13 +1981,13 @@ discard block |
||
1981 | 1981 | if ($match[1] != '') { |
1982 | 1982 | $names = explode(' ', $match[1]); |
1983 | 1983 | foreach ($names as $n => $name) { |
1984 | - $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1984 | + $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1985 | 1985 | $sql_params[$attr . 'name' . $n] = $name; |
1986 | 1986 | } |
1987 | 1987 | } |
1988 | 1988 | // Let the DB do the name sorting even when no name was entered |
1989 | 1989 | if ($sortby == 'NAME') { |
1990 | - $sortby = ''; |
|
1990 | + $sortby = ''; |
|
1991 | 1991 | $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.n_sort"; |
1992 | 1992 | } |
1993 | 1993 | } |
@@ -1999,7 +1999,7 @@ discard block |
||
1999 | 1999 | $sql_params[$attr . 'place'] = $match[1]; |
2000 | 2000 | // Don't unset this filter. This is just initial filtering |
2001 | 2001 | } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
2002 | - $sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
2002 | + $sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
2003 | 2003 | $sql_params[$attr . 'contains1'] = $match[1]; |
2004 | 2004 | $sql_params[$attr . 'contains2'] = $match[2]; |
2005 | 2005 | $sql_params[$attr . 'contains3'] = $match[3]; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * webtrees: online genealogy |
5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $this->pageh = $tmpw; |
149 | 149 | } |
150 | 150 | // Store the pagewidth without margins |
151 | - $this->noMarginWidth = (int)($this->pagew - $this->leftmargin - $this->rightmargin); |
|
151 | + $this->noMarginWidth = (int) ($this->pagew - $this->leftmargin - $this->rightmargin); |
|
152 | 152 | // If RTL |
153 | 153 | if ($this->rtl) { |
154 | 154 | $this->alignRTL = 'right'; |
@@ -740,14 +740,14 @@ discard block |
||
740 | 740 | public function textWrap($str, $width): string |
741 | 741 | { |
742 | 742 | // Calculate the line width |
743 | - $lw = (int)($width / ($this->getCurrentStyleHeight() / 2)); |
|
743 | + $lw = (int) ($width / ($this->getCurrentStyleHeight() / 2)); |
|
744 | 744 | // Wordwrap each line |
745 | 745 | $lines = explode("\n", $str); |
746 | 746 | // Line Feed counter |
747 | 747 | $lfct = count($lines); |
748 | 748 | $wraptext = ''; |
749 | 749 | foreach ($lines as $line) { |
750 | - $wtext = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true); |
|
750 | + $wtext = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true); |
|
751 | 751 | $wraptext .= $wtext; |
752 | 752 | // Add a new line as long as it’s not the last line |
753 | 753 | if ($lfct > 1) { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * webtrees: online genealogy |
5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $attrs .= ' ' . $key . '="' . e($value) . '"'; |
71 | 71 | } |
72 | 72 | |
73 | - $class = trim('dropdown-item ' . $submenu->class); |
|
73 | + $class = trim('dropdown-item ' . $submenu->class); |
|
74 | 74 | $submenus .= '<a class="' . $class . '" href="' . e($submenu->link) . '"' . $attrs . '>' . $submenu->label . '</a>'; |
75 | 75 | } |
76 | 76 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * webtrees: online genealogy |
5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -177,14 +177,14 @@ discard block |
||
177 | 177 | case '_BIRT_CHIL': |
178 | 178 | $children[$fact->getParent()->getXref()] = true; |
179 | 179 | /* I18N: Abbreviation for "number %s" */ |
180 | - $label .= '<br>' . I18N::translate('#%s', count($children)); |
|
180 | + $label .= '<br>' . I18N::translate('#%s', count($children)); |
|
181 | 181 | break; |
182 | 182 | case '_BIRT_GCHI': |
183 | 183 | case '_BIRT_GCH1': |
184 | 184 | case '_BIRT_GCH2': |
185 | 185 | $grandchildren[$fact->getParent()->getXref()] = true; |
186 | 186 | /* I18N: Abbreviation for "number %s" */ |
187 | - $label .= '<br>' . I18N::translate('#%s', count($grandchildren)); |
|
187 | + $label .= '<br>' . I18N::translate('#%s', count($grandchildren)); |
|
188 | 188 | break; |
189 | 189 | } |
190 | 190 | |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | for ($j = 0; $j < $ct; $j++) { |
579 | 579 | if (strpos($match[$j][1], '@') === false) { |
580 | 580 | $source = e($match[$j][1] . preg_replace('/\n\d CONT ?/', "\n", $match[$j][2])); |
581 | - $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>'; |
|
581 | + $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>'; |
|
582 | 582 | } |
583 | 583 | } |
584 | 584 | // Find source for each fact |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | } |
597 | 597 | $srec = substr($factrec, $spos1, $spos2 - $spos1); |
598 | 598 | $lt = preg_match_all("/$nlevel \w+/", $srec, $matches); |
599 | - $data .= '<div class="fact_SOUR">'; |
|
599 | + $data .= '<div class="fact_SOUR">'; |
|
600 | 600 | $elementID = Uuid::uuid4()->toString(); |
601 | 601 | if ($tree->getPreference('EXPAND_SOURCES')) { |
602 | 602 | $plusminus = 'icon-minus'; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * webtrees: online genealogy |
5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | if ($openParIndex !== false) { |
294 | 294 | // Opening parentheses always inherit the following directionality |
295 | 295 | self::$waitingText .= $currentLetter; |
296 | - $workingText = substr($workingText, $currentLen); |
|
296 | + $workingText = substr($workingText, $currentLen); |
|
297 | 297 | while (true) { |
298 | 298 | if ($workingText === '') { |
299 | 299 | break; |
@@ -301,13 +301,13 @@ discard block |
||
301 | 301 | if (substr($workingText, 0, 1) === ' ') { |
302 | 302 | // Spaces following this left parenthesis inherit the following directionality too |
303 | 303 | self::$waitingText .= ' '; |
304 | - $workingText = substr($workingText, 1); |
|
304 | + $workingText = substr($workingText, 1); |
|
305 | 305 | continue; |
306 | 306 | } |
307 | 307 | if (substr($workingText, 0, 6) === ' ') { |
308 | 308 | // Spaces following this left parenthesis inherit the following directionality too |
309 | 309 | self::$waitingText .= ' '; |
310 | - $workingText = substr($workingText, 6); |
|
310 | + $workingText = substr($workingText, 6); |
|
311 | 311 | continue; |
312 | 312 | } |
313 | 313 | break; |
@@ -324,9 +324,9 @@ discard block |
||
324 | 324 | // Exceptions to this rule will be handled later during final clean-up. |
325 | 325 | // |
326 | 326 | self::$waitingText .= $currentLetter; |
327 | - $workingText = substr($workingText, $currentLen); |
|
327 | + $workingText = substr($workingText, $currentLen); |
|
328 | 328 | if (self::$currentState != '') { |
329 | - $result .= self::$waitingText; |
|
329 | + $result .= self::$waitingText; |
|
330 | 330 | self::$waitingText = ''; |
331 | 331 | } |
332 | 332 | break 2; // double break because we're waiting for more information |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | } |
458 | 458 | if (substr($result . "\n", 0, self::LENGTH_START) != self::START_LTR && substr($result . "\n", 0, self::LENGTH_START) != self::START_RTL) { |
459 | 459 | $leadingText .= substr($result, 0, 1); |
460 | - $result = substr($result, 1); |
|
460 | + $result = substr($result, 1); |
|
461 | 461 | continue; |
462 | 462 | } |
463 | 463 | $result = substr($result, 0, self::LENGTH_START) . $leadingText . substr($result, self::LENGTH_START); |
@@ -592,11 +592,11 @@ discard block |
||
592 | 592 | public static function breakCurrentSpan(&$result) |
593 | 593 | { |
594 | 594 | // Interrupt the current span, insert that <br>, and then continue the current span |
595 | - $result .= self::$waitingText; |
|
595 | + $result .= self::$waitingText; |
|
596 | 596 | self::$waitingText = ''; |
597 | 597 | |
598 | 598 | $breakString = '<' . self::$currentState . 'br>'; |
599 | - $result .= $breakString; |
|
599 | + $result .= $breakString; |
|
600 | 600 | } |
601 | 601 | |
602 | 602 | /** |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | break; |
650 | 650 | } // No more numeric strings |
651 | 651 | |
652 | - $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
652 | + $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
653 | 653 | $numericString = substr($textSpan, $posLRE + 3, $posPDF - $posLRE); // Separate the entire numeric string |
654 | 654 | $textSpan = substr($textSpan, $posPDF + 3); |
655 | 655 | $posColon = strpos($numericString, ':'); |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | while ($string) { |
1142 | 1142 | if (mb_strlen($string) <= $width) { |
1143 | 1143 | // Do not wrap any text that is less than the output area. |
1144 | - $out .= $string; |
|
1144 | + $out .= $string; |
|
1145 | 1145 | $string = ''; |
1146 | 1146 | } else { |
1147 | 1147 | $sub1 = mb_substr($string, 0, $width + 1); |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | if ($spacepos === false) { |
1156 | 1156 | // No space on line? |
1157 | 1157 | if ($cut) { |
1158 | - $out .= $sub . $sep; |
|
1158 | + $out .= $sub . $sep; |
|
1159 | 1159 | $string = mb_substr($string, mb_strlen($sub)); |
1160 | 1160 | } else { |
1161 | 1161 | $spacepos = strpos($string, ' '); |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | } |
1170 | 1170 | } else { |
1171 | 1171 | // Split at space; |
1172 | - $out .= substr($string, 0, $spacepos) . $sep; |
|
1172 | + $out .= substr($string, 0, $spacepos) . $sep; |
|
1173 | 1173 | $string = substr($string, $spacepos + 1); |
1174 | 1174 | } |
1175 | 1175 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * webtrees: online genealogy |
5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } else { |
55 | 55 | $size = 75.0 + 125.0 * ($count - $minimum) / ($maximum - $minimum); |
56 | 56 | } |
57 | - $url = route($route, [ |
|
57 | + $url = route($route, [ |
|
58 | 58 | 'surname' => $surn, |
59 | 59 | 'ged' => $tree->getName(), |
60 | 60 | ]); |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | } |
132 | 132 | $newcol = ceil($count / $col); |
133 | 133 | $html2 = '<table class="list_table"><tr>'; |
134 | - $html2 .= '<td class="list_value" style="padding: 14px;">'; |
|
134 | + $html2 .= '<td class="list_value" style="padding: 14px;">'; |
|
135 | 135 | |
136 | 136 | foreach ($html as $surns) { |
137 | 137 | $html2 .= $surns . '<br>'; |
138 | 138 | $i++; |
139 | 139 | if ($i == $newcol && $i < $count) { |
140 | - $html2 .= '</td><td class="list_value" style="padding: 14px;">'; |
|
140 | + $html2 .= '</td><td class="list_value" style="padding: 14px;">'; |
|
141 | 141 | $newcol = $i + ceil($count / $col); |
142 | 142 | } |
143 | 143 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * webtrees: online genealogy |
5 | 5 | * Copy§right (C) 2017 webtrees development team |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | if ($islink) { |
528 | 528 | $value = trim($value, '@'); |
529 | 529 | } else { |
530 | - $value = (string)substr($tag, strlen($fact) + 3); |
|
530 | + $value = (string) substr($tag, strlen($fact) + 3); |
|
531 | 531 | } |
532 | 532 | if ($fact === 'REPO' || $fact === 'SOUR' || $fact === 'OBJE' || $fact === 'FAMC') { |
533 | 533 | $islink = true; |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | $html .= '<p class="small text-muted">' . I18N::translate('Use this image for charts and on the individual’s page.') . '</p>'; |
813 | 813 | } elseif ($fact === 'TYPE' && $level === '3') { |
814 | 814 | //-- Build the selector for the Media 'TYPE' Fact |
815 | - $html .= '<select name="text[]"><option selected value="" ></option>'; |
|
815 | + $html .= '<select name="text[]"><option selected value="" ></option>'; |
|
816 | 816 | $selectedValue = strtolower($value); |
817 | 817 | if (!array_key_exists($selectedValue, GedcomTag::getFileFormTypes())) { |
818 | 818 | $html .= '<option selected value="' . e($value) . '" >' . e($value) . '</option>'; |