Passed
Push — main ( f9aaf7...4197a4 )
by Jonathan
14:34
created
app/Module/Certificates/Http/RequestHandlers/CertificatePage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
             return redirect(route(TreePage::class, ['tree' => $tree->name()]));
101 101
         }
102 102
 
103
-        return $this->viewResponse($this->module->name() . '::certificate-page', [
103
+        return $this->viewResponse($this->module->name().'::certificate-page', [
104 104
             'title'                     =>  I18N::translate('Certificate - %s', $certificate->name()),
105 105
             'tree'                      =>  $tree,
106 106
             'module_name'               =>  $this->module->name(),
Please login to merge, or discard this patch.
app/Module/Certificates/Http/RequestHandlers/AutoCompleteFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@
 block discarded – undo
72 72
             return collect();
73 73
         }
74 74
 
75
-        $query  = $request->getAttribute('query') ?? '';
75
+        $query = $request->getAttribute('query') ?? '';
76 76
 
77 77
         /** @var Collection<string> $results */
78
-        $results =  $this->certif_filesystem
78
+        $results = $this->certif_filesystem
79 79
             ->certificatesForCityContaining($tree, $city, $query)
80 80
             ->map(fn(Certificate $certificate): string => $certificate->filename());
81 81
 
Please login to merge, or discard this patch.
app/Module/Certificates/Services/CertificateDataService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $tree = $certificate->tree();
44 44
         return DB::table('individuals')
45 45
             ->where('i_file', '=', $tree->id())
46
-            ->where('i_gedcom', 'like', '% _ACT ' . $this->escapedSqlPath($certificate) . '%')
46
+            ->where('i_gedcom', 'like', '% _ACT '.$this->escapedSqlPath($certificate).'%')
47 47
             ->select(['individuals.*'])
48 48
             ->get()
49 49
             ->map(Registry::individualFactory()->mapper($tree))
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $tree = $certificate->tree();
65 65
         return DB::table('families')
66 66
             ->where('f_file', '=', $tree->id())
67
-            ->where('f_gedcom', 'like', '% _ACT ' . $this->escapedSqlPath($certificate) . '%')
67
+            ->where('f_gedcom', 'like', '% _ACT '.$this->escapedSqlPath($certificate).'%')
68 68
             ->select(['families.*'])
69 69
             ->get()
70 70
             ->map(Registry::familyFactory()->mapper($tree))
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $tree = $certificate->tree();
86 86
         return DB::table('media')
87 87
             ->where('m_file', '=', $tree->id())
88
-            ->where('m_gedcom', 'like', '% _ACT ' . $this->escapedSqlPath($certificate) . '%')
88
+            ->where('m_gedcom', 'like', '% _ACT '.$this->escapedSqlPath($certificate).'%')
89 89
             ->select(['media.*'])
90 90
             ->get()
91 91
             ->map(Registry::mediaFactory()->mapper($tree))
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         return DB::table('other')
108 108
             ->where('o_file', '=', $tree->id())
109 109
             ->where('o_type', '=', 'NOTE')
110
-            ->where('o_gedcom', 'like', '% _ACT ' . $this->escapedSqlPath($certificate) . '%')
110
+            ->where('o_gedcom', 'like', '% _ACT '.$this->escapedSqlPath($certificate).'%')
111 111
             ->select(['other.*'])
112 112
             ->get()
113 113
             ->map(Registry::noteFactory()->mapper($tree))
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     public function oneLinkedSource(Certificate $certificate): ?Source
136 136
     {
137 137
         $regex_query = preg_quote($certificate->gedcomPath(), '/');
138
-        $regex_pattern = '/[1-9] SOUR @(' . Gedcom::REGEX_XREF . ')@(?:\n[2-9]\s(?:(?!SOUR)\w+)\s.*)*\n[2-9] _ACT ' . $regex_query . '/i'; //phpcs:ignore Generic.Files.LineLength.TooLong
138
+        $regex_pattern = '/[1-9] SOUR @('.Gedcom::REGEX_XREF.')@(?:\n[2-9]\s(?:(?!SOUR)\w+)\s.*)*\n[2-9] _ACT '.$regex_query.'/i'; //phpcs:ignore Generic.Files.LineLength.TooLong
139 139
 
140 140
         foreach ($this->linkedRecordsLists($certificate) as $linked_records) {
141 141
             foreach ($linked_records as $gedcom_record) {
Please login to merge, or discard this patch.
app/Module/Certificates/Services/UrlObfuscatorService.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@  discard block
 block discarded – undo
43 43
             $server_software = $request->getServerParams()['SERVER_SOFTWARE'] ?? '';
44 44
             $this->encryption_key = str_pad(md5(
45 45
                 $server_name !== '' && $server_software !== '' ?
46
-                $server_name . $server_software :
47
-                'STANDARDKEYIFNOSERVER'
46
+                $server_name.$server_software : 'STANDARDKEYIFNOSERVER'
48 47
             ), SODIUM_CRYPTO_SECRETBOX_KEYBYTES, "1234567890ABCDEF");
49 48
         }
50 49
         return $this->encryption_key;
@@ -78,7 +77,7 @@  discard block
 block discarded – undo
78 77
 
79 78
         \Fisharebest\Webtrees\DebugBar::addMessage($key);
80 79
         $encryted = sodium_crypto_secretbox($cleartext, $nonce, $key);
81
-        return strtr(base64_encode($nonce . $encryted), '+/=', '._-');
80
+        return strtr(base64_encode($nonce.$encryted), '+/=', '._-');
82 81
     }
83 82
 
84 83
     /**
Please login to merge, or discard this patch.
app/Module/Certificates/Factories/CertificateImageFactory.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         bool $add_watermark = false,
80 80
         Watermark $watermark = null
81 81
     ): ResponseInterface {
82
-        $filesystem =  $this->filesystem_service->filesystem($certificate->tree());
82
+        $filesystem = $this->filesystem_service->filesystem($certificate->tree());
83 83
         $filename   = $certificate->path();
84 84
 
85 85
         if (!$add_watermark) {
@@ -98,34 +98,34 @@  discard block
 block discarded – undo
98 98
             $height = $image->height();
99 99
 
100 100
             $watermark->adjustSize($width);
101
-            $watermark_x = (int) ceil($watermark->textLengthEstimate() * 1.5);
101
+            $watermark_x = (int)ceil($watermark->textLengthEstimate() * 1.5);
102 102
             $watermark_y = $watermark->size() * 12 + 1;
103 103
 
104
-            $font_definition = function (AbstractFont $font) use ($watermark): void {
105
-                $font->file(Webtrees::ROOT_DIR . 'resources/fonts/DejaVuSans.ttf');
104
+            $font_definition = function(AbstractFont $font) use ($watermark): void {
105
+                $font->file(Webtrees::ROOT_DIR.'resources/fonts/DejaVuSans.ttf');
106 106
                 $font->color($watermark->color());
107 107
                 $font->size($watermark->size());
108 108
                 $font->valign('top');
109 109
             };
110 110
 
111
-            for ($i = min((int) ceil($width * 0.1), $watermark_x); $i < $width; $i += $watermark_x) {
112
-                for ($j = min((int) ceil($height * 0.1), $watermark_y); $j < $height; $j += $watermark_y) {
111
+            for ($i = min((int)ceil($width * 0.1), $watermark_x); $i < $width; $i += $watermark_x) {
112
+                for ($j = min((int)ceil($height * 0.1), $watermark_y); $j < $height; $j += $watermark_y) {
113 113
                     $image = $image->text($watermark->text(), $i, $j, $font_definition);
114 114
                 }
115 115
             }
116 116
 
117 117
             $format  = static::INTERVENTION_FORMATS[$image->mime()] ?? 'jpg';
118 118
             $quality = $this->extractImageQuality($image, static::GD_DEFAULT_IMAGE_QUALITY);
119
-            $data    = (string) $image->encode($format, $quality);
119
+            $data    = (string)$image->encode($format, $quality);
120 120
 
121 121
             return $this->imageResponse($data, $image->mime(), '');
122 122
         } catch (NotReadableException $ex) {
123 123
             return $this->replacementImageResponse(pathinfo($filename, PATHINFO_EXTENSION))
124 124
             ->withHeader('X-Image-Exception', $ex->getMessage());
125 125
         } catch (FilesystemException | UnableToReadFile $ex) {
126
-            return $this->replacementImageResponse((string) StatusCodeInterface::STATUS_NOT_FOUND);
126
+            return $this->replacementImageResponse((string)StatusCodeInterface::STATUS_NOT_FOUND);
127 127
         } catch (Throwable $ex) {
128
-            return $this->replacementImageResponse((string) StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR)
128
+            return $this->replacementImageResponse((string)StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR)
129 129
             ->withHeader('X-Image-Exception', $ex->getMessage());
130 130
         }
131 131
     }
Please login to merge, or discard this patch.
app/Module/Certificates/Model/Watermark.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,6 +125,6 @@
 block discarded – undo
125 125
      */
126 126
     private function stringLengthEstimate(int $text_length, int $font_size): int
127 127
     {
128
-        return $text_length * (int) ceil(($font_size + 2) * 0.5);
128
+        return $text_length * (int)ceil(($font_size + 2) * 0.5);
129 129
     }
130 130
 }
Please login to merge, or discard this patch.
app/Module/Certificates/Model/Certificate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -202,11 +202,11 @@
 block discarded – undo
202 202
     {
203 203
         $sort_prefix = '';
204 204
         if (preg_match_all('/\b([A-Z]{3,})\b/', $this->description(), $matches, PREG_SET_ORDER) >= 1) {
205
-            $sort_prefix = implode('_', array_map(function ($match) {
205
+            $sort_prefix = implode('_', array_map(function($match) {
206 206
                 return $match[1];
207
-            }, $matches)) . '_';
207
+            }, $matches)).'_';
208 208
         }
209
-        return $sort_prefix . $this->description();
209
+        return $sort_prefix.$this->description();
210 210
     }
211 211
 
212 212
     /**
Please login to merge, or discard this patch.
app/Module/Certificates/Elements/SourceCertificate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,11 +69,11 @@
 block discarded – undo
69 69
     {
70 70
         list($city, $file) = explode('/', $this->canonical($value), 2) + ['', ''];
71 71
 
72
-        $cities = array_map(function (string $item): array {
72
+        $cities = array_map(function(string $item): array {
73 73
             return [$this->url_obfuscator_service->obfuscate($item), $item];
74 74
         }, $this->certif_filesystem->cities($tree));
75 75
 
76
-        return view($this->module->name() . '::components/edit-certificate', [
76
+        return view($this->module->name().'::components/edit-certificate', [
77 77
             'module_name'   =>  $this->module->name(),
78 78
             'tree'          =>  $tree,
79 79
             'id'            =>  $id,
Please login to merge, or discard this patch.
app/Module/AdminTasks/Http/RequestHandlers/TasksList.php 1 patch
Spacing   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
         $module = $this->module;
62 62
         $module_name = $this->module->name();
63 63
         return response(['data' => $this->taskschedules_service->all(true, true)
64
-            ->map(function (TaskSchedule $schedule) use ($module, $module_name): array {
64
+            ->map(function(TaskSchedule $schedule) use ($module, $module_name): array {
65 65
                 $task = $this->taskschedules_service->findTask($schedule->taskId());
66 66
                 $task_name = $task !== null ? $task->name() : I18N::translate('Task not found');
67 67
 
68 68
                 return [
69
-                    'edit' =>   view($module_name . '::admin/tasks-table-options', [
69
+                    'edit' =>   view($module_name.'::admin/tasks-table-options', [
70 70
                         'task_sched_id' => $schedule->id(),
71 71
                         'task_sched_enabled' => $schedule->isEnabled(),
72 72
                         'task_edit_route' => route(TaskEditPage::class, ['task' => $schedule->id()]),
@@ -76,37 +76,35 @@  discard block
 block discarded – undo
76 76
                         ])
77 77
                     ]),
78 78
                     'status'    =>  [
79
-                        'display'   =>  view($module_name . '::components/yes-no-icons', [
79
+                        'display'   =>  view($module_name.'::components/yes-no-icons', [
80 80
                             'yes' => $schedule->isEnabled()
81 81
                         ]),
82 82
                         'raw'       =>  $schedule->isEnabled() ? 1 : 0
83 83
                     ],
84 84
                     'task_name' =>  [
85
-                        'display'   =>  '<span dir="auto">' . e($task_name) . '</span>',
85
+                        'display'   =>  '<span dir="auto">'.e($task_name).'</span>',
86 86
                         'raw'       =>  $task_name
87 87
                     ],
88 88
                     'last_run'  =>  [
89 89
                         'display'   =>  $schedule->lastRunTime()->unix() === 0 ?
90
-                            view('components/datetime', ['timestamp' => $schedule->lastRunTime()]) :
91
-                            view('components/datetime-diff', ['timestamp' => $schedule->lastRunTime()]),
90
+                            view('components/datetime', ['timestamp' => $schedule->lastRunTime()]) : view('components/datetime-diff', ['timestamp' => $schedule->lastRunTime()]),
92 91
                         'raw'       =>  $schedule->lastRunTime()->unix()
93 92
                     ],
94 93
                     'last_result'   =>  [
95
-                        'display'   => view($module_name . '::components/yes-no-icons', [
94
+                        'display'   => view($module_name.'::components/yes-no-icons', [
96 95
                             'yes' => $schedule->wasLastRunSuccess()
97 96
                         ]),
98 97
                         'raw'       =>  $schedule->wasLastRunSuccess() ? 1 : 0
99 98
                     ],
100
-                    'frequency' =>  '<span dir="auto">' . e($schedule->frequency()->cascade()->forHumans()) . '</span>',
99
+                    'frequency' =>  '<span dir="auto">'.e($schedule->frequency()->cascade()->forHumans()).'</span>',
101 100
                     'nb_occurrences'    =>  $schedule->remainingOccurences() > 0 ?
102
-                        I18N::number($schedule->remainingOccurences()) :
103
-                        I18N::translate('Unlimited'),
104
-                    'running'   =>  view($module_name . '::components/yes-no-icons', [
101
+                        I18N::number($schedule->remainingOccurences()) : I18N::translate('Unlimited'),
102
+                    'running'   =>  view($module_name.'::components/yes-no-icons', [
105 103
                         'yes' => $schedule->isRunning(),
106 104
                         'text_yes' => I18N::translate('Running'),
107 105
                         'text_no' => I18N::translate('Not running')
108 106
                     ]),
109
-                    'run'       =>  view($module_name . '::admin/tasks-table-run', [
107
+                    'run'       =>  view($module_name.'::admin/tasks-table-run', [
110 108
                         'task_sched_id' => $schedule->id(),
111 109
                         'run_route' => route(TaskTrigger::class, [
112 110
                             'task'  =>  $schedule->taskId(),
Please login to merge, or discard this patch.