Passed
Branch feature/2.0 (2da243)
by Jonathan
05:05
created
src/Webtrees/Module/WelcomeBlock/Services/MatomoStatsService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
         assert($cache instanceof Cache);
45 45
         
46 46
         return $cache->remember(
47
-            $module->name() . '-matomovisits-yearly-' . $block_id,
48
-            function () use ($module, $block_id): ?int {
47
+            $module->name().'-matomovisits-yearly-'.$block_id,
48
+            function() use ($module, $block_id): ?int {
49 49
                 $visits_year = $this->visits($module, $block_id, 'year');
50 50
                 if ($visits_year === null) {
51 51
                     return null;
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
     public function visitsToday(WelcomeBlockModule $module, int $block_id): ?int
69 69
     {
70 70
         return app('cache.array')->remember(
71
-            $module->name() . '-matomovisits-daily-' . $block_id,
72
-            function () use ($module, $block_id): ?int {
71
+            $module->name().'-matomovisits-daily-'.$block_id,
72
+            function() use ($module, $block_id) : ?int {
73 73
                 return $this->visits($module, $block_id, 'day');
74 74
             }
75 75
         );
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 ]);
112 112
                 
113 113
                 if ($response->getStatusCode() === StatusCodeInterface::STATUS_OK) {
114
-                    $result = json_decode((string) $response->getBody(), true)['value'] ?? null;
114
+                    $result = json_decode((string)$response->getBody(), true)['value'] ?? null;
115 115
                     if ($result !== null) {
116 116
                         return (int)$result;
117 117
                     }
Please login to merge, or discard this patch.
src/Webtrees/Module/WelcomeBlock/WelcomeBlockModule.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function loadRoutes(Map $router): void
59 59
     {
60
-        $router->attach('', '', static function (Map $router) {
60
+        $router->attach('', '', static function(Map $router) {
61 61
 
62
-            $router->attach('', '/module-maj/welcomeblock/{block_id}', static function (Map $router) {
62
+            $router->attach('', '/module-maj/welcomeblock/{block_id}', static function(Map $router) {
63 63
                 
64 64
                 $router->get(MatomoStats::class, '/matomostats', MatomoStats::class);
65 65
             });
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $fab_login_block_view = app(\Fisharebest\Webtrees\Module\LoginBlockModule::class)
79 79
             ->getBlock($tree, $block_id, ModuleBlockInterface::CONTEXT_EMBED);
80 80
         
81
-        $content = view($this->name() . '::block-embed', [
81
+        $content = view($this->name().'::block-embed', [
82 82
             'block_id'                  =>  $block_id,
83 83
             'fab_welcome_block_view'    =>  $fab_welcome_block_view,
84 84
             'fab_login_block_view'      =>  $fab_login_block_view,
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function editBlockConfiguration(Tree $tree, int $block_id): string
115 115
     {
116
-        return view($this->name() . '::config', $this->matomoSettings($block_id));
116
+        return view($this->name().'::config', $this->matomoSettings($block_id));
117 117
     }
118 118
     
119 119
     /**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void
124 124
     {
125
-        $params = (array) $request->getParsedBody();
125
+        $params = (array)$request->getParsedBody();
126 126
         
127 127
         $matomo_enabled = $params['matomo_enabled'] == 'yes';
128 128
         $this->setBlockSetting($block_id, 'matomo_enabled', $matomo_enabled ? 'yes' : 'no');
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             ->setBlockSetting($block_id, 'matomo_token', trim($params['matomo_token']))
146 146
             ->setBlockSetting($block_id, 'matomo_siteid', $params['matomo_siteid']);
147 147
         
148
-        app('cache.files')->forget($this->name() . '-matomovisits-yearly-' . $block_id);
148
+        app('cache.files')->forget($this->name().'-matomovisits-yearly-'.$block_id);
149 149
     }
150 150
     
151 151
     /**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             'matomo_enabled' => $this->isMatomoEnabled($block_id),
172 172
             'matomo_url' => $this->getBlockSetting($block_id, 'matomo_url'),
173 173
             'matomo_token' => $this->getBlockSetting($block_id, 'matomo_token'),
174
-            'matomo_siteid'  => (int) $this->getBlockSetting($block_id, 'matomo_siteid', '0')
174
+            'matomo_siteid'  => (int)$this->getBlockSetting($block_id, 'matomo_siteid', '0')
175 175
         ];
176 176
     }
177 177
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/WelcomeBlock/Http/RequestHandlers/MatomoStats.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,11 +64,11 @@
 block discarded – undo
64 64
         $nb_visits_year = $nb_visits_today = null;
65 65
         
66 66
         if ($block_id !== false && $this->module->isMatomoEnabled($block_id)) {
67
-            $nb_visits_today = $this->matomo_service->visitsToday($this->module, (int) $block_id);
68
-            $nb_visits_year = $this->matomo_service->visitsThisYear($this->module, (int) $block_id) + $nb_visits_today;
67
+            $nb_visits_today = $this->matomo_service->visitsToday($this->module, (int)$block_id);
68
+            $nb_visits_year = $this->matomo_service->visitsThisYear($this->module, (int)$block_id) + $nb_visits_today;
69 69
         }
70 70
         
71
-        return $this->viewResponse($this->module->name() . '::matomo-stats', [
71
+        return $this->viewResponse($this->module->name().'::matomo-stats', [
72 72
             'visits_year'   =>  $nb_visits_year,
73 73
             'visits_today'  =>  $nb_visits_today
74 74
         ]);
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/Http/RequestHandlers/TaskEditPage.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
68 68
         }
69 69
         
70
-        $task_sched_id = (int) $request->getAttribute('task');
70
+        $task_sched_id = (int)$request->getAttribute('task');
71 71
         $task_schedule = $this->taskschedules_service->find($task_sched_id);
72 72
         
73 73
         if ($task_schedule === null) {
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
         /** @var TaskInterface&ConfigurableTaskInterface $task */
84 84
         $has_task_config = $task instanceof ConfigurableTaskInterface;
85 85
         
86
-        return $this->viewResponse($this->module->name() . '::admin/tasks-edit', [
86
+        return $this->viewResponse($this->module->name().'::admin/tasks-edit', [
87 87
             'module'            =>  $this->module,
88
-            'title'             =>  I18N::translate('Edit the administrative task') . ' - ' . $task->name(),
88
+            'title'             =>  I18N::translate('Edit the administrative task').' - '.$task->name(),
89 89
             'task_schedule'     =>  $task_schedule,
90 90
             'task'              =>  $task,
91 91
             'has_task_config'   =>  $has_task_config,
Please login to merge, or discard this patch.