Completed
Pull Request — master (#1904)
by Rico
12:08
created
app/Individual.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         // Dead people...
125 125
         if ($this->tree->getPreference('SHOW_DEAD_PEOPLE') >= $access_level && $this->isDead()) {
126 126
             $keep_alive             = false;
127
-            $KEEP_ALIVE_YEARS_BIRTH = (int)$this->tree->getPreference('KEEP_ALIVE_YEARS_BIRTH');
127
+            $KEEP_ALIVE_YEARS_BIRTH = (int) $this->tree->getPreference('KEEP_ALIVE_YEARS_BIRTH');
128 128
             if ($KEEP_ALIVE_YEARS_BIRTH) {
129 129
                 preg_match_all('/\n1 (?:' . WT_EVENTS_BIRT . ').*(?:\n[2-9].*)*(?:\n2 DATE (.+))/', $this->gedcom, $matches, PREG_SET_ORDER);
130 130
                 foreach ($matches as $match) {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
                     }
136 136
                 }
137 137
             }
138
-            $KEEP_ALIVE_YEARS_DEATH = (int)$this->tree->getPreference('KEEP_ALIVE_YEARS_DEATH');
138
+            $KEEP_ALIVE_YEARS_DEATH = (int) $this->tree->getPreference('KEEP_ALIVE_YEARS_DEATH');
139 139
             if ($KEEP_ALIVE_YEARS_DEATH) {
140 140
                 preg_match_all('/\n1 (?:' . WT_EVENTS_DEAT . ').*(?:\n[2-9].*)*(?:\n2 DATE (.+))/', $this->gedcom, $matches, PREG_SET_ORDER);
141 141
                 foreach ($matches as $match) {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             }
152 152
         }
153 153
         // Consider relationship privacy (unless an admin is applying download restrictions)
154
-        $user_path_length = (int)$this->tree->getUserPreference(Auth::user(), 'RELATIONSHIP_PATH_LENGTH');
154
+        $user_path_length = (int) $this->tree->getUserPreference(Auth::user(), 'RELATIONSHIP_PATH_LENGTH');
155 155
         $gedcomid         = $this->tree->getUserPreference(Auth::user(), 'gedcomid');
156 156
         if ($gedcomid !== '' && $user_path_length > 0) {
157 157
             return self::isRelated($this, $user_path_length);
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
      */
324 324
     public function isDead(): bool
325 325
     {
326
-        $MAX_ALIVE_AGE = (int)$this->tree->getPreference('MAX_ALIVE_AGE');
326
+        $MAX_ALIVE_AGE = (int) $this->tree->getPreference('MAX_ALIVE_AGE');
327 327
 
328 328
         // "1 DEAT Y" or "1 DEAT/2 DATE" or "1 DEAT/2 PLAC"
329 329
         if (preg_match('/\n1 (?:' . WT_EVENTS_DEAT . ')(?: Y|(?:\n[2-9].+)*\n2 (DATE|PLAC) )/', $this->gedcom)) {
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
                 if ($min && $max) {
713 713
                     $gregorian_calendar = new GregorianCalendar();
714 714
 
715
-                    list($year) = $gregorian_calendar->jdToYmd((int)((max($min) + min($max)) / 2));
715
+                    list($year) = $gregorian_calendar->jdToYmd((int) ((max($min) + min($max)) / 2));
716 716
                     $this->estimated_birth_date = new Date('EST ' . $year);
717 717
                 } else {
718 718
                     $this->estimated_birth_date = new Date(''); // always return a date object
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
             }
740 740
             if ($this->estimated_death_date === null) {
741 741
                 if ($this->getEstimatedBirthDate()->minimumJulianDay()) {
742
-                    $max_alive_age              = (int)$this->tree->getPreference('MAX_ALIVE_AGE');
742
+                    $max_alive_age              = (int) $this->tree->getPreference('MAX_ALIVE_AGE');
743 743
                     $this->estimated_death_date = $this->getEstimatedBirthDate()->addYears($max_alive_age, 'BEF');
744 744
                 } else {
745 745
                     $this->estimated_death_date = new Date(''); // always return a date object
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
         if ($display) {
1108 1108
             $txt .= ' style="display:' . $display . '"';
1109 1109
         }
1110
-        $txt  .= '>';
1110
+        $txt .= '>';
1111 1111
         $husb = $fam->getHusband();
1112 1112
         if ($husb) {
1113 1113
             // Temporarily reset the 'prefered' display name, as we always
@@ -1179,7 +1179,7 @@  discard block
 block discarded – undo
1179 1179
         // Extract the structured name parts - use for "sortable" names and indexes
1180 1180
         ////////////////////////////////////////////////////////////////////////////
1181 1181
 
1182
-        $sublevel = 1 + (int)$gedcom[0];
1182
+        $sublevel = 1 + (int) $gedcom[0];
1183 1183
         $NPFX     = preg_match("/\n{$sublevel} NPFX (.+)/", $gedcom, $match) ? $match[1] : '';
1184 1184
         $GIVN     = preg_match("/\n{$sublevel} GIVN (.+)/", $gedcom, $match) ? $match[1] : '';
1185 1185
         $SURN     = preg_match("/\n{$sublevel} SURN (.+)/", $gedcom, $match) ? $match[1] : '';
Please login to merge, or discard this patch.
app/Soundex.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -3617,7 +3617,7 @@  discard block
 block discarded – undo
3617 3617
             $soundTableEntry = self::$dmsounds[$thisEntry];
3618 3618
             $workingResult   = $partialResult;
3619 3619
             $partialResult   = [];
3620
-            $currPos         += strlen($thisEntry);
3620
+            $currPos += strlen($thisEntry);
3621 3621
 
3622 3622
             // Not at beginning of input string
3623 3623
             if ($state != 1) {
Please login to merge, or discard this patch.
app/Theme/AbstractTheme.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     {
216 216
         if ($analytics_id) {
217 217
             // Add extra dimensions (i.e. filtering categories)
218
-            $dimensions = (object)[
218
+            $dimensions = (object) [
219 219
                 'dimension1' => $this->tree ? $this->tree->getName() : '-',
220 220
                 'dimension2' => $this->tree ? Auth::accessLevel($this->tree) : '-',
221 221
             ];
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         if ($project_id && $security_id) {
278 278
             return
279 279
                 '<script>' .
280
-                'var sc_project=' . (int)$project_id . ',sc_invisible=1,sc_security="' . $security_id .
280
+                'var sc_project=' . (int) $project_id . ',sc_invisible=1,sc_security="' . $security_id .
281 281
                 '",scJsHost = (("https:"===document.location.protocol)?"https://secure.":"http://www.");' .
282 282
                 'document.write("<sc"+"ript src=\'"+scJsHost+"statcounter.com/counter/counter.js\'></"+"script>");' .
283 283
                 '</script>';
@@ -1783,7 +1783,7 @@  discard block
 block discarded – undo
1783 1783
     public function menuSearchPhonetic(): Menu
1784 1784
     {
1785 1785
         /* I18N: search using “sounds like”, rather than exact spelling */
1786
-        return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged'    => $this->tree->getName(), 'action' => 'soundex',]), 'menu-search-soundex', ['rel' => 'nofollow']);
1786
+        return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged'    => $this->tree->getName(), 'action' => 'soundex', ]), 'menu-search-soundex', ['rel' => 'nofollow']);
1787 1787
     }
1788 1788
 
1789 1789
     /**
Please login to merge, or discard this patch.
app/Tree.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
     public static function getAll(): array
296 296
     {
297 297
         if (empty(self::$trees)) {
298
-            $rows        = Database::prepare(
298
+            $rows = Database::prepare(
299 299
                 "SELECT g.gedcom_id AS tree_id, g.gedcom_name AS tree_name, gs1.setting_value AS tree_title" .
300 300
                 " FROM `##gedcom` g" .
301 301
                 " LEFT JOIN `##gedcom_setting`      gs1 ON (g.gedcom_id=gs1.gedcom_id AND gs1.setting_name='title')" .
Please login to merge, or discard this patch.
app/Database.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -89,8 +89,7 @@  discard block
 block discarded – undo
89 89
         self::$table_prefix = $config['tblpfx'];
90 90
 
91 91
         $dsn = (substr($config['dbhost'], 0, 1) === '/' ?
92
-            "mysql:unix_socket='{$config['dbhost']};dbname={$config['dbname']}" :
93
-            "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}"
92
+            "mysql:unix_socket='{$config['dbhost']};dbname={$config['dbname']}" : "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}"
94 93
         );
95 94
 
96 95
         // Create the underlying PDO object.
@@ -223,7 +222,7 @@  discard block
 block discarded – undo
223 222
     public static function updateSchema($namespace, $schema_name, $target_version): bool
224 223
     {
225 224
         try {
226
-            $current_version = (int)Site::getPreference($schema_name);
225
+            $current_version = (int) Site::getPreference($schema_name);
227 226
         } catch (PDOException $ex) {
228 227
             DebugBar::addThrowable($ex);
229 228
 
@@ -240,7 +239,7 @@  discard block
 block discarded – undo
240 239
             $migration = new $class();
241 240
             $migration->upgrade();
242 241
             $current_version++;
243
-            Site::setPreference($schema_name, (string)$current_version);
242
+            Site::setPreference($schema_name, (string) $current_version);
244 243
             $updates_applied = true;
245 244
         }
246 245
 
Please login to merge, or discard this patch.
app/Statement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                     $this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_NULL);
73 73
                     break;
74 74
                 case 'boolean':
75
-                    $this->pdo_statement->bindValue($key, (int)$bind_variable, PDO::PARAM_INT);
75
+                    $this->pdo_statement->bindValue($key, (int) $bind_variable, PDO::PARAM_INT);
76 76
                     break;
77 77
                 case 'integer':
78 78
                     $this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_INT);
Please login to merge, or discard this patch.
app/Schema/Migration22.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                     $_tmp_dir   = $WT_DATA_DIR;
64 64
                     while (strpos($_mf_dir, $_tmp_dir) !== 0) {
65 65
                         $_media_dir .= '../';
66
-                        $_tmp_dir   = preg_replace('~[^/\\\\]+[/\\\\]$~', '', $_tmp_dir);
66
+                        $_tmp_dir = preg_replace('~[^/\\\\]+[/\\\\]$~', '', $_tmp_dir);
67 67
                         if ($_tmp_dir == '') {
68 68
                             // Shouldn't get here - but this script is not allowed to fail...
69 69
                             continue 2;
Please login to merge, or discard this patch.
app/Report/ReportPdfFootnote.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         if ($this->wrapWidthRemaining > 0) {
111 111
             // Check with line counter too!
112 112
             // but floor the $wrapWidthRemaining first to keep it bugfree!
113
-            $wrapWidthRemaining = (int)($this->wrapWidthRemaining);
113
+            $wrapWidthRemaining = (int) ($this->wrapWidthRemaining);
114 114
             if ($lw >= $wrapWidthRemaining || $lfct > 1) {
115 115
                 $newtext = '';
116 116
                 $lines   = explode("\n", $this->numText);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                                     $newtext .= ' ';
133 133
                                 }
134 134
                             } else {
135
-                                $lw      = $pdf->GetStringWidth($word . ' ');
135
+                                $lw = $pdf->GetStringWidth($word . ' ');
136 136
                                 $newtext .= "\n$word";
137 137
                                 if ($addspace != 0) {
138 138
                                     $newtext .= ' ';
Please login to merge, or discard this patch.
app/Report/ReportPdfText.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         if ($this->wrapWidthRemaining > 0) {
126 126
             // Check with line counter too!
127 127
             // but floor the $wrapWidthRemaining first to keep it bugfree!
128
-            $wrapWidthRemaining = (int)($this->wrapWidthRemaining);
128
+            $wrapWidthRemaining = (int) ($this->wrapWidthRemaining);
129 129
             if ($lw >= $wrapWidthRemaining || $lfct > 1) {
130 130
                 $newtext = '';
131 131
                 $lines   = explode("\n", $this->text);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                                     $newtext .= ' ';
148 148
                                 }
149 149
                             } else {
150
-                                $lw      = $pdf->GetStringWidth($word . ' ');
150
+                                $lw = $pdf->GetStringWidth($word . ' ');
151 151
                                 $newtext .= "\n$word";
152 152
                                 if ($addspace != 0) {
153 153
                                     $newtext .= ' ';
Please login to merge, or discard this patch.