Completed
Pull Request — master (#1864)
by Rico
09:23
created
app/Http/Controllers/BranchesController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Http/Controllers/FamilyController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
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'    => '',
Please login to merge, or discard this patch.
app/Http/Controllers/IndividualController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -440,7 +440,7 @@
 block discarded – undo
440 440
      */
441 441
     private function significant(Individual $individual): stdClass
442 442
     {
443
-        $significant = (object)[
443
+        $significant = (object) [
444 444
             'family'     => null,
445 445
             'individual' => $individual,
446 446
             'surname'    => '',
Please login to merge, or discard this patch.
app/Http/Controllers/MessageController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
     private function validContacts(Tree $tree): array
329 329
     {
330 330
         $contacts = [
331
-            User::find((int)$tree->getPreference('CONTACT_USER_ID')),
332
-            User::find((int)$tree->getPreference('WEBMASTER_USER_ID')),
331
+            User::find((int) $tree->getPreference('CONTACT_USER_ID')),
332
+            User::find((int) $tree->getPreference('WEBMASTER_USER_ID')),
333 333
         ];
334 334
 
335 335
         return array_filter($contacts);
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     {
354 354
         // Create a dummy user, so we can send messages from the tree.
355 355
         $from = new User(
356
-            (object)[
356
+            (object) [
357 357
                 'user_id'   => null,
358 358
                 'user_name' => '',
359 359
                 'real_name' => $tree->getTitle(),
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 
364 364
         // Create a dummy user, so we can reply to visitors.
365 365
         $sender = new User(
366
-            (object)[
366
+            (object) [
367 367
                 'user_id'   => null,
368 368
                 'user_name' => '',
369 369
                 'real_name' => $sender_name,
Please login to merge, or discard this patch.
app/Date.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -448,7 +448,7 @@
 block discarded – undo
448 448
      */
449 449
     public function julianDay(): int
450 450
     {
451
-        return (int)(($this->minimumJulianDay() + $this->maximumJulianDay()) / 2);
451
+        return (int) (($this->minimumJulianDay() + $this->maximumJulianDay()) / 2);
452 452
     }
453 453
 
454 454
     /**
Please login to merge, or discard this patch.
app/Database.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,8 +88,7 @@  discard block
 block discarded – undo
88 88
         self::$table_prefix = $config['tblpfx'];
89 89
 
90 90
         $dsn = (substr($config['dbhost'], 0, 1) === '/' ?
91
-            "mysql:unix_socket='{$config['dbhost']};dbname={$config['dbname']}" :
92
-            "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}"
91
+            "mysql:unix_socket='{$config['dbhost']};dbname={$config['dbname']}" : "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}"
93 92
         );
94 93
 
95 94
         // Create the underlying PDO object.
@@ -222,7 +221,7 @@  discard block
 block discarded – undo
222 221
     public static function updateSchema($namespace, $schema_name, $target_version): bool
223 222
     {
224 223
         try {
225
-            $current_version = (int)Site::getPreference($schema_name);
224
+            $current_version = (int) Site::getPreference($schema_name);
226 225
         } catch (PDOException $ex) {
227 226
             DebugBar::addThrowable($ex);
228 227
 
@@ -239,7 +238,7 @@  discard block
 block discarded – undo
239 238
             $migration = new $class();
240 239
             $migration->upgrade();
241 240
             $current_version++;
242
-            Site::setPreference($schema_name, (string)$current_version);
241
+            Site::setPreference($schema_name, (string) $current_version);
243 242
             $updates_applied = true;
244 243
         }
245 244
 
Please login to merge, or discard this patch.
app/Census/AbstractCensusColumnCondition.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
      */
98 98
     private function isChild(Individual $individual): bool
99 99
     {
100
-        $age = (int)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
100
+        $age = (int) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
101 101
 
102 102
         return $age < $this->age_adult;
103 103
     }
Please login to merge, or discard this patch.
app/Census/CensusColumnAge.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,6 +34,6 @@
 block discarded – undo
34 34
      */
35 35
     public function generate(Individual $individual, Individual $head): string
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
 }
Please login to merge, or discard this patch.
app/Report/ReportHtml.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             $this->pageh = $tmpw;
146 146
         }
147 147
         // Store the pagewidth without margins
148
-        $this->noMarginWidth = (int)($this->pagew - $this->leftmargin - $this->rightmargin);
148
+        $this->noMarginWidth = (int) ($this->pagew - $this->leftmargin - $this->rightmargin);
149 149
         // If RTL
150 150
         if ($this->rtl) {
151 151
             $this->alignRTL  = 'right';
@@ -727,14 +727,14 @@  discard block
 block discarded – undo
727 727
     public function textWrap($str, $width): string
728 728
     {
729 729
         // Calculate the line width
730
-        $lw = (int)($width / ($this->getCurrentStyleHeight() / 2));
730
+        $lw = (int) ($width / ($this->getCurrentStyleHeight() / 2));
731 731
         // Wordwrap each line
732 732
         $lines = explode("\n", $str);
733 733
         // Line Feed counter
734 734
         $lfct     = count($lines);
735 735
         $wraptext = '';
736 736
         foreach ($lines as $line) {
737
-            $wtext    = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true);
737
+            $wtext = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true);
738 738
             $wraptext .= $wtext;
739 739
             // Add a new line as long as it’s not the last line
740 740
             if ($lfct > 1) {
Please login to merge, or discard this patch.