Passed
Branch feature/2.1-geodispersion-dev (1d61a8)
by Jonathan
61:21
created
src/Webtrees/Module/WelcomeBlock/WelcomeBlockModule.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function loadRoutes(Map $router): void
63 63
     {
64
-        $router->attach('', '', static function (Map $router): void {
64
+        $router->attach('', '', static function(Map $router): void {
65 65
 
66
-            $router->attach('', '/module-maj/welcomeblock/{block_id}', static function (Map $router): void {
66
+            $router->attach('', '/module-maj/welcomeblock/{block_id}', static function(Map $router): void {
67 67
 
68 68
                 $router->get(MatomoStats::class, '/matomostats', MatomoStats::class);
69 69
             });
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $fab_login_block_view = app(\Fisharebest\Webtrees\Module\LoginBlockModule::class)
92 92
             ->getBlock($tree, $block_id, ModuleBlockInterface::CONTEXT_EMBED);
93 93
 
94
-        $content = view($this->name() . '::block-embed', [
94
+        $content = view($this->name().'::block-embed', [
95 95
             'block_id'                  =>  $block_id,
96 96
             'fab_welcome_block_view'    =>  $fab_welcome_block_view,
97 97
             'fab_login_block_view'      =>  $fab_login_block_view,
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function editBlockConfiguration(Tree $tree, int $block_id): string
129 129
     {
130
-        return view($this->name() . '::config', $this->matomoSettings($block_id));
130
+        return view($this->name().'::config', $this->matomoSettings($block_id));
131 131
     }
132 132
 
133 133
     /**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void
138 138
     {
139
-        $params = (array) $request->getParsedBody();
139
+        $params = (array)$request->getParsedBody();
140 140
 
141 141
         $matomo_enabled = $params['matomo_enabled'] == 'yes';
142 142
         $this->setBlockSetting($block_id, 'matomo_enabled', $matomo_enabled ? 'yes' : 'no');
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             ->setBlockSetting($block_id, 'matomo_token', trim($params['matomo_token']))
160 160
             ->setBlockSetting($block_id, 'matomo_siteid', $params['matomo_siteid']);
161 161
 
162
-        Registry::cache()->file()->forget($this->name() . '-matomovisits-yearly-' . $block_id);
162
+        Registry::cache()->file()->forget($this->name().'-matomovisits-yearly-'.$block_id);
163 163
     }
164 164
 
165 165
     /**
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             'matomo_enabled' => $this->isMatomoEnabled($block_id),
186 186
             'matomo_url' => $this->getBlockSetting($block_id, 'matomo_url'),
187 187
             'matomo_token' => $this->getBlockSetting($block_id, 'matomo_token'),
188
-            'matomo_siteid'  => (int) $this->getBlockSetting($block_id, 'matomo_siteid', '0')
188
+            'matomo_siteid'  => (int)$this->getBlockSetting($block_id, 'matomo_siteid', '0')
189 189
         ];
190 190
     }
191 191
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/WelcomeBlock/Services/MatomoStatsService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
     public function visitsThisYear(WelcomeBlockModule $module, int $block_id): ?int
41 41
     {
42 42
         return Registry::cache()->file()->remember(
43
-            $module->name() . '-matomovisits-yearly-' . $block_id,
44
-            function () use ($module, $block_id): ?int {
43
+            $module->name().'-matomovisits-yearly-'.$block_id,
44
+            function() use ($module, $block_id) : ?int {
45 45
                 $visits_year = $this->visits($module, $block_id, 'year');
46 46
                 if ($visits_year === null) {
47 47
                     return null;
48 48
                 }
49
-                $visits_today = (int) $this->visits($module, $block_id, 'day');
49
+                $visits_today = (int)$this->visits($module, $block_id, 'day');
50 50
 
51 51
                 return $visits_year - $visits_today;
52 52
             },
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
     public function visitsToday(WelcomeBlockModule $module, int $block_id): ?int
65 65
     {
66 66
         return Registry::cache()->array()->remember(
67
-            $module->name() . '-matomovisits-daily-' . $block_id,
68
-            function () use ($module, $block_id): ?int {
67
+            $module->name().'-matomovisits-daily-'.$block_id,
68
+            function() use ($module, $block_id) : ?int {
69 69
                 return $this->visits($module, $block_id, 'day');
70 70
             }
71 71
         );
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                 ]);
108 108
 
109 109
                 if ($response->getStatusCode() === StatusCodeInterface::STATUS_OK) {
110
-                    $result = json_decode((string) $response->getBody(), true)['value'] ?? null;
110
+                    $result = json_decode((string)$response->getBody(), true)['value'] ?? null;
111 111
                     if ($result !== null) {
112 112
                         return (int)$result;
113 113
                     }
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/CertificatesModule.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -99,16 +99,16 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function loadRoutes($router): void
101 101
     {
102
-        $router->attach('', '', static function (Map $router): void {
102
+        $router->attach('', '', static function(Map $router): void {
103 103
 
104
-            $router->attach('', '/module-maj/certificates', static function (Map $router): void {
104
+            $router->attach('', '/module-maj/certificates', static function(Map $router): void {
105 105
 
106
-                $router->attach('', '/admin', static function (Map $router): void {
106
+                $router->attach('', '/admin', static function(Map $router): void {
107 107
 
108 108
                     $router->get(AdminTreesPage::class, '/trees', AdminTreesPage::class)
109
-                        ->extras(['middleware' => [ AuthAdministrator::class ]]);
109
+                        ->extras(['middleware' => [AuthAdministrator::class]]);
110 110
 
111
-                    $router->attach('', '/config/{tree}', static function (Map $router): void {
111
+                    $router->attach('', '/config/{tree}', static function(Map $router): void {
112 112
 
113 113
                         $router->extras([
114 114
                             'middleware' => [
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                         'permission_preference' =>  'MAJ_CERTIF_SHOW_CERT'
127 127
                     ]);
128 128
 
129
-                $router->attach('', '/certificate/{tree}/{cid}', static function (Map $router): void {
129
+                $router->attach('', '/certificate/{tree}/{cid}', static function(Map $router): void {
130 130
 
131 131
                     $router->extras([
132 132
                         'middleware'            =>  [AuthTreePreference::class],
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function headContent(): string
166 166
     {
167
-        return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">';
167
+        return '<link rel="stylesheet" href="'.e($this->moduleCssUrl()).'">';
168 168
     }
169 169
 
170 170
     /**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      */
174 174
     public function listUrl(Tree $tree, array $parameters = []): string
175 175
     {
176
-        return route(CertificatesList::class, ['tree' => $tree->name() ] + $parameters);
176
+        return route(CertificatesList::class, ['tree' => $tree->name()] + $parameters);
177 177
     }
178 178
 
179 179
     /**
@@ -191,6 +191,6 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function listIsEmpty(Tree $tree): bool
193 193
     {
194
-        return Auth::accessLevel($tree) > (int) $tree->getPreference('MAJ_CERTIF_SHOW_CERT', (string) Auth::PRIV_HIDE);
194
+        return Auth::accessLevel($tree) > (int)$tree->getPreference('MAJ_CERTIF_SHOW_CERT', (string)Auth::PRIV_HIDE);
195 195
     }
196 196
 }
Please login to merge, or discard this patch.
src/Webtrees/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.
src/Webtrees/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.
src/Webtrees/Module/Certificates/Http/RequestHandlers/CertificatesList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         $title = I18N::translate('Certificates');
81 81
 
82
-        $cities = array_map(function (string $item): array {
82
+        $cities = array_map(function(string $item): array {
83 83
             return [$this->url_obfuscator_service->obfuscate($item), $item];
84 84
         }, $this->certif_filesystem->cities($tree));
85 85
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $certificates = $this->certif_filesystem->certificatesForCity($tree, $city);
91 91
         }
92 92
 
93
-        return $this->viewResponse($this->module->name() . '::certificates-list', [
93
+        return $this->viewResponse($this->module->name().'::certificates-list', [
94 94
             'title'                     =>  $title,
95 95
             'tree'                      =>  $tree,
96 96
             'module_name'               =>  $this->module->name(),
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Http/RequestHandlers/AdminTreesPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
             return redirect(route(AdminConfigPage::class, ['tree' => $trees->first()]));
73 73
         }
74 74
 
75
-        return $this->viewResponse($this->module->name() . '::admin/trees', [
75
+        return $this->viewResponse($this->module->name().'::admin/trees', [
76 76
             'title'             =>  $this->module->title(),
77 77
             'trees'             =>  $this->tree_service->all()
78 78
         ]);
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Http/RequestHandlers/CertificateImage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
         if ($certificate === null) {
106 106
             return $this->certif_image_factory
107
-            ->replacementImageResponse((string) StatusCodeInterface::STATUS_NOT_FOUND)
107
+            ->replacementImageResponse((string)StatusCodeInterface::STATUS_NOT_FOUND)
108 108
             ->withHeader('X-Image-Exception', I18N::translate('The certificate was not found in this family tree.'))
109 109
             ;
110 110
         }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $size = $certificate->tree()->getPreference('MAJ_CERTIF_WM_FONT_MAXSIZE');
133 133
         $text = $this->watermarkText($request, $certificate);
134 134
 
135
-        return new Watermark($text, $color, is_numeric($size) ? (int) $size : Watermark::DEFAULT_SIZE);
135
+        return new Watermark($text, $color, is_numeric($size) ? (int)$size : Watermark::DEFAULT_SIZE);
136 136
     }
137 137
 
138 138
     /**
Please login to merge, or discard this patch.
src/Webtrees/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.