Passed
Pull Request — main (#1)
by Jonathan
16:29
created
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.
app/Module/AdminTasks/Http/RequestHandlers/TaskEditAction.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             return redirect($admin_config_route);
65 65
         }
66 66
 
67
-        $task_sched_id = (int) $request->getAttribute('task');
67
+        $task_sched_id = (int)$request->getAttribute('task');
68 68
         $task_schedule = $this->taskschedules_service->find($task_sched_id);
69 69
 
70 70
         if ($task_schedule === null) {
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                 'success'
85 85
             );
86 86
             //phpcs:ignore Generic.Files.LineLength.TooLong
87
-            Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” has been updated.');
87
+            Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” has been updated.');
88 88
         }
89 89
 
90 90
         return redirect($admin_config_route);
@@ -103,17 +103,17 @@  discard block
 block discarded – undo
103 103
             return false;
104 104
         }
105 105
 
106
-        $params = (array) $request->getParsedBody();
106
+        $params = (array)$request->getParsedBody();
107 107
 
108
-        $frequency = (int) $params['frequency'];
108
+        $frequency = (int)$params['frequency'];
109 109
         if ($frequency > 0) {
110 110
             $task_schedule->setFrequency(CarbonInterval::minutes($frequency));
111 111
         } else {
112 112
             FlashMessages::addMessage(I18N::translate('The frequency is not in a valid format.'), 'danger');
113 113
         }
114 114
 
115
-        $is_limited = (bool) $params['is_limited'];
116
-        $nb_occur = (int) $params['nb_occur'];
115
+        $is_limited = (bool)$params['is_limited'];
116
+        $nb_occur = (int)$params['nb_occur'];
117 117
 
118 118
         if ($is_limited) {
119 119
             if ($nb_occur > 0) {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
         FlashMessages::addMessage(I18N::translate('An error occured while updating the scheduled task.'), 'danger');
145 145
         //@phpcs:ignore Generic.Files.LineLength.TooLong
146
-        Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” could not be updated. See error log.');
146
+        Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” could not be updated. See error log.');
147 147
         return false;
148 148
     }
149 149
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                 'danger'
176 176
             );
177 177
             //phpcs:ignore Generic.Files.LineLength.TooLong
178
-            Log::addConfigurationLog('Module ' . $this->module->title() . ' : AdminTask “' . $task->name() . '” specific settings could not be updated. See error log.');
178
+            Log::addConfigurationLog('Module '.$this->module->title().' : AdminTask “'.$task->name().'” specific settings could not be updated. See error log.');
179 179
         }
180 180
 
181 181
         return true;
Please login to merge, or discard this patch.
app/Module/AdminTasks/Http/RequestHandlers/TaskStatusAction.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             return redirect($admin_config_route);
61 61
         }
62 62
 
63
-        $task_sched_id = (int) $request->getAttribute('task');
63
+        $task_sched_id = (int)$request->getAttribute('task');
64 64
         $task_schedule = $this->taskschedules_service->find($task_sched_id);
65 65
 
66 66
         $admin_config_route = route(AdminConfigPage::class);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             return redirect($admin_config_route);
74 74
         }
75 75
 
76
-        ((bool) $request->getAttribute('enable', false)) ? $task_schedule->enable() : $task_schedule->disable();
76
+        ((bool)$request->getAttribute('enable', false)) ? $task_schedule->enable() : $task_schedule->disable();
77 77
 
78 78
         if ($this->taskschedules_service->update($task_schedule) > 0) {
79 79
             FlashMessages::addMessage(
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
                 'success'
82 82
             );
83 83
             //phpcs:ignore Generic.Files.LineLength.TooLong
84
-            Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” has been updated.');
84
+            Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” has been updated.');
85 85
         } else {
86 86
             FlashMessages::addMessage(
87 87
                 I18N::translate('An error occured while updating the scheduled task.'),
88 88
                 'danger'
89 89
             );
90 90
             //phpcs:ignore Generic.Files.LineLength.TooLong
91
-            Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” could not be updated. See error log.');
91
+            Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” could not be updated. See error log.');
92 92
         }
93 93
 
94 94
         return redirect($admin_config_route);
Please login to merge, or discard this patch.
app/Module/AdminTasks/Http/RequestHandlers/AdminConfigPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
             $this->module->setPreference('PAT_FORCE_EXEC_TOKEN', $token);
74 74
         }
75 75
         
76
-        return $this->viewResponse($this->module->name() . '::admin/config', [
76
+        return $this->viewResponse($this->module->name().'::admin/config', [
77 77
             'title'             =>  $this->module->title(),
78 78
             'trigger_token'     =>  $token,
79 79
             'trigger_route'     =>  route(TaskTrigger::class, ['task' => '__TASKNAME__', 'force' => '__TOKEN__']),
Please login to merge, or discard this patch.
app/Module/AdminTasks/Http/RequestHandlers/TaskEditPage.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
60 60
         }
61 61
 
62
-        $task_sched_id = (int) $request->getAttribute('task');
62
+        $task_sched_id = (int)$request->getAttribute('task');
63 63
         $task_schedule = $this->taskschedules_service->find($task_sched_id);
64 64
 
65 65
         if ($task_schedule === null) {
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
         $has_task_config = $task instanceof ConfigurableTaskInterface;
76 76
         /** @var \MyArtJaub\Webtrees\Contracts\Tasks\TaskInterface&\MyArtJaub\Webtrees\Contracts\Tasks\ConfigurableTaskInterface $task */
77 77
 
78
-        return $this->viewResponse($this->module->name() . '::admin/tasks-edit', [
78
+        return $this->viewResponse($this->module->name().'::admin/tasks-edit', [
79 79
             'module'            =>  $this->module,
80
-            'title'             =>  I18N::translate('Edit the administrative task') . ' - ' . $task->name(),
80
+            'title'             =>  I18N::translate('Edit the administrative task').' - '.$task->name(),
81 81
             'task_schedule'     =>  $task_schedule,
82 82
             'task'              =>  $task,
83 83
             'has_task_config'   =>  $has_task_config,
Please login to merge, or discard this patch.
app/Module/AdminTasks/Http/RequestHandlers/TokenGenerate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 
57 57
         $token = $this->token_service->generateRandomToken();
58 58
         $this->module->setPreference('MAJ_AT_FORCE_EXEC_TOKEN', $token);
59
-        Log::addConfigurationLog($this->module->title() . ' : New token generated.');
59
+        Log::addConfigurationLog($this->module->title().' : New token generated.');
60 60
 
61 61
         return response(['token' => $token]);
62 62
     }
Please login to merge, or discard this patch.